/* ==========================================================================
   css/style.css
   Portal Web - Asociación Cristiana Un Encuentro con Jesús
   Diseño Editorial Inspirado en "Impacto Evangelístico"
   Mobile-First, Moderno, Solemne y Responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. VARIABLES DE DISEÑO & CONFIGURACIÓN BASE
   -------------------------------------------------------------------------- */
:root {
  --primary: #0B192C;        /* Azul marino solemne */
  --primary-rgb: 11, 25, 44;
  --secondary: #1E3E62;      /* Azul corporativo */
  --secondary-rgb: 30, 62, 98;
  --accent: #E5A823;         /* Oro / Dorado */
  --accent-rgb: 229, 168, 35;
  --accent-hover: #D19417;   /* Dorado profundo hover */
  --accent-light: rgba(229, 168, 35, 0.12);
  --bg-body: #F8FAFC;        /* Fondo gris tenue */
  --bg-card: #FFFFFF;        /* Blanco puro */
  --text-main: #0F172A;      /* Texto principal oscuro */
  --text-muted: #64748B;     /* Texto secundario gris */
  --border-light: #E2E8F0;   /* Bordes sutiles */
  --border-dark: #1E293B;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Cinzel', 'Georgia', serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(11, 25, 44, 0.05);
  --shadow-md: 0 8px 24px rgba(11, 25, 44, 0.08);
  --shadow-lg: 0 16px 36px rgba(11, 25, 44, 0.14);
  --shadow-gold: 0 8px 25px rgba(229, 168, 35, 0.28);

  --transition-fast: 0.2s ease;
  --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --------------------------------------------------------------------------
   2. RESET Y ESTILOS GLOBALES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

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

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

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--transition-fast);
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Tipografía de Encabezados */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-tag {
  display: inline-block;
  background-color: var(--accent-light);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.75rem;
  border: 1px solid rgba(229, 168, 35, 0.3);
}

.section-title {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   3. BARRA SUPERIOR Y NAVEGACIÓN STICKY
   -------------------------------------------------------------------------- */
.topbar {
  background-color: #060D17;
  color: #94A3B8;
  font-size: 0.82rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-verse {
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions a {
  color: var(--accent);
  font-weight: 600;
}

.topbar-actions a:hover {
  text-decoration: underline;
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--primary);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* Logo Badge */
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.logo-badge {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent) 0%, #B88210 100%);
  color: var(--primary);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(229, 168, 35, 0.4);
  border: 2px solid #FFF5D6;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.brand-subtitle {
  color: #CBD5E1;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* Navegación Desktop */
.nav-desktop {
  display: none;
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: #E2E8F0;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding: 0.4rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--accent);
  transition: width var(--transition-fast);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.btn-admin-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(229, 168, 35, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-admin-nav:hover {
  background: var(--accent);
  color: var(--primary);
  box-shadow: 0 4px 14px rgba(229, 168, 35, 0.35);
}

/* Botón Hamburguesa */
.btn-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 24px;
  padding: 2px;
  z-index: 1001;
}

.btn-hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #FFFFFF;
  border-radius: 2px;
  transition: all var(--transition-normal);
}

.btn-hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background-color: var(--accent);
}

.btn-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.btn-hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background-color: var(--accent);
}

/* --------------------------------------------------------------------------
   4. MENÚ LATERAL (OFF-CANVAS) Y OVERLAY
   -------------------------------------------------------------------------- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 25, 44, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

.sidebar-menu {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 82%;
  max-width: 340px;
  background-color: var(--primary);
  color: #FFFFFF;
  z-index: 1100;
  transform: translateX(-100%);
  transition: transform var(--transition-smooth);
  display: flex;
  flex-direction: column;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
}

.sidebar-menu.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-close {
  color: #94A3B8;
  font-size: 1.8rem;
  line-height: 1;
  padding: 0.2rem;
}

.sidebar-close:hover {
  color: var(--accent);
}

.sidebar-nav {
  padding: 1.5rem 0;
  flex: 1;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.75rem;
  color: #E2E8F0;
  font-size: 1.05rem;
  font-weight: 500;
  border-left: 4px solid transparent;
  transition: all var(--transition-fast);
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--accent);
  border-left-color: var(--accent);
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-sidebar-admin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  background: var(--accent);
  color: var(--primary);
  font-weight: 700;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-align: center;
  box-shadow: var(--shadow-gold);
}

.btn-sidebar-admin:hover {
  background: var(--accent-hover);
}

/* --------------------------------------------------------------------------
   5. SECCIÓN HERO / PORTADA EDITORIAL
   -------------------------------------------------------------------------- */
.hero-editorial {
  position: relative;
  background: linear-gradient(135deg, #0B192C 0%, #1E3E62 100%);
  color: #FFFFFF;
  padding: 4.5rem 0 3.5rem;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-editorial::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(229, 168, 35, 0.18) 0%, transparent 65%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(229, 168, 35, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.hero-title {
  color: #FFFFFF;
  font-size: 2.3rem;
  line-height: 1.2;
  margin-bottom: 1.2rem;
  font-weight: 800;
}

.hero-title span {
  color: var(--accent);
  display: block;
}

.hero-description {
  color: #CBD5E1;
  font-size: 1.15rem;
  line-height: 1.65;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--accent);
  color: var(--primary);
  font-weight: 700;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-gold);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #FFFFFF;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   6. SECCIÓN MULTIMEDIA (VIDEO Y RADIO EN VIVO)
   -------------------------------------------------------------------------- */
.section-multimedia {
  padding: 4rem 0;
  background-color: #08111E;
  color: #FFFFFF;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-multimedia .section-title {
  color: #FFFFFF;
}

.section-multimedia .section-subtitle {
  color: #94A3B8;
}

.multimedia-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: stretch;
}

/* Visor de Video */
.video-card {
  background-color: #0E1D31;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.video-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: #EF4444;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.live-dot {
  width: 8px;
  height: 8px;
  background-color: #FFFFFF;
  border-radius: 50%;
  animation: pulseLive 1.4s infinite;
}

@keyframes pulseLive {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.video-player-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  background-color: #000000;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(229, 168, 35, 0.3);
}

.video-player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Reproductor de Radio */
.radio-card {
  background: linear-gradient(145deg, #0F223A 0%, #152E4D 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(229, 168, 35, 0.3);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.radio-top {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.radio-icon-box {
  width: 60px;
  height: 60px;
  background: rgba(229, 168, 35, 0.15);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.radio-info h3 {
  color: #FFFFFF;
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.radio-info p {
  color: #CBD5E1;
  font-size: 0.9rem;
}

.radio-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 28px;
  margin: 1.5rem 0;
  padding: 0 0.5rem;
}

.vis-bar {
  flex: 1;
  background-color: var(--accent);
  border-radius: 2px;
  height: 20%;
  transition: height 0.2s ease;
}

.radio-card.playing .vis-bar:nth-child(1) { animation: visPulse 0.9s infinite alternate; }
.radio-card.playing .vis-bar:nth-child(2) { animation: visPulse 1.2s infinite alternate 0.2s; }
.radio-card.playing .vis-bar:nth-child(3) { animation: visPulse 0.7s infinite alternate 0.4s; }
.radio-card.playing .vis-bar:nth-child(4) { animation: visPulse 1.4s infinite alternate 0.1s; }
.radio-card.playing .vis-bar:nth-child(5) { animation: visPulse 1.0s infinite alternate 0.3s; }
.radio-card.playing .vis-bar:nth-child(6) { animation: visPulse 0.8s infinite alternate 0.5s; }
.radio-card.playing .vis-bar:nth-child(7) { animation: visPulse 1.3s infinite alternate 0.2s; }
.radio-card.playing .vis-bar:nth-child(8) { animation: visPulse 0.6s infinite alternate 0.4s; }

@keyframes visPulse {
  0% { height: 15%; }
  100% { height: 100%; }
}

.radio-player-container {
  width: 100%;
}

.radio-player-container audio {
  width: 100%;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

/* --------------------------------------------------------------------------
   7. SECCIÓN CARRUSEL DE LIDERAZGO ("CUERPO PASTORAL & LIDERAZGO")
   -------------------------------------------------------------------------- */
.section-leadership {
  padding: 4.5rem 0;
  background-color: var(--bg-body);
  position: relative;
  overflow: hidden;
}

.leadership-carousel-wrapper {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 0 2rem;
}

/* Caja de datos del líder enfocado */
.active-member-info {
  text-align: center;
  margin-bottom: 2rem;
  min-height: 85px;
  transition: opacity var(--transition-normal);
}

.active-member-name {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.active-member-role {
  display: inline-block;
  background: var(--accent-light);
  color: #925D00;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.3rem 1.25rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(229, 168, 35, 0.4);
}

/* Contenedor del Carrusel con perspectiva */
.carousel-container {
  position: relative;
  width: 100%;
  height: 420px;
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

/* Pista dinámica del carrusel */
.carousel-track {
  display: flex;
  align-items: center;
  position: relative;
  height: 100%;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform var(--transition-smooth);
}

/* Tarjetas individuales de pastores */
.carousel-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250px;
  height: 350px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: #0E1D31;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  /* Estado por defecto: Lateral reducido, atenuado y escala de grises */
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0.5;
  filter: grayscale(85%);
  transition: transform var(--transition-smooth), opacity var(--transition-smooth), filter var(--transition-smooth), box-shadow var(--transition-smooth), border var(--transition-smooth);
}

.carousel-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s ease;
}

.carousel-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(11, 25, 44, 0.92) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  color: #FFFFFF;
}

.carousel-card-name {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.carousel-card-role {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

/* Tarjeta Central Activa: Destacada, a todo color, borde dorado de 3px y sombra prominente */
.carousel-card.active {
  transform: translate(-50%, -50%) scale(1.1);
  opacity: 1;
  filter: grayscale(0%);
  border: 3px solid var(--accent);
  box-shadow: 0 16px 36px rgba(11, 25, 44, 0.28), 0 0 25px rgba(229, 168, 35, 0.35);
  z-index: 20;
}

.carousel-card.prev-card {
  transform: translate(calc(-50% - 210px), -50%) scale(0.85);
  opacity: 0.6;
  filter: grayscale(85%);
  z-index: 10;
}

.carousel-card.next-card {
  transform: translate(calc(-50% + 210px), -50%) scale(0.85);
  opacity: 0.6;
  filter: grayscale(85%);
  z-index: 10;
}

.carousel-card.far-prev {
  transform: translate(calc(-50% - 370px), -50%) scale(0.7);
  opacity: 0.25;
  filter: grayscale(100%);
  z-index: 5;
}

.carousel-card.far-next {
  transform: translate(calc(-50% + 370px), -50%) scale(0.7);
  opacity: 0.25;
  filter: grayscale(100%);
  z-index: 5;
}

.carousel-card.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.5);
  z-index: 0;
}

/* Flechas flotantes circulares */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #FFFFFF;
  color: var(--primary);
  border: 2px solid var(--border-light);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  z-index: 30;
  transition: all var(--transition-fast);
}

.carousel-btn:hover {
  background-color: var(--accent);
  color: var(--primary);
  border-color: var(--accent);
  box-shadow: var(--shadow-gold);
  transform: translateY(-50%) scale(1.08);
}

.carousel-btn-prev {
  left: 0.5rem;
}

.carousel-btn-next {
  right: 0.5rem;
}

/* Puntos / Indicadores Dinámicos */
.carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: #CBD5E1;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.carousel-dot.active {
  width: 32px;
  background-color: var(--accent);
  box-shadow: 0 2px 8px rgba(229, 168, 35, 0.5);
}

/* --------------------------------------------------------------------------
   8. GRID EDITORIAL DE ARTÍCULOS Y DEVOCIONALES
   -------------------------------------------------------------------------- */
.section-articles {
  padding: 4.5rem 0;
  background-color: #FFFFFF;
  border-top: 1px solid var(--border-light);
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.article-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(229, 168, 35, 0.4);
}

.article-image-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 58%; /* Aspect Ratio editorial */
  overflow: hidden;
  background-color: #E2E8F0;
}

.article-image-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-card:hover .article-image-wrap img {
  transform: scale(1.05);
}

.article-badge-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--accent);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.article-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
}

.article-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--primary);
  transition: color var(--transition-fast);
}

.article-card:hover .article-title {
  color: var(--secondary);
}

.article-summary {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.article-btn-read {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--secondary);
  font-weight: 700;
  font-size: 0.9rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #F1F5F9;
}

.article-btn-read:hover {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   9. CATÁLOGO DE REVISTAS (revistas.html)
   -------------------------------------------------------------------------- */
.revistas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.25rem;
  padding: 2rem 0;
}

.revista-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.revista-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(229, 168, 35, 0.4);
}

.revista-cover {
  position: relative;
  width: 100%;
  padding-bottom: 135%; /* Formato A4 / Portada de revista */
  overflow: hidden;
  background-color: #0E1D31;
}

.revista-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.revista-content {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.revista-edition {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.revista-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.revista-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
}

.btn-revista-read {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background-color: var(--accent);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-gold);
}

.btn-revista-read:hover {
  background-color: var(--accent-hover);
}

.btn-revista-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background-color: transparent;
  color: var(--secondary);
  border: 1.5px solid var(--secondary);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-revista-download:hover {
  background-color: var(--secondary);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   10. DIRECTORIO DE SEDES (sedes.html)
   -------------------------------------------------------------------------- */
.sedes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.sede-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.sede-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary) 0%, var(--accent) 100%);
}

.sede-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.sede-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.sede-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
  color: #334155;
  font-size: 0.95rem;
}

.sede-item i, .sede-item svg {
  color: var(--accent);
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.sede-actions {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 0.75rem;
}

.btn-whatsapp {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background-color: #22C55E;
  color: #FFFFFF;
  font-weight: 700;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-whatsapp:hover {
  background-color: #16A34A;
}

.btn-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background-color: transparent;
  color: var(--secondary);
  border: 1.5px solid var(--secondary);
  font-weight: 600;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-sm);
}

.btn-call:hover {
  background-color: var(--secondary);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   11. MODAL PARA LECTURA DE ARTÍCULO
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(11, 25, 44, 0.8);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background-color: #FFFFFF;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: var(--radius-md);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-dialog {
  transform: scale(1);
}

.modal-close-btn {
  position: sticky;
  top: 1rem;
  right: 1rem;
  float: right;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(11, 25, 44, 0.8);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

.modal-close-btn:hover {
  background: var(--accent);
  color: var(--primary);
}

.modal-hero-img {
  width: 100%;
  height: 320px;
  object-fit: cover;
}

.modal-content-wrap {
  padding: 2.25rem;
}

.modal-category {
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.modal-date {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.75rem;
  display: block;
}

.modal-article-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #334155;
  white-space: pre-line;
}

/* --------------------------------------------------------------------------
   12. FOOTER SOLEMNE
   -------------------------------------------------------------------------- */
.main-footer {
  background-color: #060E1A;
  color: #CBD5E1;
  padding: 4rem 0 2rem;
  margin-top: auto;
  border-top: 3px solid var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand {
  max-width: 380px;
}

.footer-brand p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: 1rem;
  color: #94A3B8;
}

.footer-col h4 {
  color: #FFFFFF;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--accent);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: #94A3B8;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 0.88rem;
  color: #64748B;
}

.footer-bottom p {
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   13. ESTADOS DE CARGA & PLACEHOLDERS
   -------------------------------------------------------------------------- */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3.5px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-message {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   14. RESPONSIVE BREAKPOINTS (TABLETS Y DESKTOP)
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .hero-title {
    font-size: 2.8rem;
  }
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .nav-desktop {
    display: block;
  }
  .btn-hamburger {
    display: none;
  }
  .hero-title {
    font-size: 3.4rem;
  }
  .multimedia-grid {
    grid-template-columns: 1.4fr 1fr;
  }
  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .footer-grid {
    grid-template-columns: 1.8fr 1fr 1fr 1.2fr;
  }
  .carousel-card {
    width: 270px;
    height: 380px;
  }
  .carousel-card.prev-card {
    transform: translate(calc(-50% - 240px), -50%) scale(0.85);
  }
  .carousel-card.next-card {
    transform: translate(calc(-50% + 240px), -50%) scale(0.85);
  }
  .carousel-card.far-prev {
    transform: translate(calc(-50% - 440px), -50%) scale(0.7);
  }
  .carousel-card.far-next {
    transform: translate(calc(-50% + 440px), -50%) scale(0.7);
  }
}

/* ===================================================
   BARRA FLOTANTE DE EDICIÓN VISUAL (IN-PLACE EDITOR)
   =================================================== */
.admin-visual-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #0b192c;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 99999;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  border: 2px solid #e5a823;
}

.visual-bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.visual-bar-actions {
  display: flex;
  gap: 10px;
}

.btn-vis-action {
  background: #1e3e62;
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: 0.2s;
}

.btn-vis-action:hover {
  background: #2c588a;
}

.btn-vis-save {
  background-color: #e5a823;
  color: #0b192c;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: bold;
  transition: 0.2s;
}

.btn-vis-save:disabled {
  background-color: #64748b;
  cursor: not-allowed;
}

/* Efecto cuando el texto está en modo editable */
[contenteditable="true"] {
  outline: 2px dashed #e5a823 !important;
  outline-offset: 4px;
  background-color: rgba(229, 168, 35, 0.08);
  border-radius: 4px;
  cursor: text;
}

/* MODAL DE TRANSMISIONES */
.vis-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100000;
}

.vis-modal-content {
  background: #ffffff;
  width: 90%;
  max-width: 500px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.vis-modal-header {
  background: #0b192c;
  color: #ffffff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vis-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

.vis-modal-body {
  padding: 20px;
}

.vis-modal-body label {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1e293b;
}

.vis-modal-body input {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box;
}

.vis-modal-body small {
  color: #64748b;
  font-size: 0.78rem;
}

.vis-modal-footer {
  padding: 15px 20px;
  background: #f8fafc;
  text-align: right;
  border-top: 1px solid #e2e8f0;
}

/* ===================================================
   VISOR DE REVISTAS DIGITALES EN PANTALLA (FLIPBOOK)
   =================================================== */
.magazine-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 25, 44, 0.92);
  backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.magazine-viewer-container {
  background: #0b192c;
  border: 1px solid rgba(229, 168, 35, 0.4);
  border-radius: 12px;
  width: 100%;
  max-width: 950px;
  height: 94vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.magazine-toolbar {
  background: #1e3e62;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e5a823;
}

.magazine-info h3 {
  color: #ffffff;
  font-size: 1.1rem;
  margin: 0;
}

.magazine-page-counter {
  color: #e5a823;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.magazine-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-tool {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.2s;
}

.btn-tool:hover {
  background: #e5a823;
  color: #0b192c;
}

.btn-close-viewer {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.btn-close-viewer:hover {
  color: #e5a823;
}

.magazine-canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  position: relative;
  overflow: hidden;
}

.magazine-viewport {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#pdfViewerCanvas {
  max-width: 95%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  background-color: #ffffff;
}

.mag-nav-btn {
  background: #1e3e62;
  color: #e5a823;
  border: 2px solid #e5a823;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: all 0.2s ease;
  z-index: 10;
  flex-shrink: 0;
}

.mag-nav-btn:hover:not(:disabled) {
  background: #e5a823;
  color: #0b192c;
  transform: scale(1.1);
}

.mag-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #64748b;
  color: #64748b;
}

.mag-spinner {
  position: absolute;
  color: #e5a823;
  font-weight: bold;
  font-size: 1.1rem;
}

.magazine-footer-hint {
  background: #07101d;
  color: #94a3b8;
  text-align: center;
  font-size: 0.78rem;
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===================================================
   VISOR EDITORIAL TIPO REVISTA (DOBLE PÁGINA 3D)
   =================================================== */
.magazine-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 14, 23, 0.96);
  backdrop-filter: blur(10px);
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.magazine-viewer-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #09121d;
  position: relative;
  overflow: hidden;
}

/* Barra superior */
.magazine-top-bar {
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0b192c;
  border-bottom: 1px solid rgba(229, 168, 35, 0.2);
}

.magazine-top-bar h3 {
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.mag-btn-icon {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: 0.2s;
}

.mag-btn-icon:hover {
  color: #e5a823;
}

/* Escenario de libro con perspectiva */
.book-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 10px;
  perspective: 2500px;
  user-select: none;
}

/* Libro abierto (dos páginas juntas) */
.book-spread {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 5px 15px rgba(0, 0, 0, 0.5);
  background-color: #ffffff;
  border-radius: 4px;
  max-width: 92vw;
  max-height: 82vh;
  transform-style: preserve-3d;
}

.book-page {
  background-color: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-page canvas {
  max-height: 82vh;
  width: auto;
  display: block;
}

/* Lomo central con sombra de pliegue editorial */
.book-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 40px;
  transform: translateX(-50%);
  background: linear-gradient(
    to right,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.18) 42%,
    rgba(0, 0, 0, 0.35) 50%,
    rgba(0, 0, 0, 0.18) 58%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
  z-index: 5;
}

/* Flechas flotantes estilo Impacto Evangelístico */
.book-nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(11, 25, 44, 0.7);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 52px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 20;
  border-radius: 4px;
}

.arrow-prev { left: 16px; }
.arrow-next { right: 16px; }

.book-nav-arrow:hover:not(:disabled) {
  background: #e5a823;
  color: #0b192c;
  border-color: #e5a823;
}

.book-nav-arrow:disabled {
  opacity: 0.15;
  cursor: not-allowed;
}

/* ANIMACIÓN 3D DE CAMBIO DE HOJA (PAGE FLIP) */
.page-flip-layer {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background-color: #ffffff;
  display: none;
  z-index: 10;
  transform-style: preserve-3d;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.2);
}

.anim-flip-forward {
  display: block;
  right: 0;
  transform-origin: left center;
  animation: flipForward 0.55s ease-in-out forwards;
}

.anim-flip-backward {
  display: block;
  left: 0;
  transform-origin: right center;
  animation: flipBackward 0.55s ease-in-out forwards;
}

@keyframes flipForward {
  0% {
    transform: rotateY(0deg);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  }
  100% {
    transform: rotateY(-180deg);
    box-shadow: -20px 0 30px rgba(0, 0, 0, 0.6);
  }
}

@keyframes flipBackward {
  0% {
    transform: rotateY(0deg);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  }
  100% {
    transform: rotateY(180deg);
    box-shadow: 20px 0 30px rgba(0, 0, 0, 0.6);
  }
}

/* Barra inferior del lector */
.magazine-bottom-bar {
  background: #0b192c;
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mag-counter-badge {
  color: #f1f5f9;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.mag-bar-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mag-btn-action {
  background: #1e3e62;
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.mag-btn-action:hover {
  background: #e5a823;
  color: #0b192c;
  border-color: #e5a823;
}

/* ===================================================
   FONDO HERO PERSONALIZABLE CON SUPERPOSICIÓN OSCURA
   =================================================== */
.hero-editorial {
  position: relative;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: background-image 0.4s ease;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(11, 25, 44, 0.94) 0%, rgba(11, 25, 44, 0.75) 100%);
  z-index: 1;
}

.hero-container-box {
  position: relative;
  z-index: 2;
}

/* ===================================================
   REDES SOCIALES (CABECERA Y PIE)
   =================================================== */
.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.social-header-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  color: #e5a823;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: 0.2s;
  border: 1px solid rgba(229, 168, 35, 0.25);
}

.social-top-link:hover {
  background: #e5a823;
  color: #0b192c;
}

.footer-social-box {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1rem;
}

.footer-soc-link {
  display: inline-block;
  background: #1e3e62;
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: 0.2s;
}

.footer-soc-link:hover {
  background: #e5a823;
  color: #0b192c;
}

/* ==========================================================================
   BLOQUE DE OPTIMIZACIÓN MOBILE-FIRST
   Responsive 320px → 768px — Añadido sobre base auditada
   NO modifica lógica JS ni configuración de backend
   ========================================================================== */

/* --------------------------------------------------------------------------
   BASE: Prevención de scroll horizontal global
   -------------------------------------------------------------------------- */
html {
  overflow-x: hidden;
}

img, video, canvas, iframe, embed, object {
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   1. TOPBAR — Ocultar verso en pantallas muy estrechas para evitar desborde
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .topbar-verse {
    display: none;
  }

  .topbar .container,
  .topbar-inner {
    justify-content: flex-end;
  }
}

/* --------------------------------------------------------------------------
   2. HEADER Y BOTÓN HAMBURGUESA — Touch target mínimo 44×44 px
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  /* Área táctil expandida sin cambiar la apariencia visual */
  .btn-hamburger {
    width: 44px;
    height: 44px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* El brand-title puede truncarse en pantallas MUY estrechas */
  .brand-title {
    font-size: 0.92rem;
  }

  .brand-subtitle {
    font-size: 0.68rem;
  }
}

/* --------------------------------------------------------------------------
   3. MENÚ LATERAL (SIDEBAR) — Ancho y comportamiento mejorado
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .sidebar-menu {
    width: 88%;
    max-width: 320px;
  }

  /* Impedir scroll del body cuando el sidebar está abierto */
  body.menu-open {
    overflow: hidden;
  }

  /* Links del sidebar: touch target generoso (min 48px altura) */
  .sidebar-nav a {
    padding: 0.85rem 1.5rem;
    min-height: 48px;
  }

  /* Botón de cierre con área táctil amplia */
  .sidebar-close {
    font-size: 2rem;
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   4. HERO SECTION — Tipografía fluida para evitar cortes de línea
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .hero-editorial {
    padding: 3rem 0 2.5rem;
  }

  .hero-title {
    font-size: 1.9rem;
    line-height: 1.25;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn-primary,
  .btn-outline {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .hero-badge {
    font-size: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   5. SECCIÓN TÍTULOS — Reducción proporcional en pantallas estrechas
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .section-title {
    font-size: 1.6rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  .section-header {
    margin-bottom: 1.75rem;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.4rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
  }
}

/* --------------------------------------------------------------------------
   6. SECCIÓN MULTIMEDIA — Padding ajustado en móvil
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .section-multimedia {
    padding: 2.5rem 0;
  }

  .multimedia-grid {
    gap: 1.5rem;
  }

  .radio-card {
    padding: 1.25rem;
  }

  .radio-top {
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .radio-icon-box {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }

  .radio-info h3 {
    font-size: 1.1rem;
  }
}

/* --------------------------------------------------------------------------
   7. CARRUSEL DE LIDERAZGO — Ajuste dimensional para móviles < 600px
   -------------------------------------------------------------------------- */
@media (max-width: 599px) {
  .section-leadership {
    padding: 3rem 0;
  }

  /* Contenedor de altura reducida */
  .carousel-container {
    height: 320px;
  }

  /* Tarjetas con dimensiones aptas para móvil */
  .carousel-card {
    width: 200px;
    height: 270px;
  }

  /* Tarjeta activa ligeramente más grande */
  .carousel-card.active {
    transform: translate(-50%, -50%) scale(1.08);
  }

  /* Tarjetas laterales: desplazamiento reducido para que no se corten */
  .carousel-card.prev-card {
    transform: translate(calc(-50% - 160px), -50%) scale(0.82);
    opacity: 0.55;
  }

  .carousel-card.next-card {
    transform: translate(calc(-50% + 160px), -50%) scale(0.82);
    opacity: 0.55;
  }

  /* Tarjetas lejanas: completamente ocultas fuera del área visible */
  .carousel-card.far-prev {
    transform: translate(calc(-50% - 290px), -50%) scale(0.65);
    opacity: 0.15;
  }

  .carousel-card.far-next {
    transform: translate(calc(-50% + 290px), -50%) scale(0.65);
    opacity: 0.15;
  }

  /* Nombre del líder activo más compacto */
  .active-member-name {
    font-size: 1.3rem;
  }

  .active-member-role {
    font-size: 0.85rem;
  }

  /* Flechas de navegación del carrusel: touch target garantizado */
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .carousel-btn-prev {
    left: 0.25rem;
  }

  .carousel-btn-next {
    right: 0.25rem;
  }
}

@media (max-width: 380px) {
  .carousel-container {
    height: 300px;
  }

  .carousel-card {
    width: 180px;
    height: 250px;
  }

  .carousel-card.prev-card {
    transform: translate(calc(-50% - 140px), -50%) scale(0.78);
  }

  .carousel-card.next-card {
    transform: translate(calc(-50% + 140px), -50%) scale(0.78);
  }
}

/* --------------------------------------------------------------------------
   8. ARTÍCULOS Y SECCIONES CON PADDING — Reducción en móvil
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .section-articles {
    padding: 2.5rem 0;
  }

  .section-leadership {
    padding: 2.5rem 0;
  }

  .article-body {
    padding: 1.25rem;
  }

  .article-title {
    font-size: 1.15rem;
  }
}

/* --------------------------------------------------------------------------
   9. SEDES — Grid a 1 columna en móvil, botones accesibles al pulgar
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
  .sedes-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1.25rem 0;
  }

  .sede-card {
    padding: 1.5rem;
  }

  .sede-actions {
    flex-direction: column;
    gap: 0.65rem;
  }

  .btn-whatsapp,
  .btn-call {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 1rem;
  }
}

/* --------------------------------------------------------------------------
   10. MEMBRESÍA — Grid a 1 columna; búsqueda y botones accesibles
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
  .members-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .member-search-bar {
    flex-direction: column;
    gap: 0.65rem;
  }

  .member-search-bar input {
    width: 100%;
  }

  .btn-ver-ficha {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    padding: 10px 12px;
  }
}

/* --------------------------------------------------------------------------
   11. MODAL ARTÍCULO (#articleModal) — Ajuste para móvil
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .modal-overlay {
    padding: 0.75rem;
    align-items: flex-end; /* sheet desde abajo en móvil */
  }

  .modal-dialog {
    max-height: 92vh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    width: 100%;
  }

  .modal-hero-img {
    height: 200px;
  }

  .modal-content-wrap {
    padding: 1.25rem;
  }

  .modal-title {
    font-size: 1.4rem;
  }

  .modal-article-text {
    font-size: 1rem;
    line-height: 1.75;
  }

  /* Botón de cierre: siempre sticky, tamaño táctil suficiente */
  .modal-close-btn {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    top: 0.75rem;
    right: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   12. MODAL FICHA MIEMBRO (#modalFichaMiembro) — padding reducido en móvil
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .member-modal-overlay {
    padding: 0.75rem;
    align-items: flex-end;
  }

  .member-modal-box {
    max-height: 92vh;
    padding: 1.25rem;
    border-radius: 14px 14px 0 0;
  }

  .modal-info-grid {
    grid-template-columns: 1fr;
  }

  .member-modal-close {
    font-size: 2rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    right: 0;
  }
}

@media (max-width: 480px) {
  .member-modal-box {
    padding: 1rem;
  }

  .modal-info-item {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}

/* --------------------------------------------------------------------------
   13. BIBLIA — Controles apilados ordenadamente, texto cómodo de leer
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* Controles de selección en columna única */
  .bible-controls {
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
  }

  .bible-select-group {
    flex: none;
    min-width: 100%;
    width: 100%;
  }

  .bible-select-group select {
    font-size: 0.95rem;
    padding: 10px 12px;
  }

  /* Título del capítulo en columna para evitar overflow */
  .bible-chapter-title {
    font-size: 1.25rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 1rem;
  }

  /* Versículos: font-size cómodo para lectura continua */
  .bible-verses-container {
    font-size: 1.05rem;
    line-height: 1.9;
    max-height: 55vh;
    padding-right: 8px;
  }

  /* Botones de navegación capítulo: ancho completo en móvil */
  .bible-nav-btns {
    flex-direction: column;
    gap: 0.65rem;
  }

  .bible-nav-btns .btn-secondary {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* Versículo destacado */
  .verse-day-card {
    padding: 1.5rem 1.25rem;
  }

  .verse-text-highlight {
    font-size: 1.15rem;
  }

  /* Pills de temas: scroll horizontal si son muchos */
  .theme-pills {
    gap: 6px;
  }

  .theme-pill {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* Botones de acción versículo */
  .verse-actions {
    flex-direction: column;
    gap: 0.65rem;
  }

  .verse-actions .btn-primary,
  .verse-actions .btn-outline {
    width: 100%;
    justify-content: center;
  }

  /* Box del lector con padding reducido */
  .bible-reader-box {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .bible-chapter-title {
    font-size: 1.1rem;
  }

  .verse-text-highlight {
    font-size: 1.05rem;
  }

  .verse-focus-text {
    font-size: 1.1rem;
  }
}

/* --------------------------------------------------------------------------
   14. REVISTAS — Grid sin overflow y viewer adaptado a móvil
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
  .revistas-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
    padding: 1.25rem 0;
  }

  .revista-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-revista-read,
  .btn-revista-download {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
}

@media (max-width: 400px) {
  .revistas-grid {
    grid-template-columns: 1fr;
  }
}

/* Visor de revista (#magazineModal) en móvil */
@media (max-width: 767px) {
  .magazine-viewer-container {
    height: 96vh;
    border-radius: 8px;
  }

  .magazine-toolbar {
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .magazine-info h3 {
    font-size: 0.9rem;
  }

  .magazine-top-bar {
    padding: 8px 14px;
  }

  .magazine-top-bar h3 {
    font-size: 0.88rem;
  }

  /* Flechas del libro: reposicionadas para no solaparse con contenido */
  .book-nav-arrow {
    width: 40px;
    height: 64px;
    font-size: 1.3rem;
  }

  .arrow-prev { left: 4px; }
  .arrow-next { right: 4px; }

  .magazine-bottom-bar {
    padding: 8px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .mag-bar-tools {
    gap: 8px;
  }

  .mag-btn-action {
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  /* Botones de navegación de página */
  .mag-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  #pdfViewerCanvas {
    max-width: 100%;
  }
}

/* --------------------------------------------------------------------------
   15. FOOTER — Padding compacto en móvil
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .main-footer {
    padding: 2.5rem 0 1.5rem;
  }

  .footer-grid {
    gap: 1.75rem;
    margin-bottom: 2rem;
  }

  .footer-bottom {
    font-size: 0.82rem;
  }
}

/* --------------------------------------------------------------------------
   16. BARRA VISUAL DE EDICIÓN — Adaptar a pantalla estrecha
   -------------------------------------------------------------------------- */
@media (max-width: 599px) {
  .admin-visual-bar {
    bottom: 10px;
    left: 12px;
    right: 12px;
    transform: none;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
  }

  .visual-bar-actions {
    width: 100%;
    justify-content: center;
  }

  .btn-vis-action,
  .btn-vis-save {
    flex: 1;
    text-align: center;
    justify-content: center;
  }
}
