/* Church Lane, Backwell Farleigh — "Navy & Stone"
   Sans only. No gradients, no photography, one subtle card shadow, corners 2–4px. */

/* Self-hosted. The site makes no third-party requests of any kind.
   Both families are variable fonts, so one file per family covers every weight
   we use — hence a weight range rather than one @font-face per weight.
   Downloaded by scripts/fetch-fonts.ts; SIL OFL 1.1, see /fonts/OFL.txt. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 500 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400 600;
  font-stretch: 100%;
  font-display: swap;
  src: url("/fonts/public-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #17263c;
  --muted: #5a6472;
  --line: #d8d7d1;
  --line-soft: #e8e7e2;
  --surface: #ffffff;
  --bg: #f5f4f0;
  --accent: #1d3a5f;
  --accent-deep: #0c1728;
  --mark: #8a6a3c;

  --measure: 760px;
  --rail-width: 190px;
  --gutter: 24px;

  --font-heading: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-body: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  --step-0: 1.0625rem;
  --step-1: 1.1875rem;
  --step-2: 1.4375rem;
  --step-3: 1.75rem;
  --step-4: 2.125rem;
  --step-5: 2.625rem;

  --radius: 3px;
  --card-shadow: 0 1px 2px rgba(12, 23, 40, 0.06);
}

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

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  color: var(--accent-deep);
  line-height: 1.2;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0 0 1.15em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-deep);
}

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

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

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent-deep);
  color: #fff;
  padding: 0.7rem 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Layout ---------- */

.shell {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Masthead ---------- */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 2.75rem 0 2.25rem;
}

.masthead h1 {
  font-size: var(--step-5);
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.masthead .standfirst {
  font-size: var(--step-1);
  color: var(--muted);
  max-width: 60ch;
  margin: 0;
}

/* ---------- Status chips ---------- */

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 1.75rem 0 0;
}

.chip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  background: var(--bg);
  line-height: 1.35;
}

.chip .chip-detail {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mark);
}

.chip .chip-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
}

/* ---------- The rail (sheet margin) ---------- */

.rail {
  display: none;
}

@media (min-width: 1240px) {
  .rail {
    display: block;
    /* Fades out as the footer arrives. See .rail[data-over-footer] below. */
    transition: opacity 200ms ease, visibility 0s;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: max(var(--gutter), calc(50vw - (var(--measure) / 2) - var(--rail-width) - 24px));
    width: var(--rail-width);
    z-index: 20;
  }

  /*
   * The rail is fixed and vertically centred, so at the foot of the page the
   * navy footer scrolls up behind it. Its text is --muted (2.99:1 there), its
   * numbers --mark (3.60:1) and the current-section link --accent-deep, which
   * is the footer's own colour: 1.00:1, invisible.
   *
   * It fades out rather than recolouring. Recolouring cannot be made correct
   * mid-transition, because while the footer edge sweeps through the rail one
   * single colour has to sit on both the pale page and the navy footer at once.
   * The rail is a position indicator for the sections, and once the footer is
   * on screen there is no section left to indicate.
   *
   * Opacity and visibility only, so nothing reflows. visibility is delayed to
   * the end of the fade when hiding, and applied immediately when showing, so
   * the links leave the tab order only once they are actually invisible.
   */
  .rail[data-over-footer="true"] {
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 0s linear 200ms;
  }

  .rail::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    width: 1px;
    background: var(--line);
  }

  .rail ol {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .rail li {
    position: relative;
  }

  /* Tick marks on the hairline, one per section. */
  .rail li::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 7px;
    height: 1px;
    background: var(--line);
    transition: width 120ms ease, background-color 120ms ease;
  }

  .rail li[data-current="true"]::after {
    width: 13px;
    background: var(--mark);
  }

  .rail a {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    justify-content: flex-end;
    padding: 0.55rem 1.15rem 0.55rem 0;
    text-decoration: none;
    color: var(--muted);
    font-family: var(--font-heading);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-align: right;
    transition: color 120ms ease;
  }

  .rail a .rail-num {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--mark);
    font-variant-numeric: tabular-nums;
  }

  .rail a:hover {
    color: var(--ink);
  }

  .rail li[data-current="true"] a {
    color: var(--accent-deep);
    font-weight: 600;
  }
}

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

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.section:nth-of-type(even) {
  background: var(--bg);
}

.section > .shell > .section-head {
  margin-bottom: 1.75rem;
}

.section h2 {
  font-size: var(--step-4);
  font-weight: 600;
}

.section h3 {
  font-size: var(--step-2);
  font-weight: 600;
  margin: 2.5rem 0 0.9rem;
}

.section h4 {
  font-size: var(--step-1);
  font-weight: 600;
  margin: 1.75rem 0 0.6rem;
}

.section-number {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--mark);
  display: block;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.prose {
  max-width: 68ch;
}

.prose > p + p {
  margin-top: 0;
}

/* Plain body-text list: same measure and rhythm as the paragraphs around it.
   No icons, no cards, no borders — the site has no other list style for prose
   and this is deliberately the restrained one. */
.prose-list {
  margin: 0 0 1.15em;
  padding-left: 1.25rem;
}

.prose-list li {
  margin-bottom: 0.35em;
}

.prose-list li:last-child {
  margin-bottom: 0;
}

/* ---------- Callout ---------- */

.callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--mark);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--card-shadow);
}

.callout h2,
.callout h3 {
  font-size: var(--step-1);
  font-weight: 700;
  margin: 0 0 0.7rem;
}

.callout p {
  margin-bottom: 0.8rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout--top {
  margin: 0;
  border-radius: 0;
  border-left-width: 3px;
  box-shadow: none;
}

.callout-band {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 2rem 0;
}

/* ---------- Key facts ---------- */

.facts {
  margin: 0;
  border-top: 1px solid var(--line);
}

.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 0 1.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.facts dt {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  align-self: center;
}

.facts dd {
  margin: 0;
  font-weight: 500;
}

@media (max-width: 600px) {
  .facts > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius);
  border: 1px solid var(--accent-deep);
  background: var(--accent-deep);
  color: #fff;
  padding: 0.72rem 1.4rem;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease;
}

.btn:hover {
  background: var(--accent);
  color: #fff;
}

.btn--secondary {
  background: var(--surface);
  color: var(--accent-deep);
  /* --muted, not --line: this is the boundary of a control, which WCAG 1.4.11
     wants at 3:1. The --line hairline is 1.4:1 and is for dividing content. */
  border-color: var(--muted);
}

.btn--secondary:hover {
  background: var(--bg);
  color: var(--accent-deep);
  border-color: var(--accent);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--accent-deep);
  color: #cfd6e0;
  padding: 3rem 0;
  border-top: 1px solid var(--accent-deep);
  font-size: 0.9375rem;
}

.site-footer a {
  color: #fff;
}

.site-footer p {
  max-width: 62ch;
  margin-bottom: 0.85rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 1.25rem;
}

/* ---------- Reduced motion ---------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    /* The rail's hide delays visibility until its fade ends. Without this the
       duration would be nothing but the delay would still run in full. */
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Site plan ---------- */

.plan-wrap {
  margin: 2rem 0 1.75rem;
}

.plan-figure {
  margin: 0;
}

.plan-open {
  display: block;
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.5rem;
  box-shadow: var(--card-shadow);
  cursor: zoom-in;
  text-decoration: none;
}

.plan-open img {
  display: block;
  width: 100%;
  height: auto;
}

.plan-open-hint {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  background: var(--accent-deep);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.6rem;
  border-radius: 2px;
}

.plan-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 0.7rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.plan-credit {
  color: var(--mark);
  font-weight: 600;
}

.plan-actions {
  margin: 0;
}

/* ---------- Lightbox ---------- */

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: var(--accent-deep);
  opacity: 0.97;
}

.lightbox-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: var(--accent-deep);
}

.lightbox-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cfd6e0;
}

.lightbox-tools {
  display: flex;
  gap: 0.4rem;
}

.lightbox-btn {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  cursor: pointer;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.lightbox-close {
  border-color: #fff;
}

.lightbox-stage {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  background: #fff;
  touch-action: none;
  cursor: grab;
}

.lightbox-stage[data-panning="true"] {
  cursor: grabbing;
}

.lightbox-stage picture {
  display: block;
}

.lightbox-img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  max-width: none;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-hint {
  margin: 0;
  padding: 0.6rem 1rem;
  text-align: center;
  color: #cfd6e0;
  background: var(--accent-deep);
  font-size: 0.8125rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
}

.lightbox-loading[hidden] {
  display: none;
}

/* ---------- Feedback form ---------- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-top: 2rem;
  box-shadow: var(--card-shadow);
}

.form-card h3 {
  margin-top: 0;
  font-size: var(--step-2);
}

.form-intro {
  color: var(--muted);
  max-width: 60ch;
}

.field {
  margin: 0 0 1.35rem;
}

.field label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
}

.field .req {
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.field-hint {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  line-height: 1.5;
}

.field textarea {
  resize: vertical;
  min-height: 11rem;
}

.field--short input {
  max-width: 12rem;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.field [aria-invalid="true"] {
  border-color: #8c2f2f;
  border-width: 2px;
}

.field-error {
  margin: 0 0 0.4rem;
  color: #8c2f2f;
  font-weight: 500;
  font-size: 0.9375rem;
}

.field-count {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.field-count[data-state="below-minimum"],
.field-count[data-state="near-maximum"] {
  color: #8c2f2f;
  font-weight: 600;
}

.field.check {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: start;
}

.field.check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.28rem;
}

.field.check label {
  font-family: var(--font-body);
  font-weight: 400;
  margin: 0;
}

.field.check .field-error {
  grid-column: 1 / -1;
  margin-top: 0.3rem;
}

/* Honeypot: off screen for everyone, out of the tab order, hidden from AT. */
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-submit {
  margin: 1.75rem 0 0;
}

.form-error {
  border: 1px solid #8c2f2f;
  border-left: 3px solid #8c2f2f;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 0 0 1.5rem;
  background: #fdf6f5;
}

.form-error-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #8c2f2f;
}

.form-error ul {
  margin: 0;
  padding-left: 1.1rem;
}

.form-error a {
  color: #8c2f2f;
}

.confirm {
  border-left: 3px solid var(--mark);
  padding-left: 1.25rem;
}

.confirm h3 {
  margin-top: 0;
}

.confirm h4 {
  margin: 1.75rem 0 0.4rem;
  font-size: var(--step-1);
}

.confirm-reference {
  margin: 0 0 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-block;
}

.confirm-reference-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mark);
}

.confirm-reference strong {
  font-family: var(--font-heading);
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Privacy page ---------- */

.masthead--inner {
  padding-bottom: 1.75rem;
}

.masthead--inner h1 {
  font-size: var(--step-4);
}

.privacy-version {
  margin: 1.25rem 0 0;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.privacy-contents {
  padding-top: 2rem;
  padding-bottom: 0.5rem;
}

.privacy-contents ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}

.privacy-contents a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

.privacy-contents a:hover {
  text-decoration: underline;
}

.privacy-contents .rail-num {
  color: var(--mark);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

/* Hint beneath the form pointing data requests at the privacy notice. */
.form-note {
  margin: 1.25rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.875rem;
  max-width: 60ch;
}

/* Portal button beneath the evidence list. Appears once planningPortalUrl is set. */
.portal-link {
  margin-top: 1.5rem;
}

/* ---------- Brand lockup ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: 0 0 1.1rem;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 2px;
}

/* em, so the mark scales with the text rather than sitting at a fixed size. */
.brand-mark {
  width: 2.2em;
  height: 2.2em;
  display: block;
  flex: none;
}

.brand-name {
  line-height: 1;
}

.brand:hover .brand-name {
  color: var(--ink);
}

/* One focus ring around the mark and the text together. */
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
