/* ==========================================================================
   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, .toc ul { list-style: none; margin: 0; padding: 0; }
.toc > ol { counter-reset: toc; }
.toc > ol > li { counter-increment: toc; font-size: var(--fs-1); margin: .3rem 0; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .55rem; }
.toc > ol > li::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: var(--fs-0); color: var(--muted); padding-top: .15em; }
/* A chapter's sections, and their parts set out in a run beneath each, as an author's own index would. */
.toc__sections { grid-column: 2; margin: .15rem 0 .45rem; }
.toc__sections > li { font-size: var(--fs-0); margin: .2rem 0; }
.toc__parts { display: flex; flex-wrap: wrap; gap: .05rem .7rem; margin: .1rem 0 .3rem .7rem; }
.toc .toc__parts a { color: var(--muted); }
.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; }
  /* A long outline scrolls within itself, so the sticky list never runs past the foot of the window. */
  .toc { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; overscroll-behavior: contain; }
}
.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 h4 { margin: 1.6em 0 .4em; font-size: var(--fs-1); font-weight: 600; font-family: var(--sans); color: var(--verdigris); scroll-margin-top: 1.5rem; }
.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; }   /* a picture wrapped in its link; a link in the caption stays in the line */
.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; }
.fig figcaption b { color: var(--ink-2); font-weight: 600; }
/* A row of pictures side by side at one height. Each takes a share of the row in proportion to its shape
   (--ratio, width over height), so their tops and bottoms line up; where the column is too narrow for them all
   at a readable size the row wraps instead of shrinking them. A row is one figure with a shared caption, or a
   set of figures each with its own. --natural caps the row where a wider one would enlarge its pictures, and
   --row-min is the height below which the row wraps rather than shrink further (a row of small details beneath
   a larger picture can go lower than the usual 11rem). */
.fig-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.25rem .75rem; margin: 2rem auto; max-width: var(--natural, none); }
.fig-row > img, .fig-row > .fig { flex: var(--ratio) 1 calc(var(--ratio) * var(--row-min, 11rem)); min-width: 0; margin: 0; max-width: none; float: none; }
.fig-row > figcaption { flex-basis: 100%; margin-top: -.75rem; text-align: center; }
.fig-row:not(figure) > .fig figcaption { text-align: left; }
/* One picture with a row of smaller ones beneath it, under one caption */
.fig > .fig-row { margin: .75rem 0 0; }
/* A paper that numbers its own figures ("Photo 4", "Fig 7") and cites them by those numbers keeps them, in
   the place and style of the automatic number. */
.fig figcaption:has(.fig-number)::before { content: none; }
.fig-number { font-family: var(--mono); color: var(--verdigris); margin-right: .3em; }
.fig figcaption ol { margin: .4rem 0 0; padding-left: 1.4rem; text-align: left; }
.fig-source { white-space: nowrap; }

/* A hand-laid report's authors, references and the people who took part */
.prose .authors { font-family: var(--sans); font-size: var(--fs-1); color: var(--muted); line-height: 1.5; margin-bottom: 1.75rem; }
.prose .authors strong { display: block; font-family: var(--serif); font-size: var(--fs-3); font-weight: 500; color: var(--ink); }
.prose .references { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: var(--fs-1); line-height: 1.5; color: var(--ink-2); }
.prose .references li { padding-left: 1.5rem; text-indent: -1.5rem; margin: 0 0 .55rem; overflow-wrap: anywhere; }
.prose .roles { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem 1.5rem; margin: 0 0 1.5rem; font-family: var(--sans); font-size: var(--fs-1); }
.prose .roles dt { font-weight: 600; color: var(--ink); }
.prose .roles dd { margin: 0; color: var(--muted); }

/* A hand-laid report's footnotes, sign-off and thanks */
.prose .notes { list-style: none; margin: 1.5rem 0 0; padding: 0; font-family: var(--sans); font-size: var(--fs-0); line-height: 1.5; color: var(--muted); }
.prose .notes::before { content: ""; display: block; width: 4rem; border-top: 1px solid var(--rule-strong); margin-bottom: .75rem; }
.prose .notes li { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); margin: .2rem 0; }
.prose .notes li > span:first-child { font-family: var(--mono); color: var(--verdigris); }
.prose .signoff { margin: 2.5rem 0 1.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--sans); font-size: var(--fs-1); color: var(--muted); }
.prose .signoff strong { display: block; font-family: var(--serif); font-size: var(--fs-3); font-weight: 500; color: var(--ink); }
.prose .thanks { font-family: var(--sans); font-size: var(--fs-0); color: var(--muted); }

/* 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; }
/* The Society's motto, in its own voice: the serif, set apart from the running text. */
.motto { font-family: var(--serif); font-style: italic; color: var(--verdigris-2); }
.hero .motto { font-size: var(--fs-3); margin: .9rem 0 0; }
.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__photo { display: block; aspect-ratio: 16 / 10; overflow: hidden; margin: .65rem 0 .75rem; background: var(--paper-2); border-radius: var(--radius); }
.panel__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.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(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; grid-template-areas: "newsletter meeting" "newsletter blog"; }
  .panel { min-width: 0; padding: 2rem 2rem 2rem 0; border-bottom: 0; }
  .panel--meeting { grid-area: meeting; padding: 2rem 0 2rem 2rem; border-bottom: 1px solid var(--rule); }
  .panel--blog { grid-area: blog; padding: 2rem 0 2rem 2rem; }
  .panel--newsletter { grid-area: newsletter; border-right: 1px solid var(--rule); }
}

.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; }
.chapters__picture { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-3); filter: saturate(.85); }
.chapters__link:hover .chapters__picture { filter: none; }

/* ---- Paying a subscription online (templates/payments/buttons.php) ---- */
.pay-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.pay { max-width: 26rem; }
.pay__what { font-family: var(--sans); }
/* PayPal's buttons are a light page in a frame. A browser paints such a frame solid white on a dark page,
   so the box holding it says it is light too: the frame stays transparent and shows the page behind it. */
.pay__buttons { margin: .9rem 0; min-height: 3rem; color-scheme: light; }
.pay__message { font-family: var(--sans); font-weight: 600; color: var(--verdigris); }
.pay__message:empty { display: none; }
.pay--done .pay__buttons, .pay--done .field, .pay--done .pay__small, .pay--done .pay__total { display: none; }
/* The donation is pounds: the £ sits inside the box, so what is typed is only the number. */
.pay__pounds { position: relative; max-width: 10rem; }
.pay__pounds span { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); font-size: var(--fs-2); color: var(--ink-2); pointer-events: none; }
.field .pay__pounds input[type="text"] { padding-left: 1.7rem; }
.pay__total { font-family: var(--sans); font-weight: 600; }
.pay__total--bad { color: var(--oxide); font-weight: 400; }
.pay__small { font-size: var(--fs-0); }
.pay-section--join { margin-top: 2rem; }
/* On the renewal page paying is the page itself, not a section after a form. */
.pay-section--renew { margin-top: 1.25rem; padding-top: 0; border-top: 0; }
.pay__or { margin-top: 1.5rem; font-family: var(--sans); color: var(--ink-2); }

/* ---- Seasons: a report told season by season opens with them side by side (season_overview.py) ---- */
.prose .seasons { margin: 0 0 2.75rem; }
.prose .chapters--seasons { margin: 0; padding: 0; grid-template-columns: repeat(var(--seasons, 4), minmax(0, 1fr)); gap: .75rem; }
.prose .chapters--seasons > li { margin: 0; }
.chapters--seasons .chapters__body { padding: .7rem .8rem .85rem; gap: .15rem; }
.chapters--seasons .chapters__number { font-family: var(--mono); font-size: var(--fs-1); letter-spacing: .04em; }
.chapters--seasons .chapters__title { font-size: var(--fs-2); }
.chapters--seasons .chapters__text { font-size: var(--fs-0); line-height: 1.45; }
@media (max-width: 719px) {
  /* a strip to swipe along, the next season showing at the edge; the page itself never scrolls sideways */
  .prose .chapters--seasons { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(12rem, 68%);
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding-bottom: .5rem; }
  .prose .chapters--seasons > li { scroll-snap-align: start; }
}

/* ---- 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; }
/* The Join form's data protection statement, read before its consent box is ticked. */
.data-protection { background: var(--paper-2); border-left: 3px solid var(--rule-strong); padding: 1rem 1.25rem; margin: 1.5rem 0 1rem; font-family: var(--sans); font-size: var(--fs-1); color: var(--ink-2); }
.data-protection h2 { font-size: var(--fs-2); font-family: var(--sans); font-weight: 600; margin: 0 0 .5rem; }
.data-protection p { margin: .5rem 0 0; }
.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 input[type="password"], .field input[type="number"], .field input[type="url"], .field input[type="time"], .field select, .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 select:focus, .field textarea:focus { border-color: var(--verdigris); outline: 2px solid var(--verdigris-soft); }
/* As specific as the box's own rule above, so the warning colour wins over its everyday border. */
.field.field--bad input, .field.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__about .motto { font-size: var(--fs-2); }
.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 .footer__officers li { margin: 0 0 .7rem; }
.footer__officers span, .footer__officers a { display: block; }
.footer__officers span { font-size: var(--fs-0); color: var(--muted); }
.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; }
/* The picture sits in a frame as big as the screen allows, whole and centred to begin with, and zooms and moves
   inside it (site.js sizes and places it); the browser's own pinch and scroll are turned off over the frame so a
   gesture zooms the picture, not the page. */
.lightbox__stage { position: relative; width: min(96vw, 1400px); height: 100%; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
/* The frame takes the height the caption leaves; a long caption scrolls in its own space on a small screen */
.lightbox figure { height: 96vh; grid-template-rows: minmax(0, 1fr) auto auto; }
.lightbox figcaption { max-height: 24vh; overflow-y: auto; padding: 0 .5rem; }
@media (max-width: 640px) { .lightbox figcaption { font-size: var(--fs-0); } }
.lightbox img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); cursor: zoom-in; -webkit-user-drag: none; }
.lightbox__stage.is-zoomed img { cursor: grab; }
.lightbox__stage.is-dragging img { cursor: grabbing; }
.lightbox figcaption { color: #ddd; font-family: var(--sans); font-size: var(--fs-1); text-align: center; }
.lightbox__hint { margin: 0; color: #9aa5a8; font: var(--fs-0)/1.4 var(--sans); text-align: center; }
.lightbox__close, .lightbox__tool { position: fixed; top: 1rem; background: rgba(15, 20, 23, .6); color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px; min-width: 2.5rem; height: 2.5rem; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.lightbox__close { right: 1rem; }
.lightbox__tools { position: fixed; top: 1rem; right: 4rem; display: flex; gap: .4rem; }
.lightbox__tool { position: static; padding: 0 .6rem; }
.lightbox__tool--fit { font: 600 var(--fs-0)/1 var(--sans); }
.lightbox__tool:disabled { opacity: .35; cursor: default; }
.lightbox__close:focus-visible, .lightbox__tool:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* The frame takes the keys, but it is the whole picture area, so a ring round it would only draw a line across the screen */
.lightbox__stage:focus { outline: none; }
/* The buttons stay above the picture however far it is zoomed */
.lightbox__close, .lightbox__tools { z-index: 1; }

/* ---- 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 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: center; }
.band__inner--about > div { max-width: var(--measure); }
.band__inner--about h2 { margin-bottom: .75rem; }
@media (min-width: 900px) { .band__inner--about { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 3.5rem; } }
.about-photo { margin: 0; }
.about-photo img { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.about-photo figcaption { font-family: var(--sans); font-size: var(--fs-0); color: var(--muted); margin-top: .6rem; line-height: 1.45; }

/* ---- 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); }

/* ---- Record collections (members) ---------------------------------------- */
.finder { display: grid; gap: 0 1rem; font-family: var(--sans); margin-bottom: 1rem; align-items: end; }
@media (min-width: 720px) { .finder { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; } }
.finder .field { margin-bottom: .75rem; }
.finder__go { display: flex; gap: .75rem; align-items: center; margin-bottom: .75rem; font-size: var(--fs-1); }
.finder-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; font-family: var(--sans); font-size: var(--fs-1);
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); padding: .6rem 0; margin-bottom: 1rem;
}
.finder-bar__count { margin: 0; margin-right: auto; color: var(--ink-2); }
.finder-bar__sort { display: flex; align-items: center; gap: .5rem; }
.finder-bar__sort label { color: var(--muted); }
.finder-bar__sort select { font: inherit; padding: .3rem .5rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--white); color: var(--ink); }
.finder-bar__dir { text-decoration: none; font-family: var(--mono); font-size: var(--fs-0); }
.switch { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; }
.switch a { padding: .35rem .8rem; text-decoration: none; color: var(--ink-2); }
.switch a + a { border-left: 1px solid var(--rule-strong); }
.switch a[aria-current="page"] { background: var(--verdigris); color: #fff; }

.entries { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 1rem; align-items: center;
  padding: .7rem .25rem; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit;
}
.entry:hover { background: var(--paper-2); color: inherit; }
.entry__thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 2px; border: 1px solid var(--rule); background: var(--paper-3); }
.entry__thumb--none { display: block; }
.entry__body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.entry__kicker { font-family: var(--sans); font-size: var(--fs-0); color: var(--verdigris); text-transform: uppercase; letter-spacing: .06em; }
.entry__title { font-family: var(--serif); font-size: var(--fs-2); font-weight: 500; line-height: 1.25; }
.entry__place { font-family: var(--sans); font-size: var(--fs-0); color: var(--muted); }
.entry__id { font-family: var(--mono); font-size: var(--fs-0); color: var(--muted); }
@media (max-width: 520px) { .entry { grid-template-columns: 48px minmax(0, 1fr); } .entry__thumb { width: 48px; height: 40px; } .entry__id { display: none; } }
.pages { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; font-family: var(--sans); font-size: var(--fs-1); margin: 1.5rem 0; }
.pages > :last-child { justify-self: end; }
.pages span { color: var(--muted); }

.recordmap { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2); z-index: 0; }
.recordmap--large { height: min(70vh, 640px); }
.recordmap--small { height: 240px; margin: 1rem 0 1.5rem; }
.recordmap__popup { display: flex; flex-direction: column; gap: .2rem; font-family: var(--sans); }
.recordmap__popup span { font-size: .75rem; color: #2a6b69; text-transform: uppercase; letter-spacing: .06em; }
.recordmap__popup a, .recordmap__popup strong { font-size: .95rem; font-weight: 600; }

.recordnav { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; font-family: var(--sans); font-size: var(--fs-1); margin-bottom: 2rem; }
.recordnav__steps { display: flex; gap: 1rem; margin-right: auto; font-family: var(--mono); font-size: var(--fs-0); }
.photoset { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.photoset h2 { margin-top: 0; }
.photoset__grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
.photoset__grid .fig { margin: 0; max-width: none; float: none; }
.photoset__credit { display: block; color: var(--muted); font-size: var(--fs-0); margin-top: .2rem; }
.photoset__grid--small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.photoset__edit { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; font-family: var(--sans); font-size: var(--fs-0); color: var(--ink-2); }
.photoset__edit img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--rule); border-radius: 2px; }
.photoset__edit:hover img { border-color: var(--verdigris); }
.photo-preview { margin: 0 0 1rem; max-width: none; float: none; }
.photo-turn { display: flex; gap: .75rem; }
.photo-save { display: flex; flex-wrap: wrap; gap: .6rem; }

.form--wide { max-width: 60rem; }
@media (min-width: 720px) { .field-row--three { grid-template-columns: repeat(3, 1fr); } }
.field textarea { resize: vertical; }
.field__hint { font-size: var(--fs-0); margin: .35rem 0 0; }
.danger { margin-top: 3rem; padding: 1.25rem 1.5rem; border: 1px solid var(--rule); border-left: 3px solid var(--oxide); border-radius: var(--radius); font-family: var(--sans); max-width: 60rem; }
.danger h2 { margin: 0 0 .75rem; font-size: var(--fs-2); font-family: var(--sans); }
.button--danger { background: var(--oxide); border-color: var(--oxide); color: #fff; }
.button--danger:hover { background: var(--ink); border-color: var(--ink); }

/* Suggested entries: the member's own list on the records shelf, the approvers' desk and one suggestion's page */
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--verdigris); text-decoration: underline; cursor: pointer; }
.link-button:hover { color: var(--oxide); }
.suggestion { font-family: var(--sans); max-width: 60rem; margin-bottom: 2rem; }
.suggestion__status { display: inline-block; margin-right: .5rem; padding: .05rem .55rem; border-radius: 999px; background: var(--paper-3); font: 600 var(--fs-0)/1.6 var(--sans); color: var(--ink-2); }
.suggestion__status--waiting { background: var(--ochre-soft); color: var(--ink); }
.suggestion__status--added { background: var(--verdigris-soft); color: var(--verdigris-2); }
.suggestion__note { margin: .5rem 0 1rem; padding: .6rem .9rem; background: var(--paper-2); border-left: 3px solid var(--rule-strong); font-family: var(--sans); }
.suggestion__photos { margin: 1rem 0; }
.suggestion__photos img { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius); }
.suggestions__waiting td { font-weight: 600; }
.your-suggestions { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-family: var(--sans); }
.your-suggestions h2 { margin: 0 0 1rem; }
.your-suggestions__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.your-suggestions__withdraw { display: inline; margin-left: .5rem; }

/* Your part in the Society: the figures together, then each part of a member's work */
.your-part { max-width: 60rem; font-family: var(--sans); }
.your-part__figures { list-style: none; margin: 0 0 2.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr)); gap: .75rem; }
.your-part__figures li { padding: 1rem 1.1rem; border: 1px solid var(--rule); border-top: 3px solid var(--verdigris); border-radius: var(--radius); background: var(--white); }
.your-part__figures strong { display: block; font-family: var(--serif); font-weight: 500; font-size: var(--fs-5); line-height: 1.1; color: var(--ink); }
.your-part__figures span { display: block; margin-top: .25rem; font-size: var(--fs-1); color: var(--muted); }
.your-part__start { margin: 0 0 2.5rem; font-size: var(--fs-2); }
.your-part__part { padding: 1.75rem 0; border-top: 1px solid var(--rule); }
.your-part__part h2 { margin: 0 0 1rem; }
.your-part__part h3 { margin: 1.25rem 0 .5rem; font-family: var(--sans); font-size: var(--fs-1); font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }
.your-part__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.your-part__more { font-size: var(--fs-1); color: var(--muted); }
.your-part__invite { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 1rem 0 0; }
.your-part__note { margin: 1rem 0 0; font-size: var(--fs-0); }
