/* Sacramento Prays 24/7 — design tokens & base styles */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Poppins:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --blue: #0B2D5C;
  --blue-deep: #061C3A;
  --gold: #F2B705;
  --gold-soft: #FFD75A;
  --gold-deep: #C99700;
  --beige: #F4EDE4;
  --beige-2: #EFE5D6;
  --ink: #1A1A1A;
  --ink-soft: #2e2a24;
  --cream: #FBF7F0;

  --grad-gold: linear-gradient(180deg, #FFD75A 0%, #F2B705 100%);
  --grad-blue: linear-gradient(180deg, #0B2D5C 0%, #061C3A 100%);
  --grad-sunset: linear-gradient(180deg, #FFD75A 0%, #F2B705 45%, #C99700 100%);

  --ff-display: 'Cinzel', 'Playfair Display', Georgia, serif;
  --ff-elegant: 'Playfair Display', Georgia, serif;
  --ff-body: 'Poppins', system-ui, sans-serif;
  --ff-mono: 'DM Mono', ui-monospace, Menlo, monospace;

  --shadow-warm: 0 24px 60px -20px rgba(11, 45, 92, 0.35);
  --shadow-soft: 0 12px 32px -12px rgba(26, 26, 26, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--beige);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; }

/* Grain overlay for retro warmth */
.grain {
  position: relative;
  isolation: isolate;
}
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  z-index: 1;
}

/* Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--beige); }
::-webkit-scrollbar-thumb { background: var(--blue); border: 3px solid var(--beige); border-radius: 8px; }

/* Utility */
.u-container { max-width: 1280px; margin: 0 auto; padding: 0 40px; }
.u-eyebrow {
  font-family: var(--ff-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: inline-block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary {
  background: var(--grad-gold);
  color: var(--blue);
  box-shadow: 0 6px 0 var(--gold-deep), 0 12px 24px -8px rgba(201, 151, 0, 0.5);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 var(--gold-deep), 0 16px 32px -8px rgba(201, 151, 0, 0.6);
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--gold-deep); }
.btn-ghost {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-ghost:hover { background: var(--blue); color: var(--gold); }
.btn-on-dark {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn-on-dark:hover { background: var(--gold); color: var(--blue); }

/* Type */
.h-display {
  font-family: var(--ff-display);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.h-elegant {
  font-family: var(--ff-elegant);
  font-style: italic;
  font-weight: 500;
}

/* Retro sunburst keyframes */
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes pulse-soft { 0%, 100% { opacity: 0.9; } 50% { opacity: 1; } }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.spin-slow { animation: spin-slow 90s linear infinite; }
.pulse-soft { animation: pulse-soft 3s ease-in-out infinite; }

/* Retro-cut card */
.retro-card {
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: 8px 8px 0 var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.retro-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 11px 11px 0 var(--ink);
}

/* Image placeholder (only used if Unsplash fails) */
.img-placeholder {
  background:
    repeating-linear-gradient(45deg, rgba(11,45,92,0.06) 0 10px, transparent 10px 20px),
    var(--beige-2);
  border: 1px solid rgba(11, 45, 92, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--blue);
  text-transform: uppercase;
  text-align: center;
  padding: 20px;
}

/* Sections */
.section { padding: 120px 0; position: relative; }
.section-dark {
  background: var(--grad-blue);
  color: var(--cream);
}
.section-dark .u-eyebrow { color: var(--gold-soft); }

/* Starburst divider */
.divider-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--gold-deep);
}
.divider-stars::before, .divider-stars::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
  max-width: 80px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Grid helpers — any 2 or 3 column grid collapses on narrow */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }

@media (max-width: 1024px) {
  .u-container { padding: 0 28px; }
  .section { padding: 80px 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  /* Any 2-col inline grid stacks at tablet */
  [style*="grid-template-columns: 1.1fr 1fr"],
  [style*="grid-template-columns: 1fr 1.2fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 1.3fr 1fr"],
  [style*="grid-template-columns: 1.4fr 1fr"],
  [style*="grid-template-columns: 1fr 1.3fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

@media (max-width: 720px) {
  html, body { font-size: 15px; }
  .u-container { padding: 0 20px; }
  .section { padding: 60px 0; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; gap: 20px !important; }

  /* Any inline-style grid with 2/3/4 cols → stack */
  [style*="grid-template-columns: 1.1fr 1fr"],
  [style*="grid-template-columns: 1fr 1.2fr"],
  [style*="grid-template-columns: 1.2fr 1fr"],
  [style*="grid-template-columns: 1.3fr 1fr"],
  [style*="grid-template-columns: 1.4fr 1fr"],
  [style*="grid-template-columns: 1fr 1.3fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns: 1.4fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .btn { padding: 14px 22px; font-size: 12px; }

  /* Scrollbar smaller */
  ::-webkit-scrollbar { width: 8px; }

  /* Mobile hides */
  .desktop-only { display: none !important; }
}

@media (min-width: 1025px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 1024px) {
  .desktop-only { display: none !important; }
}

/* Nav title sizing */
.nav-title { font-size: 18px; }
.nav-subtitle { display: block; }
@media (max-width: 720px) {
  .nav-title { font-size: 14px; letter-spacing: 0.04em; }
  .nav-subtitle { font-size: 9px; letter-spacing: 0.18em; }
}
@media (max-width: 400px) {
  .nav-subtitle { display: none; }
}

/* Coverage grid — pure CSS so it works at real mobile widths */
.coverage-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 6px;
}
@media (max-width: 720px) {
  .coverage-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Team grid — 3 → 2 → 1 */
@media (max-width: 1024px) {
  .team-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 24px !important; }
}
@media (max-width: 600px) {
  .team-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
}

/* Resources — collapse hero & grid on small screens */
@media (max-width: 900px) {
  .resource-hero { grid-template-columns: 1fr !important; }
  .resource-hero > div:first-child { padding: 36px 28px 28px !important; }
  .resource-hero > div:first-child h2 { font-size: 36px !important; }
  .resource-hero > div:last-child { padding: 32px 28px !important; }
  .resource-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .resource-bottom { grid-template-columns: 1fr !important; gap: 24px !important; }
}

/* Intercessors — collapse claim strip & grids on small screens */
@media (max-width: 1000px) {
  .claim-strip { grid-template-columns: 1fr !important; }
  .claim-strip > div:first-child { padding: 32px 28px 28px !important; }
  .claim-strip > div:first-child h2 { font-size: 30px !important; }
  .claim-strip > div:last-child { padding: 28px !important; }
  .int-focus { grid-template-columns: 1fr !important; gap: 20px !important; }
  .int-focus h2 { font-size: 30px !important; }
  .int-bottom { grid-template-columns: 1fr !important; gap: 32px !important; }
}

/* Calendar — responsive */
@media (max-width: 1000px) {
  .cal-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .rhythms-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
  .rhythms-grid { grid-template-columns: 1fr !important; }
}

/* Hero grid: keep title + big sun side-by-side until real mobile.
   The global ≤1024 stacker is too aggressive for the hero — opt out so the sun
   stays anchored on the right at tablet widths. */
/* Hero responsive — keep desktop side-by-side at tablet, only stack on phones.
   Mobile: full-bleed Sacramento sunrise photo behind a deep blue scrim,
   typography flipped to cream/gold so the photo deepens the brand instead of fighting it. */
.hero-grid { grid-template-columns: 1.1fr 1fr !important; gap: clamp(30px, 5vw, 80px) !important; }
.hero-stats-mobile { display: none; }
.hero-stats-v2-mobile { display: none; }

@media (max-width: 720px) {
  .hero-stats-v2-desktop { display: none !important; }
  .hero-stats-v2-mobile { display: block !important; }
  .hero-section-pad {
    padding: 28px 0 24px !important;
    background-image:
      linear-gradient(180deg,
        rgba(6,28,58,0.78) 0%,
        rgba(11,45,92,0.72) 45%,
        rgba(6,28,58,0.85) 100%),
      url('uploads/sacramento-sunrise.png') !important;
    background-size: cover !important;
    background-position: center 30% !important;
    background-repeat: no-repeat !important;
  }
  /* Hide the cream radial glows the section paints — they look like fog over the photo */
  .hero-section-pad > div[style*="radial-gradient"] { display: none !important; }
  .hero-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .hero-logo-wrap { display: none !important; }
  .hero-stats-desktop { display: none !important; }
  .hero-stats-mobile { display: grid !important; margin-top: 16px !important; padding: 12px 0 !important; }
  .hero-sub { font-size: 17px !important; margin: 10px 0 18px !important; color: var(--cream-soft, #F1E8C9) !important; opacity: 0.92; }

  /* Tighten the inline-style margins on the eyebrow + headline + button row */
  .hero-section-pad .u-eyebrow { margin-bottom: 12px !important; color: var(--gold) !important; }
  .hero-section-pad .h-hero { margin: 0 0 4px !important; color: var(--cream, #F7EED9) !important; }
  .hero-section-pad .h-hero span { color: var(--gold, #F2B705) !important; }
  /* The button row has inline marginBottom: 40 — pull it in */
  .hero-section-pad [class="hero-grid"] > div > div[style*="marginBottom"] { margin-bottom: 18px !important; }

  /* Stats band: light borders + cream/gold values so it floats over the photo */
  .hero-stats-mobile {
    border-top: 1px solid rgba(242,183,5,0.35) !important;
    border-bottom: 1px solid rgba(242,183,5,0.35) !important;
  }
  .hero-stats-mobile > div { border-right-color: rgba(242,183,5,0.25) !important; }
  .hero-stats-mobile .h-display { color: var(--cream, #F7EED9) !important; }

  /* Ghost button: default blue-on-cream is invisible on the dark photo. Flip to cream/gold. */
  .hero-section-pad .btn-ghost {
    color: var(--cream, #F7EED9) !important;
    border-color: var(--gold, #F2B705) !important;
    background: rgba(247,238,217,0.04) !important;
  }
  .hero-section-pad .btn-ghost:hover {
    background: var(--gold, #F2B705) !important;
    color: var(--blue, #0B2D5C) !important;
  }
}

/* Coverage section: keep grid on mobile, hide unused mobile timeline */
.coverage-clock-mobile { display: none; }
@media (max-width: 720px) {
  .coverage-clock-mobile { display: none; }
  .coverage-clock-desktop {
    box-shadow: 5px 5px 0 var(--ink) !important;
    padding: 18px !important;
  }
  .coverage-section-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
}

/* Announcement ticker — on mobile, keep only the LIVE pulse; let scrolling messages share the strip */
.ticker-live-mobile { display: none; }
@media (max-width: 720px) {
  .ticker-time { display: none !important; }
  .ticker-loc { display: none !important; }
  .ticker-live-mobile { display: inline !important; }
  .announcement-ticker-live {
    padding: 0 10px !important;
    gap: 6px !important;
  }
}

/* Responsive headline sizes */
@media (max-width: 1024px) {
  .h-display { font-size: 32px !important; line-height: 1.05 !important; }
  .h-section { font-size: 28px !important; line-height: 1.1 !important; }
  .h-hero { font-size: 44px !important; }
  .u-eyebrow { font-size: 11px !important; }
}
@media (max-width: 720px) {
  .h-hero { font-size: 36px !important; }
  .h-section { font-size: 26px !important; }
}
@media (max-width: 480px) {
  .h-display { font-size: 26px !important; }
  .h-section { font-size: 22px !important; }
  .h-hero { font-size: 28px !important; }
}
@media (max-width: 360px) {
  .h-hero { font-size: 24px !important; }
  .h-section { font-size: 20px !important; }
}

/* Mobile vertical pass — trim non-essential weight, tighten padding/margins, drop excess cards */
@media (max-width: 720px) {
  /* Section padding: already 60px from .section rule. Tighten heavily-padded sections further. */
  .section.section-dark.grain { padding: 56px 0 !important; }

  /* Section header margins (eyebrow+title blocks) — desktop uses 60/50/40, way too tall on mobile */
  .section [style*="margin-bottom: 60px"],
  .section [style*="marginBottom: 60"],
  .section [style*="marginBottom:60"] { margin-bottom: 28px !important; }
  .section [style*="margin-bottom: 50px"],
  .section [style*="marginBottom: 50"],
  .section [style*="marginBottom:50"] { margin-bottom: 24px !important; }

  /* Pillars cards: padding 40 → 24, tighten inner margins */
  .retro-card { padding: 24px !important; }
  .retro-card svg { width: 32px !important; }
  .retro-card .h-section { font-size: 30px !important; margin: 0 0 4px !important; }

  /* Prayer Wall: drop 6 cards → 3 on mobile (cards 4, 5, 6 hidden) */
  .section [style*="grid-template-columns: repeat(3, 1fr)"] > div:nth-child(n+4) {
    display: none !important;
  }

  /* Prayer Wall cards: pad smaller, smaller body text */
  .section [style*="grid-template-columns: repeat(3, 1fr)"] > div[style*="rotate"] {
    padding: 20px !important;
  }

  /* Vision badge */
  .vision-badge {
    right: auto !important;
    left: 0 !important;
    top: auto !important;
    bottom: -20px !important;
    transform: rotate(-2deg) !important;
    font-size: 11px !important;
    padding: 12px 18px !important;
  }
}

/* Hero stats — 3-col on desktop, stack vertically on tablet/mobile */
.hero-stats { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1024px) {
  .hero-stats { grid-template-columns: 1fr !important; gap: 0 !important; }
  .hero-stat {
    padding: 14px 10px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(11,45,92,0.2);
  }
  .hero-stat:last-child { border-bottom: none; }
  .hero-stat-big { font-size: 36px !important; }
  .hero-stat-small { font-size: 10px !important; letter-spacing: 0.15em !important; margin-top: 6px !important; line-height: 1.2; }
  .hero-sub { font-size: 16px !important; }
}

/* Hide scrollbars in mobile nav drawer */
.mobile-drawer-open { overflow: hidden; }

/* ============================================================
   FOOTER + PREFOOTER
   ============================================================ */
.footer-main { grid-template-columns: 1.6fr 1fr 1fr; }
@media (max-width: 1024px) {
  .footer-main { grid-template-columns: 1fr 1fr !important; gap: 36px !important; }
}
@media (max-width: 600px) {
  .footer-main { grid-template-columns: 1fr !important; gap: 28px !important; }
  .footer-legal {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
}
@media (max-width: 1024px) {
  .prefooter-inner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 20px !important;
  }
  .prefooter-inner > div {
    flex: 0 0 auto !important;
    width: 100%;
  }
}
@media (max-width: 600px) {
  .prefooter-section {
    padding: 36px 0 !important;
  }
  .prefooter-inner {
    gap: 18px !important;
  }
  .prefooter-inner > div:last-child {
    width: 100%;
    flex-direction: column !important;
    gap: 10px !important;
  }
  .prefooter-inner > div:last-child > .btn {
    width: 100%;
    text-align: center;
  }
}

/* ============================================================
   MOBILE POLISH — registration form, mission, vision, hero
   ============================================================ */

/* Mission cards: 2-col → 1-col on mobile */
@media (max-width: 720px) {
  .mission-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

/* Registration form card: tighter padding on mobile */
@media (max-width: 720px) {
  #register-form {
    padding: 48px 0 56px !important;
  }
  #register-form .u-container {
    padding: 0 16px !important;
  }
}

/* Hero: tighten padding on mobile */
@media (max-width: 720px) {
  .hero-container {
    padding: 72px 20px 48px !important;
  }
}

/* Vision section: stack on mobile, tighten spacing */
@media (max-width: 720px) {
  .vision-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
}

/* Coverage section: tighten on mobile */
@media (max-width: 720px) {
  .coverage-section-grid {
    gap: 24px !important;
  }
}

/* Prayer wall: tighten on mobile */
@media (max-width: 720px) {
  .section [style*="marginBottom: 40"],
  .section [style*="margin-bottom: 40px"] {
    margin-bottom: 20px !important;
  }
}

/* Prayer points grid: 2-col → 1-col on mobile */
@media (max-width: 720px) {
  .prayer-points-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .mountains-grid {
    padding-left: 0 !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

/* Hero stats band: contain within padding on mobile */
@media (max-width: 720px) {
  .hero-stats-v2-mobile > div {
    border-radius: 10px !important;
    border: 1px solid rgba(242,183,5,0.3) !important;
  }
}

/* Calendar day grid: ensure cells don't get too small */
@media (max-width: 380px) {
  #register-form [style*="grid-template-columns: repeat(7"] {
    gap: 4px !important;
  }
}
