/* ===== AIC Ecuador — estilos personalizados ===== */

/* --- Variables de color --- */
:root {
  --navy:       #0f2d5a;
  --navy-light: #1a4280;
  --navy-dark:  #091e3e;
  --gold:       #c9963a;
  --gold-light: #e0b054;
  --gold-dark:  #a87a28;
}

html { scroll-behavior: smooth; }

/* --- Navbar base --- */
.nav-base {
  transition: box-shadow 0.3s ease;
}
.nav-scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,.35);
}

/* Logo badge */
.nav-logo-badge {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(201,150,58,.4);
  transition: transform 0.2s ease;
}
.nav-logo-badge:hover { transform: scale(1.08); }

/* Desktop nav links */
.nav-link {
  color: rgba(209,213,219,1);
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 0.18s ease, background 0.18s ease;
  text-decoration: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
  background: transparent;
  border: none;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  right: 50%;
  height: 2px;
  background: var(--gold);
  border-radius: 9999px;
  transition: left 0.22s ease, right 0.22s ease;
}
.nav-link:hover {
  color: #fff;
  background: #1e3d6e;
}
.nav-link:hover::after,
.nav-active::after {
  left: 10px;
  right: 10px;
}
.nav-active {
  color: #fff;
  background: #224070;
}

/* Pastor CTA button */
.nav-btn-pastor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 9999px;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(201,150,58,.35);
  transition: box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.nav-btn-pastor:hover {
  box-shadow: 0 4px 18px rgba(201,150,58,.5);
  transform: translateY(-1px);
  opacity: .92;
}

/* ── Dropdown mega-menú ── */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  width: 580px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15), 0 4px 16px rgba(0,0,0,.08);
  border: 1px solid rgba(0,0,0,.06);
  padding: 16px;
  z-index: 999;
  transform-origin: top center;
}

/* Arrow tip del dropdown — centrado sobre el ítem del nav */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  translate: -50% 0;
  width: 12px; height: 12px;
  background: #fff;
  border-left: 1px solid rgba(0,0,0,.06);
  border-top: 1px solid rgba(0,0,0,.06);
  rotate: 45deg;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s ease;
  cursor: pointer;
}
.nav-dropdown-item:hover {
  background: rgba(201,150,58,.07);
}

.nav-dropdown-icon {
  width: 28px; height: 28px;
  background: rgba(15,45,90,.05);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.nav-dropdown-item:hover .nav-dropdown-icon {
  background: rgba(201,150,58,.12);
}

/* Mobile nav links */
.nav-link-mobile {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(209,213,219,1);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}
.nav-link-mobile:hover { color: #fff; background: #1e3d6e; }
.nav-link-mobile-active { color: #fff; background: #254473; }

/* --- Social icons footer --- */
.social-icon-footer {
  width: 40px; height: 40px;
  background: var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.social-icon-footer:hover { background: #fff; color: var(--navy); }

/* --- Botones --- */
.btn-primary {
  background: var(--gold); color: #fff;
  font-weight: 600; padding: 12px 24px;
  border-radius: 9999px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: background 0.2s, box-shadow 0.2s;
}
.btn-primary:hover { background: var(--gold-dark); box-shadow: 0 6px 20px rgba(0,0,0,.2); }

.btn-outline {
  border: 2px solid #fff; color: #fff;
  font-weight: 600; padding: 10px 24px;
  border-radius: 9999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.btn-outline:hover { background: #fff; color: var(--navy); }

.btn-navy {
  background: var(--navy); color: #fff;
  font-weight: 600; padding: 12px 24px;
  border-radius: 9999px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-navy:hover { background: var(--navy-light); }

/* --- Sección título --- */
.section-title    { font-family: 'Playfair Display', serif; color: var(--navy); }
.section-subtitle { color: var(--gold); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.section-divider  { width: 64px; height: 4px; background: var(--gold); border-radius: 9999px; margin: 12px auto 0; }

/* --- Tarjetas --- */
.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s;
}
.card-hover:hover { box-shadow: 0 8px 32px rgba(0,0,0,.14); transform: translateY(-4px); }

/* --- Hero carousel --- */
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
  transform: scale(1.04);
}
.hero-slide-active {
  opacity: 1;
  animation: heroKenBurns 9s ease-out forwards;
}
@keyframes heroKenBurns {
  from { transform: scale(1.04); }
  to   { transform: scale(1);    }
}

/* Hero logo central */
.hero-logo {
  display: inline-flex; align-items: center; justify-content: center;
}

/* Hero badge (tag slide) */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(201,150,58,.4);
  border-radius: 9999px;
  padding: 5px 14px;
}

/* Hero stat badges flotantes */
.hero-stat-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(9,30,62,.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(201,150,58,.25);
  border-radius: 12px;
  padding: 10px 14px;
}

/* Sombra dorada para botón primario */
.shadow-gold { box-shadow: 0 4px 20px rgba(201,150,58,.4); }

/* Scroll indicator */
.scroll-indicator {
  width: 24px; height: 40px;
  border: 2px solid rgba(255,255,255,.4);
  border-radius: 9999px;
  position: relative;
  overflow: hidden;
}
.scroll-dot {
  width: 4px; height: 8px;
  background: var(--gold);
  border-radius: 9999px;
  position: absolute;
  top: 5px; left: 50%; transform: translateX(-50%);
  animation: scrollBounce 1.6s ease-in-out infinite;
}
@keyframes scrollBounce {
  0%,100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  80%      { transform: translateX(-50%) translateY(18px); opacity: 0; }
}

/* --- Hero particles --- */
.hero-particles {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden;
}
.hero-p {
  position: absolute;
  left: var(--x); top: var(--y);
  transform: scale(var(--s));
  opacity: 0;
  animation: heroParticleFloat var(--dur) ease-in-out var(--d) infinite;
}
.hero-p--cross::before,
.hero-p--cross::after {
  content: '';
  position: absolute;
  background: var(--gold);
  border-radius: 9999px;
}
.hero-p--cross::before { width: 14px; height: 3px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.hero-p--cross::after  { width: 3px; height: 14px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.hero-p--dot {
  width: 6px; height: 6px;
  background: var(--gold-light);
  border-radius: 50%;
}
@keyframes heroParticleFloat {
  0%   { opacity: 0;    transform: scale(var(--s)) translateY(0px); }
  20%  { opacity: .55; }
  80%  { opacity: .35; }
  100% { opacity: 0;    transform: scale(var(--s)) translateY(-28px); }
}

/* Section wave dividers */
.section-wave-top { display: block; margin-top: -2px; line-height: 0; }
.section-wave-top svg { display: block; width: 100%; }
.section-divider-wave { display: block; line-height: 0; }
.section-divider-wave svg { display: block; width: 100%; }

/* --- Scroll reveal --- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* --- Loader --- */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Galería grid --- */
.gallery-grid {
  columns: 2;
  gap: 12px;
}
@media (min-width: 640px)  { .gallery-grid { columns: 3; } }
@media (min-width: 1024px) { .gallery-grid { columns: 4; } }
.gallery-grid img {
  width: 100%; margin-bottom: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s, filter 0.3s;
  break-inside: avoid;
}
.gallery-grid img:hover { transform: scale(1.02); filter: brightness(0.9); }

/* --- Lightbox (dialog nativo) --- */
dialog#lightbox {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.93);
  position: fixed; inset: 0; z-index: 1000;
  max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh;
  border: none; padding: 0;
  overflow: hidden;
}
dialog#lightbox[open] { display: flex; }
dialog#lightbox::backdrop { background: rgba(0,0,0,.9); }

#lightbox-close {
  position: absolute; top: 18px; right: 18px;
  width: 40px; height: 40px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: #ffffff; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: background 0.2s ease;
}
#lightbox-close:hover { background: rgba(0,0,0,.75); }

/* Imagen dentro del lightbox */
.lb-img-wrap {
  display: flex; align-items: center; justify-content: center;
  max-width: 90vw; max-height: 88vh;
}
#lightbox-img {
  max-width: 90vw; max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  transition: opacity 0.15s ease;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}

/* Botones prev / next */
.lb-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: #ffffff; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: background 0.2s ease;
}
.lb-nav:hover { background: rgba(0,0,0,.75); }
.lb-nav--prev { left: 18px; }
.lb-nav--next { right: 18px; }

/* Pie del lightbox */
.lb-footer {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
}
.lb-counter {
  background: rgba(0,0,0,.55);
  color: rgba(255,255,255,.8);
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,.15);
}

/* --- Post card blog --- */
.post-card { display: flex; flex-direction: column; }
.post-card img { width: 100%; height: 192px; object-fit: cover; }
.post-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }

/* --- Iglesia card --- */
.iglesia-card { text-align: center; cursor: pointer; }
.iglesia-card img { width: 100%; height: 176px; object-fit: cover; }

/* ── Page Header (compartido por todas las páginas internas) ── */
.page-header { position: relative; }

.page-header-pattern {
  position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='52' height='52' viewBox='0 0 52 52' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9963a' fill-opacity='1'%3E%3Cpath d='M10 10h2v2h-2zM30 10h2v2h-2zM10 30h2v2h-2zM30 30h2v2h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: .06;
}

.page-header-wave {
  position: absolute; bottom: -1px; left: 0; right: 0;
  line-height: 0;
}
.page-header-wave svg { display: block; width: 100%; }

/* --- MVV cards (Misión/Visión/Valores) --- */
.mvv-card { padding: 0; overflow: hidden; }
.mvv-top-bar {
  height: 5px;
  width: 100%;
  opacity: .85;
  transition: opacity 0.3s ease;
}
.mvv-card:hover .mvv-top-bar { opacity: 1; }
.mvv-icon-wrap {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: .92;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.mvv-card:hover .mvv-icon-wrap {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 10px 28px rgba(0,0,0,.2);
}
.mvv-verse {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  color: var(--gold-dark);
  font-style: italic;
  letter-spacing: 0.02em;
  opacity: .8;
}

/* --- Departamentos section --- */
.dept-bg-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='52' height='52' viewBox='0 0 52 52' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9963a' fill-opacity='1'%3E%3Cpath d='M10 10h2v2h-2zM30 10h2v2h-2zM10 30h2v2h-2zM30 30h2v2h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.dept-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  text-align: center;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.dept-card:hover {
  background: rgba(255,255,255,.09);
  border-color: rgba(201,150,58,.3);
  transform: translateY(-4px);
}

.dept-icon {
  width: 68px; height: 68px;
  background: rgba(201,150,58,.12);
  border: 1px solid rgba(201,150,58,.25);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.dept-card:hover .dept-icon {
  background: rgba(201,150,58,.2);
  border-color: rgba(201,150,58,.5);
}

/* Tarjeta Escuela Bíblica y Ministerial */
.escuela-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,150,58,.2);
  border-radius: 24px;
  padding: 2.5rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.escuela-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(201,150,58,.35);
}

/* Tarjetas de rango */
.rango-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: transform 0.25s ease, background 0.25s ease;
}
.rango-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.1); }

.rango-card--gold {
  background: linear-gradient(135deg, rgba(201,150,58,.18), rgba(168,122,40,.1));
  border-color: rgba(201,150,58,.35);
}
.rango-card--gold:hover { background: linear-gradient(135deg, rgba(201,150,58,.28), rgba(168,122,40,.18)); }

.rango-numero {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.rango-card--gold .rango-numero { color: var(--gold-light); }

.rango-icon-wrap {
  width: 24px; height: 24px;
  background: rgba(201,150,58,.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 6px auto;
  color: var(--gold);
}

.rango-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  line-height: 1.3;
  margin-top: 2px;
}
.rango-card--gold .rango-label { color: rgba(255,255,255,.85); }

/* --- Stats section --- */
.stats-card {
  padding: 20px 12px;
}
.stats-icon-wrap {
  width: 52px; height: 52px;
  background: rgba(255,255,255,.2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  backdrop-filter: blur(4px);
}

/* --- Galería section background pattern --- */
.galeria-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9963a' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* --- Institutos bíblicos (EMAIC / ITAIC) --- */
.instituto-modal {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  transition: box-shadow 0.2s ease;
}
.instituto-modal--presencial {
  background: #f0f4ff;
  border-color: rgba(15,45,90,.1);
}
.instituto-modal--virtual {
  background: rgba(201,150,58,.06);
  border-color: rgba(201,150,58,.2);
}
.instituto-modal:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.instituto-modal-icon {
  width: 44px; height: 44px;
  background: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* --- Gallery thumbnails (homepage) --- */
.gallery-thumb {
  position: relative;
  display: block;
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}
.gallery-thumb-overlay {
  position: absolute; inset: 0;
  background: rgba(9,30,62,.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-thumb:hover .gallery-thumb-overlay,
.gallery-thumb:focus-visible .gallery-thumb-overlay { opacity: 1; }
.gallery-thumb:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
