/* Layout: a painted prairie opens the page (sky, shelterbelt, a field of grain
   drawn by site.js), the Sunday times sit on the field's edge, then calm sections
   alternate between open page and one pale-sky band for Scripture. */
:root {
  --bg: #f7f8f4;
  --surface: #ffffff;
  --ink: #24291f;
  --muted: #5d6555;
  --rule: #dde1d6;
  --accent: #2f5873;
  --accent-ink: #ffffff;
  --gold: #a87c28;
  --wash: #eaf1f4;

  /* Season palette (site.js sets data-season); harvest is the default */
  --s-sky-top: #a8c3d8;
  --s-sky-low: #f3eedf;
  --s-sun: rgba(255, 226, 160, 0.85);
  --s-field-deep: #a9853a;
  --sky-top: var(--s-sky-top);
  --sky-low: var(--s-sky-low);
  --sun: var(--s-sun);
  --field-deep: var(--s-field-deep);
  --stars: 0;

  --display: "Libre Caslon Display", "Big Caslon", "Palatino Linotype", Georgia, serif;
  --text-serif: "Libre Caslon Text", "Palatino Linotype", Georgia, serif;
  --body: "Public Sans", "Segoe UI", system-ui, -apple-system, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: clamp(1.75rem, 1.4rem + 1.5vw, 2.4rem);
  --step-3: clamp(2.4rem, 1.4rem + 3.6vw, 4.1rem);

  --measure: 38rem;
  --wide: 68rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --field-h: clamp(170px, 24vw, 300px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161a;
    --surface: #182026;
    --ink: #e6e9e3;
    --muted: #a4ad9f;
    --rule: #2a343b;
    --accent: #a9c8dd;
    --accent-ink: #11161a;
    --gold: #d6b062;
    --wash: #16212a;
    --sky-top: #060b16;
    --sky-low: #1b2940;
    --sun: rgba(210, 225, 255, 0.16);
    --field-deep: color-mix(in srgb, var(--s-field-deep) 60%, #11161a);
    --stars: 1;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11161a;
  --surface: #182026;
  --ink: #e6e9e3;
  --muted: #a4ad9f;
  --rule: #2a343b;
  --accent: #a9c8dd;
  --accent-ink: #11161a;
  --gold: #d6b062;
  --wash: #16212a;
  --sky-top: #060b16;
  --sky-low: #1b2940;
  --sun: rgba(210, 225, 255, 0.16);
  --field-deep: color-mix(in srgb, var(--s-field-deep) 60%, #11161a);
  --stars: 1;
  color-scheme: dark;
}

/* ---------- Seasons (prairie months; set by site.js) ---------- */
:root[data-season="winter"]  { --s-sky-top: #b9c8d6; --s-sky-low: #eef2f6; --s-sun: rgba(255, 250, 240, 0.7);  --s-field-deep: #9fb0bf; }
:root[data-season="spring"]  { --s-sky-top: #a9cbe3; --s-sky-low: #eef5f1; --s-sun: rgba(255, 246, 214, 0.75); --s-field-deep: #6f8c45; }
:root[data-season="summer"]  { --s-sky-top: #8fbde0; --s-sky-low: #eaf3f5; --s-sun: rgba(255, 240, 190, 0.8);  --s-field-deep: #b5971a; }
:root[data-season="harvest"] { --s-sky-top: #a8c3d8; --s-sky-low: #f3eedf; --s-sun: rgba(255, 226, 160, 0.85); --s-field-deep: #a9853a; }
:root[data-season="fall"]    { --s-sky-top: #b4c0cb; --s-sky-low: #efede6; --s-sun: rgba(255, 232, 190, 0.6);  --s-field-deep: #8c7553; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--surface); color: var(--ink); padding: 0.5rem 1rem;
}
.skip:focus { left: var(--gutter); z-index: 10; }

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.1;
  text-wrap: balance;
  margin: 0;
}
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0; }

.label {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Hero: sky + painted field ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 60% at 78% 100%, var(--sun), transparent 70%),
    linear-gradient(to bottom, var(--sky-top), var(--sky-low) 85%);
  padding-bottom: calc(var(--field-h) - 1.5rem);
}
/* Stars appear only in the dark theme */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 var(--field-h) 0;
  opacity: var(--stars);
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 27% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 61% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 70% 36%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 84% 16%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 92% 44%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 52%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 46% 56%, #fff 50%, transparent 51%);
  background-size: 640px 360px;
}
.hero > * { position: relative; }
.hero canvas.field {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: var(--field-h);
  display: block;
}

.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-block: 1.25rem;
}
.brand {
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  padding-block: 0.25rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--gold); }

.hero-copy {
  display: grid;
  gap: 1.1rem;
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem);
}
.hero-copy > * { max-width: 44rem; }
.hero h1 { font-size: var(--step-3); letter-spacing: -0.01em; }
.hero .lede { font-size: var(--step-1); line-height: 1.5; max-width: 34rem; }
.hero .label { color: var(--ink); opacity: 0.8; }
.hero--short h1 { font-size: clamp(2.2rem, 1.5rem + 3.5vw, 3.75rem); }
.hero--short { --field-h: clamp(120px, 15vw, 190px); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; padding-top: 0.5rem; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: start;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 2px solid var(--accent);
}
.button:hover { filter: brightness(1.1); }
.button--quiet {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 25%, transparent);
}
.button--quiet:hover { filter: none; border-color: var(--ink); }

/* ---------- Sunday times: resting on the field's edge ---------- */
.sunday {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * clamp(1.75rem, 4vw, 3rem));
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 10px 30px -18px rgba(40, 35, 20, 0.45);
  padding: clamp(1.25rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(0, 1fr)) minmax(0, 1.3fr);
  gap: 1rem 2rem;
  align-items: center;
}
.sunday h2 { font-size: var(--step-1); }
.sunday .time { display: grid; gap: 0.1rem; }
.sunday .time span { font-size: var(--step--1); color: var(--muted); font-weight: 500; }
.sunday .time strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sunday .note { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 820px) {
  .sunday { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sunday h2, .sunday .note { grid-column: 1 / -1; }
}
/* Stacked variant for the contact page sidebar */
.sunday--stack { margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); align-self: start; }
.sunday--stack h2, .sunday--stack .note { grid-column: 1 / -1; }

/* ---------- Sections ---------- */
main > section, main > .wrap { margin-top: clamp(3.5rem, 8vw, 6rem); }
main > .wrap:first-child { margin-top: 0; }

.prose { display: grid; gap: 1.1rem; max-width: var(--measure); min-width: 0; align-content: start; }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 760px) { .intro { grid-template-columns: minmax(0, 1fr); } }

.church-photo { margin: 0; display: grid; gap: 0.6rem; }
.church-photo img,
.photo-placeholder {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.photo-placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--muted);
  font-size: var(--step--1);
  border: 1px dashed color-mix(in srgb, var(--muted) 50%, transparent);
  background:
    linear-gradient(to bottom, transparent 68%, color-mix(in srgb, var(--field-deep) 30%, transparent) 68%),
    linear-gradient(to bottom, var(--wash), var(--bg));
}
.church-photo figcaption { font-size: var(--step--1); color: var(--muted); }

.pull {
  font-family: var(--text-serif);
  font-style: italic;
  font-size: var(--step-1);
  line-height: 1.5;
}

.visit { display: grid; gap: 2rem; }
.visit-head { display: grid; gap: 0.75rem; max-width: var(--measure); }
.visit-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem clamp(1.5rem, 4vw, 3rem);
}
@media (max-width: 700px) { .visit-list { grid-template-columns: minmax(0, 1fr); } }
.visit-list div {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  padding-top: 1rem;
  border-top: 2px solid var(--field-deep);
}
.visit-list dt { font-family: var(--display); font-size: var(--step-1); }
.visit-list dd { margin: 0; color: var(--muted); }

/* ---------- Scripture band ---------- */
.band {
  background: var(--wash);
  padding-block: clamp(3rem, 7vw, 5rem);
}
.scripture .wrap { display: grid; gap: 2rem; }
.verses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem clamp(1.5rem, 4vw, 3.5rem);
}
.verses blockquote { margin: 0; display: grid; gap: 0.75rem; align-content: start; }
.verses p {
  font-family: var(--text-serif);
  font-size: 1.15rem;
  line-height: 1.6;
}
.verses blockquote:first-child { grid-column: 1 / -1; max-width: 48rem; }
.verses blockquote:first-child p {
  font-family: var(--display);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem);
  line-height: 1.3;
}
.verses cite {
  font-style: normal;
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--gold);
  letter-spacing: 0.06em;
}
@media (max-width: 640px) { .verses { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Finding us ---------- */
.find {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.landmarks { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.75rem; }
.landmarks li {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: baseline;
}
.landmarks li::before {
  content: "";
  width: 0.6rem; height: 0.6rem;
  border-radius: 50%;
  background: var(--field-deep);
  justify-self: center;
}
@media (max-width: 760px) { .find { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Further reading ---------- */
.links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 960px) { .links { grid-template-columns: minmax(0, 1fr); } }
.links a {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.links a:hover { border-color: var(--accent); }
.links strong { font-family: var(--display); font-size: var(--step-1); font-weight: 400; }
.links span { color: var(--muted); font-size: var(--step--1); }
.links .host { color: var(--accent); overflow-wrap: anywhere; }

/* ---------- Contact page ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding-top: clamp(2.5rem, 6vw, 4rem);
}
@media (max-width: 760px) { .contact { grid-template-columns: minmax(0, 1fr); } }
.contact-list { margin: 0; display: grid; gap: 1.5rem; }
.contact-list dt { margin-bottom: 0.2rem; }
.contact-list dd { margin: 0; font-size: var(--step-1); font-family: var(--display); overflow-wrap: anywhere; }
.contact-list dd small { display: block; font-family: var(--body); font-size: var(--step--1); color: var(--muted); }

/* ---------- Footer ---------- */
.site-foot {
  margin-top: clamp(4rem, 9vw, 7rem);
  border-top: 6px solid var(--field-deep);
  background: var(--surface);
  padding-block: 2rem;
  font-size: var(--step--1);
  color: var(--muted);
}
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.site-foot strong { color: var(--ink); font-family: var(--display); font-size: 1.1rem; font-weight: 400; }
.site-foot p + p { margin-top: 0.25rem; }
.site-foot .credit { flex-basis: 100%; padding-top: 1rem; border-top: 1px solid var(--rule); }

.hero, .site-foot { transition: background 0.6s ease, border-color 0.6s ease; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
