/* Shared furniture for both pages: look switch, style panel, masthead, archive,
   and the "Gazette" (old newspaper) look, applied with html[data-look="gazette"]. */

/* ---------------------------------------------------------------- look switch + panel (both looks) */
.lookswitch { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; color: var(--ink-3); }
.lookswitch button { border: 1px solid var(--line); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 2px 10px; font: inherit; cursor: pointer; }
.lookswitch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
nav.top { align-items: center; }

.figpanel { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0 0; background: var(--card); }
.figpanel > summary { cursor: pointer; padding: 10px 14px; font-weight: 650; font-size: 14px; list-style: none; display: flex; gap: 8px; align-items: center; }
.figpanel > summary::-webkit-details-marker { display: none; }
.figpanel > summary::after { content: "▾"; margin-left: auto; color: var(--ink-3); }
.figpanel[open] > summary::after { content: "▴"; }
.fp-hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.fp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 18px; padding: 4px 14px 14px; }
@media (max-width: 1000px) { .fp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .fp-grid { grid-template-columns: 1fr; } }
.fp-grid fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 8px 0 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.fp-grid legend { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 0 6px 0 0; }
.fp-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.fp-grid label.cb { flex-direction: row; align-items: center; gap: 6px; }
.fp-grid select, .fp-grid input[type="text"] { font: 13px var(--font); color: var(--ink); background: var(--chip); border: 1px solid transparent; border-radius: 6px; padding: 5px 8px; width: 100%; min-width: 0; }
.fp-grid input[type="range"] { width: 100%; accent-color: var(--ink); }
.fp-val { float: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fp-row { display: flex; gap: 10px; flex-wrap: wrap; }
.fp-row > label { flex: 1 1 120px; }
.fp-btns button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 7px 12px; font: 600 13px var(--font); cursor: pointer; }
.fp-btns .fp-go { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fp-msg { margin: 0; min-height: 1.2em; font-size: 12px; color: var(--ink-3); }
.fig-actions { position: absolute; left: 12px; top: 12px; z-index: 3; display: flex; gap: 4px; }

/* masthead: only in the Gazette look */
.masthead { display: none; }
.g-only { display: none; }
html[data-look="gazette"] .g-only { display: initial; }
html[data-look="gazette"] .m-only { display: none; }

/* archive: shown in both looks */
.archive { padding: 34px 0 4px; }
.arch-h { font-size: 21px; margin: 0 0 12px; }
.arch-grid { display: grid; grid-template-columns: 1.6fr 0.7fr 1fr; grid-template-areas: "wide tall text" "mid tall text"; gap: 18px; align-items: start; }
@media (max-width: 900px) { .arch-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "wide wide" "tall text" "mid mid"; } }
@media (max-width: 560px) { .arch-grid { grid-template-columns: 1fr; grid-template-areas: "wide" "tall" "text" "mid"; } }
.clip { margin: 0; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px; color: var(--ink); }
.clip svg { display: block; width: 100%; height: auto; }
.clip.wide { grid-area: wide; } .clip.tall { grid-area: tall; } .clip.text { grid-area: text; } .clip.mid { grid-area: mid; }
.clip.tall svg { max-height: 520px; }
.clip figcaption { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.4; }
.clip.text h3 { margin: 0 0 8px; font-size: 16px; }
.clip.text p { margin: 0 0 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.clip .tape { display: none; }
.arch-note { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; }

/* ================================================================ the Gazette look */
html[data-look="gazette"] {
  color-scheme: light;
  --paper: #f3ecdc;
  --bg: #f3ecdc; --surface: #f6f0e1; --card: #f8f3e6; --chip: #e9dfc8; --chip-on: #fbf7ec;
  --ink: #241f1a; --ink-2: #463e35; --ink-3: #756a5b; --line: #b7a98f;
  --grid: rgba(36, 31, 26, .085); --grid-2: rgba(36, 31, 26, .17);
  --shadow: 0 8px 22px rgba(70, 48, 20, .22), 0 1px 2px rgba(70, 48, 20, .2);
  /* ink colours, validated on paper: levels all-pairs, fields with shapes as the second cue */
  --ug: #2f6fb8; --pgt: #d4572a; --mres: #a8326f; --pgr: #1f9a6c;
  --f-eng: #2f6fb8; --f-sci: #1f9a6c; --f-med: #a8326f; --f-bus: #c98a12; --f-com: #6b6258;
  --single: #2f6fb8; --accent: #2f6fb8; --edge: #241f1a;
  --div-lo: #2f6fb8; --div-mid: #cdbf9f; --div-hi: #b5402a;
  --expo-dot: #8a7558; --ref: #8a7d6b;
  --font: "Old Standard TT", "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --head: "Playfair Display", "Old Standard TT", Georgia, serif;
}
html[data-look="gazette"] body {
  font-family: var(--font); font-size: 16px; color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 252, 240, .55), rgba(255, 252, 240, 0) 60%),
    radial-gradient(ellipse at 50% 100%, rgba(120, 90, 40, .10), rgba(120, 90, 40, 0) 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .27  0 0 0 0 .16  0 0 0 .075 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
}
html[data-look="gazette"] h1, html[data-look="gazette"] h2, html[data-look="gazette"] h3 { font-family: var(--head); }

/* masthead */
html[data-look="gazette"] .masthead { display: block; text-align: center; padding: 14px 0 0; }
.mh-top { display: flex; justify-content: space-between; font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--ink); padding-bottom: 4px; }
.mh-row { display: grid; grid-template-columns: 70px 1fr 70px; align-items: end; gap: 12px; padding: 6px 0 4px; }
.mh-art { color: var(--ink); height: 150px; display: flex; justify-content: center; }
.mh-art svg { height: 100%; width: auto; }
.mh-art.flip svg { transform: scaleX(-1); }
.mh-name { font-family: "UnifrakturMaguntia", "Old English Text MT", var(--head); font-size: clamp(34px, 7.4vw, 86px); line-height: 1; color: var(--ink); }
.mh-motto { font-style: italic; font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.mh-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); padding: 5px 2px; margin-top: 6px; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; }
.mh-note { font-size: 11.5px; font-style: italic; color: var(--ink-3); margin: 6px 0 0; }
@media (max-width: 640px) { .mh-row { grid-template-columns: 40px 1fr 40px; } .mh-art { height: 92px; } .mh-top span:nth-child(2) { display: none; } }

html[data-look="gazette"] nav.top { justify-content: center; flex-wrap: wrap; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; border-bottom: 1px solid var(--ink); padding: 8px 0; }
html[data-look="gazette"] nav.top a[aria-current] { border-bottom-color: var(--ink); }
html[data-look="gazette"] .lookswitch { margin-left: 18px; text-transform: none; letter-spacing: 0; }

/* headline block */
html[data-look="gazette"] header { display: block; text-align: center; padding: 18px 0 8px; border-bottom: 1px solid var(--ink); }
html[data-look="gazette"] header h1 { font-weight: 900; font-size: clamp(30px, 5.4vw, 62px); line-height: 1.02; letter-spacing: -.01em; text-transform: uppercase; }
html[data-look="gazette"] header h1 br { display: none; }
html[data-look="gazette"] .lede { font-style: italic; font-size: 18px; margin: 12px auto 14px; max-width: 70ch; color: var(--ink-2); }
html[data-look="gazette"] .credit { margin: 6px auto 16px; max-width: 640px; text-align: left; border: 1px solid var(--ink); border-left-width: 1px; padding: 10px 14px; background: var(--card); box-shadow: var(--shadow); transform: rotate(-0.4deg); position: relative; font-size: 14px; }
html[data-look="gazette"] .credit::before { content: "Editor's note"; display: block; font-family: var(--head); font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 4px; }

/* controls */
html[data-look="gazette"] .chip, html[data-look="gazette"] select, html[data-look="gazette"] input[type="search"] { font-family: var(--font); }
html[data-look="gazette"] .chip { border-radius: 3px; background: var(--chip); }
html[data-look="gazette"] .chip[aria-pressed="true"] { border-color: var(--ink); }
html[data-look="gazette"] .presets button, html[data-look="gazette"] .pcbtns button { border-radius: 3px; font-family: var(--font); background: var(--card); }

/* the chart as a printed figure plate */
html[data-look="gazette"] .chart, html[data-look="gazette"] .stage {
  border: 1px solid var(--ink); outline: 3px double var(--ink); outline-offset: 4px; background: var(--surface);
  margin: 26px 6px 8px; box-shadow: var(--shadow);
}
html[data-look="gazette"] .chart::before, html[data-look="gazette"] .stage::before {
  content: "Fig. " attr(data-fig); position: absolute; left: 10px; top: -24px; font-family: var(--head); font-weight: 700; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink);
}
html[data-look="gazette"] .howto { font-style: italic; color: var(--ink-2); text-align: center; }
html[data-look="gazette"] .zoombar button, html[data-look="gazette"] .fig-actions button { border-radius: 3px; background: var(--card); font-family: var(--font); }
html[data-look="gazette"] .card { border-radius: 2px; border: 1px solid var(--ink); background: var(--card); font-family: var(--font); }
html[data-look="gazette"] .card h3 { font-family: var(--head); }

/* sections */
html[data-look="gazette"] section > h2, html[data-look="gazette"] .arch-h { border-top: 4px double var(--ink); padding-top: 10px; font-weight: 900; font-size: 26px; text-transform: uppercase; letter-spacing: .01em; }
html[data-look="gazette"] .cols { column-count: 3; column-gap: 32px; column-rule: 1px solid var(--line); display: block; }
@media (max-width: 900px) { html[data-look="gazette"] .cols { column-count: 1; } }
html[data-look="gazette"] .cols > div { break-inside: avoid-column; }
html[data-look="gazette"] .cols > div:first-child > p:first-child::first-letter,
html[data-look="gazette"] .sub:first-of-type::first-letter { font-family: var(--head); font-weight: 900; float: left; font-size: 3.2em; line-height: .85; padding: 4px 6px 0 0; }
html[data-look="gazette"] table { font-family: var(--font); }
html[data-look="gazette"] th { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
html[data-look="gazette"] .dim, html[data-look="gazette"] .figpanel { border-radius: 2px; border-color: var(--ink); background: var(--card); }
html[data-look="gazette"] .figpanel > summary { font-family: var(--head); letter-spacing: .04em; }
html[data-look="gazette"] .badge { border-radius: 2px; border: 1px solid var(--line); }
html[data-look="gazette"] footer { border-top: 4px double var(--ink); font-style: italic; }

/* archive clippings with tape */
html[data-look="gazette"] .clip { border-radius: 0; border: none; background: #f9f4e7; box-shadow: 0 10px 22px rgba(70, 48, 20, .22), 0 1px 1px rgba(70, 48, 20, .25);
  clip-path: polygon(0% 1%, 4% 0%, 9% 1.2%, 15% .2%, 22% 1%, 30% 0%, 38% 1.1%, 47% .3%, 55% 1%, 63% 0%, 72% 1.2%, 80% .2%, 88% 1%, 95% 0%, 100% 1.1%, 99.4% 20%, 100% 40%, 99.3% 60%, 100% 80%, 99.5% 99%, 93% 100%, 85% 99%, 76% 100%, 66% 99.2%, 57% 100%, 47% 99%, 38% 100%, 28% 99.1%, 18% 100%, 9% 99.2%, 0% 100%, .6% 80%, 0% 60%, .7% 40%, 0% 20%); }
html[data-look="gazette"] .clip .tape { display: block; position: absolute; top: -2px; left: 50%; width: 88px; height: 22px; transform: translateX(-50%) rotate(-3deg); background: rgba(236, 222, 180, .75); border-left: 1px dashed rgba(120, 100, 60, .25); border-right: 1px dashed rgba(120, 100, 60, .25); z-index: 2; }
html[data-look="gazette"] .tilt-l { transform: rotate(-0.8deg); } html[data-look="gazette"] .tilt-r { transform: rotate(1deg); }
html[data-look="gazette"] .tilt-r2 { transform: rotate(0.6deg); } html[data-look="gazette"] .tilt-l2 { transform: rotate(-0.5deg); }
html[data-look="gazette"] .clip figcaption { font-style: italic; text-align: center; }
html[data-look="gazette"] .clip.text { column-count: 1; }
html[data-look="gazette"] .clip.text h3 { text-align: center; text-transform: uppercase; font-weight: 900; border-bottom: 1px solid var(--ink); padding-bottom: 6px; }
html[data-look="gazette"] .clip.text p:first-of-type::first-letter { font-family: var(--head); font-size: 2.6em; float: left; line-height: .8; padding: 3px 5px 0 0; font-weight: 900; }
html[data-look="gazette"] .clip.text .tape { left: 14%; transform: translateX(-50%) rotate(-8deg); width: 64px; }
html[data-look="gazette"] .clip.text { padding-top: 22px; }
