/**
 * Hoja de Estilos Editorial: Noticias Apyt (noticiasapyt.com)
 * Inspiración visual: El País México (Jerarquía periodística sobria, bordes finos, serif de alto impacto)
 * Arquitectura: Mobile-First, CSS Grid Asimétrico y CSS Scroll Snap Horizontal
 *
 * @version 2.0.0
 */

/* ==========================================================================
   1. VARIABLES CSS (:root) Y TOKENS EDITORIALES
   ========================================================================== */
:root {
	/* Paleta Institucional Sobria */
	--apyt-black: #111111;          /* Negro neutro profundo para titulares y cabecera */
	--apyt-charcoal: #222222;       /* Gris carbón para textos principales */
	--apyt-gray-dark: #4a4a4a;      /* Gris oscuro para bajadas/extractos */
	--apyt-gray-muted: #6e6e6e;     /* Gris medio para firmas, fechas y metadatos */
	--apyt-border-strong: #111111;  /* Filete editorial negro clásico de apertura de sección */
	--apyt-border-light: #e2e2e2;   /* Filete divisor sutil entre columnas y tarjetas */
	--apyt-surface-white: #ffffff;  /* Blanco papel principal */
	--apyt-surface-subtle: #f7f7f5; /* Gris cálido sutil para áreas utilitarias y placeholders */

	/* Acento Editorial Sutil (Azul Marino / Carmesí Periodístico) */
	--apyt-accent: #004d7a;         /* Azul prensa sobrio para kickers, enlaces activos y suscripción */
	--apyt-accent-hover: #003554;   /* Estado hover del acento */
	--apyt-gold-cta: #f5c518;       /* Acento cálido opcional para botón de suscripción en barra superior */

	/* Tipografía */
	--apyt-font-serif: 'Newsreader', 'Georgia', 'Times New Roman', serif;
	--apyt-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

	/* Layout y Retícula */
	--apyt-max-width: 1280px;
	--apyt-container-pad: 1rem;
	--apyt-grid-gap: 1.5rem;
	--apyt-transition: 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (min-width: 768px) {
	:root {
		--apyt-container-pad: 1.75rem;
		--apyt-grid-gap: 2rem;
	}
}

/* ==========================================================================
   2. RESETEO BASE Y UTILIDADES DE ACCESIBILIDAD
   ========================================================================== */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body.apyt-editorial-front {
	margin: 0;
	padding: 0;
	background-color: var(--apyt-surface-white);
	color: var(--apyt-charcoal);
	font-family: var(--apyt-font-sans);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.apyt-container {
	width: 100%;
	max-width: var(--apyt-max-width);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--apyt-container-pad);
	padding-right: var(--apyt-container-pad);
}

a {
	color: inherit;
	text-decoration: none;
	transition: color var(--apyt-transition);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

figure {
	margin: 0;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* ==========================================================================
   3. CABECERA EDITORIAL (HEADER, TOPBAR, MASTHEAD, STICKY NAV)
   ========================================================================== */
.apyt-header {
	background-color: var(--apyt-surface-white);
	border-bottom: 1px solid var(--apyt-border-light);
}

/* 3.1 Barra Superior Utilitaria */
.apyt-topbar {
	border-bottom: 1px solid var(--apyt-border-light);
	background-color: var(--apyt-surface-subtle);
	font-size: 0.75rem;
	color: var(--apyt-gray-muted);
	padding: 0.45rem 0;
}

.apyt-topbar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
}

.apyt-topbar__left {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.apyt-topbar__date {
	font-weight: 500;
	color: var(--apyt-charcoal);
}

.apyt-topbar__divider,
.apyt-topbar__updated {
	display: none;
}

/* Selector de ediciones */
.apyt-topbar__center {
	display: none;
}

.apyt-edition-selector {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.apyt-edition-selector__label {
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
	font-size: 0.6875rem;
}

.apyt-edition-selector__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.apyt-edition-selector__list li a {
	color: var(--apyt-gray-muted);
	font-weight: 500;
}

.apyt-edition-selector__list li.is-active a,
.apyt-edition-selector__list li a:hover {
	color: var(--apyt-black);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Botones de suscripción y acceso */
.apyt-topbar__right {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-left: auto;
}

.apyt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.3rem 0.75rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	border-radius: 2px;
	transition: background-color var(--apyt-transition), color var(--apyt-transition), border-color var(--apyt-transition);
}

.apyt-btn--subscribe {
	background-color: var(--apyt-accent);
	color: #ffffff;
	border: 1px solid var(--apyt-accent);
}

.apyt-btn--subscribe:hover {
	background-color: var(--apyt-accent-hover);
	border-color: var(--apyt-accent-hover);
	color: #ffffff;
}

.apyt-btn--login {
	background-color: transparent;
	color: var(--apyt-black);
	border: 1px solid var(--apyt-border-light);
}

.apyt-btn--login:hover {
	border-color: var(--apyt-black);
}

/* 3.2 Logotipo Centralizado Sobrio (Masthead) */
.apyt-masthead {
	padding: 1.5rem 0 1.25rem;
	text-align: center;
	border-bottom: 3px double var(--apyt-border-strong);
}

.apyt-masthead__logo {
	margin: 0;
	font-family: var(--apyt-font-serif);
	font-size: clamp(2.25rem, 5vw, 4.1rem);
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1;
	color: var(--apyt-black);
}

.apyt-masthead__logo a:hover {
	color: var(--apyt-black);
}

.apyt-masthead__subtitle {
	margin: 0.5rem 0 0;
	font-family: var(--apyt-font-serif);
	font-style: italic;
	font-size: clamp(0.875rem, 1.5vw, 1.05rem);
	color: var(--apyt-gray-dark);
}

/* 3.3 Barra de Navegación Principal Sticky */
.apyt-sticky-nav-wrapper {
	position: sticky;
	top: 0;
	z-index: 1000;
	background-color: var(--apyt-surface-white);
	border-bottom: 1px solid var(--apyt-border-strong);
	transition: box-shadow var(--apyt-transition);
}

/* Ajuste automático cuando la barra de administración de WordPress está visible */
body.admin-bar .apyt-sticky-nav-wrapper {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .apyt-sticky-nav-wrapper {
		top: 46px;
	}
}

.apyt-sticky-nav-wrapper.is-stuck {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.apyt-main-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 2.85rem;
	gap: 0.75rem;
}

/* Mini marca visible sólo cuando la barra hace scroll (sticky activo) */
.apyt-main-nav__mini-brand {
	font-family: var(--apyt-font-serif);
	font-weight: 700;
	font-size: 1.05rem;
	letter-spacing: -0.02em;
	color: var(--apyt-black);
	padding-right: 0.75rem;
	border-right: 1px solid var(--apyt-border-light);
	display: none;
	white-space: nowrap;
}

.apyt-sticky-nav-wrapper.is-stuck .apyt-main-nav__mini-brand {
	display: inline-block;
}

.apyt-main-nav__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	gap: 1.25rem;
	overflow-x: auto;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none;
	flex: 1;
}

.apyt-main-nav__list::-webkit-scrollbar {
	display: none;
}

.apyt-main-nav__item {
	flex: 0 0 auto;
}

.apyt-main-nav__link {
	display: inline-block;
	padding: 0.65rem 0;
	font-size: 0.8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--apyt-black);
	position: relative;
}

.apyt-main-nav__link::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 2px;
	background-color: var(--apyt-accent);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform var(--apyt-transition);
}

.apyt-main-nav__link:hover {
	color: var(--apyt-accent);
}

.apyt-main-nav__link:hover::after {
	transform: scaleX(1);
}

.apyt-search-toggle {
	background: none;
	border: none;
	padding: 0.4rem;
	cursor: pointer;
	color: var(--apyt-black);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.apyt-search-toggle:hover {
	color: var(--apyt-accent);
}

/* Gaveta de búsqueda */
.apyt-search-drawer {
	display: none;
	background-color: var(--apyt-surface-subtle);
	border-top: 1px solid var(--apyt-border-light);
	padding: 0.85rem 0;
}

.apyt-search-drawer.is-open {
	display: block;
}

.apyt-search-form {
	display: flex;
	gap: 0.5rem;
}

.apyt-search-form__input {
	flex: 1;
	padding: 0.55rem 0.85rem;
	border: 1px solid var(--apyt-border-light);
	font-family: var(--apyt-font-sans);
	font-size: 0.9rem;
}

.apyt-search-form__submit {
	padding: 0.55rem 1.25rem;
	background-color: var(--apyt-black);
	color: #ffffff;
	border: none;
	font-weight: 600;
	font-size: 0.8125rem;
	text-transform: uppercase;
	cursor: pointer;
}

/* ==========================================================================
   4. COMPONENTES EDITORIALES TRANSVERSALES (KICKERS, BYLINES, CABECERAS)
   ========================================================================== */
.apyt-main {
	padding-top: 1.5rem;
	padding-bottom: 4rem;
}

/* Encabezado de bloque de sección estilo El País */
.apyt-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-top: 2px solid var(--apyt-border-strong);
	border-bottom: 1px solid var(--apyt-border-light);
	padding: 0.55rem 0;
	margin-bottom: 1.25rem;
}

.apyt-section-header__left {
	display: flex;
	align-items: baseline;
	gap: 1rem;
}

.apyt-section-header__title {
	margin: 0;
	font-family: var(--apyt-font-serif);
	font-size: 1.25rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--apyt-black);
	text-transform: uppercase;
}

.apyt-section-header__title a:hover {
	color: var(--apyt-accent);
}

.apyt-section-header__meta {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--apyt-gray-muted);
	font-weight: 600;
}

.apyt-section-header__more {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--apyt-accent);
}

.apyt-section-header__more:hover {
	text-decoration: underline;
}

/* Kicker / Tag temático en mayúsculas pequeñas */
.apyt-kicker {
	display: inline-block;
	font-family: var(--apyt-font-sans);
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--apyt-accent);
	margin-bottom: 0.35rem;
}

.apyt-kicker:hover {
	text-decoration: underline;
}

/* Firma del autor y fecha (Byline) */
.apyt-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.75rem;
	color: var(--apyt-gray-muted);
	margin-top: 0.65rem;
}

.apyt-byline__author {
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: var(--apyt-charcoal);
}

.apyt-byline__location {
	font-style: italic;
}

.apyt-byline__sep {
	color: var(--apyt-border-light);
}

/* Placeholders elegantes en caso de nota sin miniatura */
.apyt-placeholder-img {
	background-color: var(--apyt-surface-subtle);
	border: 1px solid var(--apyt-border-light);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--apyt-gray-muted);
	font-family: var(--apyt-font-serif);
	font-size: 0.8rem;
	letter-spacing: 0.08em;
}

.apyt-placeholder-img--16x9 {
	aspect-ratio: 16 / 9;
	width: 100%;
}

.apyt-placeholder-img--square {
	aspect-ratio: 4 / 3;
	width: 100%;
}

/* ==========================================================================
   5. SECCIÓN PRINCIPAL: "LO MÁS DESTACADO DE LA SEMANA" (GRID ASIMÉTRICO)
   ========================================================================== */
.apyt-hero-section {
	margin-bottom: 3rem;
}

.apyt-hero-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--apyt-grid-gap);
	padding-bottom: 2rem;
	border-bottom: 1px solid var(--apyt-border-light);
}

/* Nota Principal de Apertura */
.apyt-hero-lead__media {
	margin-bottom: 0.9rem;
	overflow: hidden;
	background-color: var(--apyt-surface-subtle);
}

.apyt-hero-lead__img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.apyt-hero-lead:hover .apyt-hero-lead__img {
	transform: scale(1.015);
}

.apyt-hero-lead__title {
	margin: 0 0 0.65rem;
	font-family: var(--apyt-font-serif);
	font-size: clamp(1.65rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1.14;
	letter-spacing: -0.015em;
	color: var(--apyt-black);
}

.apyt-hero-lead__title a:hover {
	color: var(--apyt-accent);
}

.apyt-hero-lead__excerpt {
	margin: 0 0 0.75rem;
	font-size: 1.025rem;
	line-height: 1.55;
	color: var(--apyt-gray-dark);
}

/* Columna Lateral Secundaria (3 noticias destacadas) */
.apyt-hero-sidebar__list {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.apyt-side-card {
	display: grid;
	grid-template-columns: 1fr 110px;
	gap: 1rem;
	align-items: start;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--apyt-border-light);
}

.apyt-side-card:last-child {
	padding-bottom: 0;
	border-bottom: none;
}

.apyt-side-card__title {
	margin: 0;
	font-family: var(--apyt-font-serif);
	font-size: 1.1rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--apyt-black);
}

.apyt-side-card__title a:hover {
	color: var(--apyt-accent);
}

.apyt-side-card__media {
	overflow: hidden;
	background-color: var(--apyt-surface-subtle);
}

.apyt-side-card__img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* ==========================================================================
   6. BLOQUES POR CATEGORÍA CON CARRUSEL HORIZONTAL (CSS SCROLL SNAP)
   ========================================================================== */
.apyt-category-block {
	margin-bottom: 3rem;
}

/* Botones de flechas izquierda/derecha */
.apyt-carousel-controls {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.apyt-carousel-btn {
	width: 2rem;
	height: 2rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: var(--apyt-surface-white);
	border: 1px solid var(--apyt-border-light);
	color: var(--apyt-black);
	cursor: pointer;
	border-radius: 2px;
	transition: background-color var(--apyt-transition), border-color var(--apyt-transition), color var(--apyt-transition);
}

.apyt-carousel-btn:hover:not(:disabled) {
	background-color: var(--apyt-black);
	border-color: var(--apyt-black);
	color: #ffffff;
}

.apyt-carousel-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

/* Pista horizontal con Scroll Snap nativo */
.apyt-carousel-viewport {
	position: relative;
}

.apyt-carousel-track {
	display: flex;
	gap: 1.25rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 0.5rem;
	scrollbar-width: none; /* Ocultar barra en Firefox */
}

.apyt-carousel-track::-webkit-scrollbar {
	display: none; /* Ocultar barra en Chrome/Safari/Edge */
}

.apyt-carousel-track:focus {
	outline: 1px dashed var(--apyt-accent);
	outline-offset: 4px;
}

/* Tarjeta individual dentro del carrusel (Mobile-first: ~82% para sugerir arrastre horizontal) */
.apyt-carousel-card {
	flex: 0 0 82%;
	max-width: 82%;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	padding-right: 1.25rem;
	border-right: 1px solid var(--apyt-border-light);
}

.apyt-carousel-card:last-child {
	border-right: none;
	padding-right: 0;
}

.apyt-carousel-card__media {
	margin-bottom: 0.7rem;
	overflow: hidden;
	background-color: var(--apyt-surface-subtle);
}

.apyt-carousel-card__img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.apyt-carousel-card:hover .apyt-carousel-card__img {
	transform: scale(1.02);
}

.apyt-carousel-card__content {
	display: flex;
	flex-direction: column;
	flex: 1;
}

/* Titular legible limitado a máximo 3 líneas */
.apyt-carousel-card__title {
	margin: 0 0 0.45rem;
	font-family: var(--apyt-font-serif);
	font-size: 1.08rem;
	font-weight: 700;
	line-height: 1.26;
	color: var(--apyt-black);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.apyt-carousel-card__title a:hover {
	color: var(--apyt-accent);
}

/* Extracto corto */
.apyt-carousel-card__excerpt {
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--apyt-gray-dark);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.apyt-byline--card {
	margin-top: auto;
	padding-top: 0.35rem;
}

/* ==========================================================================
   7. PIE DE PÁGINA (FOOTER)
   ========================================================================== */
.apyt-footer {
	background-color: var(--apyt-black);
	color: #ffffff;
	padding: 2.5rem 0 2rem;
	border-top: 4px solid var(--apyt-accent);
	font-size: 0.85rem;
}

.apyt-footer__top {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding-bottom: 1.75rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.apyt-footer__logo {
	font-family: var(--apyt-font-serif);
	font-size: 1.65rem;
	font-weight: 700;
	color: #ffffff;
}

.apyt-footer__desc {
	margin: 0.35rem 0 0;
	color: #b5b5b5;
	max-width: 420px;
}

.apyt-footer__links,
.apyt-footer__legal {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
}

.apyt-footer__links a {
	color: #e0e0e0;
	font-weight: 600;
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.04em;
}

.apyt-footer__links a:hover,
.apyt-footer__legal a:hover {
	color: #ffffff;
	text-decoration: underline;
}

.apyt-footer__bottom {
	padding-top: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	color: #9e9e9e;
	font-size: 0.75rem;
}

/* ==========================================================================
   8. MEDIA QUERIES (TABLET Y ESCRITORIO)
   ========================================================================== */

/* Tablet (>= 640px) */
@media (min-width: 640px) {
	.apyt-topbar__divider,
	.apyt-topbar__updated {
		display: inline;
	}

	/* En tablet se ven 2.2 tarjetas por vista en el carrusel */
	.apyt-carousel-card {
		flex: 0 0 calc((100% - 1.25rem) / 2.2);
		max-width: calc((100% - 1.25rem) / 2.2);
	}
}

/* Escritorio Medio (>= 960px): Activación de Retícula Asimétrica 65% / 35% */
@media (min-width: 960px) {
	.apyt-topbar__center {
		display: block;
	}

	.apyt-main-nav__list {
		justify-content: center;
		gap: 2rem;
	}

	/* Cuadrícula Asimétrica: 65% Nota Principal | 35% Columna Lateral */
	.apyt-hero-grid {
		grid-template-columns: minmax(0, 6.5fr) minmax(0, 3.5fr);
		align-items: start;
	}

	.apyt-hero-lead {
		padding-right: var(--apyt-grid-gap);
		border-right: 1px solid var(--apyt-border-light);
	}

	/* En escritorio medio se muestran 3.25 tarjetas en el carrusel */
	.apyt-carousel-card {
		flex: 0 0 calc((100% - 2.5rem) / 3.25);
		max-width: calc((100% - 2.5rem) / 3.25);
	}

	.apyt-footer__top,
	.apyt-footer__bottom {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}

/* Escritorio Amplio (>= 1200px) */
@media (min-width: 1200px) {
	/* En escritorio amplio se ven 3.5 tarjetas para invitar al desplazamiento de las 5 notas */
	.apyt-carousel-card {
		flex: 0 0 calc((100% - 3.75rem) / 3.5);
		max-width: calc((100% - 3.75rem) / 3.5);
	}
}
