/*
 * HS Consultas · noticias de Instagram [hs_noticias].
 *
 * Base funcional (Desarrollo, 15-oct): 3 publicaciones a la vista en computadora y carrusel lateral en el
 * celular, con la foto 4:5 y la esquina redondeada de la marca. El diseño final lo ajusta Diseño.
 * Todo va dentro de .hs-noticias y toma las variables --hs-* del CSS adicional (con respaldo).
 */

.hs-noticias {
	--n-verde: var(--hs-verde, #123f33);
	--n-tinta: var(--hs-tinta, #17392e);
	--n-texto: var(--hs-texto, #2e4a40);
	--n-texto-2: var(--hs-texto-2, #55665e);
	--n-dorado: var(--hs-dorado, #a68a56);
	--n-dorado-texto: var(--hs-dorado-texto, #846a3c);
	--n-linea: var(--hs-linea, rgba(18, 63, 51, .15));
	--n-titulo: var(--global-heading-font-family, "Playfair", Georgia, serif);
	--n-cuerpo: var(--global-body-font-family, "Inter", system-ui, -apple-system, "Segoe UI", sans-serif);
	--n-curva: var(--hs-ease, cubic-bezier(.22, .61, .36, 1));
	--n-hueco: clamp(16px, 2vw, 28px);

	color: var(--n-texto);
	font: 400 16px/1.6 var(--n-cuerpo);
	text-align: left;
	word-break: normal;
	overflow-wrap: break-word;
}
div.hs-noticias :is(p, ul, figure), .hs-noticias :is(p, ul, figure) { margin: 0; padding: 0; }
.hs-noticias ul { list-style: none; }

.hs-noticias-cabeza {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: var(--n-hueco);
}
.hs-noticias-antetitulo {
	color: var(--n-dorado-texto);
	font: 600 12px/1.4 var(--n-cuerpo);
	letter-spacing: .16em;
	text-transform: uppercase;
}
.hs-noticias-antetitulo::before { content: "✧ "; color: var(--n-dorado); }
.hs-noticias .hs-noticias-titulo {
	margin: 6px 0 0;
	color: var(--n-tinta);
	font: 400 clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem)/1.15 var(--n-titulo);
}
.hs-noticias-seguir,
.hs-noticia-ver {
	color: var(--n-verde);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.hs-noticias-seguir { display: inline-flex; align-items: center; min-height: 44px; }

/*
 * Lista (Diseño, 20-oct): carrusel con las 6 publicaciones, sin la barra gris. Se pasa con las flechas de abajo
 * (como el palmarés y el catálogo del formulario) o con el dedo. 3 a la vista en computadora; en tableta y
 * celular, menos y el borde de la siguiente.
 */
.hs-noticias-lista {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 2 * var(--n-hueco)) / 3);
	gap: var(--n-hueco);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
	padding: 4px 2px 0; /* deja ver entero el borde dorado de la más reciente */
}
.hs-noticias-lista::-webkit-scrollbar { display: none; }
@media (max-width: 1024px) { .hs-noticias-lista { grid-auto-columns: 42%; } }
@media (max-width: 860px) { .hs-noticias-lista { grid-auto-columns: 62%; } }
@media (max-width: 520px) { .hs-noticias-lista { grid-auto-columns: 82%; } }

/*
 * Debajo del carrusel: posición («1–3 de 6») y flechas, iguales a las del palmarés.
 * Marcado que espera (lo arma Desarrollo; el JavaScript mueve una página y desactiva la flecha en cada extremo):
 *   <div class="hs-noticias-pie">
 *     <p class="hs-noticias-posicion" aria-live="polite">1–3 de 6</p>
 *     <div class="hs-noticias-flechas">
 *       <button type="button" class="hs-noticias-flecha" aria-label="Publicaciones anteriores" disabled>←</button>
 *       <button type="button" class="hs-noticias-flecha" aria-label="Publicaciones siguientes">→</button>
 *     </div>
 *   </div>
 */
.hs-noticias-pie { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; min-height: 44px; }
.hs-noticias .hs-noticias-posicion { margin: 0; color: var(--n-texto-2); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hs-noticias-flechas { display: flex; gap: 8px; }
.hs-noticias .hs-noticias-flecha {
	display: inline-grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0;
	border: 1px solid var(--n-verde); border-radius: 50%; background: transparent; color: var(--n-verde);
	font: 400 18px/1 var(--n-cuerpo); cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: 0;
	transition: background-color .25s var(--n-curva), color .25s var(--n-curva), opacity .25s;
}
.hs-noticias .hs-noticias-flecha:hover:not(:disabled) { background: var(--n-verde); color: #fff; }
.hs-noticias .hs-noticias-flecha:disabled { opacity: .3; cursor: default; }
.hs-noticias .hs-noticias-flecha:focus-visible { outline: 2px solid var(--n-verde); outline-offset: 3px; }

/*
 * La publicación más reciente (la primera de la lista): borde dorado de 2 px en la foto y una píldora verde
 * «✧ Más reciente» (maqueta aprobada el 18-oct). Solo CSS: la lista ya viene de la más nueva a la más vieja.
 */
.hs-noticia:first-child .hs-noticia-foto { box-shadow: 0 0 0 2px var(--n-dorado); }
.hs-noticia:first-child .hs-noticia-foto::after {
	content: "\2727\00a0 Más reciente";
	position: absolute; top: 12px; right: 12px; z-index: 1;
	padding: 4px 10px; border-radius: 999px;
	background: var(--n-verde); color: var(--hs-crema, #f7f5ee);
	font: 600 11px/1.5 var(--n-cuerpo); letter-spacing: .12em; text-transform: uppercase;
}
.hs-noticia:first-child .hs-noticia-fecha { color: var(--n-dorado-texto); font-weight: 600; }

.hs-noticia { scroll-snap-align: start; }
.hs-noticia-enlace {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100%;
	color: inherit;
	text-decoration: none;
}
.hs-noticia-foto {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: 32px 2px 2px 2px;
	background: var(--hs-salvia, #e9ece1);
}
.hs-noticia-foto img.hs-noticia-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	transition: transform .6s var(--n-curva);
}
.hs-noticia-enlace:hover .hs-noticia-img { transform: scale(1.03); }
.hs-noticia-reproducir {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	border-radius: 50%;
	background: rgba(13, 47, 38, .72);
}
.hs-noticia-reproducir::after {
	content: "";
	position: absolute;
	top: 18px;
	left: 22px;
	border-style: solid;
	border-width: 10px 0 10px 16px;
	border-color: transparent transparent transparent #fff;
}
.hs-noticia-fecha {
	color: var(--n-texto-2);
	font-size: 13px;
	letter-spacing: .04em;
}
.hs-noticia-texto {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}
.hs-noticia-ver { margin-top: auto; color: var(--n-verde); font-weight: 600; }
/* Kadence pinta en dorado los enlaces al pasar el ratón y al volver de Instagram (a:hover, a:visited):
   el texto de la tarjeta se queda en su color. */
.hs-noticias a.hs-noticia-enlace,
.hs-noticias a.hs-noticia-enlace:visited,
.hs-noticias a.hs-noticia-enlace:hover,
.hs-noticias a.hs-noticia-enlace:focus { color: var(--n-texto); }
.hs-noticias a.hs-noticia-enlace:hover .hs-noticia-ver { text-decoration-thickness: 2px; }
.hs-noticia-enlace:focus-visible {
	outline: 3px solid var(--n-verde);
	outline-offset: 4px;
	border-radius: 2px;
}
.hs-noticias-aviso {
	margin-top: 12px;
	padding: 8px 12px;
	border-left: 3px solid var(--n-dorado);
	color: var(--n-texto-2);
	font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
	.hs-noticias-lista { scroll-behavior: auto; }
	.hs-noticia-foto img.hs-noticia-img { transition: none; }
}

/* Texto solo para lectores de pantalla (no depende del tema). */
.hs-noticias .hs-noticias-oculto {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}
.hs-noticias, .hs-noticias-lista { min-width: 0; max-width: 100%; }
.hs-noticia { position: relative; }

/*
 * Como sección de la portada (Diseño, 19-oct): el shortcode va en un bloque «Código corto» suelto, justo antes
 * de la fila del formulario. Así la franja sale entera o no sale (sin publicaciones el shortcode no imprime
 * nada y no queda un hueco). Fondo salvia entre Preguntas (crema) y el formulario (verde), con el mismo ancho
 * y aire que las demás secciones del CSS adicional.
 */
.entry-content > .hs-noticias {
	position: relative;
	box-sizing: border-box;
	max-width: var(--global-content-width, 1240px);
	margin: 0 auto !important;
	padding: var(--hs-sec, clamp(72px, 9vw, 128px)) var(--global-content-edge-padding, clamp(20px, 5vw, 64px));
	background: var(--hs-salvia, #e9ece1);
	box-shadow: 0 0 0 100vmax var(--hs-salvia, #e9ece1);
	clip-path: inset(0 -100vmax);
}
.entry-content > .hs-noticias .hs-noticias-titulo { margin: 0; }
