/* ============================================================
   Boughton Monchelsea Churches — St Peter's & Junction
   ------------------------------------------------------------
   One stylesheet for the whole site. Colours and fonts are
   defined once below; change them here and every page updates.
   ============================================================ */

/* ---------- Self-hosted fonts (SIL Open Font License) ----------
   Served from our own host — the site makes no third-party requests,
   so no visitor data goes anywhere else and no cookie banner is needed. */

@font-face {
  font-family: "Young Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/young-serif-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/albert-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Albert Sans";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/albert-sans-italic-latin.woff2") format("woff2");
}

:root {
  /* Palette — drawn from the village itself */
  --ink: #232c26;        /* green-black, main text */
  --ink-soft: #55645b;   /* secondary text */
  --green: #2f5d44;      /* deep Wealden green — primary */
  --green-deep: #244835; /* darker green for footer / hover */
  --green-tint: #e8efe9; /* pale green wash */
  --ragstone: #f1ecdf;   /* warm Kentish ragstone — section bands */
  --wisteria: #6f4f9e;   /* the churchyard wisteria: the accent colour */
  --wisteria-deep: #5b3f8c; /* darker wisteria for the quote band */
  --wisteria-pale: #b7a2da; /* pale blossom, for small touches on dark */
  --candle: #f7e6ae;     /* the light in the doorway: buttons on green */
  --rose: #ab4255;       /* Rose Festival: kept for festival touches only */
  --brass: #a8842c;      /* brass/key accent — tiny touches only */
  --paper: #fcfbf7;      /* page background */
  --line: #d9d3c4;       /* hairlines on ragstone */

  --font-display: "Young Serif", Georgia, serif;
  --font-body: "Albert Sans", "Segoe UI", Arial, sans-serif;

  --measure: 62ch;       /* comfortable reading width */
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- Reset & base ---------- */

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h3 { font-size: 1.25rem; font-family: var(--font-body); font-weight: 700; }

p { margin: 0 0 1em; max-width: var(--measure); }

a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-deep); }
a[href^="tel:"] { white-space: nowrap; }

:focus-visible {
  outline: 3px solid var(--wisteria);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Keyboard users: first tab stop jumps past the menu */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 10;
  background: var(--green-deep);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Read out by screen readers but not shown, e.g. a heading that keeps
   the page outline in order where a visible one isn't wanted. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Small uppercase label above headings */
.eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wisteria);
  margin-bottom: 0.9rem;
}

/* ---------- Cross divider ----------
   A small brass cross used between sections.        */

.waymark {
  border: 0;
  margin: 0 auto;
  width: 34px;
  height: 34px;
  position: relative;
  overflow: visible;
}
.waymark::before, .waymark::after {
  content: "";
  position: absolute;
  background: var(--brass);
  border-radius: 2px;
}
.waymark::before { left: 50%; top: 0; width: 3px; height: 100%; transform: translateX(-50%); }
.waymark::after  { top: 50%; left: 0; height: 3px; width: 100%; transform: translateY(-50%); }

/* ---------- Header & navigation ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem var(--pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}
.brand svg, .brand img { width: 40px; height: 40px; flex: none; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
}
.brand-name small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
}
.site-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 0.3rem 0;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--green); }
.site-nav a[aria-current="page"] {
  color: var(--green);
  border-bottom-color: var(--wisteria);
}

/* ---------- Hero ---------- */

.hero {
  background: var(--green);
  color: #f2f5ef;
  overflow: hidden;
}
.hero-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 3rem;
  align-items: center;
}
.hero .eyebrow { color: #d9c78a; }
.hero h1 { color: #ffffff; }
.hero p { color: #dbe6dc; font-size: 1.15rem; }
.hero-art { justify-self: center; width: min(100%, 290px); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.8rem; }

.button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
}
.button-primary { background: var(--candle); color: var(--green-deep); }
.button-primary:hover { background: #fff3cf; color: var(--green-deep); }
.button-ghost { border-color: #ffffff88; color: #fff; }
.button-ghost:hover { border-color: #fff; color: #fff; background: #ffffff14; }

/* On light backgrounds */
.button-green { background: var(--green); color: #fff; }
.button-green:hover { background: var(--green-deep); color: #fff; }
.button-outline { border-color: var(--green); color: var(--green); }
.button-outline:hover { background: var(--green-tint); }

/* ---------- Sections ---------- */

.section { padding: clamp(3rem, 7vw, 5rem) var(--pad); }
.section-inner { max-width: 72rem; margin: 0 auto; }
.section-narrow { max-width: 46rem; margin: 0 auto; }
.section-ragstone { background: var(--ragstone); }
.section-tint { background: var(--green-tint); }
.section-center { text-align: center; }
.section-center p { margin-inline: auto; }

.lead { font-size: 1.2rem; color: var(--ink-soft); }

/* ---------- Two-church cards ---------- */

.church-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.church-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: 10px;
  padding: 1.8rem;
  overflow: hidden;
}
.church-card.is-junction { border-top-color: var(--wisteria); }
/* Drawing at the top of each card (assets/illustrations/). Its cream
   background matches the card; "multiply" hides any slight difference. */
.church-art {
  display: block;
  width: 100%;
  height: auto;
  margin: -0.4rem 0 1.2rem;
  mix-blend-mode: multiply;
}
.church-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; }
.church-card .where {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

/* ---------- Sunday timetable ---------- */

.sunday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.sunday-col {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem 1.8rem;
}
.sunday-col h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}
.service { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.service:last-child { border-bottom: 0; padding-bottom: 0; }
.service time {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--green);
  display: block;
}
.service.is-junction time { color: var(--wisteria); }
.service strong { display: block; margin-top: 0.15rem; }
.service span { color: var(--ink-soft); font-size: 0.95rem; }

/* Small picture beside a service (assets/icons/icon-*.svg) */
.service.has-icon {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 1rem;
}
.service.has-icon > * { grid-column: 2; }
.service.has-icon > .service-icon {
  grid-column: 1;
  grid-row: 1 / span 3;
  width: 44px;
  height: 44px;
  margin-top: 0.2rem;
}
.sunday-col h3.sunday-subhead { margin-top: 1.4rem; }
.service a { display: block; margin-top: 0.6rem; font-weight: 600; }

/* Messy Church column: their own red splat */
.sunday-col.is-messy { border-top: 5px solid #d2232a; }
.messy-mark { width: 9rem; height: auto; margin-bottom: 0.6rem; mix-blend-mode: multiply; }

.icon-key {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

/* Small picture at the top of a group card */
.group-icon { width: 48px; height: 48px; margin-bottom: 0.6rem; }

/* ---------- Values ---------- */

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  text-align: left;
}
.value h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--green);
}
.value h3::after {
  content: "";
  display: block;
  width: 2.2rem;
  height: 3px;
  background: var(--wisteria);
  margin-top: 0.5rem;
  border-radius: 2px;
}

/* ---------- Groups / community cards ---------- */

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.group-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.6rem;
}
.group-card .when {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wisteria);
}
.group-card p { margin-bottom: 0; }

/* ---------- Quote band ---------- */

.quote-band { background: var(--wisteria-deep); color: #f6f2fb; text-align: center; }
.quote-band blockquote {
  margin: 0 auto;
  max-width: 40ch;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  line-height: 1.3;
}
.quote-band cite {
  display: block;
  margin-top: 1.2rem;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ddd2f0;
}

/* ---------- Contact & footer ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.contact-grid h3 { margin-bottom: 0.4rem; }
.contact-grid p { margin-bottom: 0.3rem; }

.role {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wisteria);
}

/* Small portrait photo above a name (safeguarding contacts).
   Portrait 3:4 with rounded corners, so the whole face shows. */
.avatar {
  width: 96px;
  height: 128px;
  margin-bottom: 0.8rem;
  border-radius: 10px;
  object-fit: cover;
  border: 3px solid var(--paper);
}

/* Team photos (contact page) */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: 2rem 1.5rem;
  max-width: 48rem;  /* three to a row, so six people make two even rows */
  margin-top: 2rem;
}
.person { margin: 0; text-align: center; }
.person img {
  width: 140px;
  height: 140px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--green-tint);
}
.person .initials {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  border: 4px solid var(--green-tint);
  background: var(--wisteria);
  color: #fff;
  font-family: var(--font-display);
  font-size: 2.6rem;
}
.person figcaption { display: flex; flex-direction: column; gap: 0.2rem; }
.person strong { font-size: 1.05rem; }
.person a { font-size: 0.92rem; overflow-wrap: anywhere; }

/* Highlighted box (safeguarding emergency notice) */
.callout {
  background: var(--green-tint);
  border-left: 5px solid var(--wisteria);
  border-radius: 0 10px 10px 0;
  padding: 1.3rem 1.6rem;
}
.callout p:last-child { margin-bottom: 0; }

.site-footer {
  background: var(--green-deep);
  color: #cfdccf;
  font-size: 0.95rem;
}
.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem var(--pad);
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}
.site-footer a { color: #ffffff; }
.site-footer p { margin: 0 0 0.4rem; }
.footer-brand { font-family: var(--font-display); font-size: 1.1rem; color: #fff; }

/* ---------- Page hero (inner pages) ---------- */

.page-hero { background: var(--ragstone); border-bottom: 1px solid var(--line); }
.page-hero .section-inner { max-width: 46rem; }

/* ---------- Responsive ---------- */

@media (max-width: 47rem) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; width: min(45%, 170px); }
}

/* ---------- Photos ---------- */

.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.photo-strip figure, .article-body figure, .article-photo { margin: 0 0 1.2rem; }
.photo-strip img, .article-photo img, .article-body figure img {
  width: 100%;
  border-radius: 10px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.photo-strip figcaption, .article-body figcaption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}
.card-photo {
  margin: -1.8rem -1.8rem 1.2rem;
  overflow: hidden;
  border-radius: 0 0 0 0;
}
.card-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* ---------- Feature block (e.g. Messy Church) ---------- */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 2.5rem;
  align-items: center;
  margin-top: 2rem;
}
.feature img { width: 100%; border-radius: 10px; }
.feature img.feature-tall { max-height: 34rem; object-fit: contain; }
.feature img.feature-logo { max-width: 15rem; height: auto; justify-self: center; }
.feature .when {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wisteria);
}
@media (max-width: 47rem) {
  .feature { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------- News cards & articles ---------- */

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.news-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.news-card > a img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.news-card-text { padding: 1.4rem 1.6rem 1.6rem; }
.news-card .when {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wisteria);
  margin-bottom: 0.4rem;
}
.news-card h3 { margin-bottom: 0.4rem; }
.news-card h3 a { text-decoration: none; color: var(--ink); }
.news-card h3 a:hover { color: var(--green); }
.news-card p:last-child { margin-bottom: 0; }

.article-body blockquote {
  margin: 1.5rem 0;
  padding-left: 1.2rem;
  border-left: 4px solid var(--wisteria);
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.event-box {
  background: var(--ragstone);
  border-left: 4px solid var(--green);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.4rem;
  margin: 0 0 1.5rem;
}
.event-box p { margin: 0.2rem 0; }
.back-link { margin-top: 2.5rem; }

/* ---------- Before / after (What's changed page) ----------
   Shows an old and a new logo or picture side by side. */

.before-after {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0.9rem 0 0.4rem;
}
.before-after figure {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.2rem 0.7rem;
  text-align: center;
}
.before-after img {
  width: auto;
  height: 96px;
  max-width: min(100%, 14rem);
  object-fit: contain;
  margin: 0 auto;
  border-radius: 4px;
}
.before-after figcaption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Page header with illustration ----------
   Add class "has-icon" to a page-hero and put the illustration
   (assets/icons/header-*.svg) before the text, as in the header mockups. */

.page-hero.has-icon .section-inner {
  max-width: 58rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem 2.75rem;
  align-items: center;
}
.page-hero .hero-icon { width: 170px; height: auto; }
@media (max-width: 40rem) {
  .page-hero.has-icon .section-inner { grid-template-columns: 1fr; }
  .page-hero .hero-icon { width: 120px; }
}
