/* PuuProffa — static site styles.
   Hand-written, no build step. Light only, and deliberately plain: long Finnish
   prose is the thing being read, so the page is one sans at a generous measure
   and everything around it is hairlines, space and type. No boxes, no fills,
   no shadows.

   Typography and colour follow Aalto University's visual identity, since the
   site is being handed to Aalto course staff: Inter throughout, and Aalto's
   monochrome scale with its three highlight colours used sparingly. The Aalto
   logo is deliberately NOT used — the content is not Aalto’s, and the mark
   would claim otherwise. */

/* Inter is SIL OFL and served from assets/fonts/. Paths are relative to this
   file, so they resolve identically under --base and --relative. */
@font-face {
  font-family: "Inter var";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Aalto neutrals, taken from the tokens in use on aalto.fi. */
  --paper:   #ffffff;          /* brand background            */
  --ink:     #151515;          /* brand black — headings      */
  --ink-2:   #2d2d2d;          /* brand text — body           */
  --ink-3:   #6f6f6f;          /* muted; still 5:1 on white   */
  --rule:    #e3e3e3;
  --rule-2:  #f2f2f2;          /* brand neutral grey          */

/* Highlights. Used as blocks and rules, never as text colour — none of them
     reaches 4.5:1 on white. */
  --hl-yellow: #f7e159;
  --hl-green:  #69bc08;        /* the green from the original menu */
  --hl-coral:  #fd6360;
  /* The same green darkened to 4.8:1, for the places it has to be read as text
     rather than seen as a mark. */
  --green:   #468005;
  --accent:  var(--ink);

  /* Aalto: Inter everywhere; Arial is Aalto's own named fallback. */
  --sans: "Inter var", Inter, Arial, Helvetica, sans-serif;
  --display: "Inter var", Inter, Arial, Helvetica, sans-serif;

  --measure: 66ch;
  --sidebar: 16rem;
  --gap: clamp(1.25rem, 3vw, 3rem);
  --shell-pad: clamp(2rem, 4vw, 3.5rem);
  /* The sticky header's real height. site.js measures it and overwrites this on
     <html>; the value here is only the pre-script and no-script fallback. It
     matters because everything that sticks has to clear the header exactly —
     get it wrong and the sidebar visibly hops as it catches up on first scroll. */
  --header-h: 4.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-optical-sizing: auto;
  font: 400 clamp(1rem, .96rem + .2vw, 1.06rem)/1.7 var(--sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-color: currentColor; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .6rem 1rem;
  font: 500 .85rem/1 var(--sans);
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

/* --- header --------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .9rem 1.75rem;
  padding: .8rem var(--gap);
  max-width: 82rem; margin: 0 auto; width: 100%;
}

.brand { text-decoration: none; display: flex; align-items: center; }
/* The original wordmark, at its own 204×50 proportions. */
.brand-logo { display: block; height: 2.6rem; width: auto; }
.brand:hover .brand-logo { opacity: .72; }

.bar-end { margin-left: auto; display: flex; align-items: center; gap: 1.25rem; }

.site-search input, .search-form input, .glossary-filter input {
  font: 400 .85rem/1.4 var(--sans);
  padding: .15rem 0 .3rem;
  border: 0; border-bottom: 1px solid var(--rule);
  border-radius: 0; background: none; color: var(--ink);
  width: 11rem; max-width: 40vw;
  -webkit-appearance: none; appearance: none;
}
.site-search input::placeholder,
.search-form input::placeholder,
.glossary-filter input::placeholder { color: var(--ink-3); }
.site-search input:focus, .search-form input:focus, .glossary-filter input:focus {
  outline: 0; border-bottom-color: var(--ink);
}

.lang-switch {
  /* Same size as the section links it sits beside in the bar. */
  font: 500 1rem/1 var(--sans); letter-spacing: .08em;
  text-decoration: none; color: var(--ink-3);
}
.lang-switch:hover { color: var(--ink); }

.nav-toggle {
  display: none; font: 500 .82rem/1 var(--sans);
  background: none; color: var(--ink-2);
  border: 0; padding: 0; cursor: pointer;
}

/* The sections sit on the logo's line, as they did on the original site. */
.primary-nav { flex: 0 1 auto; }
.primary-nav ul {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  list-style: none; margin: 0; padding: 0;
}
.primary-nav a {
  display: block;
  /* 16px uppercase, the size the original menu set. */
  font: 400 1rem/1 var(--sans);
  text-transform: uppercase; letter-spacing: .05em;
  text-decoration: none; color: var(--ink-2);
}
.primary-nav a:hover { color: var(--green); }
/* Where you are is said in green, the way the original menu said it. */
.primary-nav a.current { color: var(--green); }

/* --- hero ----------------------------------------------------------------- */

/* The front page's banner: full width, the title over the photograph, as the
   original site opened. The dark wash falls from the left, where the words are,
   so the type has something to sit on whatever the picture does. */
.hero {
  position: relative; isolation: isolate;
  display: flex; align-items: center;
  min-height: clamp(15rem, 34vw, 27rem);
  background: var(--ink); overflow: hidden;
}
.hero-image {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.24) 45%, rgba(0,0,0,0) 75%);
}
/* The h1 is the container, so the title starts on the same line the header's
   logo does; the span inside it is what keeps the words to a readable measure. */
.hero h1 {
  width: 100%; max-width: 82rem; margin: 0 auto;
  padding: 2.5rem var(--gap);
  color: #fff;
  font: 700 clamp(1.9rem, 4.2vw, 3.9rem)/1.05 var(--display);
  text-transform: uppercase; letter-spacing: -.005em;
  text-shadow: 0 2px 10px rgba(0,0,0,.45);
}
/* One word to a line, the shape the original's narrow title column gave it. */
.hero h1 span { display: block; }
/* With the banner carrying the title, the page head is only the translation
   link, and it should not reserve a title's worth of space. */
.page.has-hero .page-head { margin-bottom: 1.25rem; }

/* --- shell ---------------------------------------------------------------- */

.shell {
  flex: 1;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: 82rem; width: 100%; margin: 0 auto;
  padding: var(--shell-pad) var(--gap) 4rem;
  align-items: start;
}
.shell:not(:has(.sidebar)) { grid-template-columns: minmax(0, 1fr); }

.sidebar {
  /* Pinned at its own resting place — header plus the shell's top padding — so
     the first scroll does not yank it upwards to meet a shorter offset. */
  position: sticky; top: calc(var(--header-h) + var(--shell-pad));
  max-height: calc(100vh - var(--header-h) - var(--shell-pad) - 2rem);
  overflow-y: auto; overscroll-behavior: contain;
  font: 400 .84rem/1.5 var(--sans);
  padding-right: .5rem;
}
/* Three levels in the tree, so three sizes that descend: the section name, the
   grouping rows under it, then the page links at the sidebar's own .84rem.
   Both headings were smaller than the links they head until 2026-09-11 — the
   tree read upside down. Size and weight carry the rank; colour barely moves,
   because the links are the things you click. */
.sidebar-title {
  font: 600 1rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink); margin: 0 0 .9rem;
}
.sidebar-title a { text-decoration: none; }
.sidebar-title a:hover { color: var(--ink); }

.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar ul.lvl-1, .sidebar ul.lvl-2, .sidebar ul.lvl-3 {
  margin: .1rem 0 .3rem .1rem; padding-left: .8rem; border-left: 1px solid var(--rule-2);
}
/* Every row is the same two columns: a gutter for the twisty, then the label.
   Leaf rows leave the gutter empty so their text still lines up. */
.sidebar li {
  display: grid; grid-template-columns: .95rem minmax(0, 1fr); align-items: baseline;
}
.sidebar li > ul { grid-column: 1 / -1; }
.sidebar li > a, .sidebar li > .group-label { grid-column: 2; }
.sidebar li > a {
  display: flex; align-items: baseline; gap: .5rem;
  padding: .25rem 0;
  text-decoration: none; color: var(--ink-2);
}
.sidebar li > a .label { min-width: 0; }

/* Collapsing is a JS affordance, so it is gated on html.js: with the script off
   every branch stays open and no page falls out of reach. */
/* The box given to the button is exactly the first line box of the row beside it
   — the row's top padding as the margin, its line-height as the height — so
   centring inside the button centres against the label, whatever size that label
   is. Hence `font: inherit`: the em below has to be the row's em. */
.twisty {
  grid-column: 1; align-self: start;
  display: none; place-items: center;
  width: .95rem; height: 1.5em; margin: .25rem 0 0 -.1rem;
  padding: 0; font: inherit;
  background: none; border: 0; color: var(--ink-3); cursor: pointer;
}
.js .sidebar li.branch > .twisty { display: grid; }
/* A hairline chevron rather than a filled triangle: the page is drawn in
   hairlines and type, and a solid arrowhead is the one heavy mark on it. */
.twisty::before {
  content: ""; width: .3rem; height: .3rem;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateX(-.06rem) rotate(-45deg);
  transition: transform .12s ease;
}
@media (prefers-reduced-motion: reduce) { .twisty::before { transition: none; } }
.twisty[aria-expanded="true"]::before { transform: translateY(-.06rem) rotate(45deg); }
.twisty:hover { color: var(--ink); }
.js .sidebar li.collapsed > ul { display: none; }
/* Open branches list their children, so the tally on the row would only repeat
   what is directly below it. */
.js .sidebar li.branch:not(.collapsed) > a > .count,
.js .sidebar li.branch:not(.collapsed) > .group-label > .count { display: none; }

/* Grouping items from the recovered menu ("Puusepan liitokset" and friends) are
   headings, not destinations — the original site had no page behind them. */
.sidebar li.group > .group-label {
  grid-column: 1 / -1;
  display: flex; align-items: baseline; gap: .5rem;
  padding: .9rem 0 .2rem;
  font: 600 .92rem/1.3 var(--sans); text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-2);
}
/* The whole grouping row is the toggle, so it carries the chevron itself. The
   widths ahead of the label add up to the twisty gutter, keeping every label in
   the sidebar on one left edge. */
.js .sidebar li.group.branch > .group-label { cursor: pointer; }
.js .sidebar li.group.branch > .group-label::before {
  content: ""; flex: none; align-self: center;
  width: .3rem; height: .3rem; margin: 0 .05rem 0 .1rem;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor;
  transform: translateX(-.06rem) rotate(-45deg);
  transition: transform .12s ease;
}
.js .sidebar li.group.branch > .group-label[aria-expanded="true"]::before {
  transform: translateY(-.06rem) rotate(45deg);
}
@media (prefers-reduced-motion: reduce) {
  .js .sidebar li.group.branch > .group-label::before { transition: none; }
}
.js .sidebar li.group.branch > .group-label:hover { color: var(--ink); }
.sidebar li.group:first-child > .group-label { padding-top: .2rem; }
.sidebar li.group > .group-label .count { text-transform: none; letter-spacing: 0; }
.sidebar li.group.on-path > .group-label { color: var(--ink-2); }
.sidebar li > a:hover { color: var(--ink); }
.sidebar li.on-path > a { color: var(--ink); }
.sidebar li.current > a { color: var(--ink); font-weight: 600; }
/* A tick on the list's own hairline. Hung off the li rather than the anchor: the
   li starts at the list's padding edge, so the offset is the padding and nothing
   else — it does not have to know about the twisty gutter. */
.sidebar li.current { position: relative; }
.sidebar li.current::before {
  content: ""; position: absolute; left: -.8rem; top: .5rem;
  width: 2px; height: .85rem; background: var(--hl-green);
}
.sidebar .count {
  margin-left: auto; flex: none;
  font: 400 .7rem/1 var(--sans); color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.content { min-width: 0; }

/* --- page furniture ------------------------------------------------------- */

.breadcrumbs { font: 400 .78rem/1.5 var(--sans); color: var(--ink-3); margin-bottom: 1.5rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--rule); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs [aria-current] { color: var(--ink-2); }

.page-head { margin-bottom: 2.25rem; }
.page-head h1 {
  font: 700 clamp(1.55rem, 1.1rem + 1.5vw, 2.3rem)/1.12 var(--display);
  /* Set in capitals, as the original site set its page titles. Capitals need
     none of the negative tracking that tightens mixed-case display type. */
  text-transform: uppercase; letter-spacing: 0; margin: 0;
  max-width: var(--measure); color: var(--ink);
}
.page-head .lede {
  font: 400 1rem/1.6 var(--sans); color: var(--ink-2);
  max-width: var(--measure); margin: .9rem 0 0;
}
.translation { margin: .9rem 0 0; font: 400 .8rem/1 var(--sans); }
.translation a { color: var(--ink-3); text-decoration-color: var(--rule); }
.translation a:hover { color: var(--ink); }

/* --- prose ---------------------------------------------------------------- */

/* A chemical formula or a bare URL has no break points, and on a phone one
   of them pushed the whole page sideways. Break it only when it cannot fit. */
.prose { max-width: var(--measure); overflow-wrap: break-word; }

/* Clear the browser's own block margins with :where(), which contributes NO
   specificity, so every rule below wins on its own terms. A plain
   `.prose p { margin: 0 }` here did not: at (0,1,1) it outranked the (0,1,0)
   rhythm rule underneath and silently zeroed the gap between every pair of
   paragraphs on the site. Only figures, headings and lists were holding the
   page apart. Do not reintroduce an element+class reset in this position. */
.prose :where(p, h1, h2, h3, h4, h5, h6, ul, ol, dl, blockquote, figure, pre, hr) {
  margin: 0;
}

/* One rhythm, applied inside the containers that hold more than one block. */
.prose > * + *,
.prose :is(blockquote, li) > * + * { margin-top: 1.35em; }
.prose > hr { margin: 3em 0; }

.prose a { text-decoration-color: var(--ink-3); }

/* Titles are separated by space, not by size: the classic editor left most
   section titles at or near body size, so if the gap above one is not clearly
   bigger than the gap between paragraphs it reads as part of the paragraph
   before it. Every level therefore clears the same ~3.4em OF BODY TEXT, which
   is why the em figures below differ — each is divided by its own font-size. */
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: var(--display); font-weight: 700; line-height: 1.25;
  letter-spacing: -.02em; margin: 0; scroll-margin-top: 6rem;
  color: var(--ink);
}
.prose h2 { font-size: 1.32em; margin-top: 2.6em; }
.prose h3 { font-size: 1.12em; margin-top: 3.05em; }
.prose h4 { font-size: 1.05em; margin-top: 3.25em; }
.prose h5, .prose h6 {
  font: 500 .8em/1.4 var(--sans); text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-2); margin-top: 4.25em;
}

/* A bold line on its own — md2html marks the short, label-shaped ones. It gets
   a title's space but stays a paragraph: the source only ever said "bold". */
.prose p.subhead {
  margin-top: 3.4em; line-height: 1.35; letter-spacing: -.015em; color: var(--ink);
}

.anchor {
  margin-left: .4em; color: var(--ink-3); text-decoration: none;
  opacity: 0; font-weight: 400; font-size: .75em;
}
:is(h2, h3, h4, h5, h6, dt):hover .anchor, .anchor:focus { opacity: 1; }

.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--ink-3); }

.prose blockquote {
  border-left: 1px solid var(--rule); padding-left: 1.4em; margin-left: 0;
  color: var(--ink-2);
}

/* The classic editor's `margin-left: 40px` asides — recipes, dosages, worked
   examples — are blockquotes now (corpus-format rule 4), and share the
   blockquote rule above. Kept as an indent and nothing more: the source said
   only "set this apart", so inventing a rule or a tint would put words in it. */

/* The original centred its images in the text column (.aligncenter, and the
   editor's own `text-align: center` paragraphs); a column-flex figure does that
   for images narrower than the measure and pulls the caption under the image
   rather than out to the column edge. */
.prose figure {
  display: flex; flex-direction: column; align-items: center;
  margin: 2.4em 0;
}
.prose figure > * { max-width: 100%; }
.prose figcaption {
  font: 400 .82rem/1.55 var(--sans); color: var(--ink-2);
  margin-top: .7rem; max-width: 52ch; text-align: center;
}
.prose figcaption:first-child { margin: 0 0 .7rem; }
.prose figcaption em { font-style: normal; }
a.zoom { display: block; cursor: zoom-in; }
.prose figure > a { display: block; }

/* Whatever follows a title stays tucked under it. Kept as one :is() rule so it
   outweighs the figure and list margins above — as separate selectors it tied
   with them on specificity and lost, which is why a list or an image after a
   heading used to open a full paragraph gap. */
.prose :is(h2, h3, h4, h5, h6, p.subhead) + * { margin-top: .6em; }

/* Nothing precedes the first block, so it opens no gap. Spelled out twice
   because the title rules above are class-specific enough to outrank a plain
   :first-child. */
.prose > :first-child, .prose > p.subhead:first-child { margin-top: 0; }

.prose .empty { color: var(--ink-3); }

/* --- listings ------------------------------------------------------------- */
/* Section and subpage lists are rows, not cards: a title, a line of context,
   and a hairline between them. */

.home-sections { max-width: 100%; margin-top: 4rem; }

.cards { list-style: none; margin: 0; padding: 0; }
.cards.big { columns: 2; column-gap: clamp(2rem, 5vw, 4rem); }
.cards.big > li { break-inside: avoid; }
.cards a {
  display: block; padding: 1rem 0;
  border-top: 1px solid var(--rule-2);
  text-decoration: none;
}
.cards a:hover .card-title { color: var(--accent); }

/* The front page's category tiles: a photograph, the name over it, and the
   invitation underneath — the original's post grid, in its own words. */
/* Two per row, two rows — the original front page was Bootstrap col-md-6
   tiles in two .post-grid-rows, and collapsed to one column below md. */
.cards.covers { columns: auto; display: grid; gap: .75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.covers > li.card-cover > a {
  position: relative; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .7rem; text-align: center;
  min-height: clamp(11rem, 22vw, 15rem);
  padding: 1.75rem 1.25rem;
  border-top: 0; overflow: hidden; background: var(--ink);
}
.card-image {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
}
.cards.covers > li.card-cover > a::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.28) 100%);
}
.cards.covers > li.card-cover > a:hover .card-image { transform: scale(1.04); }
.cards.covers > li.card-cover .card-title {
  font: 700 clamp(1.15rem, .9rem + 1vw, 1.8rem)/1.15 var(--display);
  color: #fff; text-transform: uppercase; letter-spacing: 0;
  text-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.cards.covers > li.card-cover > a:hover .card-title { color: #fff; }
.cards.covers > li.card-cover .card-meta { color: rgba(255,255,255,.82); }
.card-cta {
  display: inline-block; background: var(--green); color: #fff;
  font: 500 .78rem/1 var(--sans); text-transform: uppercase; letter-spacing: .06em;
  padding: .5rem .8rem;
}
/* A section with no picture behind it keeps the plain card it always had. */
.cards.covers > li:not(.card-cover) > a { border-top: 1px solid var(--rule-2); }
.card-title { display: block; font: 600 1rem/1.3 var(--display); letter-spacing: -.018em; color: var(--ink); }
.card-excerpt {
  display: block; font: 400 .84rem/1.6 var(--sans); color: var(--ink-2);
  margin-top: .3rem; max-width: 56ch;
}
.card-meta {
  display: block; font: 400 .72rem/1 var(--sans); color: var(--ink-3);
  margin-top: .5rem; font-variant-numeric: tabular-nums;
}

/* --- pager ---------------------------------------------------------------- */

.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
  margin-top: 4.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
.pager a { display: block; text-decoration: none; font: 600 .98rem/1.35 var(--display); letter-spacing: -.018em; }
.pager a:hover { color: var(--accent); }
.pager a span {
  display: block; margin-bottom: .3rem;
  font: 400 .7rem/1 var(--sans); text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-3);
}
.pager .next { text-align: right; }

/* --- glossary ------------------------------------------------------------- */

.glossary-filter { margin: 2rem 0 .5rem; }
.glossary-filter input { width: 20rem; max-width: 100%; }
.filter-status { font: 400 .78rem/1 var(--sans); color: var(--ink-3); margin: .7rem 0 0; min-height: 1em; }

.alphabet {
  display: flex; flex-wrap: wrap; gap: .9rem;
  padding: .9rem 0; border-bottom: 1px solid var(--rule); margin-bottom: 1rem;
  position: sticky; top: var(--header-h); background: var(--paper); z-index: 5;
}
.alphabet a { font: 400 .82rem/1 var(--sans); text-decoration: none; color: var(--ink-3); }
.alphabet a:hover { color: var(--accent); }

.glossary-body { max-width: var(--measure); }
.glossary-group { margin-top: 3rem; }
.glossary-group h2 {
  font: 700 1.35rem/1 var(--display); letter-spacing: -.025em; color: var(--ink-3);
  margin: 0 0 .5rem; scroll-margin-top: 8rem;
}
.glossary-body dl { margin: 0; }
.glossary-body .term { padding: .9rem 0; border-top: 1px solid var(--rule-2); }
.glossary-body .term[hidden] { display: none; }
.glossary-body dt { font: 600 .97rem/1.4 var(--display); letter-spacing: -.015em; scroll-margin-top: 8rem; }
.glossary-body dd { margin: .2rem 0 0; color: var(--ink-2); font-size: .96em; }
.glossary-body dd p { margin: 0; }
.glossary-body dd p + p { margin-top: .5em; }

/* --- search --------------------------------------------------------------- */

.search-form { margin: 2rem 0 .5rem; }
.search-form input { width: 24rem; max-width: 100%; font-size: 1.05rem; padding-bottom: .5rem; }
.search-status { font: 400 .8rem/1.4 var(--sans); color: var(--ink-3); margin: 1rem 0 1.5rem; }
.search-results { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.search-results li { border-top: 1px solid var(--rule-2); }
.search-results a { display: block; padding: 1.1rem 0; text-decoration: none; }
.search-results a:hover .result-title { color: var(--accent); }
.result-crumb {
  display: block; font: 400 .72rem/1.4 var(--sans); color: var(--ink-3);
  letter-spacing: .04em; margin-bottom: .25rem;
}
.result-title { display: block; font: 600 1rem/1.3 var(--display); letter-spacing: -.018em; }
.result-snippet {
  display: block; font: 400 .85rem/1.6 var(--sans); color: var(--ink-2); margin-top: .35rem;
}
.result-snippet mark, .result-title mark {
  background: none; color: inherit; font-weight: 600;
  box-shadow: inset 0 -.4em 0 var(--hl-yellow);
}
.result-kind { color: var(--ink-2); letter-spacing: .08em; text-transform: uppercase; font-size: .95em; }

/* --- lightbox ------------------------------------------------------------- */

.lightbox {
  position: fixed; inset: 0; z-index: 60;
  display: grid; grid-template-rows: 1fr auto; gap: 1.25rem;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: rgba(255, 255, 255, .985);
}
/* The script closes by setting .hidden, and this rule has to beat the
   display:grid above — the UA stylesheet's [hidden] { display: none } loses to
   any author rule, so without this the overlay never goes away. */
.lightbox[hidden] { display: none; }
.lightbox img {
  grid-row: 1; place-self: center;
  max-width: 100%; max-height: 100%; object-fit: contain;
  /* Line drawings on a white ground would otherwise have no edge. */
  outline: 1px solid var(--rule); outline-offset: 0;
}
.lightbox-caption {
  grid-row: 2; text-align: center; color: var(--ink-2);
  font: 400 .84rem/1.6 var(--sans); max-width: 56ch; margin: 0 auto;
}
.lightbox-caption strong { display: block; font-weight: 600; color: var(--ink); }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.25rem;
  width: 2rem; height: 2rem; border: 0; background: none;
  color: var(--ink-2); font: 400 1.6rem/1 var(--sans); cursor: pointer;
}
.lightbox-close:hover { color: var(--ink); }
body.lightbox-open { overflow: hidden; }

/* --- footer --------------------------------------------------------------- */

/* The original footer, reproduced: a solid band of the PuuProffa green
   (#69BC08 in the child theme) with white text on it. White on this green is
   2.4:1, below the WCAG 4.5:1 minimum — kept anyway, at the user's decision,
   because it is what the site looked like. The size bump to .85rem and the
   500 weight are the one concession: they make the line easier to read
   without changing either colour. */
.site-footer {
  background: var(--hl-green);
  padding: 2.5rem var(--gap) 3rem;
  font: 500 .85rem/1.7 var(--sans); color: #fff;
}
.site-footer p { max-width: 82rem; margin: 0 auto; }
.site-footer a { color: inherit; text-decoration-color: rgba(255, 255, 255, .55); }
.site-footer a:hover { text-decoration-color: currentColor; }
.site-footer .fine { margin-top: .3rem; }

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 61rem) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static; max-height: none; order: 2;
    /* Both of these have to go with the sticky box, not just the height. An
       overflow:auto element is still a touch-scroll target when its content
       fits, and overscroll-behavior:contain then refuses to hand the gesture
       up to the document — so a finger drag anywhere over the menu scrolled
       nothing at all. That was the mobile "page will not scroll" bug. */
    overflow: visible; overscroll-behavior: auto;
    border-top: 1px solid var(--rule); padding-top: 1.5rem; margin-top: 3rem;
  }
  .content { order: 1; }
  .cards.big { columns: 1; }
}

@media (max-width: 40rem) {
  .brand-logo { height: 2.1rem; }
  .nav-toggle { display: block; order: 3; margin-left: auto; }
  .bar-end { order: 4; width: 100%; margin-left: 0; justify-content: space-between; }
  .bar { flex-wrap: wrap; row-gap: .9rem; gap: 1rem; }
  .site-search { flex: 1; }
  .site-search input { width: 100%; max-width: none; }
  .primary-nav { display: none; order: 5; width: 100%; }
  .primary-nav.open { display: block; }
  .primary-nav ul { flex-direction: column; gap: 0; padding-bottom: .5rem; }
  .primary-nav a { padding: .55rem 0; }
  .cards.covers { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: 1fr; gap: 1.5rem; }
  .alphabet { top: 0; }
}

/* --- print ---------------------------------------------------------------- */

@media print {
  .site-header, .sidebar, .pager, .site-footer, .breadcrumbs, .translation,
  .anchor, .glossary-filter, .alphabet, .skip-link { display: none !important; }
  body { font-size: 11pt; }
  .shell { display: block; padding: 0; max-width: none; }
  .prose { max-width: none; }
  a { text-decoration: underline; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #666; }
}
