/* ============================================================
   St Paul's Carcoar — single stylesheet
   No frameworks. Mobile-first, fluid, responsive.
   ============================================================ */

:root {
  --sand:      #f4ede1;   /* warm page background  */
  --sand-deep: #e9dcc6;   /* alternating sections   */
  --ink:       #2b2520;   /* body text              */
  --ink-soft:  #6f6453;   /* captions / meta        */
  --stone:     #b5532a;   /* terracotta-brick accent*/
  --stone-dk:  #8f3f1f;
  --gold:      #b8902f;   /* secondary accent       */
  --line:      #cdbfa6;   /* hairline rules         */
  --white:     #fffdf8;

  --maxw: 1180px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r: 4px;
  --shadow: 0 18px 40px -22px rgba(43, 37, 32, .55);
}

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

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

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.65;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--stone-dk); }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 560;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ---------- shared layout ---------- */
.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }

.eyebrow {
  font-family: var(--body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 .9rem;
}

/* ============================================================
   Header / navigation
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--sand) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
}
.brand {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--stone); }

.nav-links {
  list-style: none;
  display: flex;
  gap: .35rem;
  margin: 0;
  padding: 0;
}
.nav-links a {
  display: block;
  padding: .5rem .85rem;
  border-radius: var(--r);
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: .98rem;
  transition: background .18s, color .18s;
}
.nav-links a:hover,
.nav-links a:focus-visible { background: var(--sand-deep); }
.nav-links a[aria-current="page"] { color: var(--stone); }

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--r);
  width: 44px; height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 20px; height: 2px;
  background: var(--ink);
  position: relative;
  transition: transform .25s, opacity .2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after  { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--sand);
    border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: .75rem .25rem; border-bottom: 1px solid var(--line); }
  .nav-links li:last-child a { border-bottom: 0; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: clamp(420px, 72vh, 720px);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--white);
  padding: 5rem 1.25rem;
  background-size: cover;
  background-position: center;
  background-color: #4a3f33;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(30,24,18,.45), rgba(30, 24, 18, 0.449));
}
.hero > * { position: relative; z-index: 1; }

.hero-home { background-image: url(images/church/church_img1.jpg); }
.hero-fundraising { background-image: url(images/fundraising/GratitudePhoto.jpg); }
.hero-history { background-image: url(images/history/historic-carcoar.jpg); }
.hero-carcoar { background-image: url(images/carcoar2.jpg); }

.hero .eyebrow { color: var(--sand-deep); }
.hero h1 {
  font-size: clamp(2.4rem, 1.6rem + 3.8vw, 4.6rem);
  font-weight: 600;
  text-shadow: 0 2px 24px rgba(0,0,0,.4);
  max-width: 16ch;
  margin-inline: auto;
}
.hero p.lede {
  margin: 1.1rem auto 0;
  max-width: 50ch;
  font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem);
  color: #f3e9d8;
  text-shadow: 0 1px 12px rgba(0,0,0,.5);
}

/* hero logo row (home) */
.hero-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3rem);
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.hero-logos img { filter: drop-shadow(0 4px 12px rgba(0,0,0,.4)); }
.hero-logos .crest { width: clamp(110px, 22vw, 180px); height: auto; }
.hero-logos .partner { width: clamp(70px, 13vw, 110px); height: auto; }

/* ============================================================
   Sections
   ============================================================ */
.section { padding: clamp(3rem, 6vw, 5.5rem) 0; }
.section--alt { background: var(--sand-deep); }
.section--cream { background: #fff7ec; }

.section-head { max-width: 60ch; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.9rem); }
.section-head p { color: var(--ink-soft); margin: .6rem 0 0; }
.section-head.center { margin-inline: auto; text-align: center; }

/* page intro banner (history / carcoar headings) */
.page-banner {
  text-align: center;
  padding: clamp(2.5rem, 5vw, 4rem) 1.25rem 0;
}
.page-banner h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem);
  color: var(--stone-dk);
  max-width: 18ch;
  margin-inline: auto;
}
.page-banner .eyebrow { justify-self: center; }

/* ---------- two-column feature row ---------- */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.feature + .feature { margin-top: clamp(2.5rem, 5vw, 4rem); }
.feature.reverse .feature-body { order: 2; }
.feature-media img {
  width: 100%;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  object-fit: cover;
}
.feature-body h2,
.feature-body h3 {
  color: var(--stone-dk);
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
  margin-bottom: .75rem;
}
.feature-body p { margin: 0 0 1rem; }
.feature-body p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .feature.reverse .feature-body { order: 0; }
}

/* ---------- gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.gallery a {
  display: block;
  overflow: hidden;
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.gallery img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .5s ease;
}
.gallery a:hover img,
.gallery a:focus-visible img { transform: scale(1.06); }

/* ---------- timeline (history) ---------- */
.timeline { position: relative; }
.timeline-item { position: relative; }
.timeline-item .feature-body h2::before {
  content: attr(data-year);
  display: inline-block;
  font-family: var(--body);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, transparent);
  padding: .25rem .6rem;
  border-radius: 99px;
  margin-bottom: .7rem;
}

/* ============================================================
   Fundraising
   ============================================================ */
.prose { max-width: 64ch; margin-inline: auto; }
.prose p { margin: 0 0 1.1rem; font-size: 1.15rem; }
.success-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--body);
  font-weight: 700;
  letter-spacing: .05em;
  color: #2f7d4f;
  background: #e3f1e6;
  border: 1px solid #bfe0c6;
  padding: .4rem .9rem;
  border-radius: 99px;
  font-size: .9rem;
  margin-bottom: 1.2rem;
}
.donate-card {
  margin-top: 2rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--stone);
  border-radius: var(--r);
  padding: 1.5rem 1.75rem;
}
.donate-card h3 { color: var(--stone-dk); font-size: 1.3rem; margin-bottom: .75rem; }
.donate-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .3rem 1.25rem; }
.donate-card dt { color: var(--ink-soft); font-weight: 600; }
.donate-card dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: .02em; }

/* ============================================================
   Contact form
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

.field { display: block; margin-bottom: 1.1rem; }
.field span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--ink); }
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: .8rem .95rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  transition: border-color .18s, box-shadow .18s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--stone);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--stone) 22%, transparent);
}
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  border: 0;
  border-radius: var(--r);
  padding: .85rem 1.8rem;
  color: var(--white);
  background: var(--stone);
  transition: background .18s, transform .1s;
}
.btn:hover { background: var(--stone-dk); }
.btn:active { transform: translateY(1px); }

.form-success {
  width: 100%;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.form-success[hidden],
.form-error[hidden] { display: none; }
.form-success h3 { margin-bottom: .6rem; }
.form-success p { margin: 0 auto 1.4rem; max-width: 46ch; color: var(--ink-soft); }
.form-error { margin: .8rem 0 0; color: #9f2f2f; font-size: .9rem; }
.ajax-form.is-submitting { opacity: .7; }
.ajax-form button[type="submit"]:disabled { cursor: wait; }

/* ============================================================
   Contact details strip
   ============================================================ */
.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1.25rem 1.4rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .18s, transform .18s;
}
.contact-item:hover { border-color: var(--stone); transform: translateY(-2px); }
.contact-item .ico {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--stone) 12%, transparent);
  color: var(--stone-dk);
}
.contact-item .ico svg { width: 22px; height: 22px; }
.contact-item > span:last-child { display: flex; flex-direction: column; gap: .15rem; }
.contact-item .label { font-size: .72rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .12em; }
.contact-item .value { font-weight: 600; word-break: break-word; line-height: 1.3; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: .9rem;
}
.site-footer .brand { font-size: 1.05rem; }
.site-footer nav { margin: .8rem 0; }
.site-footer nav a { color: var(--ink-soft); text-decoration: none; margin: 0 .6rem; }
.site-footer nav a:hover { color: var(--stone); }

/* ============================================================
   Accessibility / motion
   ============================================================ */
:focus-visible { outline: 2px solid var(--stone); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .gallery img { transition: none; }
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20,16,12,.92);
  display: none;
  align-items: center; justify-content: center;
  padding: 1.5rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: var(--r); box-shadow: var(--shadow); }
.lightbox button {
  position: absolute; top: 1rem; right: 1.25rem;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lightbox button:hover { background: rgba(255,255,255,.28); }
