/* ----------------------------------------------------------------------
 * MNCollections theme for Pawtucket2 — theme.css
 * Visible storage: objects on tissue mats with catalog tags, archival-box
 * gray-blue bands, MALHM plum for actions. Built by Stoa
 * (https://www.stoa.works) for the Minnesota Alliance of Local History
 * Museums. GPL v3, like CollectiveAccess.
 * ---------------------------------------------------------------------- */

/* ── Tokens ───────────────────────────────────────────────────────────── */
:root {
  /* MALHM plum, OKLCH ramp from #833476 */
  --plum: #833476;
  --plum-50: #fff2fc; --plum-100: #ffe1f8; --plum-200: #ffc0f1; --plum-300: #fa95e6;
  --plum-400: #d875c6; --plum-500: #b657a6; --plum-600: #973a88; --plum-700: #822575;
  --plum-800: #69045d; --plum-900: #46003d;
  /* Archival-box gray-blue, OKLCH ramp from #4f6475 */
  --box: #4f6475;
  --box-50: #f0f8ff; --box-100: #daeeff; --box-200: #c0dcf2; --box-300: #a7c2d8;
  --box-400: #88a2b7; --box-500: #6a8498; --box-600: #4f687c; --box-700: #3e5669;
  --box-800: #294052; --box-900: #12293a;
  /* Tissue, ink, tag */
  --paper: #fbfcfd;
  --tissue: #f3f6f9;
  --rule: #d3dde6;
  --ink: #1b2430;
  --ink-2: #33404e;
  --muted: #56626f;
  --manila: #efe2bd;
  --manila-edge: #c9b583;
  --string: #9b3b2f;
  /* Kinds of record (always paired with their text label) */
  --kind-physical_object: var(--plum);
  --kind-photograph: #1f6f8b;
  --kind-archival_item: #2f6b4f;
  --kind-library_item: #9a4a2f;
  --kind-moving_image: #4b5675;
  --kind-sound_recording: #8a6a12;

  /* Type */
  --display: "Goudy Bookletter 1911", "Goudy Old Style", Georgia, serif;
  --body: "Wix Madefor Text", "Segoe UI", system-ui, sans-serif;
  --mono: "Cutive Mono", "Courier New", ui-monospace, monospace;
  /* Fluid scale, 360px → 1280px */
  --fs-200: clamp(0.8125rem, 0.79rem + 0.11vw, 0.875rem);
  --fs-300: clamp(0.9375rem, 0.92rem + 0.09vw, 1rem);
  --fs-400: clamp(1rem, 0.9375rem + 0.28vw, 1.125rem);
  --fs-500: clamp(1.1875rem, 1.12rem + 0.33vw, 1.375rem);
  --fs-600: clamp(1.375rem, 1.24rem + 0.6vw, 1.75rem);
  --fs-700: clamp(1.75rem, 1.5rem + 1.1vw, 2.5rem);
  --fs-800: clamp(2.25rem, 1.8rem + 2vw, 3.5rem);
  --fs-900: clamp(2.625rem, 1.9rem + 3.3vw, 4.75rem);
  --leading-body: 1.6;
  --line: calc(var(--fs-400) * var(--leading-body));
  --gutter: clamp(1rem, 0.6rem + 1.8vw, 2rem);
  --wrap: 82rem;
  --radius: 4px;
  --shadow-mat: 0 1px 0 rgba(27, 36, 48, 0.06), 0 6px 14px -8px rgba(27, 36, 48, 0.28);
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--fs-400);
  line-height: var(--leading-body);
  font-optical-sizing: auto;
}
img { max-width: 100%; height: auto; }
a { color: var(--plum-700); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--plum-800); text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--plum-700); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; letter-spacing: -0.005em; text-wrap: balance; color: var(--ink); }
h1 { font-size: var(--fs-900); margin: 0 0 calc(var(--line) * 0.5); }
h2 { font-size: var(--fs-800); margin: 0 0 calc(var(--line) * 0.5); }
h3 { font-size: var(--fs-600); margin: 0 0 calc(var(--line) * 0.4); }
h4 { font-family: var(--body); font-size: var(--fs-400); font-weight: 700; margin: 0 0 0.25rem; }
p, li, figcaption { text-wrap: pretty; }
p { margin: 0 0 calc(var(--line) * 0.75); }
.visually-hidden, .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.lede { font-size: var(--fs-500); line-height: 1.5; color: var(--ink-2); max-width: 40rem; }
.mono, .tag, .catalog { font-family: var(--mono); }
.skip-link {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 100;
  background: var(--ink); color: #fff; padding: 0.7rem 1rem; border-radius: var(--radius); font-weight: 700;
}
.skip-link:focus { top: 0.75rem; color: #fff; }

/* ── Disclosure banner ───────────────────────────────────────────────── */
.proto-banner {
  background: var(--box-900); color: var(--box-100);
  font-size: var(--fs-200); line-height: 1.4; padding: 0.45rem var(--gutter); text-align: center;
}
.proto-banner a { color: #fff; }

/* ── Masthead ─────────────────────────────────────────────────────────── */
.masthead { background: var(--paper); border-bottom: 1px solid var(--rule); position: relative; z-index: 20; view-transition-name: masthead; }
.masthead__bar {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  gap: 0.75rem 1.5rem; padding-block: 0.9rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--ink); text-decoration: none; min-height: 44px; }
.brand:hover { color: var(--ink); }
.brand__mark { width: 2.75rem; height: auto; flex: none; }
.brand__words { display: grid; line-height: 1; }
.brand__name { font-family: var(--display); font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.15rem); letter-spacing: -0.01em; }
.brand__name b { font-weight: 400; color: var(--plum); }
.brand__sub { font-size: var(--fs-200); color: var(--muted); margin-top: 0.3rem; }

.omnibox { justify-self: end; width: min(100%, 34rem); position: relative; }
.omnibox__row { display: flex; }
.omnibox__input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0.55rem 0.95rem;
  font: inherit; font-size: var(--fs-400); color: var(--ink);
  background: #fff; border: 2px solid var(--box-600); border-right: 0;
  border-radius: 999px 0 0 999px;
}
.omnibox__input::placeholder { color: var(--muted); opacity: 1; }
.omnibox__input:focus-visible { outline: 3px solid var(--plum-700); outline-offset: -4px; }
.omnibox__button {
  min-height: 48px; min-width: 48px; padding: 0 1.15rem; font: inherit; font-weight: 700;
  color: #fff; background: var(--plum-700); border: 2px solid var(--plum-700);
  border-radius: 0 999px 999px 0; cursor: pointer;
}
.omnibox__button:hover { background: var(--plum-800); border-color: var(--plum-800); }
.omnibox__button:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.omnibox__more { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 0.55rem; font-size: var(--fs-200); }
.omnibox__more a { color: var(--box-700); }
.omnibox__list {
  position: absolute; left: 0; right: 0; top: calc(48px + 0.35rem); margin: 0; padding: 0.35rem 0;
  list-style: none; background: #fff; border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 18px 40px -18px rgba(18, 41, 58, 0.45); max-height: min(28rem, 60vh); overflow: auto; z-index: 40;
}
.omnibox__list[hidden] { display: none; }
.omnibox__group { padding: 0.55rem 1rem 0.2rem; font-family: var(--mono); font-size: var(--fs-200); color: var(--box-700); text-transform: uppercase; letter-spacing: 0.04em; }
.omnibox__option { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0.7rem; align-items: center; padding: 0.4rem 1rem; min-height: 44px; cursor: pointer; }
.omnibox__option[aria-selected="true"], .omnibox__option:hover { background: var(--box-50); }
.omnibox__thumb { width: 2.75rem; height: 2.75rem; object-fit: contain; background: var(--tissue); border-radius: 3px; }
.omnibox__thumb--none { display: block; background: var(--tissue); border-radius: 3px; }
.omnibox__title { display: block; font-weight: 600; line-height: 1.3; color: var(--ink); }
.omnibox__meta { display: block; font-size: var(--fs-200); color: var(--muted); line-height: 1.3; }
.omnibox__option--ask .omnibox__title { color: var(--plum-700); }
.omnibox__empty { padding: 0.75rem 1rem; color: var(--muted); }

.primary-nav { border-top: 1px solid var(--rule); }
.primary-nav__toggle { display: none; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; flex-wrap: balance; gap: 0.25rem 0; }
.primary-nav li { margin: 0; }
.primary-nav a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 1rem;
  color: var(--ink); text-decoration: none; font-weight: 600; position: relative;
}
.primary-nav li:first-child a { padding-left: 0; }
.primary-nav a::after {
  content: ""; position: absolute; left: 1rem; right: 1rem; bottom: 0.45rem; height: 3px;
  background: transparent; border-radius: 2px;
}
.primary-nav li:first-child a::after { left: 0; }
.primary-nav a:hover { color: var(--plum-700); }
.primary-nav a:hover::after { background: var(--plum-300); }
.primary-nav a[aria-current="page"] { color: var(--plum-700); }
.primary-nav a[aria-current="page"]::after { background: var(--plum); }

@media (max-width: 52rem) {
  .masthead__bar { grid-template-columns: minmax(0, 1fr) auto; }
  .omnibox { grid-column: 1 / -1; justify-self: stretch; width: 100%; }
  .omnibox__more { justify-content: flex-start; }
  .primary-nav__toggle {
    display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 0.9rem;
    font: inherit; font-weight: 700; color: var(--ink); background: var(--tissue);
    border: 1px solid var(--rule); border-radius: 999px; cursor: pointer; list-style: none;
  }
  .primary-nav__toggle::-webkit-details-marker { display: none; }
  .primary-nav__toggle::before { content: "\25B8" / ""; color: var(--plum); }
  details[open] > .primary-nav__toggle::before { content: "\25BE" / ""; }
  .primary-nav { border-top: 0; }
  .primary-nav ul { display: grid; gap: 0; padding-block: 0.25rem 0.75rem; }
  .primary-nav a, .primary-nav li:first-child a { padding: 0 0.25rem; width: 100%; border-bottom: 1px solid var(--rule); }
  .primary-nav a::after, .primary-nav li:first-child a::after { left: 0.25rem; right: auto; width: 2rem; bottom: 0.35rem; }
}
@media (min-width: 52.01rem) {
  .primary-nav__details > summary { display: none; }
}

/* ── Buttons and chips ───────────────────────────────────────────────── */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0 1.3rem; border-radius: 999px; font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; border: 2px solid var(--plum-700);
  background: var(--plum-700); color: #fff;
}
.button:hover { background: var(--plum-800); border-color: var(--plum-800); color: #fff; }
.button--quiet { background: transparent; color: var(--plum-700); }
.button--quiet:hover { background: var(--plum-50); color: var(--plum-800); }
.button--on-box { background: #fff; border-color: #fff; color: var(--box-900); }
.button--on-box:hover { background: var(--box-100); border-color: var(--box-100); color: var(--box-900); }
.button:focus-visible { outline-offset: 3px; }
[data-control-group="actions"] { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1rem; }

/* ── The catalog tag (motif) ─────────────────────────────────────────── */
.tag {
  --tag-kind: var(--plum);
  position: relative; display: inline-grid; gap: 0.05rem; align-items: center;
  padding: 0.35rem 0.75rem 0.35rem 1.55rem; min-height: 2rem;
  background: var(--manila); color: var(--ink); font-size: 0.875rem; line-height: 1.15;
  clip-path: polygon(0.7rem 0, 100% 0, 100% 100%, 0.7rem 100%, 0 calc(100% - 0.7rem), 0 0.7rem);
  border-left: 4px solid var(--tag-kind);
}
.tag::before {
  content: ""; position: absolute; left: 0.55rem; top: 50%; width: 0.45rem; height: 0.45rem; margin-top: -0.225rem;
  border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--manila-edge);
}
.tag__no:empty { display: none; }
.tag__no { font-family: var(--mono); font-size: 0.9375rem; letter-spacing: 0.01em; white-space: nowrap; }
.tag__holder { font-family: var(--body); font-size: 0.8125rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16rem; }
.tag[data-kind="photograph"] { --tag-kind: var(--kind-photograph); }
.tag[data-kind="archival_item"] { --tag-kind: var(--kind-archival_item); }
.tag[data-kind="library_item"] { --tag-kind: var(--kind-library_item); }
.tag[data-kind="moving_image"] { --tag-kind: var(--kind-moving_image); }
.tag[data-kind="sound_recording"] { --tag-kind: var(--kind-sound_recording); }
.kind { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--fs-200); font-weight: 600; color: var(--ink-2); }
.kind::before { content: ""; width: 0.7rem; height: 0.7rem; border-radius: 2px; background: var(--kind-color, var(--plum)); }
.kind[data-kind="photograph"] { --kind-color: var(--kind-photograph); }
.kind[data-kind="archival_item"] { --kind-color: var(--kind-archival_item); }
.kind[data-kind="library_item"] { --kind-color: var(--kind-library_item); }
.kind[data-kind="moving_image"] { --kind-color: var(--kind-moving_image); }
.kind[data-kind="sound_recording"] { --kind-color: var(--kind-sound_recording); }

/* ── Objects on tissue mats ──────────────────────────────────────────── */
.wall { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.1rem; --row: var(--wall-row, 11.5rem); }
.wall > li { flex: calc(var(--ar, 1) * 100) 1 calc(var(--ar, 1) * var(--row)); min-width: min(9.75rem, 100%); max-width: max(9.75rem, calc(var(--ar, 1) * var(--row) * 1.5)); }
.wall::after { content: ""; flex: 999999 1 0; }
.obj { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem; text-decoration: none; color: var(--ink); }
.obj:hover { color: var(--plum-800); }
.obj__mat {
  display: grid; place-items: center; aspect-ratio: var(--ar, 1);
  background: linear-gradient(180deg, #fff 0%, var(--tissue) 100%);
  border-radius: var(--radius); box-shadow: var(--shadow-mat); padding: 8%;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.obj__mat img { width: auto; height: auto; max-width: min(100%, var(--half, 100%)); max-height: 100%; object-fit: contain; }
.obj__name { font-weight: 600; font-size: var(--fs-300); line-height: 1.3; text-wrap: balance; overflow-wrap: anywhere; }
.obj .tag { max-width: 100%; }
.obj .tag__no { white-space: normal; }
.obj__meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; align-items: center; }
.obj .tag { justify-self: start; max-width: 100%; min-width: 0; }
.obj .tag__no { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 40rem) {
  .wall { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem 0.9rem; }
  .wall > li { max-width: none; }
  .wall::after { display: none; }
  .wall .obj__mat { aspect-ratio: 1; }
  .wall .tag__holder { max-width: 100%; }
  #storeroom-wall > .wall > li:nth-child(n+13) { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .obj:hover .obj__mat { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(27,36,48,.06), 0 14px 22px -12px rgba(27,36,48,.38); }
}
.obj--noimage .obj__mat { padding: 1rem; background: var(--tissue); color: var(--muted); font-size: var(--fs-200); text-align: center; }
.obj__noimage { font-family: var(--mono); }

/* Grid of uniform mats (results, galleries) */
.mats { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); }
.mats .obj__mat { aspect-ratio: 4 / 5; }
.mats .obj--noimage .obj__mat, .wall .obj--noimage .obj__mat { aspect-ratio: auto; min-height: 2.25rem; padding: 0.35rem 0.75rem; place-items: center start; background: transparent; box-shadow: none; border: 1px dashed var(--box-600); text-align: start; }
.obj--noimage:hover .obj__mat { transform: none; box-shadow: none; }
@media (max-width: 40rem) { .mats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 0.85rem; } }

/* ── Shelving (results grouped on headed shelves) ────────────────────── */
.shelve-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.shelve-form[hidden], .search-start[hidden] { display: none; }
.shelve-form label { font-weight: 700; }
.shelve-form select {
  min-height: 44px; padding: 0 2.25rem 0 0.9rem; font: inherit; color: var(--ink);
  border: 2px solid var(--box-600); border-radius: 999px; background: #fff;
}
.shelve-form button { min-height: 44px; }
.js .shelve-form .shelve-go { display: none; }
@supports (appearance: base-select) {
  .shelve-form select, .shelve-form select::picker(select) { appearance: base-select; }
  .shelve-form select::picker(select) { border: 1px solid var(--rule); border-radius: 10px; padding: 0.3rem; max-height: min(22rem, 55vh); box-shadow: 0 18px 40px -18px rgba(18,41,58,.45); }
  .shelve-form select option { min-height: 40px; padding: 0.4rem 0.75rem; border-radius: 6px; }
  .shelve-form select option:checked { background: var(--plum-50); color: var(--plum-800); font-weight: 700; }
  .shelve-form select::picker-icon { color: var(--plum); }
}
.shelf { margin-top: calc(var(--line) * 1.5); }
.shelf__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-bottom: 0.6rem; margin-bottom: 1rem; border-bottom: 3px solid var(--box-600); position: relative;
}
.shelf__head::before, .shelf__head::after {
  content: ""; position: absolute; bottom: -0.9rem; width: 3px; height: 0.9rem; background: var(--box-600);
}
.shelf__head::before { left: 0.75rem; }
.shelf__head::after { right: 0.75rem; }
.shelf__title { font-family: var(--display); font-size: var(--fs-600); margin: 0; }
.shelf__count { font-family: var(--mono); font-size: var(--fs-300); color: var(--box-700); }
.shelf__more { font-size: var(--fs-300); }

/* ── The tag as divider and hover cue (with .tag-list markers and empty states) ── */
.tag-rule { border: 0; height: 1.4rem; margin: 0; background: linear-gradient(var(--rule), var(--rule)) 0 50% / 100% 1px no-repeat; position: relative; }
.tag-rule::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 2.75rem; height: 1.3rem; transform: translateY(-50%);
  background: var(--manila); border-left: 4px solid var(--plum);
  clip-path: polygon(0.55rem 0, 100% 0, 100% 100%, 0.55rem 100%, 0 calc(100% - 0.55rem), 0 0.55rem);
}
.tag-rule::after { content: ""; position: absolute; left: 0.95rem; top: 50%; width: 0.4rem; height: 0.4rem; margin-top: -0.2rem; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2px var(--manila-edge); }
.obj:hover .tag, .obj:focus-visible .tag { background: #f5ead0; }
.obj:hover .tag__no { color: var(--plum-800); }
.notfound { padding-bottom: calc(var(--line) * 2); }
.notfound__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem 3.5rem; align-items: center; }
.notfound .tag { margin-bottom: 1rem; }
.notfound__photo { margin: 0; }
.notfound__photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.notfound__photo figcaption { font-size: var(--fs-200); color: var(--muted); margin-top: 0.5rem; }
@media (max-width: 52rem) { .notfound__grid { grid-template-columns: 1fr; } }

/* ── Sections and the archival-box register ──────────────────────────── */
.section { padding-block: calc(var(--line) * 3); }
.section--tight { padding-block: calc(var(--line) * 2); }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.75rem 2rem; margin-bottom: calc(var(--line) * 1.25); }
.section__head h2 { margin: 0; }
.section__head p { margin: 0; max-width: 34rem; color: var(--ink-2); }
.band { background: var(--box-800); color: var(--box-50); }
.band h2, .band h3 { color: #fff; }
.band a:not(.button) { color: var(--plum-200); }
.band a:not(.button):hover { color: #fff; }
.band p, .band li { -webkit-font-smoothing: antialiased; }
.band .lede { color: var(--box-100); }
.band figcaption, .band .visit figcaption { color: var(--box-200); }
.rail { height: 0; border-top: 3px solid var(--box-600); position: relative; margin-block: calc(var(--line) * 2); }
.rail::before, .rail::after { content: ""; position: absolute; top: -3px; width: 3px; height: 1rem; background: var(--box-600); }
.rail::before { left: 1.25rem; } .rail::after { right: 1.25rem; }

/* ── Homepage ─────────────────────────────────────────────────────────── */
.storeroom { padding-block: calc(var(--line) * 1.5) calc(var(--line) * 2.5); }
/* Phones: title, the quilt, then the words and actions. Tablets: the title across, the quilt beside the words.
   Wide screens: title and words on the left, the quilt on its mat to the right. */
.storeroom__intro { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "object" "aside"; gap: 1.25rem 3rem; margin-bottom: calc(var(--line) * 1.25); }
.storeroom__intro h1 { grid-area: title; margin: 0; max-width: 14ch; font-size: clamp(2.375rem, 1.6rem + 2.4vw, 3.5rem); }
.storeroom__intro h1 em { font-style: normal; color: var(--plum); }
.storeroom__aside { grid-area: aside; display: grid; gap: 0.9rem; justify-items: start; align-content: center; }
.hero-object { grid-area: object; margin: 0; width: min(100%, 26rem); }
.hero-object__mat { display: grid; place-items: center; padding: 6%; background: linear-gradient(180deg, #fff, var(--tissue)); border-radius: 6px; box-shadow: var(--shadow-mat); }
.hero-object__mat img { width: 100%; max-width: var(--half, 100%); height: auto; }
.hero-object figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-top: 0.85rem; font-size: var(--fs-300); color: var(--ink-2); }
@media (min-width: 48rem) {
  .storeroom__intro { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "title title" "object aside"; }
  .storeroom__intro h1 { max-width: none; }
}
@media (min-width: 70rem) {
  .storeroom__intro { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "title object" "aside object"; align-items: start; }
  .storeroom__aside { align-content: start; padding-top: 0.5rem; }
  .hero-object { justify-self: end; }
}
.storeroom__aside .lede { margin: 0; }
.storeroom__controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem; padding-block: 0.9rem; margin-bottom: 1.25rem; border-block: 1px solid var(--rule); }
.storeroom__note { margin: 0; font-size: var(--fs-300); color: var(--muted); }
@media (max-width: 52rem) {
  .wall { --row: calc(var(--wall-row, 11.5rem) * 0.63); gap: 0.8rem; }
}

.near { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); gap: 2rem 3.5rem; align-items: start; }
.near__photo { margin: 0; position: sticky; top: 1.5rem; }
.near__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.near__photo figcaption { font-size: var(--fs-200); color: var(--muted); margin-top: 0.5rem; }
.counties__more { display: none; }
@media (max-width: 40rem) { .counties > li:nth-child(n+7) { display: none; } .counties__more { display: block; margin: 0.5rem 0 0; } }
.counties { columns: 2 18rem; column-gap: 2.5rem; margin: 0; padding: 0; list-style: none; }
.county { break-inside: avoid; margin: 0 0 1.25rem; }
.county__name { font-family: var(--mono); font-size: var(--fs-300); color: var(--box-700); margin: 0 0 0.35rem; text-transform: uppercase; letter-spacing: 0.03em; }
.county ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.2rem; }
.county li { display: grid; grid-template-columns: 1.15rem minmax(0, 1fr); gap: 0.5rem; align-items: start; }
.tag-list > li::before {
  content: ""; margin-top: 0.42em; width: 0.85rem; height: 0.6rem; background: var(--manila);
  clip-path: polygon(0.3rem 0, 100% 0, 100% 100%, 0.3rem 100%, 0 70%, 0 30%);
}
.county a { font-weight: 600; text-decoration: none; color: var(--ink); }
.county a:hover { color: var(--plum-700); text-decoration: underline; }
.county .count { font-family: var(--mono); font-size: 0.875rem; color: var(--muted); }
@media (max-width: 52rem) { .near { grid-template-columns: 1fr; } .near__photo { position: static; } }

.galleries { list-style: none; margin: 0; padding: 0; display: grid; gap: 2rem 1.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.gallery-card { display: grid; gap: 0.85rem; text-decoration: none; color: var(--ink); }
.gallery-card__plates { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; gap: 0.5rem; aspect-ratio: 5 / 4; }
.gallery-card__plates span { display: grid; place-items: center; background: linear-gradient(180deg, #fff, var(--tissue)); border-radius: var(--radius); box-shadow: var(--shadow-mat); padding: 8%; overflow: hidden; }
.gallery-card__plates span:first-child { grid-row: 1 / 3; }
.gallery-card__plates img { width: auto; height: auto; max-width: min(100%, var(--half, 100%)); max-height: 100%; object-fit: contain; }
.gallery-card__title { font-family: var(--display); font-size: var(--fs-600); line-height: 1.15; }
.gallery-card__by { font-size: var(--fs-300); color: var(--muted); }
.gallery-card:hover .gallery-card__title { color: var(--plum-700); text-decoration: underline; text-decoration-thickness: 0.06em; }
.gallery-item { display: grid; gap: 0.35rem; align-content: start; }
.gallery-item .gallery-card__by, .gallery-item .gallery-card__meta { margin: 0; }
.gallery-card__meta { font-size: var(--fs-200); color: var(--box-700); display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 0.6rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; }
.chip--sample { background: var(--manila); color: var(--ink); }

/* ── A featured gallery: wall, list and story views ──────────────────── */
.gallery-index .galleries { margin-top: calc(var(--line) * 1.25); }
.gallery__head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem 3rem; align-items: start; padding-block: calc(var(--line) * 1) calc(var(--line) * 1.25); }
.gallery__head h1 { margin: 0 0 0.4rem; font-size: var(--fs-800); }
.gallery__by { margin: 0; font-size: var(--fs-500); }
.gallery__by a { font-weight: 700; }
.gallery__intro p { margin: 0 0 0.6rem; }
.gallery__meta { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; color: var(--box-700); }
@media (max-width: 52rem) { .gallery__head { grid-template-columns: 1fr; } }
.views { border-block: 1px solid var(--rule); padding-block: 0.75rem; margin-bottom: 1.5rem; }
.views ul { list-style: none; margin: 0; padding: 0.25rem; display: inline-flex; gap: 0.25rem; background: var(--box-50); border-radius: 999px; }
.views a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 1.1rem; border-radius: 999px; text-decoration: none; font-weight: 700; color: var(--box-800); }
.views a:hover { background: #fff; color: var(--plum-800); }
.views a[aria-current="page"] { background: var(--plum-700); color: #fff; }
.views__icon { width: 1rem; height: 1rem; display: inline-grid; gap: 2px; }
.views__icon--wall { grid-template-columns: 1.4fr 1fr; grid-template-rows: 1fr 1fr; }
.views__icon--wall::before, .views__icon--wall::after { content: ""; background: currentColor; border-radius: 1px; }
.views__icon--wall::before { grid-row: 1 / 3; }
.views__icon--list { background: repeating-linear-gradient(180deg, currentColor 0 2px, transparent 2px 5px); }
.views__icon--story { border: 2px solid currentColor; border-radius: 2px; background: linear-gradient(90deg, currentColor 0 45%, transparent 45%); }
.gallery__wall { margin-bottom: calc(var(--line) * 2); }
.gallery-table th[scope="row"] { font-family: var(--body); font-weight: 600; font-size: var(--fs-400); }
.gallery-table th[scope="row"] a { text-decoration: none; }
.gallery-table th[scope="row"] a:hover { text-decoration: underline; }
.gallery-table__pic { width: 5.5rem; }
.gallery-table__pic img { width: 4.5rem; height: 4.5rem; object-fit: contain; background: linear-gradient(180deg, #fff, var(--tissue)); border-radius: 3px; box-shadow: var(--shadow-mat); padding: 0.3rem; }
.gallery-table .muted { color: var(--muted); }
.gallery-table tbody tr:hover { background: var(--plum-50); }
@media (max-width: 46rem) {
  .gallery-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .gallery-table, .gallery-table tbody, .gallery-table tr, .gallery-table td, .gallery-table th { display: block; }
  .gallery-table tr { display: grid; grid-template-columns: 5rem minmax(0, 1fr); column-gap: 0.9rem; padding: 0.9rem 0.9rem 0.6rem; border-bottom: 1px solid var(--rule); }
  .gallery-table td, .gallery-table th { border: 0; padding: 0.15rem 0; grid-column: 2; }
  .gallery-table .gallery-table__pic { grid-column: 1; grid-row: 1 / span 5; width: auto; }
  .gallery-table td[data-label]::before { content: attr(data-label) ": "; font-family: var(--mono); font-size: var(--fs-200); color: var(--box-700); }
  .gallery-table td:has(> .muted:only-child) { display: none; }
}
.story { list-style: none; margin: 0 0 calc(var(--line) * 2); padding: 0; counter-reset: none; }
.story__item { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr); gap: 1.5rem 3rem; align-items: center; min-height: 0; padding-block: calc(var(--line) * 1.5); border-bottom: 1px solid var(--rule); scroll-margin-top: 1rem; }
.story__plate { margin: 0; display: grid; place-items: center; background: linear-gradient(180deg, #fff, var(--tissue)); border-radius: 6px; box-shadow: var(--shadow-mat); padding: 1.75rem; width: min(100%, calc(var(--half, 24rem) + 3.5rem)); justify-self: end; }
.story__plate img { width: auto; height: auto; max-width: min(100%, var(--half, 100%)); max-height: 100%; object-fit: contain; }
.story__text { display: grid; gap: 0.75rem; justify-items: start; }
.story__text h2 { margin: 0; font-size: var(--fs-700); }
.story__text h2 a { text-decoration: none; color: var(--ink); }
.story__text h2 a:hover { color: var(--plum-700); text-decoration: underline; }
.story__text p { margin: 0; max-width: 38rem; }
.story__count { color: var(--box-700); font-size: var(--fs-300); }
.story__date { font-weight: 700; color: var(--ink-2); }
.story__next a { font-weight: 700; }
@media (max-width: 52rem) { .story__item { grid-template-columns: 1fr; min-height: 0; } .story__plate { justify-self: center; } }

.families { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 3.5rem; align-items: center; }
.families form { display: flex; max-width: 30rem; }
.families input[type="search"] { flex: 1; min-height: 48px; padding: 0 1rem; font: inherit; border: 2px solid var(--box-200); border-right: 0; border-radius: 999px 0 0 999px; background: #fff; color: var(--ink); }
.families input[type="search"]:focus-visible { outline: 3px solid var(--plum-300); outline-offset: -4px; }
.families button { min-height: 48px; padding: 0 1.2rem; font: inherit; font-weight: 700; border: 2px solid #fff; background: #fff; color: var(--box-900); border-radius: 0 999px 999px 0; cursor: pointer; }
.families button:focus-visible { outline: 3px solid var(--plum-700); outline-offset: -6px; }
.names { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.names a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 0.95rem; border-radius: 999px; background: var(--box-700); color: #fff; text-decoration: none; font-weight: 600; font-size: var(--fs-300); }
.names a:hover { background: var(--box-600); color: #fff; }
.families figure { margin: 0; }
.families figure img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.families figcaption { font-size: var(--fs-200); color: var(--box-200); margin-top: 0.5rem; }
@media (max-width: 52rem) { .families { grid-template-columns: 1fr; } }

.visit { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem 3.5rem; align-items: center; }
.visit figure { margin: 0; }
.visit img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.visit figcaption { font-size: var(--fs-200); color: var(--muted); margin-top: 0.5rem; }
/* The wet-salvage photograph is portrait: four members' faces above, gloved hands in the tub below. A portrait
   frame keeps both instead of cutting half the picture away. */
.band .visit { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.8fr); }
.band .visit figure { justify-self: end; width: min(100%, 24rem); }
.band .visit img { aspect-ratio: 4 / 5; }
.quote { font-family: var(--display); font-size: var(--fs-700); line-height: 1.2; margin: 0 0 1rem; color: var(--ink); }
.quote::before { content: "\201C"; color: var(--plum); }
.quote::after { content: "\201D"; color: var(--plum); }
@media (max-width: 52rem) { .visit, .band .visit { grid-template-columns: minmax(0, 1fr); } .band .visit figure { justify-self: start; } }

/* ── Record page ─────────────────────────────────────────────────────── */
.crumbs { font-size: var(--fs-300); padding-top: 1.25rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.35rem; color: var(--muted); }
/* The tag and title come first on every screen: beside the picture on wide screens, above it on phones. */
.record { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "plate head" "plate body"; gap: 0 3.5rem; padding-block: calc(var(--line) * 1.25) calc(var(--line) * 2.5); align-items: start; }
.record__head { grid-area: head; }
.record__body { grid-area: body; }
.record__plate { grid-area: plate; margin: 0; position: sticky; top: 1.25rem; }
.record__mat {
  display: grid; place-items: center; background: linear-gradient(180deg, #fff, var(--tissue));
  border-radius: 6px; box-shadow: var(--shadow-mat); padding: 7%; aspect-ratio: 1 / 1;
}
.record__mat img { width: auto; height: auto; max-width: min(100%, var(--half, 100%)); max-height: 100%; object-fit: contain; }
.record__thumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0.9rem 0 0; }
.record__thumbs button { width: 4.5rem; height: 4.5rem; padding: 0.3rem; border: 2px solid var(--rule); border-radius: var(--radius); background: #fff; cursor: pointer; }
.record__thumbs button[aria-pressed="true"] { border-color: var(--plum); }
.record__thumbs img { width: 100%; height: 100%; object-fit: contain; }
.record__head { display: grid; gap: 0.75rem; justify-items: start; }
.record__head h1 { font-size: var(--fs-800); margin: 0; }
.record__holder { font-size: var(--fs-500); margin: 0; }
.record__holder a { font-weight: 700; }
.facts { margin: calc(var(--line) * 1) 0 0; display: grid; grid-template-columns: minmax(7.5rem, max-content) minmax(0, 1fr); border-top: 1px solid var(--rule); }
.facts dt, .facts dd { padding: 0.65rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.facts dt { font-family: var(--mono); font-size: var(--fs-300); color: var(--box-700); padding-right: 1.25rem; }
.facts dd { min-width: 0; overflow-wrap: anywhere; }
.facts dd ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 0.5rem; }
.facts dd ul a { display: inline-flex; min-height: 32px; align-items: center; padding: 0 0.7rem; border-radius: 999px; background: var(--box-50); color: var(--box-800); text-decoration: none; }
.facts dd ul a:hover { background: var(--box-100); }
.record__desc { font-size: var(--fs-400); margin-top: 1rem; overflow-wrap: break-word; }
.record__more { margin-top: 0.5rem; }
.record__more summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 700; color: var(--plum-700); text-decoration: underline; text-underline-offset: 0.2em; }
.record__more summary:hover { color: var(--plum-800); }
.record__more[open] summary { margin-bottom: 0.5rem; }
.record__tools { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.note { padding: 1rem 1.25rem; border-left: 4px solid var(--box-600); background: var(--box-50); border-radius: 0 var(--radius) var(--radius) 0; font-size: var(--fs-300); overflow-wrap: anywhere; }
.note p:last-child { margin-bottom: 0; }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1rem; border-top: 1px solid var(--rule); }
@media (max-width: 52rem) { .record { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "head" "plate" "body"; } .record__plate { position: static; margin-top: 1.5rem; } }
/* A record without a picture reads in one column, with a quiet dashed note where the picture would be. */
.record.record--no-picture { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "body"; max-width: 50rem; }
.record__nopicture { margin: 1rem 0 0; padding: 0.65rem 0.9rem; border: 1.5px dashed var(--box-200); border-radius: 6px; font-family: var(--mono); font-size: var(--fs-300); color: var(--box-700); max-width: 34rem; }

/* ── Museum (contributor) page ───────────────────────────────────────── */
.museum-head { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.5rem 3rem; padding-block: calc(var(--line) * 1.25) calc(var(--line) * 1.5); align-items: start; }
.museum-head h1 { margin: 0; font-size: var(--fs-800); }
.museum-card { padding: 1.25rem 1.4rem; border-radius: 6px; background: var(--box-800); color: var(--box-50); overflow-wrap: anywhere; }
.museum-card h2 { color: #fff; font-size: var(--fs-500); margin: 0 0 0.5rem; font-family: var(--body); font-weight: 700; }
.museum-card a { color: var(--plum-200); }
.museum-card address { font-style: normal; }
.scoped-search { display: flex; max-width: 36rem; margin-top: 1rem; }
.scoped-search input { flex: 1; min-height: 48px; padding: 0 1rem; font: inherit; border: 2px solid var(--box-600); border-right: 0; border-radius: 999px 0 0 999px; background: #fff; color: var(--ink); }
.scoped-search input:focus-visible { outline: 3px solid var(--plum-700); outline-offset: -4px; }
.scoped-search button { min-height: 48px; padding: 0 1.2rem; font: inherit; font-weight: 700; color: #fff; background: var(--plum-700); border: 2px solid var(--plum-700); border-radius: 0 999px 999px 0; cursor: pointer; }
.scoped-search button:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
@media (max-width: 52rem) { .museum-head { grid-template-columns: minmax(0, 1fr); } }

.museums-photo { margin: 0 0 1.5rem; max-width: 44rem; }
.museums-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 55%; border-radius: var(--radius); }
.museums-photo figcaption { font-size: var(--fs-200); color: var(--muted); margin-top: 0.5rem; }
.people-faces { margin: 1.25rem 0 0.5rem; }
.people-faces .shelf__title { margin-bottom: 0.75rem; }
.nearby { margin-top: calc(var(--line) * 2); }
.nearby .shelf__title { margin: 1rem 0 1rem; }

/* ── Long index (People and Families): sticky discovery, 20 a page ──── */
:where([data-stoa-index]) { --stoa-index-sticky-top: 0px; --stoa-index-controls-max: 25vh; }
[data-stoa-index-controls] { position: sticky; inset-block-start: var(--stoa-index-sticky-top); z-index: 20; max-block-size: var(--stoa-index-controls-max); overflow-y: auto; scrollbar-gutter: stable; }
[data-stoa-index-controls] input[type="search"], [data-stoa-index-controls] button { min-block-size: 44px; }
[data-stoa-index-results] { scroll-margin-block-start: calc(var(--stoa-index-sticky-top) + var(--stoa-index-controls-max) + 1rem); min-block-size: var(--stoa-index-controls-max); }
[data-stoa-index-pagination] ul { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0; margin: 0; list-style: none; }
[data-stoa-index-pagination] a, [data-stoa-index-pagination] [aria-current="page"] { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 44px; min-block-size: 44px; padding: 0 0.6rem; border-radius: 999px; }
[data-stoa-index-pagination] [aria-current="page"] { background: var(--plum-700); color: #fff; font-weight: 700; }
@media (max-width: 640px) { :where([data-stoa-index]) { --stoa-index-controls-max: 30svh; } }
@media (prefers-reduced-motion: reduce) { :where(html, [data-stoa-index], [data-stoa-index-results]) { scroll-behavior: auto !important; } }
.index-controls { background: var(--paper); padding: 0.75rem 0 0.5rem; border-bottom: 1px solid var(--rule); display: grid; gap: 0.5rem; }
.index-controls .scoped-search { margin-top: 0; }
.index-controls .letters { margin: 0; gap: 0.3rem; }
.index-controls .letters a { min-height: 36px; min-width: 36px; justify-content: center; padding: 0 0.55rem; }
.index-controls .results-summary { margin: 0; font-size: var(--fs-300); }
.pager--pages { border-top: 1px solid var(--rule); padding-block: 1rem; }
@media (max-width: 40rem) { .index-controls .letters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; } }

/* ── Results page ────────────────────────────────────────────────────── */
.results-head { padding-block: calc(var(--line) * 1.25) 0.5rem; }
.results-head h1 { font-size: var(--fs-800); margin: 0 0 0.5rem; }
h1.title--name { font-size: clamp(1.875rem, 1.45rem + 1.7vw, 3.25rem); overflow-wrap: anywhere; }
h1.title--long { font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2.25rem); }
h1.title--longer { font-size: clamp(1.25rem, 1.15rem + 0.45vw, 1.625rem); line-height: 1.2; }
.results-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding-block: 0.85rem; border-block: 1px solid var(--rule); }
.results-summary { margin: 0; color: var(--ink-2); }
.results-summary strong { color: var(--ink); }
.facets { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.facets a, .facets span { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 36px; padding: 0 0.85rem; border-radius: 999px; border: 1px solid var(--rule); background: #fff; color: var(--ink-2); text-decoration: none; font-size: var(--fs-300); }
.facets a:hover { border-color: var(--plum-400); color: var(--plum-800); }
.facets [aria-current="true"] { background: var(--plum-700); border-color: var(--plum-700); color: #fff; }
.you-were-here { outline: 3px solid var(--plum-300); outline-offset: 6px; border-radius: 6px; }
.you-were-here .tag::after { content: "You were here"; position: absolute; right: 0.5rem; top: -1.6rem; font-family: var(--body); font-size: 0.75rem; font-weight: 700; color: var(--plum-700); }
.empty { padding: 2rem 0; }
.empty .tag { margin-bottom: 1rem; }

.answer { margin: 1.25rem 0 0; padding: 1.25rem 1.4rem; border-radius: 10px; background: var(--box-800); color: var(--box-50); }
.answer[hidden] { display: none; }
.answer__title { font-family: var(--mono); font-size: var(--fs-300); color: var(--plum-200); margin: 0 0 0.4rem; font-weight: 400; }
.answer__text { font-size: var(--fs-500); line-height: 1.5; margin: 0; -webkit-font-smoothing: antialiased; }
.answer__sources { list-style: none; margin: 0.9rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.answer__sources a { display: inline-flex; min-height: 36px; align-items: center; padding: 0 0.85rem; border-radius: 999px; background: var(--box-700); color: #fff; text-decoration: none; font-size: var(--fs-300); }
.answer__sources a:hover { background: var(--box-600); }
.results-more[hidden] { display: none; }
.results-more { border-top: 3px solid var(--box-600); padding-top: 1.25rem; margin-top: calc(var(--line) * 1.5); }

/* ── Museum directory and people index ──────────────────────────────── */
.museum-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); gap: 0 2.5rem; align-items: start; }
.museum-groups > .shelf--wide { grid-column: 1 / -1; }
.museum-row.museum-row--plain { grid-template-columns: minmax(0, 1fr); }
.museum-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.museum-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); grid-template-rows: auto auto; gap: 0.1rem 1rem; align-items: center; padding: 0.6rem; border-radius: 8px; text-decoration: none; color: var(--ink); }
.museum-row:hover { background: var(--box-50); color: var(--plum-800); }
.museum-row__peek { grid-row: 1 / 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.museum-row__peek span { aspect-ratio: 1; background: linear-gradient(180deg, #fff, var(--tissue)); border-radius: 3px; box-shadow: var(--shadow-mat); display: grid; place-items: center; overflow: hidden; }
.museum-row__peek span:empty::after { content: ""; width: 40%; height: 26%; background: var(--manila); clip-path: polygon(30% 0, 100% 0, 100% 100%, 30% 100%, 0 70%, 0 30%); }
.museum-row__peek img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.museum-row__name { font-weight: 700; line-height: 1.3; }
.museum-row__where { font-size: var(--fs-300); color: var(--muted); }
.people-list { list-style: none; margin: 1rem 0 0; padding: 0; columns: 3 16rem; column-gap: 2rem; }
.people-list li { break-inside: avoid; }
.people-list a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.25rem; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); min-height: 44px; align-items: center; }
.people-list a:hover { color: var(--plum-800); background: var(--box-50); }
.people-list__count { font-family: var(--mono); font-size: var(--fs-200); color: var(--muted); white-space: nowrap; }
.letters a { min-width: 2.75rem; justify-content: center; font-weight: 700; }
.results-more { display: grid; gap: 1.5rem; margin-bottom: calc(var(--line) * 2); }

.search-start { margin-top: calc(var(--line) * 1.25); }
.search-start__ways { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 1.75rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.way { display: grid; gap: 0.55rem; align-content: start; }
.way__how { margin: 0; font-size: var(--fs-300); color: var(--box-700); }
.way__try { justify-self: start; display: inline-flex; gap: 0.4rem; align-items: center; min-height: 44px; padding: 0 1rem; border: 1.5px solid var(--box-600); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; }
.way__try:hover { border-color: var(--plum-700); color: var(--plum-800); }
.way .way__found { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 40rem) { .search-start__ways { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 0.85rem; } }

/* ── Prose pages (About, Help, Staff) ────────────────────────────────── */
.prose-page { padding-bottom: calc(var(--line) * 2); }
.prose { max-width: 44rem; }
.prose h2 { font-size: var(--fs-700); margin-top: calc(var(--line) * 1.5); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 2rem 3.5rem; align-items: start; }
.about-photo { margin: 0; position: sticky; top: 1.5rem; }
.about-photo img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); }
.about-photo figcaption { font-size: var(--fs-200); color: var(--muted); margin-top: 0.5rem; }
@media (max-width: 52rem) { .about-grid { grid-template-columns: 1fr; } .about-photo { position: static; } }
.faq { display: grid; gap: 0; max-width: 48rem; }
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem); gap: 2rem 4rem; align-items: start; }
.help-index { position: sticky; top: 1.5rem; margin-top: 1.25rem; padding: 0.25rem 0 0.25rem 1.25rem; border-left: 1px solid var(--rule); }
.help-index__title { margin: 0 0 0.6rem; font-weight: 700; font-size: var(--fs-300); }
.help-index ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.55rem; }
.help-index li { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: 0.45rem; align-items: start; font-size: var(--fs-300); line-height: 1.35; }
.help-index li::before { content: ""; width: 0.95rem; height: 0.62rem; margin-top: 0.32rem; background: var(--manila); border-left: 2px solid var(--plum); clip-path: polygon(30% 0, 100% 0, 100% 100%, 30% 100%, 0 70%, 0 30%); }
.help-index a { color: var(--ink); text-decoration: none; }
.help-index a:hover { color: var(--plum-700); text-decoration: underline; }
@media (max-width: 52rem) { .help-layout { grid-template-columns: 1fr; } .help-index { display: none; } }
.faq__item { padding-block: 1.25rem; border-bottom: 1px solid var(--rule); }
.faq__q { font-family: var(--display); font-size: var(--fs-600); margin: 0 0 0.5rem; }
.faq__item p { margin: 0; }
.museum-about { max-width: 48rem; margin-bottom: 1rem; overflow-wrap: anywhere; }
.record__harm { font-size: var(--fs-200); color: var(--muted); margin-top: 1.5rem; max-width: 40rem; }
.record__plate figcaption { font-size: var(--fs-300); margin-top: 0.9rem; color: var(--ink-2); }
.sync-summary { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin: 0 0 1.5rem; }
.sync-summary p { margin: 0; }
.sync-form { margin-bottom: 1.5rem; }
[data-sync-monitor] td[data-hours-ago] { white-space: nowrap; }
.sync-queue:empty { display: none; }
.sync-queue { padding: 1rem 1.25rem; border-radius: 8px; background: var(--box-50); border-left: 4px solid var(--box-600); }
.ask-form { max-width: 48rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
.ask-form__status:empty { display: none; }
.ask-form__status { padding: 0.9rem 1.1rem; background: var(--box-50); border-left: 4px solid var(--plum); border-radius: 0 6px 6px 0; }
.field [aria-invalid="true"] { border-color: #a3261b; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer { background: var(--box-900); color: var(--box-100); margin-top: calc(var(--line) * 2); }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--plum-200); }
.footer__grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: 2rem 3rem; padding-block: calc(var(--line) * 2.5) calc(var(--line) * 1.5); }
.footer__grid h2 { font-family: var(--body); font-size: var(--fs-300); font-weight: 700; color: #fff; text-transform: none; margin: 0 0 0.6rem; }
.footer__grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.footer__brand { display: grid; gap: 0.75rem; }
.footer__brand img { width: 9rem; height: auto; background: #fff; border-radius: 4px; padding: 0.4rem; }
.footer__legal { border-top: 1px solid var(--box-700); padding-block: 1.25rem 2rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; font-size: var(--fs-200); }
.footer__legacy { display: flex; gap: 1rem; align-items: center; max-width: 38rem; }
.footer__legacy img { width: 7.5rem; height: auto; background: #fff; border-radius: 3px; padding: 0.25rem; flex: none; }
.site-footer p { -webkit-font-smoothing: antialiased; }
@media (max-width: 52rem) { .footer__grid { grid-template-columns: 1fr; } }

/* ── Forms (advanced search, ask a curator) ──────────────────────────── */
.form-grid { display: grid; gap: 1.25rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); max-width: 60rem; }
.field { display: grid; gap: 0.35rem; min-width: 0; }
.field select { max-width: 100%; min-width: 0; }
.field label { font-weight: 700; }
.field .hint { font-size: var(--fs-200); color: var(--muted); }
.field input, .field select, .field textarea { min-height: 46px; padding: 0.5rem 0.85rem; font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--box-400); border-radius: 6px; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--plum-700); outline-offset: 1px; border-color: var(--box-700); }
fieldset { border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.25rem; margin: 0 0 1.5rem; min-inline-size: 0; }
legend { font-family: var(--display); font-size: var(--fs-600); padding: 0 0.35rem; }

/* ── Advanced search ─────────────────────────────────────────────────── */
.adv .views { margin-top: 0.5rem; }
.adv-form { max-width: 62rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.field--wide { grid-column: 1 / -1; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > legend { font-family: var(--body); font-size: var(--fs-400); font-weight: 700; padding: 0; margin-bottom: 0.35rem; }
.years { display: flex; align-items: center; gap: 0.6rem; }
.years input { width: 7.5rem; }
.choice-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0 1rem; border: 2px solid var(--box-200); border-radius: 999px; background: #fff; font-weight: 600; cursor: pointer; }
.choice input { width: 1.1rem; height: 1.1rem; accent-color: var(--plum-700); }
.choice:has(input:checked) { border-color: var(--plum-700); background: var(--plum-50); color: var(--plum-800); }
.choice:has(input:focus-visible) { outline: 3px solid var(--plum-700); outline-offset: 2px; }
.adv-note { max-width: 48rem; margin-top: 2rem; }
.ent-section { margin-top: 1.75rem; }
.ent-list { list-style: none; margin: 0.75rem 0 0; padding: 0; columns: 2 24rem; column-gap: 2.5rem; }
.ent-list li { break-inside: avoid; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.ent-list a { font-weight: 700; }
.ent-meta { display: block; color: var(--muted); font-size: var(--fs-200); margin-top: 0.15rem; }
.ent-list .chip { background: var(--box-50); color: var(--box-800); }

/* ── Tables (sync monitor) ───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-300); }
th, td { text-align: left; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { background: var(--box-50); font-family: var(--mono); font-weight: 400; color: var(--box-800); position: sticky; top: 0; }
.status { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.status::before { content: ""; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: currentColor; }
.status--ok { color: #2f6b4f; } .status--late { color: #8a5a00; } .status--failed { color: #a3261b; }

/* ── View transitions (cross-document, progressive) ──────────────────── */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(*) { animation-duration: 320ms; animation-timing-function: cubic-bezier(.2,.7,.2,1); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ── Print ───────────────────────────────────────────────────────────── */
@media print {
  .proto-banner, .masthead .omnibox, .primary-nav, .site-footer, .record__tools, .storeroom__controls, .skip-link { display: none !important; }
  body { background: #fff; }
  .record { grid-template-columns: 1fr 1fr; }
  a { color: inherit; }
}
