/* ==========================================================================
   Wigan Archaeological Society — design system
   One stylesheet. Tokens first, then the frame, then the content vocabulary
   the migration tool writes (prose, fig, data), then the page pieces.
   ========================================================================== */

/* ---- Tokens ------------------------------------------------------------ */
:root {
  --paper: #f6f3ec;
  --paper-2: #ede8dd;
  --paper-3: #e3dccd;
  --ink: #1b2226;
  --ink-2: #3a454b;
  --muted: #6a7479;
  --rule: #d8d0c1;
  --rule-strong: #b9ae9b;
  --verdigris: #2a6b69;
  --verdigris-2: #1f5250;
  --verdigris-soft: #d9e7e5;
  --ochre: #b5842a;
  --ochre-soft: #f1e6cf;
  --oxide: #8d3c2c;
  --white: #ffffff;
  --shadow: 0 1px 2px rgba(27, 34, 38, .06), 0 8px 24px rgba(27, 34, 38, .08);

  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --measure: 70ch;
  --wide: 1180px;
  --gutter: 16px;
  --radius: 4px;

  --fs-0: .8125rem;
  --fs-1: .9375rem;
  --fs-2: 1.0625rem;
  --fs-3: 1.3125rem;
  --fs-4: 1.75rem;
  --fs-5: 2.375rem;
  --fs-6: 3.25rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15191c;
    --paper-2: #1c2226;
    --paper-3: #252d32;
    --ink: #e9e4da;
    --ink-2: #c8c1b4;
    --muted: #8f978f;
    --rule: #2c353a;
    --rule-strong: #43505a;
    --verdigris: #63aaa6;
    --verdigris-2: #8fc7c3;
    --verdigris-soft: #1d3331;
    --ochre: #d2a24e;
    --ochre-soft: #332a17;
    --oxide: #d0705c;
    --white: #1c2226;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #15191c;
  --paper-2: #1c2226;
  --paper-3: #252d32;
  --ink: #e9e4da;
  --ink-2: #c8c1b4;
  --muted: #8f978f;
  --rule: #2c353a;
  --rule-strong: #43505a;
  --verdigris: #63aaa6;
  --verdigris-2: #8fc7c3;
  --verdigris-soft: #1d3331;
  --ochre: #d2a24e;
  --ochre-soft: #332a17;
  --oxide: #d0705c;
  --white: #1c2226;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-2);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--verdigris); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--verdigris-2); text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(var(--fs-4), 2.2vw + 1rem, var(--fs-6)); }
h2 { font-size: clamp(var(--fs-3), 1vw + 1rem, var(--fs-4)); }
h3 { font-size: var(--fs-3); }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); font-size: .86em; letter-spacing: .01em; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--verdigris); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: var(--gutter); }
:focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }

.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-0);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--verdigris);
  margin: 0 0 .6rem;
}
.lede { font-size: clamp(var(--fs-2), .5vw + 1rem, var(--fs-3)); color: var(--ink-2); max-width: var(--measure); line-height: 1.5; }

.button {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: var(--fs-1);
  background: var(--verdigris);
  color: #fff;
  padding: .7rem 1.25rem;
  border: 1px solid var(--verdigris);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.button:hover { background: var(--verdigris-2); border-color: var(--verdigris-2); color: #fff; }
.button--ghost { background: transparent; color: var(--verdigris); }
.button--ghost:hover { background: var(--verdigris-soft); color: var(--verdigris-2); }

/* ---- Brand mark ---------------------------------------------------------- */
.brand__seal, .hero__seal {
  display: inline-block;
  width: 44px; height: 68px;
  background-color: var(--ink);
  -webkit-mask: url("../images/brand/seal.png") center / contain no-repeat;
  mask: url("../images/brand/seal.png") center / contain no-repeat;
  flex: none;
}
.brand__seal--small { width: 30px; height: 46px; opacity: .8; }
.hero__seal { width: 120px; height: 186px; background-color: var(--verdigris); }

/* ---- Masthead ------------------------------------------------------------ */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); position: relative; }
.masthead__inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1rem var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; color: inherit; min-width: 0; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name { font-family: var(--serif); font-weight: 500; font-size: clamp(1.15rem, 1vw + .9rem, 1.55rem); letter-spacing: -.01em; line-height: 1.1; }
.brand__since { font-family: var(--sans); font-size: var(--fs-0); color: var(--muted); margin-top: .25rem; letter-spacing: .02em; }
.masthead__tools { display: none; align-items: center; gap: .25rem; }
.tool {
  font-family: var(--sans); font-size: var(--fs-0); font-weight: 500;
  color: var(--ink-2); text-decoration: none; padding: .45rem .6rem; border-radius: var(--radius);
  background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
}
.tool:hover { background: var(--paper-2); color: var(--ink); }
.search { display: flex; align-items: center; border: 1px solid var(--rule); border-radius: 999px; background: var(--white); padding: 0 .25rem 0 .9rem; }
.search input { font-family: var(--sans); font-size: var(--fs-0); border: 0; background: transparent; color: var(--ink); width: 11rem; padding: .45rem 0; outline: none; }
.search button { border: 0; background: transparent; color: var(--muted); padding: .35rem .5rem; cursor: pointer; display: grid; place-items: center; border-radius: 999px; }
.search button:hover { color: var(--verdigris); }
.nav-toggle {
  display: inline-grid; gap: 5px; background: none; border: 1px solid var(--rule); border-radius: var(--radius);
  padding: .55rem; cursor: pointer; width: 42px; height: 40px; align-content: center; justify-items: center;
}
.nav-toggle span:not(.visually-hidden) { display: block; width: 20px; height: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav { display: none; border-top: 1px solid var(--rule); background: var(--paper); }
.nav.is-open { display: block; }
.nav ul { list-style: none; margin: 0 auto; padding: .5rem var(--gutter); max-width: var(--wide); display: flex; flex-direction: column; }
.nav a {
  display: block; font-family: var(--sans); font-size: var(--fs-1); font-weight: 500; color: var(--ink-2);
  text-decoration: none; padding: .7rem .25rem; border-bottom: 1px solid var(--rule);
}
.nav li:last-child a { border-bottom: 0; }
.nav a:hover { color: var(--verdigris); }
.nav a[aria-current="page"] { color: var(--verdigris); font-weight: 600; }
.nav__join a { color: var(--ochre); font-weight: 600; }

@media (min-width: 900px) {
  .masthead__inner { grid-template-columns: 1fr auto; padding: 1.1rem var(--gutter) .9rem; }
  .masthead__tools { display: flex; }
  .nav-toggle { display: none; }
  .nav { display: block; border-top: 1px solid var(--rule); }
  .nav ul { flex-direction: row; gap: .25rem; padding: 0 var(--gutter); }
  .nav a { border-bottom: 2px solid transparent; padding: .8rem .75rem; margin-bottom: -1px; }
  .nav li:first-child a { padding-left: 0; }
  .nav a:hover { border-bottom-color: var(--rule-strong); }
  .nav a[aria-current="page"] { border-bottom-color: var(--verdigris); }
  .nav__join { margin-left: auto; }
}

/* ---- Page head ----------------------------------------------------------- */
.page-head { border-bottom: 1px solid var(--rule); background: linear-gradient(180deg, var(--paper-2), var(--paper)); }
.page-head__inner { max-width: var(--wide); margin: 0 auto; padding: 2rem var(--gutter) 1.75rem; }
.page-head h1 { max-width: 22ch; }
.page-head .lede { margin: .9rem 0 0; }
.page-head--hero { position: relative; overflow: hidden; background: var(--paper-3); }
.page-head--hero::before {
  content: ""; position: absolute; inset: 0; background-image: var(--hero); background-size: cover; background-position: center;
  opacity: .22; filter: saturate(.6) contrast(1.05);
}
.page-head--hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--paper-2) 30%, transparent 100%); opacity: .9; }
.page-head--hero .page-head__inner { position: relative; z-index: 1; }
.crumbs ol { list-style: none; margin: 0 0 .9rem; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; font-family: var(--sans); font-size: var(--fs-0); color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: .35rem; color: var(--rule-strong); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--verdigris); }
.facts { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 1.25rem 0 0; padding: 0; font-family: var(--sans); }
.facts div { display: flex; flex-direction: column; gap: .1rem; }
.facts dt { font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.facts dd { margin: 0; font-size: var(--fs-1); color: var(--ink); }
.facts--stacked { flex-direction: column; gap: .75rem; }

/* ---- Main grid ----------------------------------------------------------- */
.main__inner { max-width: var(--wide); margin: 0 auto; padding: 2rem var(--gutter) 3rem; }
.with-aside { display: grid; gap: 2rem; }
.aside { order: -1; }
.toc { border-left: 2px solid var(--verdigris); padding-left: 1rem; font-family: var(--sans); }
.toc__title { font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 .5rem; font-weight: 600; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; font-size: var(--fs-1); margin: .3rem 0; display: flex; gap: .55rem; }
.toc li::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: var(--fs-0); color: var(--muted); padding-top: .15em; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover, .toc a.is-active { color: var(--verdigris); }
.toc a.is-active { font-weight: 600; }
@media (min-width: 1024px) {
  .with-aside { grid-template-columns: 240px minmax(0, 1fr); gap: 3.5rem; }
  .aside { order: 0; }
  .toc { position: sticky; top: 1.5rem; }
}
.content { min-width: 0; }

/* ---- Prose: the content vocabulary --------------------------------------- */
.prose { max-width: var(--measure); counter-reset: figure; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { margin: 2.4em 0 .7em; padding-top: 1.2em; border-top: 1px solid var(--rule); scroll-margin-top: 1.5rem; }
.prose h2:first-child, .prose > h2.lead { border-top: 0; padding-top: 0; margin-top: 0; }
.prose h3 { margin: 1.8em 0 .5em; font-size: var(--fs-2); font-weight: 600; font-family: var(--sans); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose blockquote {
  margin: 1.5em 0; padding: .25em 0 .25em 1.25em; border-left: 3px solid var(--ochre);
  color: var(--ink-2); font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose .more { font-family: var(--sans); font-size: var(--fs-1); }
.prose .more a::after { content: " \2192"; }
.prose .bigcap { float: left; font-size: 3.2em; line-height: .85; padding: .08em .08em 0 0; font-weight: 500; color: var(--verdigris); }
.prose cite { display: block; font-style: normal; font-family: var(--sans); font-size: var(--fs-0); color: var(--muted); margin: -.6em 0 1.2em 1.5em; }
.prose reference, .prose byline { display: block; font-family: var(--sans); font-size: var(--fs-0); color: var(--muted); margin: -.4em 0 1.2em; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.prose a[href$=".pdf"]::after { content: " (PDF)"; font-family: var(--sans); font-size: .8em; color: var(--muted); }
.prose p#top-of-page strong { color: var(--ink-2); }

/* Figures */
.fig { margin: 1.5rem 0; counter-increment: figure; }
.fig img { width: 100%; height: auto; border: 1px solid var(--rule); background: var(--white); border-radius: 2px; }
.fig { max-width: var(--natural, 100%); }
.fig a { display: block; }
.fig a:hover img { border-color: var(--verdigris); }
.fig img[data-zoom] { cursor: zoom-in; }
.fig figcaption { font-family: var(--sans); font-size: var(--fs-0); color: var(--muted); line-height: 1.45; margin-top: .5rem; }
.fig figcaption::before { content: "Fig. " counter(figure) "\2002"; font-family: var(--mono); color: var(--verdigris); }
.fig-center { margin-left: auto; margin-right: auto; }
.fig-center img { margin: 0 auto; }
.fig-center figcaption { text-align: center; }
@media (min-width: 720px) {
  .fig-left { float: left; margin: .3rem 1.75rem 1rem 0; }
  .fig-right { float: right; margin: .3rem 0 1rem 1.75rem; }
  /* A figure takes its share of the column, but never more than its picture's own pixels (--natural). */
  .fig-left, .fig-right { --share: 45%; }
  .w10 { --share: 15%; } .w15 { --share: 18%; } .w20 { --share: 22%; } .w25 { --share: 26%; }
  .w30 { --share: 30%; } .w35 { --share: 35%; } .w40 { --share: 40%; } .w45 { --share: 45%; }
  .w50 { --share: 50%; } .w60 { --share: 60%; } .w70 { --share: 70%; } .w75 { --share: 75%; }
  .w80 { --share: 80%; } .w85 { --share: 85%; } .w90 { --share: 90%; }
  .fig { max-width: min(var(--share, 100%), var(--natural, 100%)); }
  .prose h2 { clear: both; }
}
.prose::after, .story::after { content: ""; display: table; clear: both; }
.prose--plate .fig { max-width: var(--natural, 100%); float: none; margin: 1.5rem 0; }
.prose--plate .fig img { border: 0; }
.prose--plate .fig figcaption::before { content: none; }

/* Tables */
.data, .issues, .programme {
  width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: var(--fs-1); margin: 1.25rem 0;
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule-strong);
}
.data th, .issues th, .programme th { text-align: left; font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .6rem .5rem; border-bottom: 1px solid var(--rule-strong); font-weight: 600; }
.data td, .issues td, .programme td { padding: .55rem .5rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data tr:last-child td, .issues tr:last-child td, .programme tr:last-child td { border-bottom: 0; }
.programme tr.past td { color: var(--muted); }
.prose .data { display: block; overflow-x: auto; }
.prose .data td, .prose .data th { min-width: 8rem; }

/* Newsletter reading view */
.newsletter { max-width: var(--measure); }
.newsletter__masthead {
  display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: baseline;
  border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); padding: .6rem 0; margin-bottom: 2rem;
  font-family: var(--sans);
}
.newsletter__brand { grid-column: 1 / -1; font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .16em; color: var(--muted); }
.newsletter__issue { font-family: var(--serif); font-size: var(--fs-3); font-weight: 500; }
.newsletter__date { font-size: var(--fs-1); color: var(--ink-2); }
.story { margin: 0 0 2.5rem; }
.story + .story { padding-top: 2rem; border-top: 1px solid var(--rule); }
.story h2 { border-top: 0; padding-top: 0; margin: 0 0 .7em; }
.story h2.lead { font-size: clamp(var(--fs-4), 1.5vw + 1rem, var(--fs-5)); }
.story.programme table { width: 100%; }
.talkDate { font-weight: 600; color: var(--verdigris); }
.speaker { font-weight: 600; }
.talkTitle { font-style: italic; }
.newsletter__foot { font-family: var(--sans); font-size: var(--fs-0); color: var(--muted); border-top: 1px solid var(--rule); padding-top: 1rem; margin-top: 2rem; }

/* Q and A */
.prose--qa .qa-question, .prose--qa .qa-answer { margin: 0 0 2rem; }
.prose--qa h2 { border: 0; padding: 0; margin: 0 0 .5em; font-family: var(--sans); font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .14em; color: var(--verdigris); }
.prose--qa .qa-question { padding: 1.25rem 1.5rem; background: var(--paper-2); border-left: 3px solid var(--ochre); border-radius: 0 var(--radius) var(--radius) 0; }
.prose--qa .qa-question p:last-child { margin-bottom: 0; }

/* Pager */
.pager {
  max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter) 3rem;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: start; font-family: var(--sans);
}
.pager a { text-decoration: none; color: var(--ink-2); display: flex; flex-direction: column; gap: .15rem; }
.pager__label { font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .1em; color: var(--verdigris); }
.pager__title { font-family: var(--serif); font-size: var(--fs-2); }
.pager__next { text-align: right; align-items: flex-end; }
.pager__up { font-size: var(--fs-0); color: var(--muted); padding-top: .2rem; }
.pager a:hover .pager__title { color: var(--verdigris); }
.back { font-family: var(--sans); font-size: var(--fs-1); margin-top: 2rem; }

/* ---- Home ---------------------------------------------------------------- */
.hero { position: relative; background: var(--paper-2); border-bottom: 1px solid var(--rule); overflow: hidden; }
/* The dig photograph sits behind the words: full colour at the right, fading into the paper where the headline is. */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("../images/brand/hero-dig.jpg") center right / cover no-repeat;
  opacity: .55; filter: saturate(.85);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--paper-2) 0%, rgba(237, 232, 221, .88) 45%, rgba(237, 232, 221, .55) 100%);
}
:root[data-theme="dark"] .hero::after { background: linear-gradient(180deg, var(--paper-2) 0%, rgba(28, 34, 38, .88) 45%, rgba(28, 34, 38, .6) 100%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero::after { background: linear-gradient(180deg, var(--paper-2) 0%, rgba(28, 34, 38, .88) 45%, rgba(28, 34, 38, .6) 100%); }
}
.hero__inner { position: relative; z-index: 1; max-width: var(--wide); margin: 0 auto; padding: 2.5rem var(--gutter); display: grid; gap: 1.5rem; align-items: center; }
.hero__seal { justify-self: start; }
.hero h1 { max-width: 16ch; }
.hero .lede { margin: 1rem 0 1.5rem; }
.hero__actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 0; }
@media (min-width: 720px) {
  .hero__inner { grid-template-columns: auto 1fr; gap: 3rem; padding: 3.5rem var(--gutter); }
  .hero__seal { width: 150px; height: 232px; }
  .hero::before { opacity: .7; }
  .hero::after { background: linear-gradient(90deg, var(--paper-2) 0%, var(--paper-2) 40%, rgba(237, 232, 221, .82) 62%, rgba(237, 232, 221, .12) 100%); }
  :root[data-theme="dark"] .hero::after { background: linear-gradient(90deg, var(--paper-2) 0%, var(--paper-2) 34%, rgba(28, 34, 38, .8) 58%, rgba(28, 34, 38, .25) 100%); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .hero::after { background: linear-gradient(90deg, var(--paper-2) 0%, var(--paper-2) 34%, rgba(28, 34, 38, .8) 58%, rgba(28, 34, 38, .25) 100%); }
  }
}

.panels { border-bottom: 1px solid var(--rule); background: var(--paper); }
.panels__inner { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); display: grid; }
.panel { padding: 1.75rem 0; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: .35rem; }
.panel:last-child { border-bottom: 0; }
.panel__label { font-family: var(--sans); font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .12em; color: var(--verdigris); font-weight: 600; margin: 0; }
.panel__date { color: var(--muted); margin: 0; }
.panel__title { font-size: var(--fs-3); margin: 0; }
.panel__title a { color: inherit; text-decoration: none; }
.panel__title a:hover { color: var(--verdigris); }
.panel__sub { color: var(--ink-2); margin: 0; }
.panel__foot { font-family: var(--sans); font-size: var(--fs-0); color: var(--muted); margin: .25rem 0 0; }
.panel__more { font-family: var(--sans); font-size: var(--fs-1); text-decoration: none; margin-top: auto; padding-top: .75rem; }
.postlist { list-style: none; margin: 0; padding: 0; }
.postlist li { display: flex; flex-direction: column; padding: .4rem 0; border-bottom: 1px dotted var(--rule); }
.postlist li:last-child { border-bottom: 0; }
.postlist a { text-decoration: none; color: var(--ink); }
.postlist a:hover { color: var(--verdigris); }
.postlist .mono { color: var(--muted); }
@media (min-width: 900px) {
  .panels__inner { grid-template-columns: repeat(3, 1fr); }
  .panel { padding: 2rem 2rem 2rem 0; border-bottom: 0; border-right: 1px solid var(--rule); }
  .panel + .panel { padding-left: 2rem; }
  .panel:last-child { border-right: 0; padding-right: 0; }
}

.band { padding: 3rem 0; }
.band--alt { background: var(--paper-2); border-top: 1px solid var(--rule); }
.band__inner { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.band__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem; margin-bottom: 1.5rem; }
.band__head .eyebrow { flex-basis: 100%; margin: 0; }
.band__more { margin-left: auto; font-family: var(--sans); font-size: var(--fs-1); text-decoration: none; }
.band__inner--split { display: grid; gap: 2.5rem; }
.band__inner--split h2 { margin-bottom: .75rem; }
@media (min-width: 900px) { .band__inner--split { grid-template-columns: 3fr 2fr; gap: 5rem; } }
.chapterlist { margin: 0; padding: 0 0 0 1.5rem; columns: 2; column-gap: 2rem; font-family: var(--sans); font-size: var(--fs-1); }
.chapterlist li { margin: .25rem 0; break-inside: avoid; }
.chapterlist a { text-decoration: none; color: var(--ink-2); }
.chapterlist a:hover { color: var(--verdigris); }

/* Cards */
.cards { display: grid; gap: 1.25rem; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards { grid-template-columns: repeat(4, 1fr); } .cards--catalogue { grid-template-columns: repeat(3, 1fr); } }
.card {
  display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  text-decoration: none; color: inherit; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--rule-strong); color: inherit; }
.card__image { display: block; aspect-ratio: 4 / 3; background: var(--paper-3) center / cover no-repeat; border-bottom: 1px solid var(--rule); filter: saturate(.85); }
.card:hover .card__image { filter: saturate(1); }
.card__body { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem 1.2rem; }
.card__kicker { color: var(--verdigris); font-size: var(--fs-0); }
.card__title { font-family: var(--serif); font-size: var(--fs-3); font-weight: 500; line-height: 1.2; }
.card__text { font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); line-height: 1.5; }
.card__grid { color: var(--muted); margin-top: .25rem; }
.card__ext { font-family: var(--sans); font-size: var(--fs-0); color: var(--ochre); margin-top: .25rem; }
.card--plain { border-top: 3px solid var(--verdigris); }

/* ---- Archive ------------------------------------------------------------- */
.archive { display: grid; gap: 2rem; }
@media (min-width: 900px) { .archive { grid-template-columns: 200px minmax(0, 1fr); gap: 3.5rem; } }
.yearrail ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; font-family: var(--mono); font-size: var(--fs-1); }
.yearrail a { display: block; padding: .3rem .6rem; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink-2); }
.yearrail a:hover { border-color: var(--verdigris); color: var(--verdigris); }
.yearrail a[aria-current="page"] { background: var(--verdigris); border-color: var(--verdigris); color: #fff; }
@media (min-width: 900px) {
  .yearrail { position: sticky; top: 1.5rem; }
  .yearrail ul { flex-direction: column; flex-wrap: nowrap; gap: 0; }
  .yearrail a { border: 0; border-left: 2px solid var(--rule); border-radius: 0; padding: .25rem .9rem; }
  .yearrail a[aria-current="page"] { background: transparent; color: var(--verdigris); border-left-color: var(--verdigris); font-weight: 600; }
}
.archive__year { margin: 0 0 .5rem; }
.featured {
  display: grid; grid-template-columns: auto 1fr; gap: .25rem 1.25rem; align-items: baseline;
  background: var(--white); border: 1px solid var(--rule); border-left: 4px solid var(--ochre); border-radius: var(--radius);
  padding: 1.1rem 1.4rem; margin-bottom: 2rem; text-decoration: none; color: inherit;
}
.featured:hover { box-shadow: var(--shadow); color: inherit; }
.featured__label { grid-column: 1 / -1; font-family: var(--sans); font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .12em; color: var(--ochre); font-weight: 600; }
.featured__number { font-family: var(--mono); font-size: var(--fs-3); color: var(--verdigris); }
.featured__title { font-size: var(--fs-3); }
.featured__date { grid-column: 2; color: var(--muted); }
.issues td:first-child { width: 4rem; color: var(--muted); }
.issues td:nth-child(2) { width: 8rem; }
.issues a { text-decoration: none; color: var(--ink); }
.issues a:hover { color: var(--verdigris); text-decoration: underline; }

/* ---- History contents ---------------------------------------------------- */
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 720px) { .chapters { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .chapters { grid-template-columns: repeat(3, 1fr); } }
.chapters__link { display: flex; flex-direction: column; height: 100%; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: inherit; overflow: hidden; }
.chapters__link:hover { box-shadow: var(--shadow); border-color: var(--rule-strong); color: inherit; }
.chapters__image { aspect-ratio: 16 / 7; background: var(--paper-3) center / cover no-repeat; filter: saturate(.8); }
.chapters__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.chapters__number { color: var(--verdigris); font-size: var(--fs-0); }
.chapters__title { font-family: var(--serif); font-size: var(--fs-3); }
.chapters__text { font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); line-height: 1.5; }

/* ---- History as one book ------------------------------------------------- */
.book__chapter { max-width: var(--measure); scroll-margin-top: 1.5rem; }
.book__chapter + .book__chapter { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 3px double var(--rule-strong); }
.book__head { margin-bottom: 1.25rem; }
.book__head .eyebrow { margin-bottom: .35rem; }
.book__title { font-size: clamp(var(--fs-4), 1.5vw + 1rem, var(--fs-5)); }
.book .prose h3 { margin: 2em 0 .6em; font-family: var(--serif); font-size: var(--fs-3); font-weight: 500; }
.book .prose h4 { margin: 1.6em 0 .5em; font-family: var(--sans); font-size: var(--fs-2); font-weight: 600; }

/* ---- Q and A list -------------------------------------------------------- */
.qalist { list-style: none; margin: 0; padding: 0; max-width: 80ch; counter-reset: qa; }
.qalist li { border-bottom: 1px solid var(--rule); }
.qalist a { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; padding: 1.1rem 0; text-decoration: none; color: inherit; counter-increment: qa; }
.qalist a::before { content: counter(qa, decimal-leading-zero); font-family: var(--mono); color: var(--muted); grid-row: 1 / span 2; padding-top: .2em; }
.qalist__subject { font-size: var(--fs-3); }
.qalist a:hover .qalist__subject { color: var(--verdigris); }
.qalist__teaser { font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); }
.callout { margin: 2.5rem 0 0; padding: 1.25rem 1.5rem; background: var(--verdigris-soft); border-radius: var(--radius); max-width: 80ch; font-family: var(--sans); font-size: var(--fs-1); }
.callout p { margin: 0; }

/* ---- Meetings ------------------------------------------------------------ */
.meetings { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .meetings { grid-template-columns: 320px minmax(0, 1fr); gap: 4rem; } }
.venue h2, .season h2 { margin-bottom: .9rem; }
.venue h3 { margin: 2rem 0 .75rem; font-family: var(--sans); font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.upcoming { list-style: none; margin: 0; padding: 0; }
.upcoming li { display: flex; flex-direction: column; gap: .1rem; padding: .75rem 0 .75rem 1rem; border-left: 3px solid var(--verdigris); margin-bottom: .75rem; }
.upcoming .mono { color: var(--verdigris); }
.upcoming span:last-child:not(.mono) { font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); }
.season__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 1rem; }
.pills { display: flex; flex-wrap: wrap; gap: .35rem; font-family: var(--mono); font-size: var(--fs-0); }
.pills a { padding: .25rem .6rem; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; color: var(--ink-2); }
.pills a[aria-current="page"] { background: var(--verdigris); border-color: var(--verdigris); color: #fff; }
.programme td:first-child { width: 11rem; white-space: nowrap; }

/* ---- Links --------------------------------------------------------------- */
.linkgroups { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .linkgroups { grid-template-columns: repeat(2, 1fr); gap: 4rem; } }
.linkgroup h2 { margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 2px solid var(--ink); }
.linkgroup ul { list-style: none; margin: 0; padding: 0; }
.linkgroup li { display: flex; flex-direction: column; padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.linkgroup li a { text-decoration: none; font-size: var(--fs-2); }
.linkgroup li a:hover { text-decoration: underline; }
.linkgroup__desc { font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); }

/* ---- Split pages (contact, join, members) -------------------------------- */
.split { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 4rem; } }
.split__aside h2 { font-size: var(--fs-2); font-family: var(--sans); font-weight: 600; margin: 0 0 .6rem; padding-top: .3rem; }
.split__aside h2 + * { margin-top: 0; }
.split__aside > * + h2 { margin-top: 2rem; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; flex-direction: column; padding: .5rem 0; border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: var(--fs-1); }
.people li span { color: var(--muted); }
.people__members { font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); margin-top: .75rem; }
.ticks { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: var(--fs-1); }
.ticks li { padding: .35rem 0 .35rem 1.5rem; position: relative; }
.ticks li::before { content: "\2713"; position: absolute; left: 0; color: var(--verdigris); font-weight: 700; }
.toollist { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.toollist li { display: flex; flex-direction: column; padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.toollist li a { font-size: var(--fs-2); text-decoration: none; }
.toollist li span { font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); }

/* Forms */
.form { font-family: var(--sans); max-width: 40rem; }
.field { margin: 0 0 1.25rem; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-size: var(--fs-1); font-weight: 600; margin-bottom: .35rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="date"], .field textarea {
  width: 100%; font: inherit; font-size: var(--fs-2); color: var(--ink); background: var(--white);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: .6rem .75rem;
}
.field input:focus, .field textarea:focus { border-color: var(--verdigris); outline: 2px solid var(--verdigris-soft); }
.field--bad input, .field--bad textarea { border-color: var(--oxide); }
.field__error { color: var(--oxide); font-size: var(--fs-0); margin: .35rem 0 0; }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }
.choices { display: grid; gap: .5rem; }
@media (min-width: 600px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400 !important; font-size: var(--fs-1); padding: .6rem .75rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--verdigris); background: var(--verdigris-soft); }
.choice input { margin-top: .25rem; accent-color: var(--verdigris); }
.choice em { font-style: normal; color: var(--muted); margin-left: .35rem; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 1rem 1.25rem; border-radius: var(--radius); font-family: var(--sans); font-size: var(--fs-1); margin-bottom: 1.5rem; }
.notice p { margin: 0; }
.notice--ok { background: var(--verdigris-soft); border-left: 3px solid var(--verdigris); }
.notice--bad { background: var(--ochre-soft); border-left: 3px solid var(--oxide); }

/* ---- Search -------------------------------------------------------------- */
.search--page { max-width: 40rem; margin-bottom: 1.5rem; border-radius: var(--radius); padding: .25rem .25rem .25rem .9rem; }
.search--page input { width: 100%; font-size: var(--fs-2); }
.results { list-style: none; margin: 0; padding: 0; max-width: 80ch; }
.results li { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.results__kind { color: var(--verdigris); font-size: var(--fs-0); }
.results li a { font-size: var(--fs-3); text-decoration: none; }
.results__snippet { font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); }

/* ---- Site index ---------------------------------------------------------- */
.siteindex { display: grid; gap: 2.5rem; font-family: var(--sans); font-size: var(--fs-1); }
@media (min-width: 900px) { .siteindex { grid-template-columns: repeat(3, 1fr); gap: 3rem; } }
.siteindex h2 { margin: 0 0 .75rem; font-size: var(--fs-3); }
.siteindex h2 + ul, .siteindex h2 + ol { margin-bottom: 2rem; }
.siteindex ul, .siteindex ol { margin: 0; padding-left: 1.2rem; }
.siteindex li { margin: .3rem 0; }
.siteindex ul ul { padding-left: 1rem; font-size: var(--fs-0); }
.siteindex details { border-top: 1px solid var(--rule); padding: .5rem 0; }
.siteindex summary { cursor: pointer; font-family: var(--mono); font-weight: 500; }
.siteindex details ul { list-style: none; padding: .5rem 0 0; }
.siteindex details a { text-decoration: none; }

/* ---- Related / plates ---------------------------------------------------- */
.related { max-width: var(--measure); margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.related h2 { margin: 0 0 .75rem; font-size: var(--fs-3); }
.platelist { columns: 2; column-gap: 2rem; list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: var(--fs-1); }
.platelist li { margin: .3rem 0; break-inside: avoid; }
.platelist a { text-decoration: none; }
.platelist a:hover { text-decoration: underline; }

/* ---- Footer -------------------------------------------------------------- */
.footer { background: var(--paper-2); border-top: 1px solid var(--rule); margin-top: 2rem; font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); }
.footer__inner { max-width: var(--wide); margin: 0 auto; padding: 2.5rem var(--gutter) 2rem; display: grid; gap: 2rem; }
@media (min-width: 900px) { .footer__inner { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; } }
.footer__about p { margin: .75rem 0 0; }
.footer__heading { font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; margin: 0 0 .6rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: .3rem 0; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--verdigris); text-decoration: underline; }
.footer__base { border-top: 1px solid var(--rule); }
.footer__base p { max-width: var(--wide); margin: 0 auto; padding: 1rem var(--gutter); font-size: var(--fs-0); color: var(--muted); }
.dev-badge { display: inline-block; background: var(--ochre); color: #fff; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; padding: .1rem .5rem; border-radius: 999px; vertical-align: middle; }

/* ---- Lightbox ------------------------------------------------------------ */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 96vh; }
.lightbox::backdrop { background: rgba(15, 20, 23, .9); }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: .5rem; }
.lightbox img { max-width: 96vw; max-height: 86vh; width: auto; height: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox figcaption { color: #ddd; font-family: var(--sans); font-size: var(--fs-1); text-align: center; }
.lightbox__close { position: fixed; top: 1rem; right: 1rem; background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px; width: 2.5rem; height: 2.5rem; font-size: 1.5rem; cursor: pointer; }

/* ---- Plate modal (project detail pages opened in place) ------------------ */
.plate-modal { border: 0; padding: 0; background: transparent; width: min(96vw, 900px); max-height: 94vh; }
.plate-modal::backdrop { background: rgba(15, 20, 23, .78); }
.plate-modal__frame { background: var(--paper); color: var(--ink); border-radius: var(--radius); box-shadow: 0 24px 70px rgba(0, 0, 0, .45); max-height: 94vh; display: flex; flex-direction: column; }
.plate-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--rule); }
.plate-modal__title { font-size: var(--fs-3); margin: 0; }
.plate-modal__close { background: transparent; border: 1px solid var(--rule-strong); border-radius: 999px; width: 2.25rem; height: 2.25rem; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-2); flex: none; }
.plate-modal__close:hover { color: var(--verdigris); border-color: var(--verdigris); }
.plate-modal__body { padding: 1.25rem; overflow: auto; max-width: none; }
.plate-modal__body .fig { margin: 0 0 1.25rem; }
.plate-modal__body .fig img { width: 100%; }
.plate-modal__body > :last-child { margin-bottom: 0; }
.fig a[href*="/projects/"] img, .fig a[href*="/notes/"] img { cursor: zoom-in; }

/* ---- Print --------------------------------------------------------------- */
@media print {
  .masthead, .nav, .footer, .pager, .aside, .back, .skip, .lightbox { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page-head { border: 0; background: none; }
  .prose { max-width: none; }
  .fig img { border: 0; }
  a { color: inherit; text-decoration: none; }
}

/* ---- Members' area ------------------------------------------------------- */
.cards--members { grid-template-columns: repeat(2, 1fr); margin: 1.5rem 0 2rem; }
@media (min-width: 1024px) { .cards--members { grid-template-columns: repeat(2, 1fr); } }
.card__image--square { aspect-ratio: 1 / 1; background-size: contain; background-color: var(--white); filter: none; }

/* ---- About band directly under the hero ---------------------------------- */
.band--about { background: var(--paper); border-bottom: 1px solid var(--rule); padding: 2.75rem 0; }
.band__inner--about { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.band__inner--about h2 { margin-bottom: .75rem; }

/* ---- Survey records (graffiti survey) ------------------------------------ */
.record { border: 1px solid var(--rule); border-left: 3px solid var(--verdigris); border-radius: var(--radius); background: var(--white); padding: 1rem 1.25rem; margin: 1.5rem 0; max-width: none; }
.record__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem 1rem; margin-bottom: .75rem; }
.record__type { font-family: var(--sans); font-size: var(--fs-0); text-transform: uppercase; letter-spacing: .12em; color: var(--verdigris); font-weight: 600; }
.record__fabric { color: var(--muted); font-size: var(--fs-0); }
.record__title { flex-basis: 100%; margin: 0; font-family: var(--serif); font-size: var(--fs-3); font-weight: 500; }
.record__body { display: grid; gap: 1rem; }
@media (min-width: 720px) { .record__body { grid-template-columns: minmax(0, 3fr) minmax(220px, 2fr); gap: 1.5rem; } }
.record__locations { margin: 0 0 .75rem; font-size: var(--fs-0); border-top-width: 1px; }
.record__locations td:first-child { width: 3rem; color: var(--muted); }
.record__notes { font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); margin: 0; }
.record__pics { display: grid; gap: .75rem; }
.record__pics .fig { margin: 0; max-width: none; float: none; }
.record__pics .fig figcaption { display: none; }
.record__pics .fig img { border-color: var(--rule); }
.prose .index { font-size: var(--fs-0); }
.prose .index td:first-child { white-space: nowrap; }
.prose .record h4 { margin: 0; }
.prose h3[id^="area-"] { font-family: var(--serif); font-size: var(--fs-3); font-weight: 500; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.fig a.no-zoom { cursor: default; }
.fig a.no-zoom:hover img { border-color: var(--rule); }
