/* Bransfield House (YCC 86) site styles. Plain CSS, no build step. */

:root {
  --paper: #f7f4ee;
  --surface: #ffffff;
  --sand: #eee7da;
  --line: #ded7c9;
  --ink: #1c252d;
  --muted: #56616b;
  --brick: #94472d;
  --brick-dark: #763622;
  --alert: #c62828;
  --alert-dark: #a31f1f;
  --slate: #22313d;
  --slate-soft: #c7d0d7;

  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 10px;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }

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

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

a { color: var(--brick); text-underline-offset: 0.18em; }
a:hover { color: var(--brick-dark); }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 5vw, 3.7rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
li { margin-bottom: 0.4em; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 46rem; }
.section { padding-block: clamp(48px, 8vw, 88px); }
.section.tint { background: var(--sand); }
.section.dark { background: var(--slate); color: #fff; }
.section.dark a { color: #fff; }

.eyebrow {
  display: block;
  margin-bottom: 0.9em;
  color: var(--brick);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.section.dark .eyebrow { color: #e7b9a6; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; }
.section.dark .lede { color: var(--slate-soft); }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(247, 244, 238, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.brand { display: block; flex: none; }
.brand img { width: 196px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: 999px; color: var(--ink); font-size: 0.98rem; font-weight: 500; text-decoration: none; }
.nav a:hover { background: var(--sand); color: var(--ink); }
.nav a[aria-current="page"] { color: var(--brick); box-shadow: inset 0 -2px 0 var(--brick); border-radius: 0; }
.nav a.nav-cta { margin-left: 8px; background: var(--ink); color: #fff; }
.nav a.nav-cta:hover { background: var(--brick-dark); }
.nav a.nav-cta[aria-current="page"] { background: var(--brick); color: #fff; box-shadow: none; border-radius: 999px; }
.nav-toggle { display: none; padding: 8px 14px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 600 0.95rem var(--sans); cursor: pointer; }

@media (max-width: 760px) {
  .bar { flex-wrap: wrap; min-height: 64px; row-gap: 0; }
  .brand img { width: 164px; }
  .nav-toggle { display: block; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 4px 0 14px; }
  .nav.open { display: flex; }
  .nav a, .nav a.nav-cta { margin: 0; padding: 13px 4px; border-radius: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); box-shadow: none; }
  .nav a[aria-current="page"], .nav a.nav-cta[aria-current="page"] { background: none; color: var(--brick); border-radius: 0; }
}

/* Buttons */
.btn { display: inline-block; padding: 13px 22px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 1rem; text-decoration: none; }
.btn:hover { background: var(--brick-dark); border-color: var(--brick-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }

/* Home hero. The two outer spacer columns keep the text on the same left edge as the rest of the page. */
.hero { display: grid; grid-template-columns: minmax(var(--gutter), 1fr) minmax(0, calc(var(--wrap) * 0.46)) minmax(0, calc(var(--wrap) * 0.54)) minmax(0, 1fr); align-items: stretch; border-bottom: 1px solid var(--line); }
.hero-text { grid-column: 2; display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 6vw, 88px) clamp(24px, 4vw, 56px) clamp(40px, 6vw, 88px) 0; }
.hero-text h1 { font-size: clamp(2.3rem, 4.3vw, 3.5rem); }
.hero-text p { font-size: 1.2rem; color: var(--muted); max-width: 30rem; }
.hero-photo { grid-column: 3 / 5; min-height: 440px; max-height: 640px; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 50%; }
@media (min-width: 1400px) {
  /* Wide screens: the photo ends at the page's right edge instead of running to the edge of the window. */
  .hero-photo { grid-column: 3; min-height: 480px; margin-block: 48px; border-radius: var(--radius); overflow: hidden; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-text, .hero-photo { grid-column: 1; }
  .hero-photo { order: -1; min-height: 0; height: 56vw; max-height: 380px; }
  .hero-text { padding: 36px var(--gutter) 44px; }
}

/* Page header (inner pages) */
.page-head { padding-block: clamp(40px, 7vw, 76px) clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); }
.page-head .lede { margin-bottom: 0; }

/* Facts strip */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0 max(0px, calc((100% - var(--wrap)) / 2 - var(--gutter))); list-style: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.facts li { margin: 0; padding: 26px var(--gutter); border-left: 1px solid var(--line); }
.facts li:first-child { border-left: 0; }
.facts b { display: block; font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 500; line-height: 1.1; font-variant-numeric: lining-nums; }
.facts span { color: var(--muted); font-size: 0.95rem; }
@media (max-width: 760px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts li:nth-child(odd) { border-left: 0; }
  .facts li:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Link cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.cards li { margin: 0; }
.card { display: flex; flex-direction: column; height: 100%; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.card h3 { margin-bottom: 0.35em; }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.card .go { margin-top: auto; padding-top: 18px; color: var(--brick); font-weight: 600; font-size: 0.95rem; }
a.card:hover { border-color: var(--brick); color: var(--ink); transform: translateY(-2px); }

/* Image + text rows */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.split + .split { margin-top: clamp(48px, 8vw, 96px); }
.split.flip > .media { order: 2; }
.split.top { align-items: start; }
.media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.media.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.media.pair img:first-child { grid-column: 1 / -1; }
.media.pair img:not(:first-child) { aspect-ratio: 4 / 3; }
.media.pair img:nth-child(2):last-child { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
@media (max-width: 820px) {
  .split { grid-template-columns: 1fr; }
  .split.flip > .media { order: 0; }
}

/* Neighbourhood cards under the location block (home) */
.near { margin-top: clamp(40px, 6vw, 72px); }
.near h3 { margin-bottom: 0.8em; font-size: 1.5rem; }
.near .card h4 { margin: 0 0 0.4em; font: 600 1.05rem var(--sans); }
.near .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .near .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .near .cards { grid-template-columns: 1fr; } }

/* Photo grid (home) */
.gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.gallery li { position: relative; margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.gallery span { position: absolute; left: 10px; bottom: 10px; padding: 4px 11px; border-radius: 999px; background: rgba(28, 37, 45, 0.82); color: #fff; font-size: 0.85rem; font-weight: 500; }
@media (max-width: 640px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Lists */
.ticks { padding: 0; list-style: none; }
.ticks li { position: relative; padding-left: 1.5em; }
.ticks li::before { content: ""; position: absolute; left: 0.15em; top: 0.62em; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--brick); }
.section.dark .ticks li::before { background: #e7b9a6; }

/* Hours pills + key facts */
.keyfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 0 0 1.3em; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); overflow: hidden; }
.keyfacts div { padding: 14px 16px; background: var(--surface); }
.keyfacts dt { color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.keyfacts dd { margin: 2px 0 0; font-weight: 600; line-height: 1.35; }

/* Tables */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { padding: 13px 18px; text-align: left; vertical-align: top; border-top: 1px solid var(--line); }
thead th { border-top: 0; background: var(--sand); color: var(--muted); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
tbody th { font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) { tbody th { white-space: normal; } th, td { padding: 11px 13px; } }

/* Callout */
.callout { margin: 1.4em 0; padding: 18px 20px; border-left: 4px solid var(--brick); border-radius: 0 var(--radius) var(--radius) 0; background: var(--surface); }
.callout p:last-child { margin-bottom: 0; }
.section.tint .callout { background: var(--paper); }

/* Contact cards */
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }

/* Jump link to the emergencies panel (contact page) */
.emergency-jump { display: inline-flex; align-items: center; gap: 9px; margin-top: 1.5em; padding: 12px 20px; border-radius: 999px; background: var(--alert); color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; box-shadow: 0 0 0 5px rgba(198, 40, 40, 0.18); }
.emergency-jump:hover { background: var(--alert-dark); color: #fff; }
.emergency-jump svg { flex: none; }
.emergency-jump span { font-size: 1.25em; line-height: 1; }

/* Emergencies panel (contact page) */
.emergency { margin-top: 16px; padding: clamp(20px, 3vw, 32px); border: 1px solid var(--alert); border-radius: var(--radius); background: var(--surface); box-shadow: 0 0 0 6px rgba(198, 40, 40, 0.14); }
/* The halo pulses twice when the Emergency button brings you here, then settles. Two names so a repeat click restarts it (see js/site.js). */
@keyframes arrive { 0% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.55); } 60% { box-shadow: 0 0 0 14px rgba(198, 40, 40, 0.2); } 100% { box-shadow: 0 0 0 6px rgba(198, 40, 40, 0.14); } }
@keyframes arrive-again { 0% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.55); } 60% { box-shadow: 0 0 0 14px rgba(198, 40, 40, 0.2); } 100% { box-shadow: 0 0 0 6px rgba(198, 40, 40, 0.14); } }
.emergency:target { animation: arrive 1.1s ease-out 2; }
.emergency.arrived { animation: arrive-again 1.1s ease-out 2; }
@media (prefers-reduced-motion: reduce) { .emergency:target, .emergency.arrived { animation: none; } }
.emergency-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 32px; margin-bottom: 20px; }
.emergency-head h2 { margin: 0 0 2px; font-size: 1.7rem; }
.emergency-head p { margin: 0; font-weight: 600; }
.emergency-head .big-link { font-size: 1.9rem; }
.emergency-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.e-col { padding: 20px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.e-col.e-911 { border-color: #ecb9b4; background: #fdecea; }
.e-col h3 { margin: 0 0 2px; font: 600 1.2rem var(--sans); }
.e-col .when { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; }
.e-col ul { margin: 0 0 12px; }
.e-col .then { margin: 0; font-weight: 600; }
.e-police { margin: 16px 0 0; padding: 14px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.e-fallback { margin: 18px 0 0; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 700px) { .emergency-cols { grid-template-columns: 1fr; } }
a[href^="tel:"] { white-space: nowrap; }
.contact-card { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.contact-card.alert { border-color: var(--brick); }
.contact-card h2 { font-size: 1.5rem; margin-bottom: 0.25em; }
.contact-card .who { margin: 0 0 0.6em; font-weight: 600; }
.contact-card .who span { display: block; color: var(--muted); font-size: 0.92rem; font-weight: 400; }
.contact-card h2 + .big-link { display: inline-block; margin-top: 0.3em; }
.contact-card dl { margin: 0; }
/* The three cards share one set of rows, so the name, the phone number and the details start at the same height in each */
@supports (grid-template-rows: subgrid) {
  .contact-grid > .contact-card { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 0; }
  .contact-grid > .contact-card > h2 { grid-row: 1; }
  .contact-grid > .contact-card > .who { grid-row: 2; }
  .contact-grid > .contact-card > .big-link { grid-row: 3; justify-self: start; align-self: start; }
  .contact-grid > .contact-card > dl,
  .contact-grid > .contact-card > .more { grid-row: 4; }
}
.contact-card dt { margin-top: 14px; color: var(--muted); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.contact-card dd { margin: 2px 0 0; }
.big-link { font-family: var(--serif); font-size: 1.55rem; font-variant-numeric: lining-nums; text-decoration: none; white-space: nowrap; }
.big-link:hover { text-decoration: underline; }

/* Living here layout */
.guide { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(0, 48rem); gap: clamp(28px, 5vw, 72px); align-items: start; }
.toc { position: sticky; top: 96px; font-size: 0.97rem; }
.toc h2 { margin-bottom: 0.9em; color: var(--muted); font: 600 0.78rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; }
.toc a:hover { border-left-color: var(--brick); color: var(--brick); }
.topic { padding-bottom: clamp(36px, 6vw, 56px); margin-bottom: clamp(36px, 6vw, 56px); border-bottom: 1px solid var(--line); }
.topic:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.topic h3 { margin-top: 1.4em; font-size: 1.15rem; font-family: var(--sans); font-weight: 600; }
.rule-ref { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 860px) {
  .guide { grid-template-columns: 1fr; }
  .toc { position: static; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .toc ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; border-left: 0; }
  .toc a { margin: 0; padding: 5px 0; border-left: 0; }
}

/* Document downloads */
.docs { margin: 0 0 2.4em; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.docs li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; align-items: center; margin: 0; padding: 18px 20px; border-top: 1px solid var(--line); }
.docs li:first-child { border-top: 0; }
.docs h3 { margin: 0 0 2px; font: 600 1.05rem var(--sans); }
.docs p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.docs .dl { padding: 9px 16px; border: 1px solid var(--ink); border-radius: 999px; color: var(--ink); font-size: 0.9rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.docs .dl:hover { background: var(--ink); color: #fff; }
.docs .dl small { font-weight: 400; opacity: 0.75; }
@media (max-width: 560px) { .docs li { grid-template-columns: 1fr; } .docs .dl { justify-self: start; } }

.doc-link { font-weight: 600; }

/* Included-services block (home, fees section) */
.incl { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 28px clamp(24px, 4vw, 56px); margin-top: clamp(36px, 5vw, 56px); padding-top: clamp(32px, 4vw, 44px); border-top: 1px solid rgba(255, 255, 255, 0.16); }
.incl h3 { font-size: 1.6rem; }
.incl p { color: var(--slate-soft); margin: 0; }
.incl h4 { margin: 0 0 0.9em; color: #e7b9a6; font: 600 0.78rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.incl ul { margin: 0; }
.incl-note { margin: 2em 0 0; max-width: 52rem; color: var(--slate-soft); }
@media (max-width: 820px) { .incl { grid-template-columns: 1fr 1fr; } .incl > div:first-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .incl { grid-template-columns: 1fr; } }

/* Expandable photos (see js/site.js) */
.zoomable { cursor: zoom-in; }
.gallery span { pointer-events: none; }
.zoom-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(24, 32, 40, 0.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; cursor: zoom-out; }
.zoom-photo { position: fixed; z-index: 91; margin: 0; max-width: none; object-fit: cover; border-radius: var(--radius); cursor: zoom-out; will-change: left, top, width, height; }

/* Footer */
.site-footer { background: var(--slate); color: var(--slate-soft); font-size: 0.97rem; }
.site-footer a { color: #fff; }
.foot { display: grid; grid-template-columns: 1.4fr 1fr 1fr 0.8fr; gap: 32px; padding-block: 56px 36px; }
.foot h2 { margin-bottom: 0.8em; color: #fff; font: 600 0.78rem var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.foot ul { margin: 0; padding: 0; list-style: none; }
.foot li { margin-bottom: 0.3em; }
.foot-logo { width: 210px; margin-bottom: 18px; filter: invert(1); }
.fine { padding-block: 22px 36px; border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.86rem; }
.fine p { margin: 0; max-width: 56rem; }
@media (max-width: 860px) { .foot { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot { grid-template-columns: 1fr; gap: 24px; } }

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

@media print {
  .site-header, .site-footer, .toc, .btn-row, .nav-toggle { display: none; }
  body { background: #fff; font-size: 11pt; }
  .section { padding-block: 16px; }
}
