/* Adventistas Central Osorno — base */
:root {
  --cream: #F5EFE0;
  --cream-2: #EFE7D2;
  --cream-3: #E6DCC2;
  --ink: #14213D;
  --navy: #1B2C5C;
  --navy-2: #243B7A;
  --navy-soft: #4A5A8A;
  --gold: #B89055;
  --gold-2: #C9A26B;
  --line: rgba(27, 44, 92, 0.14);
  --line-2: rgba(27, 44, 92, 0.08);
  --serif: 'Newsreader', 'Source Serif 4', Georgia, serif;
  --sans: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --bg: var(--cream);
  --fg: var(--navy);
  --muted: rgba(27, 44, 92, 0.62);
  --surface: #FBF7EC;
  --surface-2: #F0E8D2;
  --hairline: rgba(27, 44, 92, 0.12);
  --shadow-soft: 0 1px 2px rgba(27,44,92,.06), 0 8px 24px rgba(27,44,92,.06);
}

[data-theme="dark"] {
  --bg: #0E1730;
  --fg: #F0E8D2;
  --navy: #F0E8D2;
  --navy-2: #E6DCC2;
  --navy-soft: #B9C2DA;
  --cream: #0E1730;
  --cream-2: #15224A;
  --cream-3: #1B2C5C;
  --muted: rgba(240,232,210,.62);
  --surface: #15224A;
  --surface-2: #1B2C5C;
  --line: rgba(240,232,210,.14);
  --line-2: rgba(240,232,210,.08);
  --hairline: rgba(240,232,210,.14);
  --gold: #D4B07A;
  --gold-2: #E2C28F;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; }
body { transition: background-color .35s ease, color .35s ease; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* type */
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold); }
.eyebrow { font-family: var(--sans); font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted); font-weight: 600; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; letter-spacing: -0.02em;
  margin: 0; line-height: 1.05; text-wrap: balance; }
p { text-wrap: pretty; margin: 0; }

/* layout shell */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1240px; margin: 0 auto;
  padding-left: clamp(20px, 4vw, 56px); padding-right: clamp(20px, 4vw, 56px); }
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section-tight { padding: clamp(40px, 5vw, 72px) 0; }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-2); }
.nav-inner { display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 24px; }
.nav-brand { display: flex; align-items: center; }
.nav-brand img { width: 48px; height: 48px; object-fit: contain; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-link { font-size: 13.5px; font-weight: 500; color: var(--fg); opacity: .76;
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
  transition: opacity .2s, background .2s; border: 0; background: transparent;
  font-family: var(--sans); letter-spacing: -0.005em; }
.nav-link:hover { opacity: 1; background: var(--cream-2); }
.nav-link.active { opacity: 1; color: var(--fg);
  background: color-mix(in oklab, var(--gold) 14%, transparent); }
.nav-live { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: 999px; background: var(--navy); color: var(--cream); font-size: 12px;
  font-weight: 600; cursor: pointer; border: 0; font-family: var(--sans); }
.nav-live .dot { width: 7px; height: 7px; border-radius: 50%; background: #E25C5C;
  box-shadow: 0 0 0 0 rgba(226,92,92,.7); animation: pulse 1.6s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(226,92,92,.65); }
  70% { box-shadow: 0 0 0 8px rgba(226,92,92,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,92,92,0); }
}
.nav-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
/* Botón hamburguesa — oculto en desktop, visible en mobile (ver media query) */
.nav-toggle { display: none; flex-direction: column; justify-content: center;
  align-items: center; gap: 5px; width: 42px; height: 42px; padding: 0;
  background: transparent; border: 0; border-radius: 10px; cursor: pointer; }
.nav-toggle:hover { background: var(--cream-2); }
.nav-toggle span { display: block; width: 22px; height: 2px; border-radius: 2px;
  background: var(--fg); transition: transform .25s ease, opacity .2s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px;
  border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer;
  border: 1px solid transparent; transition: transform .15s, background .2s, color .2s;
  font-family: var(--sans); letter-spacing: -0.005em; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: var(--cream); }
.btn-primary:hover { background: var(--navy-2); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { background: var(--cream-2); }
.btn-gold { background: var(--gold); color: #1B2C5C; }
.btn-gold:hover { background: var(--gold-2); }

/* placeholder image */
.placeholder { background:
  repeating-linear-gradient(135deg,
    color-mix(in oklab, var(--navy) 8%, transparent) 0 1px,
    transparent 1px 8px),
  var(--surface-2);
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center; position: relative;
  color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; overflow: hidden;
}
.placeholder::after { content: attr(data-label); padding: 6px 10px;
  background: color-mix(in oklab, var(--bg) 80%, transparent); border-radius: 4px; }
.placeholder.dark { background:
  repeating-linear-gradient(135deg,
    rgba(240,232,210,.06) 0 1px, transparent 1px 8px),
  #0F1A36; color: rgba(240,232,210,.6); }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px;
  padding: 22px; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

/* hairlines */
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.rule-thick { height: 1px; background: var(--navy); opacity: .85; border: 0; }

/* footer */
.footer { background: var(--navy); color: var(--cream);
  padding: 64px 0 32px; margin-top: auto; }
[data-theme="dark"] .footer { background: #08102A; }
.footer .container { color: var(--cream); }
.footer a { opacity: .76; }
.footer a:hover { opacity: 1; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* focus */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* utility */
.grid { display: grid; gap: 24px; }
.flex { display: flex; }
.between { display: flex; align-items: center; justify-content: space-between; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; } .mt-5 { margin-top: 48px; } .mt-6 { margin-top: 64px; }
.muted { color: var(--muted); }
.text-balance { text-wrap: balance; }
.uppercase { text-transform: uppercase; letter-spacing: .14em; }

/* page transitions */
.page-enter { animation: pageIn .4s ease both; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Hymn link — clickable hymn reference in program details */
.hymn-link {
  color: var(--gold);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color .15s;
}
.hymn-link:hover { color: var(--navy); }

/* Calendar month navigation buttons */
.cal-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  min-width: 120px;
  justify-content: center;
}
.cal-nav-btn:hover {
  background: var(--surface);
  border-color: var(--gold);
}
.cal-nav-btn-primary {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
  min-width: 90px;
  font-weight: 600;
  letter-spacing: .04em;
}
.cal-nav-btn-primary:hover {
  background: color-mix(in oklab, var(--navy) 85%, var(--gold));
  color: var(--cream);
  border-color: transparent;
}

/* Hide chrome when printing the page itself */
@media print {
  .no-print { display: none !important; }
}

/* Programa table — mobile collapse */
@media (max-width: 720px) {
  .prog-row {
    grid-template-columns: 1fr !important;
  }
  .prog-row > div {
    border-right: 0 !important;
  }
}
@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: color-mix(in oklab, var(--bg) 97%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line-2);
    padding: 12px 20px 18px;
    box-shadow: 0 14px 28px rgba(0,0,0,.10);
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 14px; text-align: left; font-size: 15px; opacity: .9; }
  .nav-live { justify-content: center; margin-top: 6px; }
  .nav-sep { display: none; }
  .nav-inner { height: 60px; }
  .hero-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .hero-grid > div:last-child { min-height: 70vw !important; }
  .next-service-card { grid-template-columns: 1fr !important; }
  .moments-grid { grid-template-columns: repeat(2, 1fr) !important; grid-auto-rows: 160px !important; }
  .moments-grid > div { grid-column: span 1 !important; grid-row: span 1 !important; }
  .past-sermons-grid { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .footer-grid > div { display: flex; flex-direction: column; align-items: center; }
  .footer .between { flex-direction: column; gap: 8px; }
  .home-schedule-grid > div { border-right: 0 !important; }
  .home-schedule-grid > div:last-child { border-bottom: 0 !important; }
  .schedule-day { grid-template-columns: 1fr !important; gap: 20px !important; }
  .sunset-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .sunset-grid > div { border-left: 0 !important; border-bottom: 1px solid rgba(245,239,224,.18) !important; }
  .sunset-grid > div:nth-last-child(-n+2) { border-bottom: 0 !important; }
}

@media (max-width: 480px) {
  .sunset-grid { grid-template-columns: 1fr !important; }
  .cal-event-editor { grid-template-columns: 1fr !important; gap: 8px !important; }
  .cal-event-editor > * { min-width: 0; }
}
