/* ═══════════════════════════════════════════
 * Block: Post Card (observatorio-cero/post-card)
 *
 * Unified article card with vertical and horizontal variants.
 * Inner blocks: image-fx (post-featured-image), meta row, title,
 * categories, tags and excerpt.
 * ═══════════════════════════════════════════ */

/* Base wrapper */
.wp-block-observatorio-cero-post-card.oc-post-card {
	background: var(--wp--preset--color--surface-container-lowest);
	border: var(--wp--custom--ui--decoration--border) solid color-mix(in srgb, var(--wp--preset--color--outline-variant) var(--wp--custom--blend--border), transparent);
	border-radius: var(--wp--custom--border-radius--xl);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition:
		background-color var(--wp--custom--mode-transitions--duration) var(--wp--custom--mode-transitions--timing),
		color var(--wp--custom--mode-transitions--duration) var(--wp--custom--mode-transitions--timing),
		border-color var(--wp--custom--mode-transitions--duration) var(--wp--custom--mode-transitions--timing),
		box-shadow var(--wp--custom--mode-transitions--duration) var(--wp--custom--mode-transitions--timing);
}

/* Hover: elevated shadow + primary border accent */
.wp-block-observatorio-cero-post-card.oc-post-card:hover {
	box-shadow: var(--wp--preset--shadow--elevated);
	border-color: color-mix(in srgb, var(--wp--preset--color--primary) var(--wp--custom--blend--border), transparent);
}

/* Horizontal variant: image on the left, content on the right */
.wp-block-observatorio-cero-post-card.oc-post-card--horizontal {
	flex-direction: row;
}

/* Image FX wrapper inside the card */
.wp-block-observatorio-cero-post-card.oc-post-card > .wp-block-observatorio-cero-image-fx {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	overflow: hidden;
	margin: 0;
	flex-shrink: 0;
}

.wp-block-observatorio-cero-post-card.oc-post-card--horizontal > .wp-block-observatorio-cero-image-fx {
	width: 40%;
	height: auto;
	min-height: 100%;
	aspect-ratio: 16 / 9;
}

/* Make image-fx stage and frame fill the allocated area */
.wp-block-observatorio-cero-post-card.oc-post-card > .wp-block-observatorio-cero-image-fx .oc-image-fx__stage,
.wp-block-observatorio-cero-post-card.oc-post-card > .wp-block-observatorio-cero-image-fx .oc-image-fx__frame {
	display: block;
	width: 100%;
	height: 100%;
}

.wp-block-observatorio-cero-post-card.oc-post-card > .wp-block-observatorio-cero-image-fx .oc-image-fx__frame > figure,
.wp-block-observatorio-cero-post-card.oc-post-card > .wp-block-observatorio-cero-image-fx .oc-image-fx__frame > .wp-block-image,
.wp-block-observatorio-cero-post-card.oc-post-card > .wp-block-observatorio-cero-image-fx .wp-block-post-featured-image {
	width: 100%;
	height: 100%;
	margin: 0;
}

.wp-block-observatorio-cero-post-card.oc-post-card > .wp-block-observatorio-cero-image-fx img {
	width: 100%;
	height: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	object-position: center;
}

/* Hide empty image wrapper when the post has no featured image */
.wp-block-observatorio-cero-post-card.oc-post-card > .wp-block-observatorio-cero-image-fx:not(:has(img)) {
	display: none;
}

/* Horizontal variant: hide image when no image and let content fill */
.wp-block-observatorio-cero-post-card.oc-post-card--horizontal > .wp-block-observatorio-cero-image-fx:not(:has(img)) + .oc-post-card__content,
.wp-block-observatorio-cero-post-card.oc-post-card--horizontal > .wp-block-observatorio-cero-image-fx:not(:has(img)) ~ .oc-post-card__content {
	width: 100%;
}

/* Hover zoom on image: trigger when hovering anywhere on the card.
 * image-fx in zoom-crop mode scales the inner img. */
.wp-block-observatorio-cero-post-card.oc-post-card:hover > .wp-block-observatorio-cero-image-fx .oc-image-fx__frame > figure img {
	transform: scale(var(--oc-image-fx-zoom));
}

/* Content area */
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__content {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.wp-block-observatorio-cero-post-card.oc-post-card--horizontal .oc-post-card__content {
	width: 60%;
}

/* Query grids — equal-height cards in the same row.
 * The post-template wrapper stretches .wp-block-post; this rule makes the
 * post-card block fill that height. */
.oc-archive-posts-grid .wp-block-post > .wp-block-observatorio-cero-post-card,
.oc-recent-posts .wp-block-post > .wp-block-observatorio-cero-post-card,
.oc-related-posts-section .wp-block-post > .wp-block-observatorio-cero-post-card {
	width: 100%;
	flex: 1 1 auto;
	min-height: 0;
}

/* Date */
.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-date time {
	font-size: var(--wp--preset--font-size--label-sm);
	color: var(--wp--preset--color--on-surface-variant);
	text-transform: capitalize;
}

/* Title */
.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-title {
	font-size: var(--wp--preset--font-size--headline-sm);
	color: var(--wp--preset--color--on-surface);
	margin: var(--wp--preset--spacing--20) 0;
	line-height: var(--wp--custom--typography--line-height--headline-sm);
}

.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-title a {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
	transition:
		transform var(--wp--custom--mode-transitions--duration) var(--wp--custom--mode-transitions--timing),
		color var(--wp--custom--ui--interaction--medium);
}

.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-title a:hover,
.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-title a:focus-visible {
	transform: translateX(var(--wp--custom--ui--decoration--transform-translate-lg)) scale(var(--wp--custom--ui--scale--text));
	color: var(--wp--preset--color--primary);
}

/* Excerpt */
.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-excerpt {
	color: var(--wp--preset--color--on-surface-variant);
	font-size: var(--wp--preset--font-size--body-sm);
	line-height: var(--wp--custom--typography--line-height--body-sm);
	margin-top: auto;
}

.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-excerpt p {
	display: -webkit-box;
	-webkit-line-clamp: var(--wp--custom--ui--line-clamp--limited);
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
}

.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-excerpt__more-text {
	color: var(--wp--preset--color--primary);
	font-weight: var(--wp--custom--typography--font-weight--label-md);
	margin-top: var(--wp--preset--spacing--20);
	text-align: right;
	padding-right: var(--wp--preset--spacing--20);
}

/* Increased spacing for "Leer más" link in post-card with oc-post-excerpt-more-spaced class */
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-excerpt-more-spaced .wp-block-post-excerpt__more-text {
	margin-top: var(--wp--preset--spacing--40);
}

/* Taxonomy rows — Categories & Tags as inline text lists below meta, above title.
 * Use normal block flow so the label and the terms list sit on the same text line
 * and wrap naturally as a single paragraph, instead of splitting into flex items. */
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories-row,
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__tags-row {
	display: block;
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	text-align: left;
}

/* Counter the constrained layout's auto-margins and inline-block shrink */
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories-row .wp-block-post-terms,
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__tags-row .wp-block-post-terms {
	display: inline;
	width: auto;
	margin: 0;
	vertical-align: baseline;
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__taxonomy-label {
	display: inline;
	margin: 0;
	font-size: var(--wp--preset--font-size--label-sm);
	font-weight: var(--wp--custom--typography--font-weight--label-md);
	text-transform: uppercase;
	letter-spacing: var(--wp--custom--typography--letter-spacing--label-sm);
	color: var(--wp--preset--color--on-surface-variant);
}

/* Categories — text links, primary color, normal weight */
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories {
	display: inline;
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: var(--wp--preset--font-size--label-sm);
	color: var(--wp--preset--color--on-surface-variant);
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	font-weight: var(--wp--custom--typography--font-weight--label-md);
	transition:
		color var(--wp--custom--ui--interaction--medium),
		text-decoration-color var(--wp--custom--ui--interaction--medium),
		transform var(--wp--custom--mode-transitions--duration) var(--wp--custom--mode-transitions--timing);
	display: inline-flex;
	align-items: center;
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a:hover,
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a:focus-visible {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-underline-offset: var(--wp--custom--ui--decoration--text-underline-offset);
	transform: translateX(var(--wp--custom--ui--decoration--transform-translate-sm)) scale(var(--wp--custom--ui--scale--text));
}

/* Category badges in cards — use per-category container colors for accessible chips */
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a.oc-post-category-badge--editorial,
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a.oc-post-category-badge--tribuna-abierta {
	background-color: var(--wp--preset--color--secondary-container);
	color: var(--wp--preset--color--on-secondary-container);
	padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--border-radius--full);
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a.oc-post-category-badge--manifiesto,
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a.oc-post-category-badge--recursos {
	background-color: var(--wp--preset--color--tertiary-container);
	color: var(--wp--preset--color--on-tertiary-container);
	padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--border-radius--full);
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a.oc-post-category-badge--actualidad {
	background-color: var(--wp--preset--color--primary-container);
	color: var(--wp--preset--color--on-primary-container);
	padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--border-radius--full);
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a.oc-post-category-badge--evento {
	background-color: var(--wp--preset--color--surface-container-high);
	color: var(--wp--preset--color--on-surface);
	padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--border-radius--full);
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a.oc-post-category-badge--ideas-dialogo {
	background-color: var(--wp--preset--color--surface-variant);
	color: var(--wp--preset--color--on-surface-variant);
	padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--30);
	border-radius: var(--wp--custom--border-radius--full);
}

/* Tags — text links, italic, secondary color, lighter weight */
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__tags {
	display: inline;
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: var(--wp--preset--font-size--label-sm);
	font-style: italic;
	color: var(--wp--preset--color--on-surface-variant);
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__tags a {
	color: var(--wp--preset--color--secondary);
	text-decoration: none;
	font-weight: var(--wp--custom--typography--font-weight--regular);
	transition:
		color var(--wp--custom--ui--interaction--medium),
		text-decoration-color var(--wp--custom--ui--interaction--medium),
		transform var(--wp--custom--mode-transitions--duration) var(--wp--custom--mode-transitions--timing);
	display: inline-flex;
	align-items: center;
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__tags a:hover,
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__tags a:focus-visible {
	color: var(--wp--preset--color--secondary);
	text-decoration: underline;
	text-underline-offset: var(--wp--custom--ui--decoration--text-underline-offset);
	transform: translateX(var(--wp--custom--ui--decoration--transform-translate-sm)) scale(var(--wp--custom--ui--scale--text));
}

/* Author name — link in meta row with zoom + slide effect */
.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-author-name {
	font-size: var(--wp--preset--font-size--label-sm);
	color: var(--wp--preset--color--on-surface-variant);
}

.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-author-name a {
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	font-weight: var(--wp--custom--typography--font-weight--label-md);
	transition:
		color var(--wp--custom--ui--interaction--medium),
		text-decoration-color var(--wp--custom--ui--interaction--medium),
		transform var(--wp--custom--mode-transitions--duration) var(--wp--custom--mode-transitions--timing);
	display: inline-flex;
	align-items: center;
}

.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-author-name a:hover,
.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-author-name a:focus-visible {
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	text-underline-offset: var(--wp--custom--ui--decoration--text-underline-offset);
	transform: translateX(var(--wp--custom--ui--decoration--transform-translate)) scale(var(--wp--custom--ui--scale--text));
}

/* Hide taxonomy row when its terms list is empty */
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories-row:has(.oc-post-card__categories:empty),
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__tags-row:has(.oc-post-card__tags:empty) {
	display: none;
}

/* Meta row — force single line with nowrap and distribute items:
   date left, word count center, reading time right. */
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__meta-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: var(--wp--preset--spacing--20);
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	color: var(--wp--preset--color--on-surface-variant);
	font-size: var(--wp--preset--font-size--label-sm);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__meta-row .wp-block-post-date,
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__meta-row .wp-block-post-author-name,
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__meta-row .wp-block-post-time-to-read {
	font-size: var(--wp--preset--font-size--label-sm);
	color: var(--wp--preset--color--on-surface-variant);
	white-space: nowrap;
}

.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__meta-separator {
	color: var(--wp--preset--color--outline);
	margin: 0;
	line-height: 1;
	white-space: nowrap;
}

/* Placeholder shown when the block has no inner content */
.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__placeholder {
	padding: var(--wp--preset--spacing--50);
	color: var(--wp--preset--color--on-surface-variant);
	font-size: var(--wp--preset--font-size--body-md);
	margin: 0;
}

/* ═══════════════════════════════════════════
 * Responsive adjustments
 * ═══════════════════════════════════════════ */

@media (max-width: 599px) {
	.wp-block-observatorio-cero-post-card.oc-post-card--horizontal {
		flex-direction: column;
	}

	.wp-block-observatorio-cero-post-card.oc-post-card--horizontal > .wp-block-observatorio-cero-image-fx,
	.wp-block-observatorio-cero-post-card.oc-post-card--horizontal .oc-post-card__content {
		width: 100%;
	}

	.wp-block-observatorio-cero-post-card.oc-post-card--horizontal > .wp-block-observatorio-cero-image-fx {
		height: var(--wp--custom--ui--sizes--header-height);
		min-height: auto;
	}
}

/* ═══════════════════════════════════════════
 * Reduced motion
 * ═══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
	.wp-block-observatorio-cero-post-card.oc-post-card,
	.wp-block-observatorio-cero-post-card.oc-post-card > .wp-block-observatorio-cero-image-fx .oc-image-fx__frame > figure img,
	.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-title a,
	.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a,
	.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__tags a,
	.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-author-name a {
		transition: none !important;
		animation: none !important;
	}

	.wp-block-observatorio-cero-post-card.oc-post-card:hover > .wp-block-observatorio-cero-image-fx .oc-image-fx__frame > figure img,
	.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-title a:hover,
	.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__categories a:hover,
	.wp-block-observatorio-cero-post-card.oc-post-card .oc-post-card__tags a:hover,
	.wp-block-observatorio-cero-post-card.oc-post-card .wp-block-post-author-name a:hover {
		transform: none !important;
	}
}
