/* The part pages (scripts/parts/pages.ts): the app's typefaces and its tokens (app/src/ui/styles.css), dark as the
   app opens and light where the reader's system asks for it. The inks are the app's, each held to 4.5:1 against the
   page and a panel there (app/tests/contrast.test.ts), and are the only colours text is written in. No script. */
@font-face { font-family: 'Geist Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/assets/geist-latin-wght-normal-fyz3j8y6.woff2) format('woff2-variations'); }
@font-face { font-family: 'Geist Mono Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(/assets/geist-mono-latin-wght-normal-bnrovxpd.woff2) format('woff2-variations'); }

:root {
  --font-ui: 'Geist Variable', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-num: 'Geist Mono Variable', ui-monospace, 'SF Mono', monospace;
  --r-sm: 8px;
  --r-md: 12px;
  --bg: #141517;
  --panel: #18191b;
  --ink: #e9e7e3;
  --ink-2: #a5a4a0;
  --ink-3: #908f8b;
  --line: rgba(255, 255, 255, 0.075);
  --hover: rgba(255, 255, 255, 0.055);
  --accent: #e8ad6e;
  --ok: #7fae8a;
  --corr: #7fa9ae;
  --prov: #cfa257;
  --conflict: #e0705a;
  /* a part's picture is drawn on the light backdrop in both themes, and its caption is written on that */
  --picture: #dcdad5;
  --picture-ink: #4a4945;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #dcdad5;
    --panel: #f9f8f6;
    --ink: #1d1c1a;
    --ink-2: #4a4945;
    --ink-3: #5f5e5a;
    --line: rgba(0, 0, 0, 0.075);
    --hover: rgba(0, 0, 0, 0.045);
    --accent: #8f4a1a;
    --ok: #3b6946;
    --corr: #34666e;
    --prov: #7c5a1c;
    --conflict: #a1422d;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.pp { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--font-ui); -webkit-font-smoothing: antialiased; }
.pp a { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 3px; }
.pp a:focus-visible, .pp summary:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (hover: hover) { .pp a:hover { text-decoration-color: var(--ink); } }
.pp-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 0.94em; letter-spacing: -0.01em; }
.pp-quiet { color: var(--ink-3); }
.pp-sep { color: var(--ink-3); }

.pp-mast, .pp-main, .pp-foot { max-width: 960px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.pp-mast { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; }
.pp-mast a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.pp-mark { font-weight: 620; font-size: 11.5px; letter-spacing: 0.22em; }
.pp-nav { display: flex; gap: 4px; }
.pp-nav a { color: var(--ink-2); font-size: 13.5px; padding: 0 10px; border-radius: var(--r-sm); }
@media (hover: hover) { .pp-nav a:hover { color: var(--ink); background: var(--hover); } }

.pp-main { padding-bottom: 32px; }
.pp h1 { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; margin: 4px 0 8px; text-wrap: balance; }
.pp h1 .nw { white-space: nowrap; }
@media (max-width: 560px) { .pp h1 { font-size: 25px; } }
.pp h2 { font-size: 18px; font-weight: 600; margin: 0 0 6px; }
.pp h3 { font-size: 13px; font-weight: 600; margin: 14px 0 4px; letter-spacing: 0.02em; }
.pp-crumbs { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.pp-crumbs a { color: var(--ink-2); display: inline-block; padding: 6px 0; }
.pp-kind { margin: 10px 0 0; font-size: 11.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-3); }
.pp-description { color: var(--ink-2); max-width: 46em; margin: 0 0 14px; }

.pp-top { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 10px; }
@media (max-width: 760px) { .pp-top { grid-template-columns: minmax(0, 1fr); } }
.pp-picture { margin: 0; background: var(--picture); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }
.pp-picture img { display: block; width: 100%; height: auto; }
.pp-picture figcaption { font-size: 12px; color: var(--picture-ink); padding: 6px 12px 8px; }
.pp-nopicture { display: grid; place-items: center; aspect-ratio: 2 / 1; }
.pp-nopicture p { color: var(--picture-ink); margin: 0; font-size: 13px; }

.pp-side { display: grid; gap: 12px; }
.pp-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; margin: 0; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); }
.pp-facts dt { color: var(--ink-3); font-size: 13px; padding-top: 1px; }
.pp-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pp-from { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.pp-swatches { display: inline; }
.pp-swatch { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; background: var(--swatch, transparent); border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); margin-right: 5px; vertical-align: -0.05em; }
.pp-open { margin: 0; }
.pp-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 580; background: var(--ink); color: var(--bg) !important; text-decoration: none !important; }
@media (hover: hover) { .pp-button:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); } }
.pp-open-how { margin: 0; font-size: 13px; color: var(--ink-2); }

.pp-status { font-size: 11.5px; font-weight: 560; white-space: nowrap; }
.pp-status::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: currentColor; vertical-align: 0.05em; }
.pp-status.confirmed { color: var(--ok); } .pp-status.corroborated { color: var(--corr); } .pp-status.provisional { color: var(--prov); }
.pp-status.conflict { color: var(--conflict); } .pp-status.missing { color: var(--ink-3); }

.pp-section { margin-top: 30px; }
.pp-lede { color: var(--ink-2); font-size: 13.5px; margin: 0 0 10px; max-width: 52em; }
.pp-figures { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pp-figure { border-bottom: 1px solid var(--line); }
.pp-figure summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 2px 14px; align-items: baseline; padding: 10px 4px; cursor: pointer; list-style: none; min-height: 44px; }
.pp-figure summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .pp-figure summary:hover { background: var(--hover); } }
.pp-label { min-width: 0; }
.pp-value { text-align: right; white-space: nowrap; }
.pp-line { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-figure details[open] .pp-line { white-space: normal; }
@media (max-width: 560px) {
  .pp-figure summary { grid-template-columns: minmax(0, 1fr) auto; }
  .pp-figure .pp-status { grid-column: 2; grid-row: 2; text-align: right; }
  .pp-value { grid-column: 1 / -1; grid-row: 2; text-align: left; }
}
.pp-readings { list-style: none; margin: 0 0 8px; padding: 0 4px; display: grid; gap: 8px; }
.pp-reading { padding: 8px 12px; border-radius: var(--r-sm); background: var(--panel); border: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.pp-reading p { margin: 2px 0; }
.pp-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.pp-used { font-size: 11px; font-weight: 600; color: var(--ok); }
.pp-reason, .pp-conflict { font-size: 13px; margin: 4px 4px 8px; }
.pp-conflict { color: var(--conflict); }
.pp-figure details > .pp-quiet { font-size: 13px; margin: 4px 4px 10px; }

.pp-way { padding: 4px 0 8px; border-top: 1px solid var(--line); }
.pp-way h3 { color: var(--ink-2); }
.pp-way dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; font-size: 14px; }
.pp-way dt { color: var(--ink-3); }
.pp-way dd { margin: 0; }
.pp-way dd a { display: inline-block; padding: 3px 0; }

.pp-offers { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.pp-offers li { padding: 9px 4px; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }

.pp-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.pp-kinds a { font-size: 13px; text-decoration: none; padding: 0 12px; min-height: 36px; display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); }
@media (hover: hover) { .pp-kinds a:hover { color: var(--ink); } }
.pp-group { margin-top: 26px; scroll-margin-top: 12px; }
.pp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.pp-item { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); text-decoration: none !important; min-height: 72px; }
@media (hover: hover) { .pp-item:hover { border-color: color-mix(in srgb, var(--ink) 25%, transparent); } }
.pp-thumb { display: block; width: 112px; height: 56px; object-fit: contain; border-radius: var(--r-sm); background: var(--picture); }
.pp-item-words { display: grid; gap: 2px; min-width: 0; }
.pp-item-name { font-weight: 560; font-size: 14px; line-height: 1.3; }
.pp-item-figures { color: var(--ink-2); font-size: 12.5px; }

.pp-foot { border-top: 1px solid var(--line); padding-top: 14px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.pp-foot p { color: var(--ink-3); font-size: 12.5px; margin: 0; max-width: 52em; }

/* a finger's size on a phone's page (every screen up to 1000 px, as the app's): a link of a list on a line of its own,
   one in a line of text reaching past its words without moving them */
@media (max-width: 1000px) {
  .pp-crumbs a { padding: 10px 6px; margin: 0 -6px; }
  .pp-way dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pp-way dt { margin-top: 8px; }
  .pp-way dd .pp-sep { display: none; }
  .pp-way dd a { display: flex; align-items: center; min-height: 40px; padding: 0; }
  .pp-way dd a + .pp-quiet { display: block; margin: -8px 0 4px; font-size: 12.5px; }
  .pp-offers li { min-height: 44px; }
  .pp-offers li > a:first-child, .pp-facts dd a, .pp-reading a { display: inline-block; padding: 10px 0; margin: -10px 0; }
}
