/* ============================================================
   Union Baptist Church — Modern Redesign
   Design system: royal purple + gold, warm ivory neutrals  (FLAT colors, no gradients)
   Typography: Playfair Display (display) + Inter (body)
   WCAG AAA: contrast 4.5:1, focus rings, reduced-motion support
   ============================================================ */

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

/* ------------------------------------------------------------
   CHURCH BRAND PALETTE — EDIT THE HEX VALUES HERE TO REBRAND.
   Every color on the site comes from these tokens. Swap any hex
   (and the matching rgba() values in the hero scrim + shadows)
   to change the whole theme at once.
   ------------------------------------------------------------ */
:root{
  --brand:#4B2275;            /* PRIMARY  royal purple (buttons, headings, links)   */
  --brand-dark:#371460;       /* hover / footer / dark purple                        */
  --brand-soft:#6538A0;       /* lighter purple (hover tint, accents)                */
  --accent:#C9A227;           /* ACCENT   warm gold (CTAs, eyebrows, underlines)     */
  --accent-dark:#8F6E10;      /* darker gold for text-on-light (AA contrast)         */
  --on-accent:#231A00;        /* text color sitting ON gold                          */
  --bg:#FAF6F1;               /* page background: warm ivory                         */
  --bg-alt:#F3ECFB;           /* alternating section: soft lavender                  */
  --fg:#241531;               /* foreground: deep plum-black                         */
  --muted:#6C5C7A;            /* secondary text: muted purple-gray                   */
  --card:#FFFFFF;             /* cards                                              */
  --border:#E0D6F0;           /* lavender borders                                    */
  --link:#4B2275;             /* links                                              */
  --destructive:#B91C1C;      /* delete / error                                     */
  --radius:14px;
  --shadow:0 12px 40px rgba(45,18,74,.12);
  --shadow-sm:0 4px 16px rgba(45,18,74,.08);
  --container:1180px;
  --font-display:'Playfair Display', Georgia, serif;
  --font-body:'Inter', system-ui, -apple-system, sans-serif;
}
/* NOTE: if you change --brand, also update the hardcoded purple rgba() in the
   .hero-photo photo scrim (rgba(75,34,117,...)) to match. */

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:var(--font-body);
  font-size:17px;line-height:1.7;
  color:var(--fg);background:var(--bg);
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4,h5{font-family:var(--font-display);color:var(--brand);line-height:1.18;margin:0 0 .6em;font-weight:700}
h1{font-size:clamp(2.1rem,5vw,3.7rem);font-weight:800}
h2{font-size:clamp(1.7rem,3.4vw,2.5rem)}
h3{font-size:clamp(1.25rem,2.2vw,1.6rem)}
p{margin:0 0 1.1em}
a{color:var(--link);text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%;display:block}
:focus-visible{outline:3px solid var(--accent);outline-offset:3px;border-radius:4px}

.container{max-width:var(--container);margin:0 auto;padding:0 24px}
.section{padding:72px 0}
.section.tint{background:var(--bg-alt)}
.section.brand{background:var(--brand-dark);color:#FDF6EC}
.section.brand h2,.section.brand h3,.section.brand h4{color:#fff}
.lead{font-size:1.2rem;color:var(--muted);max-width:62ch}

/* ---------- Content / handbook utilities ---------- */
.callout{background:var(--bg-alt);border-left:4px solid var(--accent);border-radius:12px;padding:1.6rem 2rem}
.callout h2{color:var(--brand);margin-top:0}
.check-list{list-style:none;padding:0;margin:1rem 0}
.check-list li{position:relative;padding-left:2rem;margin-bottom:.8rem}
.check-list li::before{content:'✓';position:absolute;left:0;top:.08rem;color:var(--accent);font-weight:700}
.scripture{font-style:italic;color:var(--brand-soft);border-left:3px solid var(--accent);padding-left:1rem;margin:1.4rem 0}
.grid-feature{display:grid;gap:1.2rem}
.mission-pillars{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin:2rem 0 0}
.mission-pillar{background:rgba(255,255,255,.72);border:1px solid var(--border);border-top:4px solid var(--accent);border-radius:14px;padding:1.45rem 1.25rem 1.35rem;text-align:center;box-shadow:0 8px 22px rgba(54,22,91,.08)}
.mission-pillar h3{margin:0 0 .65rem;color:var(--brand);font-size:1.3rem}
.mission-pillar p{margin:0;color:var(--fg);line-height:1.6}
.mission-quote{margin:2rem 0 0;color:var(--brand);font-size:1.05rem}
@media (max-width:700px){.mission-pillars{grid-template-columns:1fr;max-width:360px;margin-left:auto;margin-right:auto}}
.table-striped{border-collapse:collapse;width:100%;font-size:.95rem}
.table-striped th,.table-striped td{text-align:left;padding:.65rem .8rem;border-bottom:1px solid var(--border)}
.table-striped tbody tr:nth-child(even){background:var(--bg-alt)}
.table-striped th{color:var(--brand);font-weight:600;border-bottom:2px solid var(--accent)}
.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem;margin:1.4rem 0}
.stat-grid .stat{background:var(--bg-alt);border-radius:12px;padding:1.2rem;text-align:center}
.stat-grid .stat b{display:block;font-size:1.8rem;color:var(--brand);font-family:Georgia,serif}
.stat-grid .stat span{font-size:.85rem;color:var(--muted);letter-spacing:.03em}
.people-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:.6rem;list-style:none;padding:0;margin:1rem 0}
.people-list li{background:var(--bg);border:1px solid var(--border);border-radius:10px;padding:.7rem 1rem;font-weight:500;color:var(--brand)}
.month-card{padding:0;overflow:hidden}
.month-card .month-name{background:var(--brand);color:#fff;margin:0;padding:.75rem 1.1rem;font-family:Georgia,serif;font-size:1.05rem}
.month-card .month-name.sub{background:var(--brand-dark)}
.month-card .check-list{padding:1rem 1.2rem;margin:0}
.month-card .check-list li{margin-bottom:.7rem;color:var(--muted)}
.month-card .check-list li::before{color:var(--accent)}

/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;gap:.55rem;cursor:pointer;border:none;
  font-family:var(--font-body);font-weight:600;font-size:1rem;line-height:1;
  padding:.95rem 1.6rem;border-radius:999px;transition:transform .18s ease,box-shadow .18s ease,background .18s ease;
  text-decoration:none!important;}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--accent);color:#241A00}
.btn-primary:hover{background:#d6ad34;box-shadow:var(--shadow-sm)}
.btn-brand{background:var(--accent);color:#241A00}
.btn-brand:hover{background:#d6ad34;box-shadow:var(--shadow-sm)}
.btn-outline{background:transparent;color:inherit;border:2px solid currentColor}
.btn-outline.light{color:#fff}
.btn-lg{padding:1.15rem 2rem;font-size:1.05rem}
.eyebrow{font-size:.8rem;letter-spacing:.18em;text-transform:uppercase;color:var(--accent);font-weight:700;display:block;margin-bottom:.6rem}
.section.brand .eyebrow{color:#e7c95e}

/* ---------- Header ---------- */
.site-header{position:sticky;top:0;z-index:60;background:rgba(251,247,240,.97);border-bottom:1px solid var(--border)}
.menu-backdrop{display:none}
body.nav-open{overflow:hidden}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;padding:1rem 0;flex-wrap:wrap}
.brand-lockup{display:flex;align-items:center;gap:.8rem;text-decoration:none}
.brand-lockup .logo{width:54px;height:54px;border-radius:0;object-fit:contain;background:transparent}
.brand-lockup .name{font-family:var(--font-display);font-weight:800;color:var(--brand);line-height:1;font-size:1.15rem}
.brand-lockup .name small{display:block;margin-top:.3rem;font-family:var(--font-body);font-weight:500;color:var(--muted);font-size:.72rem;letter-spacing:.06em;text-transform:uppercase}
.nav{display:flex;align-items:center;gap:1.1rem;flex-wrap:wrap;flex:1;min-width:0;justify-content:flex-end}
.nav a{color:var(--fg);font-weight:500;font-size:.98rem;padding:.4rem .2rem;border-bottom:2px solid transparent}
.nav a:hover{color:var(--brand);text-decoration:none;border-bottom-color:var(--accent)}
.nav .nav-cta{padding:.65rem 1.2rem;border-radius:999px}
.nav .btn-brand,.nav .btn-brand:hover{color:#241A00}
.menu-toggle{display:none;background:none;border:none;cursor:pointer;padding:.5rem}
.menu-toggle span{display:block;width:26px;height:2.5px;background:var(--brand);margin:6px 0;border-radius:2px}

/* ---------- Hero ---------- */
.hero{position:relative;color:#fff;padding:120px 0 90px;text-align:center;background:var(--brand)}
.hero .container{position:relative;z-index:2}
.hero h1{color:#fff}
.hero .sub{max-width:60ch;margin:0 auto 1.6rem;font-size:1.2rem;color:#F3E7D5}
.hero-actions{display:flex;gap:1rem;justify-content:center;flex-wrap:wrap}
.hero-note{margin-top:2rem;font-size:.95rem;color:#EADBC4}

/* Photo hero: text on LEFT over a dark fade, church image bright on RIGHT.
   The gradient runs left(dim/dark) -> right(transparent/bright). */
.hero-photo{
  position:relative;color:#fff;
  min-height:78vh;display:flex;align-items:center;
  padding:110px 0 96px;
  background-image:
    linear-gradient(90deg,
      rgba(75,34,117,1) 0%,
      rgba(75,34,117,.96) 34%,
      rgba(75,34,117,.72) 50%,
      rgba(75,34,117,.30) 64%,
      rgba(75,34,117,0) 80%),
    url('../images/hero/sign-v3.webp');
  background-size:cover,cover;
  background-position:left center,right center;
  background-repeat:no-repeat;
}
/* Two-column hero: copy sits flush LEFT; photo fills the RIGHT. */
.hero-copy{max-width:600px}
.hero-photo .container{position:relative;z-index:2;max-width:none;width:100%;margin:0;padding:0 clamp(28px,7vw,110px)}
.hero-photo h1{color:#fff;text-shadow:0 2px 24px rgba(0,0,0,.4);font-size:clamp(2.1rem,4.2vw,3.1rem)}
.hero-copy .sub{max-width:46ch;margin:0 0 1.6rem;font-size:1.15rem;color:#F7EDDD;text-shadow:0 1px 12px rgba(0,0,0,.35)}
.hero-photo .hero-actions{justify-content:flex-start}
.hero-photo .hero-note{color:#EADBC4}
@media (max-width:720px){
  .hero-photo{background-position:left center,62% center}
  .hero-photo .container{padding:0 24px}
  .hero-copy{max-width:none}
  .hero-copy .sub{max-width:none}
}

/* Compact tinted hero (Events/Sermons/Ministries headers, etc.): same flat
   purple size as .hero, just with a faded photo behind the purple tint. */
.hero-tinted{background-size:cover;background-position:center;background-repeat:no-repeat}

/* ---------- Announcement / ticker ---------- */
.ticker{background:var(--accent);color:#241A00;overflow:hidden;white-space:nowrap;padding:.5rem 0;font-weight:600;font-size:.9rem}
.ticker-track{display:inline-flex;align-items:center;animation:marquee 38s linear infinite;will-change:transform}
.ticker-track:hover{animation-play-state:paused}
.ticker-track .ticker-item{display:inline-flex;align-items:center;flex:none;margin-right:2.6rem}
.ticker-track .ticker-item strong{font-weight:700}
.ticker-track .ticker-item .tsep{margin-left:2.6rem;opacity:.7}
@keyframes marquee{from{transform:translateX(0)}to{transform:translateX(-50%)}}

/* ---------- Cards ---------- */
.grid{display:grid;gap:24px}
.grid.cols-2{grid-template-columns:repeat(2,1fr)}
.grid.cols-3{grid-template-columns:repeat(3,1fr)}
.grid.cols-4{grid-template-columns:repeat(4,1fr)}
.card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm);transition:transform .2s ease,box-shadow .2s ease;display:flex;flex-direction:column}
.card:hover{transform:translateY(-4px);box-shadow:var(--shadow)}
.card img,.card .img-ph{width:100%;aspect-ratio:16/10;object-fit:cover}
.card .card-body{padding:1.4rem 1.5rem 1.6rem;display:flex;flex-direction:column;gap:.5rem;flex:1}
.card .card-title{font-size:1.3rem}
.card .card-meta{font-size:.86rem;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.card .card-link{margin-top:auto;font-weight:600;color:var(--brand)}

/* Cards used directly inside .grid-feature (no .card-body wrapper) need their
   own padding, and must stay readable even when the parent section is the
   dark .section.brand background (which otherwise force-whites h2/h3/h4). */
.grid-feature .card{padding:1.5rem 1.6rem}
.section.brand .card,
.section.brand .card p{color:var(--fg)}
.section.brand .card h3,
.section.brand .card h4{color:var(--brand)}

/* ---------- Homepage ministries carousel ---------- */
.carousel-heading{display:flex;align-items:end;justify-content:space-between;gap:1.25rem;margin-bottom:1.7rem}
.carousel-actions{display:flex;align-items:center;gap:1.25rem;flex-wrap:wrap;justify-content:flex-end}
.text-link{font-weight:700;color:var(--brand);white-space:nowrap}
.text-link:hover{color:var(--brand-dark)}
.carousel-arrows{display:flex;gap:.55rem}
.carousel-arrow{width:44px;height:44px;display:grid;place-items:center;border:1px solid var(--brand);border-radius:999px;background:var(--card);color:var(--brand);font-size:1.25rem;line-height:1;cursor:pointer;transition:background .2s ease,color .2s ease,opacity .2s ease}
.carousel-arrow:hover:not(:disabled),.carousel-arrow:focus-visible:not(:disabled){background:var(--brand);color:#fff;outline:none}
.carousel-arrow:disabled{opacity:.35;cursor:not-allowed}
.carousel-viewport{overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:none;padding:.25rem .1rem 1rem;outline:none}
.carousel-viewport::-webkit-scrollbar{display:none}
.carousel-viewport:focus-visible{outline:3px solid var(--accent);outline-offset:4px;border-radius:var(--radius)}
.carousel-track{display:flex;gap:24px;width:max-content}
.carousel-card{width:calc((min(1180px, 100vw - 48px) - 72px) / 4);min-width:260px;scroll-snap-align:start}
@media (max-width:1050px){.carousel-card{width:calc((100vw - 70px) / 3)}}
@media (max-width:760px){.carousel-heading{align-items:flex-start;flex-direction:column}.carousel-actions{width:100%;justify-content:space-between}.carousel-card{width:calc((100vw - 58px) / 2);min-width:240px}}
@media (max-width:520px){.carousel-card{width:calc(100vw - 58px);min-width:0}.carousel-heading h2{font-size:2rem}.carousel-actions{gap:.75rem}.carousel-arrow{width:42px;height:42px}}


@media (max-width:960px){.grid.cols-4{grid-template-columns:repeat(2,1fr)}.grid.cols-3{grid-template-columns:repeat(2,1fr)}}
@media (max-width:640px){.grid.cols-4,.grid.cols-3,.grid.cols-2{grid-template-columns:1fr}}

/* ---------- Feature split ---------- */
.split{display:grid;grid-template-columns:1fr 1fr;gap:48px;align-items:center}
.split .img-ph,.split img{border-radius:var(--radius);box-shadow:var(--shadow)}
@media (max-width:820px){.split{grid-template-columns:1fr}}

/* ---------- Image placeholder ---------- */
.img-ph{background:var(--bg-alt);border:2px dashed var(--border);border-radius:var(--radius);display:flex;align-items:center;justify-content:center;min-height:200px;position:relative;color:var(--muted);overflow:hidden}
.img-ph span{font-size:.9rem;text-align:center;padding:1rem}
.img-ph::before{content:"🖼";position:absolute;top:12px;left:14px;font-size:1rem;opacity:.5}

/* ---------- Service times ---------- */
.services{display:grid;gap:18px;grid-template-columns:repeat(3,1fr)}
@media (max-width:820px){.services{grid-template-columns:1fr}}
.service{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:1.6rem;box-shadow:var(--shadow-sm)}
.service .icon{font-size:1.6rem;margin-bottom:.6rem}

/* ---------- Timeline / list ---------- */
.timeline{list-style:none;margin:0;padding:0;position:relative}
.timeline li{padding-left:1.8rem;position:relative;margin-bottom:1.1rem}
.timeline li::before{content:"";position:absolute;left:0;top:.55em;width:.7rem;height:.7rem;border-radius:50%;background:var(--accent);box-shadow:0 0 0 4px var(--bg-alt)}

/* ---------- Table ---------- */
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;background:var(--card);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow-sm)}
th,td{padding:1rem 1.2rem;text-align:left;border-bottom:1px solid var(--border);font-size:.98rem}
th{background:var(--bg-alt);font-weight:700;color:var(--brand);font-size:.9rem;text-transform:uppercase;letter-spacing:.04em}

/* ---------- Forms ---------- */
.form-grid{display:grid;gap:1rem;grid-template-columns:1fr 1fr}
@media (max-width:640px){.form-grid{grid-template-columns:1fr}}
.field{display:flex;flex-direction:column;gap:.35rem}
.field label{font-weight:600;font-size:.92rem}
.field input,.field select,.field textarea{font-family:var(--font-body);font-size:1rem;padding:.85rem 1rem;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--fg);width:100%}
.field input:focus,.field select:focus,.field textarea:focus{outline:3px solid var(--accent);outline-offset:1px}
.field textarea{min-height:130px;resize:vertical}

/* ---------- Google map embed ---------- */
.map-wrap{border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);aspect-ratio:16/8;background:#e9e2f2}
.map-wrap iframe{width:100%;height:100%;border:0;display:block}
@media (max-width:640px){.map-wrap{aspect-ratio:16/11}}

/* ---------- Footer ---------- */
.site-footer{background:var(--brand-dark);color:#EADBC4;padding:64px 0 30px;margin-top:0}
.site-footer a{color:#e7c95e}
.footer-grid{display:grid;grid-template-columns:2fr 1fr 1fr 1.2fr;gap:40px}
@media (max-width:820px){.footer-grid{grid-template-columns:1fr 1fr}}
@media (max-width:520px){.footer-grid{grid-template-columns:1fr}}
.site-footer h4{color:#fff;margin-bottom:.9rem}
.site-footer ul{list-style:none;padding:0;margin:0;display:grid;gap:.5rem}
.site-footer .foot-note{font-size:.85rem;margin-top:2rem;border-top:1px solid rgba(255,255,255,.15);padding-top:1.2rem;display:flex;justify-content:space-between;flex-wrap:wrap;gap:1rem}

/* ---------- Social ---------- */
.social{display:flex;gap:.7rem;flex-wrap:wrap}
.social a{display:inline-flex;align-items:center;gap:.4rem;font-weight:600}

/* ---------- Utilities ---------- */
.text-center{text-align:center}
.mt-0{margin-top:0}
.icon-badge{width:48px;height:48px;border-radius:12px;background:var(--brand);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:1.3rem}
.badge{display:inline-block;background:var(--bg-alt);color:var(--brand);border:1px solid var(--border);border-radius:999px;padding:.3rem .8rem;font-size:.82rem;font-weight:600}

/* ---------- Mobile nav ---------- */
@media (max-width:1200px){
  .menu-toggle{display:block}
  .menu-backdrop{display:block;position:fixed;inset:0;z-index:55;background:rgba(36,26,0,.42);opacity:0;visibility:hidden;transition:opacity .25s ease,visibility .25s ease;border:0;padding:0;cursor:pointer}
  .menu-backdrop.is-visible{opacity:1;visibility:visible}
  .nav{position:fixed;inset:0 0 0 auto;z-index:61;width:min(82%,340px);background:var(--card);flex-direction:column;align-items:flex-start;justify-content:flex-start;padding:5rem 2rem 2rem;gap:.2rem;transform:translateX(105%);transition:transform .25s ease;box-shadow:-6px 0 30px rgba(0,0,0,.22);overflow-y:auto}
  .nav.open{transform:translateX(0)}
  .nav a{padding:.9rem 0;width:100%;font-size:1.05rem}
  .nav .nav-cta{margin-top:1rem}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}
