/*
 * Shared styles for westunitycommunitychurch.org.
 *
 * Site-level presentation only. The framework itself styles nothing beyond
 * what pin geometry, header transitions and submenu visibility require —
 * see cue/cue.css.
 *
 * Palette: warm ivory paper, calm blue, a little gold. Light, quiet, and not
 * tied to any denomination's colours.
 */

:root {
  --bg:        #fbf9f4;   /* warm ivory */
  --bg-raised: #ffffff;
  --bg-tint:   #f2eee6;   /* soft sand — alternating bands */
  --ink:       #2b3440;
  --ink-dim:   #5c6673;
  --line:      #e3dccf;
  --brand:     #3d6fa3;   /* calm blue */
  --brand-dk:  #2b5279;   /* hover, and blue text on light */
  --brand-lt:  #dbe7f4;   /* blue tint for chips and washes */
  --gold:      #b8923f;   /* warm accent: eyebrows, ticks, counters */
  --shadow:    0 18px 44px -18px rgb(43 52 64 / 0.22);
  --shell:     min(1180px, 92vw);
  --serif:     "Lora", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 700px at 10% -8%, rgb(61 111 163 / 0.10), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgb(184 146 63 / 0.08), transparent 55%);
  background-color: var(--bg);
  color: var(--ink);
  font: 400 clamp(1rem, 0.95rem + 0.25vw, 1.125rem)/1.65
        ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 1.5rem + 3.6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 1.3rem + 2.2vw, 2.9rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1em; color: var(--ink-dim); max-width: 62ch; }
a  { color: inherit; }
address { font-style: normal; }

.shell { width: var(--shell); margin-inline: auto; }
.eyebrow {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 1rem;
}

/* Buttons. */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.72rem 1.35rem; border-radius: 9px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.98rem; line-height: 1;
  text-decoration: none; cursor: pointer;
  color: #fff; background: var(--brand);
  transition: background-color 160ms ease, border-color 160ms ease;
}
.btn:hover, .btn:focus-visible { background: var(--brand-dk); }
.btn-ghost {
  color: var(--brand-dk); background: var(--bg-raised); border-color: var(--line);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  background: var(--brand-lt); border-color: var(--brand); color: var(--brand-dk);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.4rem; }

/* ---------------------------------------------------------- progress bar */
.readout {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 200;
  background: linear-gradient(90deg, var(--brand), var(--gold));
  transform-origin: 0 50%;
  /* --page comes from the `progress` effect, scoped to :root */
  transform: scaleX(var(--page, 0));
}

/* --------------------------------------------------------------- header */
.site-header {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.header-inner {
  width: var(--shell); margin-inline: auto;
  display: flex; align-items: center; gap: 2rem;
  min-height: 84px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--serif);
  font-weight: 600; letter-spacing: 0; text-decoration: none;
  font-size: clamp(1rem, 0.85rem + 0.6vw, 1.25rem);
  white-space: nowrap;
  color: var(--ink);
  transform-origin: left center;
  transition: transform 220ms ease;
}
.wordmark .logo { display: block; height: 2.6rem; width: auto; }
.wordmark span { color: var(--brand-dk); font-weight: 500; }
.wordmark:hover, .wordmark:focus-visible { transform: scale(1.03); }

/* Phone number between the wordmark and the menu; pushes the nav right. */
.header-phone {
  margin-inline: auto;
  font-weight: 700; font-size: 0.98rem; line-height: 1;
  color: var(--brand-dk); text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease;
}
.header-phone:hover, .header-phone:focus-visible { color: var(--ink); }
@media (max-width: 760px) {
  .header-phone { display: none; } /* too tight next to the drawer button */
}

.site-nav { margin-left: 0; }
.site-nav > ul {
  display: flex; align-items: center; gap: 0.35rem;
  list-style: none; margin: 0; padding: 0;
}
.site-nav li { position: relative; }
.site-nav a {
  display: inline-block; padding: 0.5rem 0.7rem; border-radius: 7px;
  text-decoration: none; font-size: 0.94rem; color: var(--ink-dim);
  transition: color 160ms ease, background-color 160ms ease;
}
.site-nav a:hover,
.site-nav a.is-current { color: var(--ink); background: var(--bg-tint); }

.site-nav .cue-submenu {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.4rem;
  box-shadow: var(--shadow);
}
.site-nav .cue-submenu a { display: block; white-space: nowrap; color: var(--ink-dim); }
.cue-submenu-toggle { color: var(--ink-dim); vertical-align: middle; }

/* Link to the page you're already on. */
.site-nav a.is-current-page { color: var(--ink); background: var(--bg-tint); }
.site-nav .is-current-page-parent > a { color: var(--ink); }

/* Stays blue even when the menu pack marks it as the current page (on the
   home page its index.html#contact href matches the current URL). */
.cta, .site-nav a.cta.is-current-page {
  background: var(--brand); color: #fff !important;
  padding: 0.55rem 1.1rem !important; border-radius: 8px; font-weight: 600;
}
.cta:hover, .site-nav a.cta:hover { background: var(--brand-dk); }

/* ----------------------------------------------------------------- hero */
/* Fills most of a laptop screen, but the min-height is capped in rem so a
   tall portrait monitor doesn't get a hero that is mostly empty paper. */
.hero {
  position: relative; min-height: min(80svh, 46rem); display: grid; align-items: center;
  overflow: hidden; padding-block: clamp(7rem, 16vh, 10rem) clamp(3rem, 8vh, 6rem);
}
/* A soft wash rather than a photo — swap in the church photo when it arrives. */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 55% at 78% 30%, rgb(61 111 163 / 0.14), transparent 70%),
    radial-gradient(40% 40% at 15% 85%, rgb(184 146 63 / 0.10), transparent 70%);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero h1 { max-width: 14ch; }
.hero .lede { font-size: 1.15rem; max-width: 50ch; }

.scroll-hint {
  position: absolute; bottom: 1.6rem; left: 50%; translate: -50% 0;
  font-size: 0.74rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--ink-dim);
}

/* Hero art: the church itself, in a soft frame. */
.hero-art {
  margin: 0;
  justify-self: end;
  width: min(100%, 34rem);
}
.hero-art img {
  display: block; width: 100%; height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* "This Sunday" strip: the one thing a visitor wants to know, right under
   the hero — times on the left, where and how to get there on the right. */
.sunday-bar {
  background: var(--bg-raised);
  border-block: 1px solid var(--line);
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
}
.sunday-bar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.sunday-bar-grid > div + div {
  padding-left: clamp(1.5rem, 4vw, 3.5rem);
  border-left: 1px solid var(--line);
}
.sunday-label {
  display: block;
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.3rem;
}
.sunday-when {
  display: block;
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem);
  color: var(--brand-dk); line-height: 1.1;
}
.sunday-where address { color: var(--ink); font-size: 1.02rem; margin-bottom: 0.7rem; }
@media (max-width: 820px) {
  .sunday-bar-grid { grid-template-columns: 1fr 1fr; }
  .sunday-bar-grid > .sunday-where { grid-column: 1 / -1; padding-left: 0; border-left: 0;
    padding-top: 1.2rem; border-top: 1px solid var(--line); }
}
@media (max-width: 480px) {
  .sunday-bar-grid { grid-template-columns: 1fr; }
  .sunday-bar-grid > div + div { padding-left: 0; border-left: 0; padding-top: 1rem; border-top: 1px solid var(--line); }
}

.checks {
  list-style: none; margin: 1.6rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 1.5rem;
  max-width: 30rem;
}
.checks li {
  display: flex; align-items: center; gap: 0.6rem;
  font-weight: 600; font-size: 0.98rem;
}
.checks li::before {
  content: '\2713';
  display: grid; place-items: center;
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  color: var(--gold); font-size: 0.8rem; flex: none;
}

@media (max-width: 900px) {
  .hero { min-height: auto; padding-bottom: 1.5rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { width: min(100%, 22rem); }
  .scroll-hint { display: none; }
}

/* ---------------------------------------------------------------- bands */
.band { padding: clamp(5rem, 12vh, 9rem) 0; }
.band-tint { background: var(--bg-tint); border-block: 1px solid var(--line); }
.band-head { text-align: center; }
.band-head p { margin-inline: auto; max-width: 60ch; }

/* --------------------------------------------------------- service times */
/* Flex, not grid, so an odd tile on the last row centres instead of
   hanging off the left edge. Three across at desktop. */
.times-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.3rem;
  margin-top: 2.4rem;
}
.time-tile {
  flex: 1 1 17rem;
  max-width: 22.5rem;
  padding: 1.6rem 1.7rem;
  border-radius: 15px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  transition: box-shadow 250ms ease, border-color 250ms ease, transform 250ms ease;
}
.time-tile:hover, .time-tile:focus-within {
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.time-day {
  display: inline-block;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brand-dk);
  padding: 0.35rem 0.7rem; border-radius: 999px;
  background: var(--brand-lt);
  margin-bottom: 0.9rem;
}
.time-tile h3 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.time-when {
  font-family: var(--serif); font-weight: 600; font-size: 1.55rem;
  color: var(--ink); margin: 0;
}
.time-tile p { font-size: 0.92rem; margin: 0.5rem 0 0; }

/* -------------------------------------------------------------- photos */
.photo { margin: 0; }
.photo img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.photo figcaption { margin-top: 0.6rem; font-size: 0.88rem; color: var(--ink-dim); }

/* Services heading with the marker photo alongside. */
.times-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 820px) {
  .times-head { grid-template-columns: 1fr; }
  .times-head .photo { order: 2; }
}

/* Unmissable placeholder for details the church still has to supply.
   Must never ship — grep for .todo before launch. */
.todo {
  display: inline-block;
  color: #7a5200;
  background: #fff3cf;
  border-left: 3px solid #e0a72a;
  padding: 0.2rem 0.6rem;
  font-style: italic;
  font-size: 0.9rem;
}

/* --------------------------------------------------------------- creed */
/* Homepage teaser: one article of the statement as a pull-quote. */
.creed-teaser {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.creed-teaser > div > p { max-width: 58ch; }
.creed-teaser .creed-quote { margin: 1.4rem 0 0.4rem; }
.creed-quote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
  line-height: 1.45;
  color: var(--ink);
  padding-left: 1.4rem;
  border-left: 3px solid var(--gold);
}
.creed-quote p { color: inherit; max-width: none; margin: 0; }
@media (max-width: 820px) { .creed-teaser { grid-template-columns: 1fr; } }

/* Full statement of faith: numbered articles in the serif. */
.creed {
  list-style: none; counter-reset: article;
  margin: 0; padding: 0;
  max-width: 58rem;
  display: grid; gap: 0.9rem;
}
.creed li {
  counter-increment: article;
  display: grid; grid-template-columns: auto 1fr; gap: 1.3rem; align-items: start;
  padding: 1.4rem 1.6rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.creed li::before {
  content: counter(article, upper-roman);
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem;
  color: var(--gold); min-width: 2.2rem; padding-top: 0.15rem;
}
.creed p {
  margin: 0; max-width: 66ch;
  font-family: var(--serif); font-size: 1.08rem; line-height: 1.6; color: var(--ink);
}

/* ---------------------------------------------------------------- tract */
.tract-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.tract-grid > div > p { max-width: 54ch; }

/* The tract's four headings, as a numbered card. */
.tract-steps {
  list-style: none; counter-reset: step;
  margin: 0; padding: clamp(1.2rem, 2.5vw, 1.8rem);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid; gap: 0.2rem;
}
.tract-steps li {
  counter-increment: step;
  display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: baseline;
  padding: 0.75rem 0.4rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-dim);
}
.tract-steps li:last-child { border-bottom: 0; }
.tract-steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--brand-lt); color: var(--brand-dk);
  font-weight: 700; font-size: 0.85rem;
  align-self: center;
}
.tract-steps span {
  display: block;
  font-family: var(--serif); font-weight: 600; font-size: 1.12rem; color: var(--ink);
}
@media (max-width: 820px) {
  .tract-grid { grid-template-columns: 1fr; }
  .tract-grid .tract-steps { order: 2; } /* text leads on phones */
}

/* ------------------------------------------------------------------ map */
.mapsec {
  padding: clamp(5rem, 12vh, 9rem) 0;
  display: grid;
  align-items: center;
}
.mapsec-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.map-card h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
.map-card address {
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.45; color: var(--ink);
  margin: 0.4rem 0 0.9rem;
}
.map-phone {
  display: inline-block;
  font-weight: 700; font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem); line-height: 1;
  color: var(--brand-dk); text-decoration: none;
  border-bottom: 2px solid color-mix(in srgb, var(--brand) 45%, transparent);
  padding-bottom: 0.15rem;
}
.map-phone:hover, .map-phone:focus-visible { color: var(--ink); border-bottom-color: var(--brand); }
.map-note { margin-top: 1.4rem; font-size: 0.92rem; }

/*
 * Deliberately modest. Leaflet's cost scales with the map's pixel area; a
 * 620x440 panel is roughly a quarter of the tiles a full-bleed map needs.
 */
.map-panel {
  aspect-ratio: 7 / 5;
  max-height: 48svh;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--bg-raised);
}

/* Pin colours, consumed by cue.css. */
.map-panel {
  --cue-pin-color: #c2412d;
  --cue-pin-label-bg: rgb(255 255 255 / 0.96);
  --cue-pin-label-color: #2b3440;
}
.map-panel .cue-pin-label { font-size: 14px; font-weight: 700; }

@media (max-width: 820px) {
  .mapsec-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .map-panel { max-height: 40svh; }
}

/* ------------------------------------------------------ inner-page head */
/* Inner pages open with extra air above the h1, echoing the home hero. */
.page-head { padding-top: clamp(8rem, 20vh, 13rem); padding-bottom: clamp(2rem, 5vh, 3.5rem); }
.page-head h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.4rem);
  max-width: 24ch;
}
.page-head .lede { max-width: 62ch; }
/* Header with artwork alongside: text left, the angel right. */
.page-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.page-head-angel { margin: 0; width: clamp(12rem, 22vw, 19rem); justify-self: end; }
.page-head-angel img {
  display: block; width: 100%; height: auto;
  filter: drop-shadow(0 10px 28px rgb(184 146 63 / 0.22));
}
@media (max-width: 700px) {
  .page-head-grid { grid-template-columns: 1fr; }
  .page-head-angel { justify-self: center; width: 12rem; }
}
.page-head .lede a { color: var(--brand-dk); }
.page-cta a { color: var(--brand-dk); }

/* --------------------------------------------------------------- footer */
.site-footer {
  padding: 3.5rem 0 0;
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
}
.foot-grid {
  display: grid;
  grid-template-columns: auto 1.4fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
  padding-bottom: 2.5rem;
}
.foot-photo { display: block; width: clamp(9rem, 14vw, 13rem); }
.foot-photo img {
  display: block; width: 100%; height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.foot-brand { display: flex; align-items: center; gap: 0.9rem; }
.foot-brand img { display: block; height: 3.4rem; width: auto; }
.foot-name {
  font-family: var(--serif); font-weight: 600; font-size: 1.15rem;
  color: var(--ink); margin: 0; line-height: 1.25;
}
.foot-name span { display: block; color: var(--brand-dk); font-weight: 500; font-size: 0.95rem; }
.foot-where { font-size: 0.95rem; color: var(--ink-dim); line-height: 1.55; }
.foot-where a { color: var(--brand-dk); text-decoration: none; font-weight: 600; }
.foot-where a:hover, .foot-where a:focus-visible { color: var(--ink); }
.foot-col h4 {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-dim); margin: 0 0 0.8rem;
}
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.foot-col a { text-decoration: none; font-size: 0.92rem; color: var(--ink-dim); }
.foot-col a:hover, .foot-col a:focus-visible { color: var(--brand-dk); }
.foot-legal { border-top: 1px solid var(--line); padding-block: 1.1rem; }
.foot-legal p { font-size: 0.82rem; margin: 0; }
@media (max-width: 820px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-photo, .foot-brand { grid-column: 1 / -1; }
}

/*
 * Drawer skin. cue.css handles position/transition; appearance is ours.
 * These hang off .cue-drawer-mode, which the drawer effect toggles at its
 * breakpoint — no media query needed here.
 */
.site-nav.cue-drawer-mode {
  background: var(--bg-raised);
  border-left: 1px solid var(--line);
  padding: 5rem 1.4rem 2rem;
}
.site-nav.cue-drawer-mode > ul { display: block; }
.site-nav.cue-drawer-mode li { margin-bottom: 0.25rem; }
.site-nav.cue-drawer-mode a {
  display: block;
  padding: 0.7rem 0.8rem;
  font-size: 1.05rem;
}
.site-nav.cue-drawer-mode .cue-has-submenu { display: flex; flex-wrap: wrap; align-items: center; }
.site-nav.cue-drawer-mode .cue-has-submenu > a { flex: 1; }
.site-nav.cue-drawer-mode .cue-submenu { width: 100%; padding: 0.2rem 0 0.4rem 0.8rem; }
.site-nav.cue-drawer-mode .cue-submenu a { font-size: 0.95rem; padding: 0.5rem 0.8rem; }

.cue-drawer-toggle { color: var(--ink); margin-left: auto; }
/* Keep the toggle usable while the header itself is peeking/hidden. */
.site-header .cue-drawer-toggle { position: relative; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
