/* ==========================================
   SEXTO PODER BOLIVIA 2026 - STYLE MASTER v17.2
   ✓ Paleta Slate News (Azul Pizarra)
   ✓ Hero Portada Móvil: 330px (IGUAL que seccional)
   ✓ Hero Seccional Móvil: 330px
   ✓ Lo Más Leído expandido (flex 1.55)
   ✓ Caricatura expandida (min-height 170px)
   ✓ Descanso visual mantenido
   ✓ Zoom hero 1.03 (estándar profesional)
   ✓ Legibilidad profesional en detalle.html
   ✓ Orden: Imagen → Título → Desarrollo
   ✓ Botón Volver al final
   ✓ Justificación de texto
   ✓ Primera letra destacada (drop cap)
   ✅ DESKTOP: Título detalle -40%, sin fecha/portada
   ✅ MÓVIL: Hero portada = Hero seccional (330px)
   ✅ MÓVIL: Imagen +20%, Título -20%
   ✅ MÓVIL: Secciones y Footer corregidos
   ✅ MÓVIL: Hero solo título (sin resumen)
   ✅ MÓVIL: Logo imagen -15% (50px), Logo TEXTO +18%
   ✅ DESKTOP: Logo imagen -15% (48px), Logo TEXTO +20%
   ✅ GLOBAL: Eliminar figcaption (pie de foto)
   ✅ OPTIMIZACIÓN: Lo Más Leído sin lag (GPU forzada)
   ✅ OPTIMIZACIÓN: will-change + contain + content-visibility
   ✅ OPTIMIZACIÓN: Hover effects reducidos en móvil
   ✅ v17.2: @import eliminado (fuentes vía <link preload> en HTML)
   ✅ v17.2: fetchpriority="high" soportado en hero image
   ✅ v17.2: Lightbox con aspect-ratio preventivo (anti-CLS)
   ✅ v17.2: Ticker 60s en móvil (reduce jank gama baja)
   ========================================== */

/* ✅ v17.2: @import ELIMINADO. Las fuentes se cargan vía <link rel="preload"> en index.html
   Esto desbloquea el renderizado ~300-500ms. Las variables CSS siguen funcionando
   porque las fuentes tienen fallback system-ui. */

:root {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-card: #1E293B;
    --bg-hover: #334155;
    --bg-glass: rgba(15, 23, 42, 0.95);
    
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --primary-light: #60A5FA;
    --primary-glow: rgba(59, 130, 246, 0.3);
    --primary-muted: rgba(59, 130, 246, 0.15);
    
    --gradient-primary: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    --urgent: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;
    
    --border-primary: rgba(148, 163, 184, 0.15);
    --border-accent: rgba(59, 130, 246, 0.4);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --duration-fast: 200ms;
    --duration-normal: 350ms;
    
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Merriweather', Georgia, serif;
    
    --progress-height: 3px;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.7;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

/* ===== TIPOGRAFÍA BASE ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--text-primary);
}

p, .lead, .hero-content p, .article-detail p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

/* ===== UTILIDADES ===== */
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: all var(--duration-fast) var(--ease-smooth); }
a:hover { color: var(--primary); }
ul, ol { list-style: none; }

.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

main > .container { padding: 0 24px; }

/* ===== BARRA DE PROGRESO ===== */
.reading-progress-bar {
  position: fixed; top: 0; left: 0; height: var(--progress-height);
  background: var(--gradient-primary); width: 0%; z-index: 99999;
  transition: width 0.1s ease-out;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-primary);
}

.header.scrolled {
  background: rgba(15, 23, 42, 0.98);
  box-shadow: var(--shadow-md);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-text h1 {
  font-size: clamp(1.44rem, 2.4vw, 1.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

.logo-text h1 .highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text h1 span[style*="primary-light"] {
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}

.tagline { display: none; }

.header-date-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(148, 163, 184, 0.08);
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-display);
}

.header-date-right i {
  color: var(--primary-light);
  font-size: 0.85rem;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ===== NAVEGACIÓN ===== */
.navbar {
  padding: 6px 0 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-menu {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-menu li a {
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--duration-fast) var(--ease-smooth);
  border: 1px solid transparent;
  font-family: var(--font-display);
  background: rgba(148, 163, 184, 0.06);
}

.nav-menu li a:hover {
  background: var(--primary-muted);
  color: var(--text-primary);
  border-color: var(--border-accent);
  transform: translateY(-1px);
}

.nav-menu li a.active {
  background: var(--gradient-primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-glow);
  border-color: transparent;
  font-weight: 700;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  padding: 6px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--duration-fast) var(--ease-smooth);
}

/* ===== TICKER ===== */
.breaking-news-bar {
  background: linear-gradient(90deg, var(--urgent) 0%, #dc2626 100%);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 26px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.breaking-label {
  background: rgba(0, 0, 0, 0.4);
  padding: 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.68rem;
  white-space: nowrap;
  letter-spacing: 0.08em;
}

.breaking-label .indicator {
  width: 6px;
  height: 6px;
  background: var(--text-primary);
  border-radius: 50%;
  margin-right: 6px;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.breaking-ticker {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.ticker-content {
  display: flex;
  white-space: nowrap;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  animation: ticker-scroll 90s linear infinite;
  will-change: transform;
}

.breaking-ticker:hover .ticker-content {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0) translateY(-50%); }
  100% { transform: translateX(-50%) translateY(-50%); }
}

.ticker-item {
  padding: 0 20px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-block;
}

.ticker-item::after {
  content: "•";
  margin-left: 20px;
  color: rgba(241, 245, 249, 0.8);
}

/* ===== LAYOUT PRINCIPAL ===== */
.main-top-layout {
  display: grid;
  grid-template-columns: 54fr 46fr;
  gap: 26px;
  margin: 24px 0 32px;
  align-items: stretch;
  height: calc(100vh - 175px);
  max-height: 680px;
  min-height: 590px;
}

.hero-column {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== HERO PORTADA ===== */
.hero-section {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  height: 100%;
  min-height: 0;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
}

.hero-section:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

/* ✅ v17.2: Imágenes con fetchpriority="high" no necesitan transición de entrada */
.hero-image img[fetchpriority="high"] {
  transition: transform 0.6s var(--ease-out);
}

.hero-section:hover .hero-image img {
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.15) 40%,
    rgba(15, 23, 42, 0.75) 70%,
    rgba(15, 23, 42, 0.98) 100%
  );
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 27px 31px 31px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
}

.hero-content * {
  pointer-events: auto;
}

.hero-badge { display: none; }

.hero-content h2 {
  font-size: clamp(1.33rem, 2.25vw, 1.75rem);
  font-weight: 800;
  margin: 0 0 14px 0;
  line-height: 1.25;
  color: var(--text-primary);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hero-content p.lead {
  font-size: 0.91rem;
  margin: 0 0 16px 0;
  line-height: 1.6;
  color: var(--text-secondary);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: justify;
  hyphens: auto;
}

.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-light);
  font-weight: 700;
  font-size: 0.89rem;
  margin-top: 6px;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: var(--font-display);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
}

.btn-read-more:hover {
  gap: 12px;
  color: var(--primary);
  transform: translateX(3px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 17px;
  height: 100%;
  min-height: 0;
}

.widget-lo-mas-leido {
  flex: 1.55;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.widget-lo-mas-leido .widget-title { 
  display: block !important;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-primary);
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
  flex-shrink: 0;
}

.lo-mas-leido-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.lo-mas-leido-item {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.08);
  overflow: hidden;
  min-height: 0;
  transform: translateZ(0);
  will-change: transform;
  contain: layout style paint;
  backface-visibility: hidden;
  perspective: 1000px;
  transition: none !important;
}

.lo-mas-leido-item:hover {
  transform: translateZ(0) translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.lo-mas-leido-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: none !important;
  content-visibility: auto;
  contain-intrinsic-size: 200px 150px;
}

.lo-mas-leido-item:hover img {
  transform: scale(1.05) translateZ(0);
}

.lo-mas-leido-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.2) 40%,
    rgba(15, 23, 42, 0.92) 100%
  );
  z-index: 2;
  pointer-events: none;
}

.lo-mas-leido-item h4 {
  position: relative;
  z-index: 3;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0;
  padding: 9px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 700;
  text-align: left;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.sidebar-bottom-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 17px;
  flex: 1;
  min-height: 0;
}

.widget-caricatura {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.widget-caricatura .widget-title {
  display: block !important;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-primary);
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
  flex-shrink: 0;
}

.cartoon-widget {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  gap: 10px;
}

.cartoon-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid var(--border-primary);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  min-height: 170px;
}

.cartoon-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform var(--duration-normal) var(--ease-out);
}

.cartoon-widget:hover .cartoon-container {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.cartoon-widget:hover .cartoon-container img {
  transform: scale(1.02);
}

.caricatura-caption {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-body);
  flex-shrink: 0;
}

.widget-redes {
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.widget-redes .widget-title {
  display: block !important;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-primary);
  flex-shrink: 0;
}

.redes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.red-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(148, 163, 184, 0.05);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.08);
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
  color: var(--text-primary);
  flex: 1;
}

.red-item:hover {
  background: var(--bg-hover);
  transform: translateX(4px);
  border-color: var(--border-accent);
}

.red-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: white;
  flex-shrink: 0;
}

.red-icon.facebook { background: #1877F2; }
.red-icon.youtube { background: #FF0000; }
.red-icon.tiktok { background: #000000; border: 1px solid #333; }
.red-icon.whatsapp { background: #25D366; }
.red-icon.telegram { background: #0088cc; }

.red-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.red-name {
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.red-count {
  font-size: 0.69rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ===== GRID DE NOTICIAS ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin: 44px auto 56px;
  max-width: 920px;
  padding: 0 20px;
}

.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  min-height: 290px;
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: 0 300px;
}

@media (hover: hover) and (pointer: fine) {
  .news-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-lg);
  }
  
  .news-card:hover .news-card-image img {
    transform: scale(1.04);
  }
}

.news-card-image {
  width: 100%;
  height: 175px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.6s var(--ease-out);
}

.news-card-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.news-card-content h4 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0;
  font-family: var(--font-display);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-content .card-resumen {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== SECCIONES DESTACADAS ===== */
.secciones-destacadas {
  margin: 72px 0 56px;
  padding: 0 24px;
}

.secciones-destacadas .section-header {
  text-align: center;
  margin-bottom: 36px;
}

.secciones-destacadas .section-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 24px 0;
  font-family: var(--font-display);
}

.secciones-destacadas .section-header p { display: none; }

.secciones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

.seccion-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-primary);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 290px;
  contain: layout style;
  content-visibility: auto;
  contain-intrinsic-size: 0 300px;
}

@media (hover: hover) and (pointer: fine) {
  .seccion-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-lg);
  }
  
  .seccion-card:hover .seccion-card-image img {
    transform: scale(1.05);
  }
}

.seccion-card-image {
  width: 100%;
  height: 170px;
  position: relative;
  flex-shrink: 0;
  background: var(--bg-secondary);
  overflow: hidden;
}

.seccion-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.seccion-card-content {
  padding: 19px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
}

.seccion-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--primary-muted);
  color: var(--primary-light);
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-display);
  width: fit-content;
}

.seccion-card-content h4 {
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--text-primary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 700;
}

.seccion-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-light);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: auto;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: var(--font-display);
}

.seccion-card:hover .seccion-card-link {
  gap: 10px;
  color: var(--primary);
}

.secciones-grid-bottom {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  max-width: 800px;
  margin: 24px auto 0;
}

/* ===== SECCIONES INTERNAS ===== */
.paginas-secciones .main-top-layout {
  grid-template-columns: 1fr;
  margin-top: 0;
  min-height: auto;
  height: auto;
  max-height: none;
}

.paginas-secciones .sidebar { display: none; }

.paginas-secciones .hero-column {
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.paginas-secciones .hero-section {
  min-height: 500px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-display);
}

.breadcrumb a { color: var(--primary-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb .separator { color: var(--text-muted); font-size: 0.7rem; }
.breadcrumb .current { color: var(--text-primary); font-weight: 600; }

/* ===== PAGINACIÓN ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 48px auto 64px;
  padding: 20px;
  flex-wrap: wrap;
}

.btn-page, .btn-page-nav {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  gap: 6px;
}

.btn-page:hover, .btn-page-nav:hover {
  background: var(--primary-muted);
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.btn-page.active {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-page-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== BOTÓN VOLVER ARRIBA ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--gradient-primary);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

/* ===== ARTICLE DETAIL - DESKTOP ===== */
.article-detail {
  max-width: 800px;
  margin: 32px auto;
  padding: 48px 56px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-primary);
  box-shadow: var(--shadow-lg);
}

.article-detail figure {
  margin: 0 0 32px 0;
}

.article-detail figure img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  cursor: zoom-in;
  transition: transform 0.3s var(--ease-out);
}

.article-detail figure img:hover {
  transform: scale(1.02);
}

.article-detail h1 {
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  font-weight: 800;
  margin: 0 0 20px 0;
  line-height: 1.3;
  text-align: left;
  color: var(--text-primary);
}

.article-meta,
#article-meta {
  display: none !important;
}

.article-detail figcaption,
#article-caption {
  display: none !important;
}

.article-detail .lead,
.article-detail .article-lead,
#article-lead {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border-primary);
  line-height: 1.75;
  text-align: justify;
  hyphens: auto;
}

.article-detail .lead p,
.article-detail .article-lead p,
#article-lead p {
  font-family: var(--font-body);
  margin: 0;
}

.article-detail .content,
.article-detail .article-content,
#article-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
  text-align: justify;
  hyphens: auto;
  font-family: var(--font-body);
}

.article-detail .content p,
.article-detail .article-content p,
#article-content p {
  margin-bottom: 28px;
}

.article-detail .content p:first-of-type::first-letter,
.article-detail .article-content p:first-of-type::first-letter,
#article-content p:first-of-type::first-letter {
  font-size: 3.2rem;
  font-weight: 700;
  float: left;
  line-height: 0.8;
  margin-right: 12px;
  margin-top: 4px;
  color: var(--primary-light);
  font-family: var(--font-display);
}

.back-link-container {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-primary);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-light);
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: var(--font-display);
}

.back-link:hover {
  color: var(--primary);
  transform: translateX(-4px);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-primary);
  padding: 56px 0 28px;
  margin-top: 64px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-logo h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  font-family: var(--font-display);
}

.footer-logo .highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-section p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.88rem;
}

.footer-section h3 {
  margin-bottom: 20px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
}

.footer-section ul li { margin-bottom: 12px; }

.footer-section ul li a {
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--ease-smooth);
  display: inline-block;
  font-weight: 500;
  font-size: 0.88rem;
}

.footer-section ul li a:hover {
  color: var(--primary-light);
  transform: translateX(4px);
}

.social-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.social-links a {
  width: 38px;
  height: 38px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all var(--duration-normal) var(--ease-out);
  border: 1px solid var(--border-primary);
}

.social-links a:hover {
  background: var(--gradient-primary);
  transform: translateY(-3px);
  color: var(--text-primary);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.footer-bottom {
  text-align: center;
  padding-top: 28px;
  border-top: 1px solid var(--border-primary);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.96);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  backdrop-filter: blur(12px);
}

.lightbox.active { display: flex; }

/* ✅ v17.2: aspect-ratio preventivo anti-CLS */
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9);
  border: 3px solid rgba(148, 163, 184, 0.15);
  aspect-ratio: attr(width) / attr(height);
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: var(--text-primary);
  font-size: 2.5rem;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  background: rgba(148, 163, 184, 0.15);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(148, 163, 184, 0.25);
}

.lightbox-close:hover {
  transform: scale(1.15) rotate(90deg);
  color: var(--primary-light);
  background: rgba(148, 163, 184, 0.25);
}

/* ===== RESPONSIVE - TABLET ===== */
@media (max-width: 1024px) {
  .container { padding: 0 20px; }
  main > .container { padding: 0 20px; }
  
  .main-top-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    height: auto;
    min-height: auto;
    max-height: none;
  }
  
  .hero-column { max-width: 100%; width: 100%; }
  
  .sidebar {
    position: static;
    flex-direction: column;
    width: 100%;
    margin: 24px 0 0;
    height: auto;
    gap: 20px;
  }
  
  .widget-lo-mas-leido,
  .widget-caricatura,
  .widget-redes {
    flex: none;
    min-height: 300px;
    padding: 16px;
  }
  
  .sidebar-bottom-row { grid-template-columns: 1fr; }
  
  .news-grid { 
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin: 36px auto 48px;
    max-width: 820px;
  }
  
  .secciones-grid { grid-template-columns: repeat(2, 1fr); }
  .secciones-grid-bottom { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
  
  .article-detail {
    padding: 40px 48px;
    max-width: 700px;
  }
  
  .article-detail h1 {
    font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  }
  
  .article-detail .content p:first-of-type::first-letter,
  .article-detail .article-content p:first-of-type::first-letter,
  #article-content p:first-of-type::first-letter {
    font-size: 2.8rem;
  }
}

/* ===== RESPONSIVE - MÓVIL ===== */
@media (max-width: 768px) {
  .header-top { padding: 10px 0; gap: 10px; }
  .logo-icon { width: 50px; height: 50px; }
  .logo-text h1 { font-size: 1.3rem; }
  .header-date-right { display: none; }
  .hamburger { display: flex; padding: 4px; }
  
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: var(--radius-lg);
    margin-top: 8px;
    border: 1px solid var(--border-primary);
    gap: 4px;
  }
  .nav-menu.active { display: flex; }
  .nav-menu li a { width: 100%; justify-content: center; padding: 10px; }
  
  .navbar { padding: 4px 0; }
  
  .breaking-news-bar { height: 26px; }
  .breaking-label { padding: 0 10px; font-size: 0.65rem; }
  .ticker-item { font-size: 0.78rem; padding: 0 16px; }
  
  /* ✅ v17.2: Ticker más lento en móvil para reducir jank */
  .ticker-content {
    animation-duration: 60s;
  }
  
  .container { padding: 0 12px; }
  main > .container { padding: 0 12px; }
  
  .main-top-layout { 
    margin: 12px 0 20px; 
    gap: 14px;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
  }
  
  .hero-column { max-width: 100%; width: 100%; }
  
  .hero-section { 
    min-height: 330px; 
    border-radius: var(--radius-lg); 
  }
  
  .hero-content { 
    padding: 18px 20px 20px; 
  }
  
  .hero-content h2 { 
    font-size: 1.3rem; 
    margin-bottom: 0; 
    line-height: 1.25; 
  }
  
  .hero-content p.lead { 
    font-size: 0.9rem; 
    line-height: 1.5; 
    margin-bottom: 12px; 
    -webkit-line-clamp: 2; 
  }
  
  .btn-read-more { 
    font-size: 0.82rem; 
    margin-top: 8px; 
  }
  
  .sidebar { margin: 10px 0 0; gap: 14px; }
  .widget-lo-mas-leido, .widget-caricatura, .widget-redes { padding: 12px; }
  .sidebar-bottom-row { grid-template-columns: 1fr; }
  .lo-mas-leido-list { grid-template-columns: 1fr; gap: 10px; }
  .lo-mas-leido-item { min-height: 110px; }
  
  .paginas-secciones .main-top-layout {
    margin: 8px 0 12px !important;
  }
  
  .paginas-secciones .hero-section {
    min-height: 330px !important;
    border-radius: var(--radius-lg) !important;
  }
  
  .paginas-secciones .hero-content {
    padding: 18px 20px 20px !important;
  }
  
  .paginas-secciones .hero-content h2 {
    font-size: 1.3rem !important;
    margin-bottom: 0 !important;
    line-height: 1.25 !important;
  }
  
  .paginas-secciones .hero-content p.lead {
    display: none !important;
  }
  
  .paginas-secciones .btn-read-more {
    font-size: 0.82rem !important;
  }
  
  .hero-content p.lead {
    display: none !important;
  }
  
  .news-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin: 16px auto 24px !important;
    padding: 0 12px !important;
  }
  
  .news-card {
    min-height: 110px !important;
    border-radius: var(--radius-md) !important;
    flex-direction: row !important;
    overflow: hidden;
  }
  
  .news-card-image {
    width: 120px !important;
    height: 110px !important;
    flex-shrink: 0 !important;
  }
  
  .news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .news-card-content {
    padding: 10px 12px !important;
    gap: 6px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
  }
  
  .news-card-content h4 {
    font-size: 0.85rem !important;
    line-height: 1.25 !important;
    -webkit-line-clamp: 2 !important;
    margin: 0 !important;
  }
  
  .news-card-content .card-resumen {
    font-size: 0.78rem !important;
    line-height: 1.4 !important;
    -webkit-line-clamp: 2 !important;
    margin: 0 !important;
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  
  .secciones-destacadas {
    margin: 48px 0 36px !important;
    padding: 0 12px !important;
  }
  
  .secciones-destacadas .section-header {
    margin-bottom: 28px !important;
  }
  
  .secciones-destacadas .section-header h2 {
    font-size: 0.95rem !important;
    letter-spacing: 0.15em !important;
  }
  
  .secciones-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    max-width: 100% !important;
  }
  
  .seccion-card {
    min-height: auto !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  
  .seccion-card-image {
    width: 100% !important;
    height: 140px !important;
    min-height: auto !important;
  }
  
  .seccion-card-content {
    padding: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  .seccion-card-content h4 {
    font-size: 0.85rem !important;
    line-height: 1.3 !important;
    -webkit-line-clamp: 2 !important;
  }
  
  .seccion-card-badge {
    font-size: 0.7rem !important;
    padding: 4px 8px !important;
    margin-bottom: 6px !important;
  }
  
  .seccion-card-link {
    font-size: 0.8rem !important;
    margin-top: auto !important;
  }
  
  .secciones-grid-bottom {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
    max-width: 100% !important;
    margin: 16px auto 0 !important;
  }
  
  .footer {
    padding: 40px 0 20px !important;
    margin-top: 48px !important;
  }
  
  .footer-content {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    margin-bottom: 28px !important;
  }
  
  .footer-section {
    text-align: center !important;
  }
  
  .footer-section h3 {
    font-size: 0.95rem !important;
    margin-bottom: 16px !important;
  }
  
  .footer-section p,
  .footer-section ul li a {
    font-size: 0.85rem !important;
  }
  
  .footer-section ul li {
    margin-bottom: 10px !important;
  }
  
  .social-links {
    justify-content: center !important;
    gap: 12px !important;
    margin-top: 16px !important;
  }
  
  .social-links a {
    width: 36px !important;
    height: 36px !important;
  }
  
  .footer-bottom {
    text-align: center !important;
    padding-top: 24px !important;
    font-size: 0.8rem !important;
  }
  
  .article-detail {
    padding: 28px 24px !important;
    margin: 20px 0 !important;
    max-width: 100% !important;
  }
  
  .article-detail figure img {
    max-height: 414px !important;
    border-radius: var(--radius-lg) !important;
  }
  
  .article-detail h1 {
    font-size: 1.4rem !important;
    margin: 24px 0 20px 0 !important;
    line-height: 1.3 !important;
  }
  
  .article-detail .lead,
  .article-detail .article-lead,
  #article-lead {
    font-size: 1rem !important;
    line-height: 1.65 !important;
    margin-bottom: 32px !important;
  }
  
  .article-detail .content,
  .article-detail .article-content,
  #article-content {
    font-size: 0.98rem !important;
    line-height: 1.75 !important;
  }
  
  .article-detail .content p,
  .article-detail .article-content p,
  #article-content p {
    margin-bottom: 24px;
  }
  
  .article-detail .content p:first-of-type::first-letter,
  .article-detail .article-content p:first-of-type::first-letter,
  #article-content p:first-of-type::first-letter {
    font-size: 2.5rem !important;
  }
  
  .back-link-container {
    margin-top: 36px;
    padding-top: 20px;
  }
  
  .back-link {
    font-size: 0.95rem;
  }
  
  .back-to-top { bottom: 20px; right: 20px; width: 44px; height: 44px; }
  
  .lo-mas-leido-item {
    transition: none !important;
    will-change: auto !important;
  }
  
  .lo-mas-leido-item:hover {
    transform: none !important;
    box-shadow: none !important;
  }
  
  .lo-mas-leido-item:hover img {
    transform: none !important;
  }
  
  .news-card {
    transition: none !important;
  }
  
  .news-card:hover {
    transform: none !important;
  }
  
  .news-card:hover .news-card-image img {
    transform: none !important;
  }
  
  .seccion-card {
    transition: none !important;
  }
  
  .seccion-card:hover {
    transform: none !important;
  }
  
  .seccion-card:hover .seccion-card-image img {
    transform: none !important;
  }
}

/* ===== MÓVIL MUY PEQUEÑO ===== */
@media (max-width: 480px) {
  .container { padding: 0 10px; }
  main > .container { padding: 0 10px; }
  
  .logo-icon { width: 46px; height: 46px; }
  .logo-text h1 { font-size: 1.24rem; }
  
  .hero-content h2 { font-size: 1.25rem; }
  .hero-content { padding: 18px; }
  
  .paginas-secciones .hero-section {
    min-height: 300px !important;
  }
  
  .paginas-secciones .hero-content h2 {
    font-size: 1.2rem !important;
  }
  
  .article-detail {
    padding: 24px 20px !important;
  }
  
  .article-detail figure img {
    max-height: 360px !important;
  }
  
  .article-detail h1 {
    font-size: 1.3rem !important;
  }
  
  .article-detail .lead,
  .article-detail .article-lead,
  #article-lead {
    font-size: 0.98rem !important;
  }
  
  .article-detail .content,
  .article-detail .article-content,
  #article-content {
    font-size: 0.95rem !important;
  }
  
  .article-detail .content p:first-of-type::first-letter,
  .article-detail .article-content p:first-of-type::first-letter,
  #article-content p:first-of-type::first-letter {
    font-size: 2.3rem !important;
  }
  
  .secciones-grid,
  .secciones-grid-bottom {
    grid-template-columns: 1fr !important;
  }
  
  .news-card-image {
    width: 100px !important;
    height: 110px !important;
  }
  
  .news-card-content h4 {
    font-size: 0.82rem !important;
  }
  
  .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { opacity: 1 !important; transform: translateY(0) !important; }

/* ===== ACCESIBILIDAD ===== */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

a:focus-visible, button:focus-visible, .news-card:focus-visible, .lo-mas-leido-item:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}