:root {
  color-scheme: light;
  --canvas: #f3ead9;
  --paper: #f8efdf;
  --inset: #ebe0cc;
  --rule: #cec0a8;
  --ink: #322e25;
  --muted: #685f4f;
  --accent: #435c42;
  --measure: 980px;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body, figure, h1, h2, p { margin: 0; }
body { min-height: 100vh; background: var(--canvas); }
a { color: var(--accent); text-underline-offset: .16em; }
:is(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.wrap, .mast-inner { width: min(calc(100% - 64px), var(--measure)); margin-inline: auto; }
.journal-mast { color: var(--ink); }
.mast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 63px;
  border-bottom: 1px solid var(--rule);
}
.brand, .store-link, footer a { display: inline-flex; align-items: center; text-decoration: none; }
.brand { gap: 9px; color: var(--ink); font-size: 15px; font-weight: 650; letter-spacing: -.025em; }
.brand b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
}
.store-link, footer a { padding-block: 10px; font-size: 14px; }
.store-link { gap: 4px; }
:is(.store-link, footer a):hover { text-decoration: underline; }
.category { color: var(--muted); font-size: 13px; font-weight: 550; }
h1, h2 { font-family: var(--serif); color: var(--ink); font-weight: 400; }
figcaption { padding: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.photo-credit { display: block; }
.photo-credit a { color: var(--accent); }
.photo-license { white-space: nowrap; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Index */
.library-wrap { padding-block: clamp(24px, 4vw, 46px) 60px; }
.library-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 290px);
  align-items: end;
  gap: 28px;
}
.library-intro h1 {
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.06;
  letter-spacing: -.045em;
}
.library-intro p { margin-top: 9px; color: var(--muted); font-size: 16px; }
.library-search-field { position: relative; }
.library-search-field::before, .library-search-field::after {
  content: "";
  position: absolute;
  pointer-events: none;
  color: var(--muted);
}
.library-search-field::before {
  top: calc(50% - 8px);
  left: 14px;
  width: 10px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
.library-search-field::after {
  top: calc(50% + 4px);
  left: 24px;
  width: 6px;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.library-search input, .request select {
  max-width: 100%;
  min-height: 44px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.library-search input { width: 100%; padding: 8px 12px 8px 40px; font-size: 15px; }
.library-search input::placeholder { color: var(--muted); opacity: 1; }
.library-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin-top: 22px;
  border-bottom: 1px solid var(--rule);
}
.library-topics a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
}
.library-topics a[aria-current] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.library-topics a:hover { color: var(--accent); text-decoration: underline; }
.library-results, .library-empty { margin-top: clamp(18px, 2.8vw, 30px); }
.library-results { display: grid; gap: 30px; }
.library-card { min-width: 0; }
.library-card-link {
  display: grid;
  grid-template-columns: minmax(0, 1.17fr) minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}
.library-card-link img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.library-card-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  padding: clamp(22px, 3.2vw, 38px);
}
.library-card-copy:only-child { grid-column: 1 / -1; }
.library-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.library-card-meta > :last-child::before { content: "·"; margin-right: 8px; }
.library-card h2 {
  font-size: clamp(27px, 3.2vw, 39px);
  line-height: 1.12;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.library-card-copy p { font-size: 15px; line-height: 1.55; color: var(--muted); }
.library-actions { margin-top: 6px; }
.library-read { display: inline-flex; gap: 8px; color: var(--accent); font-size: 14px; font-weight: 600; }
.library-card-link:hover .library-read { text-decoration: underline; }
.library-empty {
  padding: 24px 0 32px;
  border-bottom: 1px solid var(--rule);
}
.library-empty h2 { font-size: 26px; }
.library-empty p { margin: 6px 0 12px; color: var(--muted); }
.library-empty a { font-size: 14px; font-weight: 600; }

/* Article */
.story-page {
  --canvas: #fff;
  --paper: #fff;
  --inset: #f6f8f6;
  --rule: #d7dcd9;
  --ink: #33383a;
  --muted: #596164;
  --accent: #435b4d;
}
.story-page .reading h2 { color: #286141; }
.story-page .request h2 { color: #52635b; }
main.story-wrap { padding-top: 12px; }
.story-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
}
.article-title h1 {
  max-width: 24ch;
  margin: 9px 0 16px;
  font-size: clamp(34px, 4.7vw, 53px);
  line-height: 1.07;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.lead { color: var(--ink); font-size: clamp(16px, 1.6vw, 18px); line-height: 1.55; }
.story-hero img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 9px; }
.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 205px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(30px, 5vw, 62px);
  margin-top: clamp(24px, 3.5vw, 40px);
  padding-top: clamp(24px, 3.5vw, 36px);
  border-top: 1px solid var(--rule);
}
.story-nav {
  position: sticky;
  top: 20px;
  min-width: 0;
  max-height: calc(100dvh - 40px);
  border-right: 1px solid var(--rule);
  padding-right: 18px;
}
.story-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  list-style: none;
}
.story-nav summary::-webkit-details-marker { display: none; }
.story-nav summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: -3px 4px 0 0;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.story-nav details[open] summary::after { margin-top: 3px; transform: rotate(225deg); }
.story-nav ul {
  max-height: min(65vh, 37rem);
  margin: 11px 0 0;
  padding: 1px 3px 3px 0;
  overflow: auto;
  list-style: none;
}
.story-nav a {
  display: block;
  padding-block: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}
.story-nav a:hover { color: var(--accent); text-decoration: underline; }
.story-nav a:focus-visible { outline-offset: -1px; }
.story-column { min-width: 0; }
.reading h2, .request h2 {
  margin-bottom: 12px;
  font-size: clamp(24px, 2.7vw, 31px);
  line-height: 1.18;
  letter-spacing: -.025em;
  scroll-margin-block-start: 22px;
}
.reading h2:focus { outline: none; }
.reading h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.reading p { max-width: 70ch; font-size: 16px; line-height: 1.7; }
.reading p + p { margin-top: 14px; }
.reading section + section { margin-top: clamp(28px, 3.5vw, 42px); }
.story-history ol {
  margin: 0;
  border-left: 1px solid var(--rule);
  padding: 0 0 0 18px;
  list-style: none;
}
.story-history li + li { margin-top: 14px; }
.story-history time { color: var(--accent); font-weight: 650; font-variant-numeric: tabular-nums; }
.story-reading > figure { margin-top: 22px; }
.story-reading > figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 9px; }
.request {
  margin-top: clamp(28px, 4vw, 44px);
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--inset);
}
.request p { max-width: 58ch; margin-bottom: 18px; color: var(--muted); font-size: 15px; }
.request form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.request-choice { flex: 0 1 270px; min-width: 0; width: 100%; }
.request label { font-size: 14px; font-weight: 600; }
.request-select { position: relative; margin-top: 5px; }
.request-select::after {
  content: "";
  position: absolute;
  top: calc(50% - 5px);
  right: 15px;
  width: 7px;
  height: 7px;
  border: solid var(--accent);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
.request select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 8px 36px 8px 12px;
  border-color: #a7b3ac;
  cursor: pointer;
  font-size: 16px;
}
.request button {
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--accent);
  color: var(--paper);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}
.request button:hover { text-decoration: underline; }
@media (forced-colors: active) {
  .request select { appearance: auto; }
  .request-select::after { display: none; }
}
footer { margin-top: 30px; border-top: 1px solid var(--rule); padding: 12px 0 28px; }
.sources ul { padding-left: 20px; }
.sources li + li { margin-top: 6px; }

@media (max-width: 52rem) {
  .story-layout { display: block; padding-top: 0; border-top: 0; }
  .story-nav {
    z-index: 1;
    top: 0;
    max-height: none;
    margin-bottom: 24px;
    padding: 0;
    border: solid var(--rule);
    border-width: 1px 0;
    background: var(--canvas);
  }
  .story-nav summary { min-height: 48px; }
  .story-nav ul { max-height: min(50dvh, 24rem); margin: 0; padding: 0 5px 9px 0; }
  .story-nav a { padding-block: 9px; }
  .reading h2 { scroll-margin-block-start: 66px; }
}
@media (max-width: 46rem) {
  .wrap, .mast-inner { width: min(calc(100% - 36px), 580px); }
  .mast-inner { min-height: 52px; }
  .library-deck { display: block; }
  .library-search { margin-top: 17px; }
  .library-topics { margin-top: 10px; }
  .library-card-link, .story-hero { grid-template-columns: minmax(0, 1fr); }
  .library-card-link img { height: auto; }
  .library-card-copy { gap: 10px; padding: 20px; }
  .library-actions { margin-top: 3px; }
  .story-hero { gap: 22px; }
  .article-title h1 { margin-bottom: 12px; }
  .story-hero figure { max-width: 440px; }
}


.request-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.request-details summary::-webkit-details-marker { display: none; }
.request-details[open] summary { margin-bottom: 16px; }
.request-details form { align-items: start; }
.request-details p { flex-basis: 100%; margin: 0; }
.request-choice input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 5px;
  padding: 10px 12px;
  border: 1px solid #cbd5d0;
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: inherit;
}

.story-hero-text { display: block; max-width: 760px; }
