/*--------------------------------------------------------------
# Tarjeta noticias (.noticia-card) — 4/3 (menos panorámico que 16/9; no 1/1). Listados, archivo, relacionadas.
# Casos de éxito (`.caso-thumbnail` en .caso-item): miniatura 1/1; no confundir con noticia-card.
--------------------------------------------------------------*/

/*
 * Huecos entre bloques: elementos .gap8 / .gap16 (gaps.css) en noticia-card.php.
 * Misma altura: .noticia-card__stretch (flex:1) empuja categorías al pie de la celda.
 */
.noticia-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	margin: 0;
}

.noticia-card__media {
	display: block;
	text-decoration: none;
	color: inherit;
}

.noticia-card__thumb {
	width: 100%;
	/* 4/3: intermedio entre 16/9 y cuadrado; alineado con `noticia-card` en functions.php. */
	aspect-ratio: 4 / 3;
	height: auto;
	min-height: 0;
	border-radius: 20px;
	background-color: var(--gray-light-20);
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	overflow: hidden;
	transition: opacity 0.3s ease, transform 0.35s ease;
}

.noticia-card__thumb--placeholder {
	background-image: none;
}

.noticia-card:hover .noticia-card__thumb,
.noticia-card:focus-within .noticia-card__thumb {
	transform: scale(1.02);
}

@media (prefers-reduced-motion: reduce) {
	.noticia-card__thumb {
		transition-duration: 0.15s;
	}

	.noticia-card:hover .noticia-card__thumb,
	.noticia-card:focus-within .noticia-card__thumb {
		transform: none;
	}
}

.noticia-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	min-height: 0;
}

.noticia-card__lead {
	display: flex;
	flex-direction: column;
	flex-shrink: 0;
	gap: 8px;
	min-width: 0;
}

.noticia-card__stretch {
	flex: 1 1 0;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
}

.noticia-card__title {
	margin: 0;
	padding: 0;
	font-weight: inherit;
}

.noticia-card__title-link {
	text-decoration: none;
	color: inherit;
}

.noticia-card__title-link:hover,
.noticia-card__title-link:focus-visible {
	color: var(--secondary-100);
}

.noticia-card__date {
	margin: 0;
	padding: 0;
	color: var(--black-80);
}

.noticia-card__categories {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	align-content: flex-end;
	flex-shrink: 0;
}

/* Chip categoría: tarjeta listado y single (fondo primary-60). */
.noticia-card__categories .noticia-card__tag,
.noticia-single-meta__categories .noticia-card__tag {
	display: inline-block;
	margin: 0;
	padding: 2px 10px;
	border-radius: 9999px;
	border: 0;
	background-color: var(--primary-60);
	color: var(--noticia-category-chip-text);
	text-decoration: none;
	font-weight: 400;
	transition: opacity 0.2s ease, background-color 0.2s ease;
}

.noticia-card__categories .noticia-card__tag:hover,
.noticia-card__categories .noticia-card__tag:focus-visible,
.noticia-single-meta__categories .noticia-card__tag:hover,
.noticia-single-meta__categories .noticia-card__tag:focus-visible {
	background-color: var(--primary-80);
	color: var(--noticia-category-chip-text);
}

.noticia-single-meta__categories {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.noticia-single-meta__categories li {
	margin: 0;
	padding: 0;
}

/*--------------------------------------------------------------
# Single noticia: meta (fecha y categorías) bajo page-header
--------------------------------------------------------------*/

.noticia-single-intro {
	margin: 0;
	padding: 0;
}

.noticia-single-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	padding: 0;
}

.noticia-single-meta__date {
	margin: 0;
	padding: 0;
	color: var(--black-80);
}

/*--------------------------------------------------------------
# Single noticia: panel (imagen destacada + contenido) — borde dark grey 20
--------------------------------------------------------------*/

.single-post .caso-exito-single-panel {
	border-color: var(--black-20);
}

/* Cuerpo estrecho: título del adjunto + contenido (the_content); espacio vía gap (mismo valor que .gap-S), sin margin entre bloques */
.single-post .noticia-single-body-wrap {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-width: 900px;
	width: 100%;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

@media (min-width: 992px) {
	.single-post .noticia-single-body-wrap {
		gap: 32px;
	}
}

/*
 * Etiquetas en panel: misma posición que .caso-exito-single-servicios (ancho panel, alineación derecha/móvil izq., margen hasta la barra).
 * Formato propio: pill borde secondary, body-XXXS, sin mayúsculas (no .tag-vacante).
 */
.single-post .noticia-single-panel-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: flex-end;
	align-items: flex-start;
	width: 100%;
	box-sizing: border-box;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

@media (min-width: 992px) {
	.single-post .noticia-single-panel-tags {
		margin-bottom: 24px;
	}
}

@media (max-width: 991px) {
	.single-post .noticia-single-panel-tags {
		justify-content: flex-start;
	}
}

.single-post .noticia-single-panel-tags li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.single-post .noticia-single-panel-tags__link {
	display: inline-block;
	box-sizing: border-box;
	margin: 0;
	padding: 2px 10px;
	border: 1px solid var(--secondary-100);
	border-radius: 9999px;
	background-color: transparent;
	color: var(--secondary-100);
	text-decoration: none;
	font-weight: 400;
	text-transform: none;
	transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, opacity 0.2s ease;
}

.single-post .noticia-single-panel-tags__link:hover,
.single-post .noticia-single-panel-tags__link:focus-visible {
	background-color: var(--secondary-100);
	border-color: var(--secondary-100);
	color: var(--white-100);
	opacity: 1;
}

.single-post .noticia-single-panel-tags__link:focus-visible {
	outline: 2px solid var(--accent-100);
	outline-offset: 2px;
}

/*
 * Título del adjunto en single noticia (campo «Título» en medios).
 * Especificación: color --black-40, cuerpo 18px; no hay .body-* con ese combo.
 */
.single-post .noticia-single-body-wrap .noticia-single-photo-title {
	margin: 0;
	padding: 0;
	font-family: var(--font-body);
	font-weight: 400;
	font-size: 18px;
	line-height: 1.35;
	letter-spacing: 0;
	color: var(--black-40);
}

/*
 * Contenido wrap noticia: h1–h6 color marca, semibold (600); tamaños .body-XL … .body-XXS (fonts-sizes.css).
 */
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h1,
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h2,
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h3,
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h4,
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h5,
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h6 {
	font-family: var(--font-body);
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0;
	color: var(--secondary-100);
}

.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h1 {
	font-size: 20px;
}

.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h2 {
	font-size: 18px;
}

.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h3 {
	font-size: 18px;
}

.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h4 {
	font-size: 16px;
}

.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h5 {
	font-size: 14px;
}

.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h6 {
	font-size: 12px;
}

@media (min-width: 992px) {
	.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h1 {
		font-size: 28px;
	}

	.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h2 {
		font-size: 24px;
	}

	.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h3 {
		font-size: 20px;
	}

	.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h4 {
		font-size: 18px;
	}

	.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h5 {
		font-size: 16px;
	}

	.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg h6 {
		font-size: 14px;
	}
}

.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg a,
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg a:visited,
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg a:hover,
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg a:active,
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg a:focus,
.single-post .noticia-single-body-wrap .caso-exito-body-full.caso-exito-wysiwyg a:focus-visible {
	color: var(--secondary-100);
	text-decoration: none;
}

/* Imágenes: max-width 100% y radio (destacada + cuerpo del editor) */
.single-post .caso-exito-featured {
	max-width: 100%;
}

.single-post .caso-exito-featured img,
.single-post .caso-exito-featured__img {
	max-width: 100%;
	border-radius: 20px;
}

/* Párrafos del contenido: tipografía body-XS (alineado con fonts-sizes.css) */
.single-post .caso-exito-body-full.caso-exito-wysiwyg p {
	font-family: var(--font-body);
	font-weight: 400;
	font-size: 14px;
	line-height: 1.4;
	letter-spacing: 0;
	color: var(--body-text-100);
}

@media (min-width: 992px) {
	.single-post .caso-exito-body-full.caso-exito-wysiwyg p {
		font-size: 16px;
	}
}

.single-post .caso-exito-body-full figure,
.single-post .caso-exito-body-full .wp-block-image {
	max-width: 100%;
}

.single-post .caso-exito-body-full img,
.single-post .caso-exito-body-full picture img {
	max-width: 100%;
	height: auto;
	border-radius: 20px;
}

/*--------------------------------------------------------------
# Single noticia: título del bloque de relacionadas
--------------------------------------------------------------*/

.single-post .noticia-otras__title {
	color: var(--secondary-100);
}

/*--------------------------------------------------------------
# Bloque reutilizable: template-parts/noticia-relacionadas-bloque.php
--------------------------------------------------------------*/

.noticia-relacionadas-bloque__header {
	margin: 0;
	padding: 0;
}

.noticia-relacionadas-bloque__label {
	margin: 0;
	text-transform: uppercase;
	color: var(--accent-100, #86c8bc);
}

/* Tipografía: title-S (fonts-sizes.css); título de bloque en secundario corporativo */
.noticia-relacionadas-bloque__title.title-S {
	color: var(--secondary-100, #196c87);
}

/* Botón bajo el grid (segundo contenedor) */
.noticia-relacionadas-bloque__footer-cta {
	margin-top: 0;
	text-align: center;
}

.noticia-relacionadas-bloque__footer-cta .boton.secondary.dark {
	margin: 0 auto;
}

/*--------------------------------------------------------------
# Filtro por categorías (archivo + plantilla Noticias)
# Dos <nav> (mobile / desktop); visibilidad por breakpoint. Desktop dentro de .contenedor.
--------------------------------------------------------------*/

.noticias-categorias-nav {
	box-sizing: border-box;
	margin-bottom: 24px;
	max-width: none;
	overflow: visible;
}

.noticias-categorias-nav--mobile {
	display: block;
	margin-left: 16px;
	width: calc(100% - 16px);
}

.noticias-categorias-nav--desktop {
	display: none;
	margin-left: 0;
	width: 100%;
}

/* Empaqueta el nav de escritorio (evita dejar un .contenedor vacío en móvil). */
.noticias-categorias-nav-bloque-desktop {
	display: none;
}

.noticias-categorias-nav__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 12px;
	overflow: visible;
}

/* Listado «todas las noticias»: chip «Todas» relleno secondary-100 (refuerzo sobre .boton-categoria--todas). */
.noticias-categorias-nav--listado-todas .noticias-categorias-nav__inner > a:first-child.boton-categoria--todas {
	background-color: var(--secondary-100);
	border-color: var(--secondary-100);
	color: var(--white-100);
}

/* Móvil: carril horizontal en la variante móvil. */
@media (max-width: 991px) {
	.noticias-categorias-nav--mobile {
		overflow: visible;
	}

	.noticias-categorias-nav--mobile .noticias-categorias-nav__inner {
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
		box-sizing: border-box;
		margin: 0 0 0 -16px;
		width: calc(100% + 16px);
		padding: 0 16px 0 16px;
		scrollbar-width: none;
		-ms-overflow-style: none;
	}

	.noticias-categorias-nav--mobile .noticias-categorias-nav__inner::-webkit-scrollbar {
		display: none;
	}

	.noticias-categorias-nav--mobile .noticias-categorias-nav__inner .boton-categoria {
		flex: 0 0 auto;
	}
}

@media (min-width: 992px) {
	.noticias-categorias-nav--mobile {
		display: none;
	}

	.noticias-categorias-nav-bloque-desktop {
		display: block;
	}

	.noticias-categorias-nav--desktop {
		display: block;
		margin-bottom: 32px;
	}

	.noticias-categorias-nav--desktop .noticias-categorias-nav__inner {
		gap: 16px;
	}
}
