/*
Theme Name: News
Theme URI: https://example.com/news
Author: Meli
Author URI: https://example.com
Description: Tema clásico para sitios de noticias / revista digital. Home modular por bloques de categorías, panel de opciones propio (secciones, colores, contacto, logo), SEO semántico y optimización de rendimiento.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: news
Tags: news, magazine, blog, custom-logo, custom-menu, featured-images, two-columns, right-sidebar, full-width-template, theme-options, translation-ready
*/

/* =========================================================
   1. Variables (los colores se sobrescriben desde el panel)
   ========================================================= */
:root {
	--news-primary: #c8102e;
	--news-secondary: #1a1a1a;
	--news-bg: #ffffff;
	--news-text: #1f2933;
	--news-link: #c8102e;
	--news-header-bg: #ffffff;
	--news-footer-bg: #111418;

	--news-muted: #6b7280;
	--news-border: #e5e7eb;
	--news-surface: #f7f8fa;

	--news-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--news-font-heading: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	--news-maxw-desktop: 80vw;
	--news-maxw: 80vw;
	--news-gap: clamp(1rem, 2vw, 2rem);
	--news-radius: 8px;
}

/* =========================================================
   2. Reset / base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--news-font);
	font-size: 1rem;
	line-height: 1.65;
	color: var(--news-text);
	background: var(--news-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a { color: var(--news-link); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* Foco visible para accesibilidad (WCAG). */
:focus-visible {
	outline: 3px solid var(--news-primary);
	outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--news-font-heading);
	font-weight: 700;
	line-height: 1.2;
	color: var(--news-secondary);
	margin: 0 0 .5em;
	letter-spacing: -0.01em;
}

/* Títulos que no son encabezados pero deben usar la fuente de títulos. */
.site-title, .card__title, .post-item__title, .section-block__title, .entry-title, .widget__title {
	font-family: var(--news-font-heading);
}
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.2em; }

/* Salto de accesibilidad. */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--news-primary);
	color: #fff;
	padding: .75rem 1rem;
	z-index: 1000;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* =========================================================
   3. Layout / contenedor (regla global Meli)
   ========================================================= */
.container {
	width: 100%;
	max-width: var(--news-maxw);
	margin-inline: auto;
}

.site-main { padding-block: clamp(1.5rem, 4vw, 3rem); }

/* =========================================================
   4. Header
   ========================================================= */
.site-header {
	background: var(--news-header-bg);
	border-bottom: 1px solid var(--news-border);
	position: sticky;
	top: 0;
	z-index: 100;
}
/* Header no fijo (toggle del panel). */
.news-no-sticky .site-header { position: static; }

/* Logo alternativo para header fijo: por defecto se muestra el normal. */
.custom-logo--sticky { display: none; }
.site-header.is-stuck .custom-logo--default { display: none; }
.site-header.is-stuck .custom-logo--sticky { display: block; }

/* ---- Top bar (Etapa 3): fecha + contacto/redes + buscador ---- */
.topbar { min-height: 36px; } /* reserva alto -> evita CLS */
.topbar__left,
.topbar__right { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.topbar__date { opacity: .85; text-transform: capitalize; }
.topbar__search { display: flex; align-items: center; }
.topbar__search input[type="search"] {
	border: 0;
	border-radius: 4px 0 0 4px;
	padding: .3rem .6rem;
	font-size: .8rem;
	min-height: 30px;
	width: 150px;
	max-width: 40vw;
}
.topbar__search button {
	border: 0;
	background: var(--news-primary);
	color: #fff;
	min-height: 30px;
	padding: 0 .6rem;
	border-radius: 0 4px 4px 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
}

/* ---- Tipos de cabecera (Etapa 3) ---- */
.site-header__bar { min-height: 72px; } /* reserva alto -> evita CLS */

/* Tipo 1: logo izquierda + menú derecha. */
.header--type-1 .header-bar--inline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--news-gap);
	flex-wrap: wrap;
}
.header--type-1 .main-navigation { border-top: 0; }
.header--type-1 .main-navigation .container { padding: 0; width: auto; max-width: none; margin: 0; }
.header--type-1 .main-navigation .menu { justify-content: flex-end; }

/* Tipo 2: logo centrado + menú debajo. */
.header--type-2 .header-bar--centered {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: .25rem;
}
.header--type-2 .main-navigation .menu { justify-content: center; }

/* Tipo 3: logo + banner 728×90 + menú debajo. */
.header--type-3 .header-bar--with-ad {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--news-gap);
	flex-wrap: wrap;
}
.header-ad {
	width: 728px;
	max-width: 100%;
	min-height: 90px; /* reserva alto -> evita CLS */
	display: flex;
	align-items: center;
	justify-content: center;
}
.header-ad img { width: 728px; max-width: 100%; height: auto; }
.header-ad__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 90px;
	background: var(--news-surface);
	color: var(--news-muted);
	font-size: .85rem;
	border: 1px dashed var(--news-border);
	border-radius: var(--news-radius);
}

@media (max-width: 768px) {
	.header-ad { display: none; } /* el banner 728×90 no entra en móvil */
	.header--type-1 .header-bar--inline { justify-content: center; }
}
.site-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--news-gap);
	padding-block: 1rem;
}
.site-branding { display: flex; align-items: center; gap: .75rem; }
.site-title { font-size: 1.6rem; margin: 0; }
.site-title a { color: var(--news-secondary); text-decoration: none; }
.site-description { margin: 0; font-size: .85rem; color: var(--news-muted); }
.custom-logo { max-height: 56px; width: auto; }

/* Tira superior con contacto/redes. */
.topbar {
	background: var(--news-secondary);
	color: #fff;
	font-size: .82rem;
}
.topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: .5rem 1.5rem;
	padding-block: .5rem;
}
.topbar a { color: #fff; }
.topbar__contact, .topbar__social { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.topbar__social a { display: inline-flex; min-width: 24px; min-height: 24px; align-items: center; justify-content: center; }

/* Cinta de últimas noticias (ticker). */
.news-ticker { background: var(--news-secondary); color: #fff; min-height: 44px; overflow: hidden; } /* alto reservado -> CLS */
.news-ticker__inner { display: flex; align-items: center; gap: 1rem; min-height: 44px; }
.news-ticker__label {
	flex: 0 0 auto;
	background: var(--news-primary);
	color: #fff;
	font-weight: 700;
	text-transform: uppercase;
	font-size: .72rem;
	letter-spacing: .04em;
	padding: .35rem .7rem;
	white-space: nowrap;
}
.news-ticker__viewport { flex: 1; min-width: 0; overflow: hidden; }
.news-ticker__track {
	display: flex;
	gap: 2.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
	white-space: nowrap;
	will-change: transform;
}
.news-ticker.is-running .news-ticker__track { animation: news-ticker-scroll linear infinite; }
@keyframes news-ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.news-ticker__item a { color: #fff; font-size: .85rem; }
.news-ticker__item a:hover { color: #fff; text-decoration: underline; }
/* prefers-reduced-motion: sin animación, scroll manual. */
.news-ticker.is-static .news-ticker__viewport { overflow-x: auto; }
.news-ticker.is-static .news-ticker__track { animation: none; }

/* Navegación principal. */
.main-navigation { border-top: 1px solid var(--news-border); }
.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: .25rem;
}
.main-navigation li { position: relative; }
.main-navigation a {
	display: block;
	padding: .85rem 1rem; /* touch target >=44px */
	color: var(--news-secondary);
	font-weight: 600;
	text-decoration: none;
	text-transform: uppercase;
	font-size: .85rem;
	letter-spacing: .03em;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a { color: var(--news-primary); }

/* Submenús. */
.main-navigation ul ul {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--news-border);
	min-width: 220px;
	box-shadow: 0 10px 30px rgba(0,0,0,.08);
	z-index: 50;
}
.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul { display: flex; }

/* Toggle móvil. */
.menu-toggle {
	display: none;
	align-items: center;
	gap: .5rem;
	background: transparent;
	border: 1px solid var(--news-border);
	border-radius: var(--news-radius);
	padding: .6rem .9rem;
	min-height: 44px;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	color: var(--news-secondary);
}

/* =========================================================
   5. Home modular (bloques de sección)
   ========================================================= */
.home-sections {
	display: flex;
	flex-wrap: wrap;
	gap: var(--news-gap);
	align-items: flex-start;
}
.section-block { min-width: 0; } /* evita overflow en flex */
.section-block--full      { flex: 1 1 100%; }
.section-block--principal { flex: 1 1 62%; }
.section-block--lateral   { flex: 1 1 30%; }
.section-block--grid-2,
.section-block--grid-3    { flex: 1 1 100%; }

/* ---- Home por bloques (Etapa 4): pila vertical de bloques ---- */
.home-blocks {
	display: flex;
	flex-direction: column;
	gap: clamp(2rem, 4vw, 3rem);
}
.home-blocks .section-block { width: 100%; }

/* Layout destacado: lead + lista del resto (2 columnas en escritorio). */
.block-featured { display: grid; gap: var(--news-gap); }
@media (min-width: 1024px) {
	.block-featured { grid-template-columns: 2fr 1fr; align-items: start; }
}
.block-featured__rest { display: grid; gap: 1rem; }

/* Layout ancho completo: tarjetas grandes apiladas. */
.block-full { display: grid; gap: var(--news-gap); }

/* ====== Hero / Destacados (Etapa 5) ====== */
.hero { width: 100%; }
.hero-card { position: relative; min-width: 0; }
.hero-card__title { margin: 0; }
.hero-card__title a { color: var(--news-secondary); }
.hero-card__title a:hover { color: var(--news-primary); text-decoration: none; }
.hero-card__excerpt { color: var(--news-muted); margin: .35rem 0 0; }
.hero-card .card__meta,
.hero-card .post-item__meta { font-size: .78rem; color: var(--news-muted); margin-top: .35rem; }

/* Nota principal con imagen + overlay de texto. */
.hero-card--lead .hero-card__media { display: block; position: relative; aspect-ratio: 16 / 9; border-radius: var(--news-radius); overflow: hidden; }
.hero-card--lead .hero-card__media img { width: 100%; height: 100%; object-fit: cover; }
.hero-card--lead .card__cat { position: absolute; top: .8rem; left: .8rem; }
.hero-card--lead .hero-card__body {
	position: absolute;
	inset: auto 0 0 0;
	padding: 1.5rem 1.25rem 1.25rem;
	background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,0));
}
.hero-card--lead .hero-card__title { font-size: clamp(1.4rem, 2.6vw, 2.1rem); }
.hero-card--lead .hero-card__title a,
.hero-card--lead .hero-card__excerpt,
.hero-card--lead .card__meta,
.hero-card--lead .card__meta a { color: #fff; }

/* Layout principal: lead + secundarias al costado. */
.hero--main { display: grid; gap: var(--news-gap); }
@media (min-width: 1024px) { .hero--main { grid-template-columns: 2fr 1fr; align-items: start; } }
.hero-main__side { display: flex; flex-direction: column; gap: 1rem; }
.hero-main__side .hero-card--sec { display: grid; grid-template-columns: 110px 1fr; gap: .8rem; align-items: start; }
.hero-main__side .hero-card__media { aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--news-surface); }
.hero-main__side .hero-card__media img { width: 100%; height: 100%; object-fit: cover; }
.hero-main__side .hero-card__title { font-size: 1rem; line-height: 1.35; }
.hero-main__side .hero-card__excerpt { display: none; }

/* Layout grilla: tarjetas verticales. */
.hero--grid .hero-card { display: flex; flex-direction: column; background: var(--news-bg); border: 1px solid var(--news-border); border-radius: var(--news-radius); overflow: hidden; }
.hero--grid .hero-card__media { display: block; aspect-ratio: 3 / 2; background: var(--news-surface); }
.hero--grid .hero-card__media img { width: 100%; height: 100%; object-fit: cover; }
.hero--grid .hero-card__body { padding: 1rem; }
.hero--grid .hero-card--lead .hero-card__body { position: static; background: none; padding: 1rem; }
.hero--grid .hero-card--lead .hero-card__title,
.hero--grid .hero-card--lead .hero-card__title a,
.hero--grid .hero-card--lead .hero-card__excerpt,
.hero--grid .hero-card--lead .card__meta a { color: var(--news-secondary); }
.hero--grid .hero-card--lead .hero-card__media { aspect-ratio: 3 / 2; }

/* Layout slider. */
.hero--slider { position: relative; }
.hero-slider__track { position: relative; }
.hero-slide[hidden] { display: none; }
.hero-slider__nav {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 44px; height: 44px; border: 0; border-radius: 50%;
	background: rgba(0,0,0,.5); color: #fff; font-size: 1.6rem; line-height: 1;
	cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center;
}
.hero-slider__prev { left: .6rem; }
.hero-slider__next { right: .6rem; }
.hero-slider__nav:hover { background: var(--news-primary); }
.hero-slider__dots { position: absolute; bottom: .8rem; left: 0; right: 0; display: flex; gap: .4rem; justify-content: center; z-index: 2; }
.hero-slider__dot { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,.6); cursor: pointer; padding: 0; }
.hero-slider__dot.is-active { background: var(--news-primary); }

@media (max-width: 768px) {
	/* Se quitó el "aplanado" del lead en móvil (body estático + fondo claro + texto
	   oscuro): rompía el tratamiento de overlay del módulo Destacados "1 grande + 2
	   apiladas" (.hero--top) en ≤768px. El overlay es el comportamiento BASE
	   (.hero-card--lead .hero-card__body absoluto + degradado + texto #fff, arriba)
	   y ahora se mantiene en móvil/tablet igual que en desktop. .hero--grid conserva
	   su propio tratamiento estático (reglas base scopeadas), no dependía de esto. */
	.hero-slider__dots { position: static; margin-top: .6rem; }
}

/* ---- Bloques de publicidad (Etapa 4) ---- */
.news-ad {
	margin-inline: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	background: var(--news-surface);
}
.news-ad img { display: block; max-width: 100%; height: auto; }
.news-ad a { display: block; line-height: 0; max-width: 100%; }

/* Encabezado de sección. */
.section-block__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	border-bottom: 3px solid var(--news-primary);
	margin-bottom: 1.25rem;
	padding-bottom: .4rem;
}
.section-block__title {
	margin: 0;
	font-size: 1.25rem;
	text-transform: uppercase;
	letter-spacing: .02em;
}
.section-block__title::before {
	content: "";
	display: inline-block;
	width: .55rem; height: .55rem;
	background: var(--news-primary);
	margin-right: .5rem;
	vertical-align: middle;
}
.section-block__more { font-size: .8rem; font-weight: 600; text-transform: uppercase; }

/* Grillas internas de los bloques. */
.posts-grid { display: grid; gap: var(--news-gap); }
.posts-grid--2 { grid-template-columns: repeat(2, 1fr); }
.posts-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* Bloque principal: destacado grande + lista. */
.block-main__lead { margin-bottom: 1.25rem; }
.block-main__rest { display: grid; gap: 1rem; }

/* Bloque lateral / lista compacta. */
.post-list { display: grid; gap: 1rem; }

/* =========================================================
   6. Tarjetas de post
   ========================================================= */
.card {
	background: var(--news-bg);
	border: 1px solid var(--news-border);
	border-radius: var(--news-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover { box-shadow: 0 12px 28px rgba(0,0,0,.08); transform: translateY(-2px); }
.card__media { position: relative; aspect-ratio: 3 / 2; background: var(--news-surface); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__cat {
	position: absolute;
	top: .6rem; left: .6rem;
	background: var(--news-primary);
	color: #fff;
	font-size: .68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: .3rem .55rem;
	border-radius: 4px;
}
.card__cat:hover { color: #fff; text-decoration: none; }
.card__body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card__title { font-size: 1.1rem; margin: 0; }
.card__title a { color: var(--news-secondary); }
.card__title a:hover { color: var(--news-primary); text-decoration: none; }
.card__excerpt { color: var(--news-muted); font-size: .92rem; margin: 0; }
.card__meta { font-size: .78rem; color: var(--news-muted); display: flex; gap: .75rem; flex-wrap: wrap; }

/* Destacado grande (block principal lead / full). */
.card--lead .card__media { aspect-ratio: 16 / 9; }
.card--lead .card__title { font-size: clamp(1.4rem, 2.5vw, 2rem); }
.card--lead .card__body { padding: 1.25rem 0 0; }
.card--lead { border: 0; border-radius: 0; }

/* Item horizontal (listas laterales). */
.post-item {
	display: grid;
	grid-template-columns: 110px 1fr;
	gap: .85rem;
	align-items: start;
}
.post-item__media { aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--news-surface); }
.post-item__media img { width: 100%; height: 100%; object-fit: cover; }
.post-item__title { font-size: .98rem; margin: 0 0 .25rem; line-height: 1.35; }
.post-item__title a { color: var(--news-secondary); }
.post-item__title a:hover { color: var(--news-primary); text-decoration: none; }
.post-item__meta { font-size: .74rem; color: var(--news-muted); }

/* =========================================================
   7. Contenido principal + sidebar (single / archive)
   ========================================================= */
.content-area {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: start;
}
.no-sidebar .content-area { grid-template-columns: minmax(0, 1fr); }

/* Entrada individual. */
.entry-header { margin-bottom: 1.5rem; }
.entry-title { margin-bottom: .5rem; }
.entry-meta { font-size: .85rem; color: var(--news-muted); display: flex; flex-wrap: wrap; gap: 1rem; }
.entry-meta a { color: var(--news-muted); }
.entry-thumb { margin: 1.5rem 0; border-radius: var(--news-radius); overflow: hidden; }
.entry-content { font-size: 1.05rem; }
.entry-content img { border-radius: var(--news-radius); margin-block: 1.5rem; }
.entry-content h2, .entry-content h3 { margin-top: 1.5em; }
.entry-content blockquote {
	margin: 1.5rem 0;
	padding: .5rem 1.25rem;
	border-left: 4px solid var(--news-primary);
	color: var(--news-secondary);
	font-style: italic;
}
.entry-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--news-border); font-size: .85rem; }
.tags-links a {
	display: inline-block;
	background: var(--news-surface);
	padding: .25rem .6rem;
	border-radius: 4px;
	margin: 0 .25rem .25rem 0;
	font-size: .8rem;
}

/* ====== Single — meta, compartir, relacionadas (Etapa 6) ====== */
.entry-cat {
	display: inline-block;
	background: var(--news-primary);
	color: #fff;
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	padding: .25rem .6rem;
	border-radius: 4px;
	margin-bottom: .75rem;
}
.entry-cat:hover { color: #fff; text-decoration: none; }
.entry-lead { font-size: 1.15rem; color: var(--news-muted); margin-top: .5rem; }

.single-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem 1.5rem;
	margin: 1rem 0;
	padding-block: .75rem;
	border-block: 1px solid var(--news-border);
	font-size: .85rem;
}
.single-meta__author { display: flex; align-items: center; gap: .6rem; }
.single-meta__avatar { border-radius: 50%; }
.single-meta__name { font-weight: 600; color: var(--news-secondary); display: block; }
.single-meta__date { color: var(--news-muted); }
.single-meta__items { display: flex; gap: 1.25rem; color: var(--news-muted); }

/* Compartir. */
.news-share { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.news-share__label { font-size: .82rem; color: var(--news-muted); font-weight: 600; }
.news-share__btn {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	min-height: 36px;
	min-width: 36px;
	justify-content: center;
	padding: 0 .6rem;
	border: 1px solid var(--news-border);
	border-radius: 6px;
	background: #fff;
	color: var(--news-secondary);
	cursor: pointer;
	font: inherit;
	font-size: .8rem;
}
.news-share__btn:hover { background: var(--news-primary); color: #fff; border-color: var(--news-primary); text-decoration: none; }
.news-share__copy-txt { font-size: .8rem; }

/* Relacionadas. */
.related { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 3px solid var(--news-primary); }
.related__title { font-size: 1.25rem; text-transform: uppercase; margin-bottom: 1.25rem; }
.posts-grid--4 { grid-template-columns: repeat(4, 1fr); }
.card--related .card__media { aspect-ratio: 3 / 2; }

/* Sidebar sticky (toggle del panel). */
@media (min-width: 1024px) {
	.widget-area--sticky { position: sticky; top: 90px; }
}

/* Widgets de noticias. */
.news-widget-posts { list-style: none; margin: 0; padding: 0; }
.news-wp-item { display: grid; grid-template-columns: 72px 1fr; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--news-border); }
.news-wp-thumb { display: block; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--news-surface); }
.news-wp-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-wp-thumb--ph { display: block; width: 100%; height: 100%; background: var(--news-surface); }
.news-wp-title { display: block; font-weight: 600; font-size: .92rem; line-height: 1.3; color: var(--news-secondary); }
.news-wp-title:hover { color: var(--news-primary); text-decoration: none; }
.news-wp-meta { font-size: .75rem; color: var(--news-muted); }

@media (max-width: 768px) {
	.posts-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

/* Breadcrumbs. */
.breadcrumbs { font-size: .8rem; color: var(--news-muted); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--news-muted); }
.breadcrumbs span[aria-current] { color: var(--news-text); }

/* =========================================================
   8. Sidebar / widgets
   ========================================================= */
.widget { margin-bottom: 2rem; }
.widget__title {
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: .02em;
	border-bottom: 3px solid var(--news-primary);
	padding-bottom: .4rem;
	margin-bottom: 1rem;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: .5rem 0; border-bottom: 1px solid var(--news-border); }

/* =========================================================
   9. Archivos / paginación
   ========================================================= */
.page-header { margin-bottom: 1.5rem; }
.page-title { margin: 0; }
.archive-description { color: var(--news-muted); margin-top: .5rem; }

.pagination { margin-top: 2rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 .6rem;
	border: 1px solid var(--news-border);
	border-radius: var(--news-radius);
	color: var(--news-secondary);
	font-weight: 600;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover {
	background: var(--news-primary);
	color: #fff;
	border-color: var(--news-primary);
	text-decoration: none;
}

/* =========================================================
   10. Footer
   ========================================================= */
.site-footer {
	background: var(--news-footer-bg);
	color: #cfd4da;
	margin-top: 3rem;
	padding-block: clamp(2rem, 5vw, 3.5rem);
}
.site-footer a { color: #fff; }
.footer-widgets {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--news-gap);
}
.site-footer .widget__title { color: #fff; border-color: var(--news-primary); }
.site-footer .widget li { border-color: rgba(255,255,255,.12); }
.footer-bottom {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255,255,255,.12);
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	font-size: .85rem;
}
.footer-menu ul { list-style: none; display: flex; gap: 1.25rem; margin: 0; padding: 0; flex-wrap: wrap; }
.footer-social { display: flex; gap: 1rem; }
.footer-social a { min-width: 24px; min-height: 24px; }

/* =========================================================
   11. 404 / sin resultados
   ========================================================= */
.error-404, .no-results { text-align: center; padding-block: 3rem; }
.error-404 .page-title { font-size: clamp(3rem, 10vw, 6rem); color: var(--news-primary); }

/* =========================================================
   12. Responsive (mobile-first overrides)
   ========================================================= */
@media (max-width: 1024px) {
	:root { --news-maxw: 84vw; } /* tablet */
	.content-area { grid-template-columns: minmax(0, 1fr); }
	.footer-widgets { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
	:root { --news-maxw: 90vw; } /* mobile */

	/* Bloques de la home a una columna. */
	.section-block--principal,
	.section-block--lateral { flex: 1 1 100%; }
	.posts-grid--2, .posts-grid--3 { grid-template-columns: 1fr; }
	.footer-widgets { grid-template-columns: 1fr; }

	/* Menú móvil. */
	.menu-toggle { display: inline-flex; }
	.main-navigation .menu {
		display: none;
		flex-direction: column;
		gap: 0;
	}
	.main-navigation.is-open .menu { display: flex; }
	.main-navigation ul ul { position: static; border: 0; box-shadow: none; padding-left: 1rem; }
	.main-navigation li:hover > ul { display: none; }
	.main-navigation .menu a { border-bottom: 1px solid var(--news-border); }
}

@media (max-width: 480px) {
	.posts-grid--2, .posts-grid--3 { grid-template-columns: 1fr; }
	.topbar__inner { justify-content: center; }
}

/* Respeta preferencia de menos movimiento. */
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
