/* =====================================================================
   IGLESIA FUENTE DE VERDAD — Hoja de estilos del sitio público
   ===================================================================== */

:root {
  --primary: #0f6659;
  --primary-dark: #0b4d43;
  --primary-light: #14856f;
  --gold: #c9a24b;
  --gold-light: #e6c778;
  --dark: #0b1f1c;
  --ink: #1c2622;
  --muted: #5c6f6a;
  --paper: #ffffff;
  --paper-soft: #f6f4ee;
  --border: #e3e0d4;
  --danger: #b3413a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 30px rgba(11, 31, 28, 0.10);
  --shadow-sm: 0 4px 14px rgba(11, 31, 28, 0.08);
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; width: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 72px 0; }
.section--soft { background: var(--paper-soft); }
.section--dark { background: var(--dark); color: #eef4f2; }
.section--dark .eyebrow { color: var(--gold-light); }
.section--dark h2 { color: #fff; }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}
.section-head { max-width: 680px; margin: 0 0 40px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .95rem;
  border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--gold); color: var(--dark); }
.btn-primary:hover { background: var(--gold-light); box-shadow: var(--shadow-sm); }
.btn-outline { border-color: rgba(255,255,255,.65); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-solid { background: var(--primary); color: #fff; }
.btn-solid:hover { background: var(--primary-light); box-shadow: var(--shadow-sm); }
.btn-ghost { border-color: var(--border); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 18px; font-size: .85rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.announcement {
  background: var(--dark);
  color: #eef4f2;
  text-align: center;
  font-size: .85rem;
  padding: 8px 14px;
}
.announcement a { color: var(--gold-light); font-weight: 700; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; min-width: 0; }
.brand img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--paper-soft); flex-shrink: 0; }
.brand-text { line-height: 1.15; min-width: 0; }
.brand-text strong { display: block; font-size: 1.05rem; color: var(--primary-dark); letter-spacing: .01em; }
.brand-text span { display: block; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); font-weight: 700; white-space: nowrap; }
/* A partir de aquí hay espacio suficiente para que el menú completo se
   muestre en una sola línea (ver breakpoint del menú más abajo): evitamos
   que el nombre de la iglesia se parta en varias líneas y empuje el resto
   del encabezado. En pantallas más angostas el menú va oculto en el botón
   de hamburguesa, así que el nombre puede ajustarse/partirse con libertad. */
@media (min-width: 1551px) {
  .brand { flex-shrink: 0; }
  .brand-text, .brand-text strong { white-space: nowrap; }
}

.main-nav { display: flex; align-items: center; gap: 15px; flex-shrink: 1; }
.main-nav a { display: block; white-space: nowrap; font-weight: 600; font-size: .87rem; color: var(--ink); position: relative; padding: 6px 0; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); }
.main-nav a.active::after { content:''; position:absolute; left:0; right:0; bottom:-2px; height:2px; background: var(--gold); border-radius: 2px; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--danger); color: #fff; font-size: .72rem; font-weight: 800;
  letter-spacing: .06em; padding: 6px 12px; border-radius: 999px;
}
.live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.35;} }

.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
}
.nav-toggle span { display:block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

/* Hero / Slider */
.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--dark), var(--primary-dark)); }
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease;
  background-size: cover; background-position: center;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,31,28,.55), rgba(11,31,28,.85));
}
.hero-slide.no-image { background: radial-gradient(circle at 20% 20%, rgba(201,162,75,.28), transparent 55%), linear-gradient(135deg, #0b4d43, #0b1f1c); }
.hero-inner { position: relative; z-index: 2; padding: 130px 0 110px; text-align: center; }
.hero-eyebrow { color: var(--gold-light); }
.hero-inner h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); max-width: 820px; margin: 0 auto 18px; }
.hero-sub { font-size: clamp(1rem, 2vw, 1.25rem); max-width: 640px; margin: 0 auto 34px; color: #e4ece9; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-slide-controls { position: absolute; z-index: 3; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; gap: 8px; }
.hero-dot { width: 30px; height: 4px; border-radius: 4px; border: none; background: rgba(255,255,255,.35); }
.hero-dot.is-active { background: var(--gold); }

/* Radio widget */
.radio-widget {
  display: flex; align-items: center; gap: 16px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow-sm);
}
.radio-widget .play-btn {
  width: 54px; height: 54px; border-radius: 50%; background: var(--primary); color: #fff;
  border: none; font-size: 1.1rem; flex-shrink: 0; display:flex; align-items:center; justify-content:center;
}
.radio-widget .play-btn:hover { background: var(--primary-light); }
.radio-meta strong { display:block; font-size: 1rem; }
.radio-meta span { font-size: .82rem; color: var(--muted); }
.radio-inline { max-width: 480px; margin: 26px auto 0; }
.radio-hero-card { max-width: 460px; margin: 34px auto 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); }
.radio-hero-card .radio-meta strong, .radio-hero-card .radio-meta span { color: #fff; }
.radio-hero-card .radio-meta span { color: #cfe0db; }

.radio-page-player { text-align:center; background: linear-gradient(135deg, var(--dark), var(--primary-dark)); color:#fff; border-radius: var(--radius); padding: 50px 24px; }
.radio-page-player .play-btn-lg {
  width: 92px; height: 92px; border-radius: 50%; border: 3px solid var(--gold); background: transparent; color: #fff;
  font-size: 1.6rem; margin: 22px auto; display:flex; align-items:center; justify-content:center;
}
.radio-page-player .play-btn-lg:hover { background: rgba(201,162,75,.15); }

/* Cards grid */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 16/10; background: var(--paper-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media.no-image { display:flex; align-items:center; justify-content:center; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: rgba(255,255,255,.8); font-size: 2rem; }
.card-tag {
  position: absolute; top: 12px; left: 12px; background: var(--gold); color: var(--dark);
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 5px 11px; border-radius: 999px;
}
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-meta { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.card-body h3 { font-size: 1.08rem; }
.card-body p { color: var(--muted); font-size: .93rem; margin-bottom: 0; flex: 1; }
.card-foot { margin-top: 12px; }
.card-link { color: var(--primary); font-weight: 700; font-size: .88rem; }
.card-link:hover { text-decoration: underline; }

/* Pastor / Nosotros */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.split-media {
  aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display:flex; align-items:center; justify-content:center; color: rgba(255,255,255,.85); font-size: 3rem;
}
.split-media img { width:100%; height:100%; object-fit: cover; }
.verse-box {
  border-left: 4px solid var(--gold); padding: 14px 20px; margin-top: 18px; font-style: italic; color: var(--primary-dark); background: var(--paper-soft); border-radius: 0 10px 10px 0;
}

/* Ministries / platforms */
.icon-badge {
  width: 54px; height: 54px; border-radius: 14px; background: var(--paper-soft); color: var(--primary);
  display:flex; align-items:center; justify-content:center; font-size: 1.4rem; margin-bottom: 6px;
}

/* Schedule */
.schedule-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.schedule-tab {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font-weight: 700; font-size: .85rem;
}
.schedule-tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.schedule-row {
  display: flex; gap: 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; margin-bottom: 12px;
}
.schedule-time { font-weight: 800; color: var(--primary); min-width: 130px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: .88rem; }
.field input, .field textarea, .field select {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,102,89,.14); }
.field-check { display:flex; align-items:flex-start; gap: 10px; font-size: .88rem; color: var(--muted); }
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow-sm); }

.alert { padding: 14px 18px; border-radius: 12px; font-weight: 600; margin-bottom: 20px; font-size: .92rem; }
.alert-success { background: #e4f4ef; color: #0b4d43; border: 1px solid #b8e0d2; }
.alert-error { background: #fbe9e7; color: #8c2b23; border: 1px solid #f2beb6; }

/* Gallery */
.gallery-item { cursor: pointer; }
.lightbox {
  position: fixed; inset: 0; background: rgba(11,31,28,.92); display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 30px;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 12px; }
.lightbox-close { position: absolute; top: 20px; right: 26px; color: #fff; font-size: 2rem; background: none; border: none; }

/* Footer */
.site-footer { background: var(--dark); color: #cfe0db; padding: 60px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand img { width: 44px; height: 44px; border-radius: 50%; }
.footer-brand strong { color: #fff; font-size: 1.05rem; }
.site-footer h4 { color: #fff; font-size: .92rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 16px; }
.site-footer p { color: #a9c0b9; font-size: .9rem; }
.site-footer ul li { margin-bottom: 10px; font-size: .9rem; }
.site-footer ul li a:hover { color: var(--gold-light); }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.footer-social a:hover { background: var(--gold); color: var(--dark); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 20px 0; font-size: .82rem; color: #8fa7a0; }
.footer-counter img, .footer-counter iframe { max-height: 30px; }

/* WhatsApp float */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 58px; height: 58px; border-radius: 50%;
  background: #25D366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(0,0,0,.25);
  font-size: 1.6rem;
}
.wa-float:hover { transform: scale(1.06); }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.badge-soft { display:inline-block; background: var(--paper-soft); color: var(--primary-dark); font-size: .78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; }
.empty-note { color: var(--muted); font-style: italic; padding: 20px 0; }
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span { padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; font-weight: 700; font-size: .85rem; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filters-bar { display: flex; gap: 12px; margin-bottom: 30px; flex-wrap: wrap; }
.filters-bar input, .filters-bar select { padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; }
.filters-bar input { flex: 1; min-width: 220px; }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--primary); font-weight: 600; }
.page-hero { background: linear-gradient(135deg, var(--dark), var(--primary-dark)); color: #fff; padding: 64px 0 44px; text-align: center; }
.page-hero .eyebrow { color: var(--gold-light); }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 6px; }
.page-hero p { color: #d8e6e2; max-width: 620px; margin: 0 auto; }

.detail-header { margin-bottom: 26px; }
.detail-meta { display:flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.detail-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 26px; aspect-ratio: 16/8; background: var(--paper-soft); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-body { max-width: 760px; margin: 0 auto; }
.detail-body p { color: var(--ink); font-size: 1.02rem; }
.video-embed { position: relative; padding-top: 56.25%; border-radius: var(--radius); overflow: hidden; background: #000; margin: 20px 0; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Portada de detalle con proporción NATURAL (sin recortar): se usa sólo
   cuando conocemos las dimensiones reales del archivo subido (imagen con
   metadatos automáticos). Un volante vertical se ve vertical, un banner
   horizontal se ve horizontal y un cuadrado se ve cuadrado — sin deformar
   ni recortar contenido importante. No sustituye a .detail-cover normal:
   se añade como clase adicional, así el diseño existente no cambia para
   contenido antiguo sin metadatos. */
.detail-cover.is-natural { aspect-ratio: auto; display: flex; align-items: center; justify-content: center; max-height: 720px; }
.detail-cover.is-natural img { width: auto; height: auto; max-width: 100%; max-height: 720px; object-fit: contain; margin: 0 auto; }

/* Reproductor de video propio (subido, no incrustado de YouTube/Facebook):
   responsivo pero sin forzar una proporción 16:9 fija que recorte o
   distorsione el video original. */
.video-native { margin: 20px 0; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-native video { display: block; width: 100%; height: auto; max-height: 640px; }

/* Texto de metadatos detectados automáticamente en el panel de administración. */
.hint.media-meta { display: block; margin-top: 4px; color: var(--muted); font-size: .78rem; }

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1550px) {
  /* Nota: .site-header usa "position: sticky", que por especificación CSS
     actúa como "containing block" para cualquier descendiente con
     "position: fixed" (en vez de la ventana del navegador). Por eso NO se
     usa "bottom: 0" aquí (se calcularía respecto a la altura del header, no
     de la pantalla) — se usa "height: 100vh" (independiente del ancestro)
     junto con "top: 0", asegurando que el menú cubra toda la altura visible
     sin importar la posición del header. */
  .main-nav { position: fixed; top: 0; right: 0; height: 100vh; width: min(320px, 84vw); background: #fff; flex-direction: column;
    align-items: flex-start; padding: 90px 26px 26px; gap: 4px; transform: translateX(100%); transition: transform .25s ease;
    box-shadow: -12px 0 30px rgba(0,0,0,.15); overflow-y: auto; z-index: 100; }
  .main-nav.is-open { transform: translateX(0); }
  .main-nav a { width: 100%; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .nav-toggle { display: flex; }
  .header-actions .btn span.long { display: none; }
  .split { grid-template-columns: 1fr; }
  .split-media { order: -1; aspect-ratio: 16/9; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-inner { padding: 96px 0 80px; }
  .section { padding: 52px 0; }
  .radio-widget { flex-wrap: wrap; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
/* Margen de seguridad extra: mantiene el botón compacto justo por encima del
   punto donde aparece el menú horizontal completo, para evitar que quede
   ajustado al límite en resoluciones de laptop comunes (ej. 1600px). */
@media (min-width: 1551px) and (max-width: 1700px) {
  .header-actions .btn span.long { display: none; }
}
