/* Layout: one world map that changes with the gem you pick: the producing countries shaded by
   importance, key mining areas as points, and on request the trading and cutting centres;
   beside it the list of sources with notes, then the gem's story and sources. */
:root {
  --paper: #ffffff;
  --ink: #16161a;
  --ink-soft: #3d3d45;
  --muted: #6b6b75;
  --rule: #e4e2de;
  --mist: #f4f3f1;
  --ruby: #9b1b30;
  --gold: #b8892f;
  --land: #e7e4dd;
  --land-edge: #ffffff;
  --sea: #f6f5f2;
  --gem: #9b1b30;
  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

:root[data-theme="dark"] {
  --paper: #121216; --ink: #f1efe9; --ink-soft: #c9c6bf; --muted: #9a978f; --rule: #2c2c33; --mist: #1b1b21;
  --ruby: #e0566c; --gold: #e1b25a; --land: #2a2b31; --land-edge: #121216; --sea: #17181d; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; margin: 0; }
a { color: var(--ink); text-decoration-color: var(--ruby); text-underline-offset: 3px; }
.wrap { max-width: 1240px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 48px; display: grid; gap: 22px; }
header.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ruby); display: inline-flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; flex: none; width: 4px; height: 15px; background: var(--gold); clip-path: polygon(0 24%, 100% 0, 100% 76%, 0 100%); }
h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.03; letter-spacing: -.01em; margin: 6px 0 0; text-wrap: balance; }
h2.sec { font-family: var(--font-display); font-weight: 500; font-size: 28px; margin: 0; line-height: 1.1; }
.lede { max-width: 66ch; color: var(--ink-soft); margin: 6px 0 0; }
.prototype { font-size: 12px; color: var(--muted); border: 1px solid var(--rule); padding: 4px 10px; white-space: nowrap; }
.help { font-size: 12px; color: var(--muted); }
.gems { display: flex; flex-wrap: wrap; gap: 6px; }
.gems button { font: 600 13px var(--font-body); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 5px 10px 5px 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.gems button i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.gems button img { width: 20px; height: 20px; object-fit: contain; }
.gems button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ruby); outline-offset: 2px; }
.toggles { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.toggles label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

.layout { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }
.mapbox { background: var(--sea); position: relative; }
.mapbox svg { display: block; width: 100%; height: auto; }
.country { fill: var(--land); stroke: var(--land-edge); stroke-width: .5; transition: fill .25s; }
.country.major { fill: var(--gem); }
.country.minor { fill: var(--gem); fill-opacity: .42; }
.country.hist { fill: var(--gem); fill-opacity: .16; }
.country:hover { stroke: var(--ink); stroke-width: 1; }
.loc circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.loc text, .centre text { font: 600 10.5px var(--font-body); fill: var(--ink); paint-order: stroke; stroke: var(--sea); stroke-width: 3px; stroke-linejoin: round; }
.centre rect { fill: var(--gold); stroke: var(--ink); stroke-width: .8; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 12.5px; padding: 6px 9px; max-width: 260px; display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-soft); padding: 8px 2px 0; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 14px; height: 10px; display: inline-block; background: var(--gem); }

.panel { display: grid; gap: 12px; align-content: start; }
.panel h2 { font-family: var(--font-display); font-weight: 500; font-size: 34px; margin: 0; line-height: 1; display: flex; gap: 10px; align-items: center; }
.panel h2 i { width: 22px; height: 22px; border-radius: 50%; background: var(--gem); flex: none; }
.panel h2 img { width: 72px; height: 72px; object-fit: contain; flex: none; filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.panel .intro { margin: 0; color: var(--ink-soft); font-size: 14px; }
.srcs { border-top: 1px solid var(--ink); }
.src { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14px; cursor: default; }
.src .dot { width: 12px; height: 12px; margin-top: 5px; background: var(--gem); }
.src.minor .dot { opacity: .42; } .src.hist .dot { opacity: .16; outline: 1px solid var(--gem); }
.src b { font-weight: 600; }
.src span { display: block; color: var(--ink-soft); font-size: 13px; }
.src .num { font: 500 12px var(--font-data); color: var(--muted); }
.centres { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ccard { border-top: 2px solid var(--gold); padding-top: 6px; font-size: 13.5px; color: var(--ink-soft); }
.ccard b { color: var(--ink); font-family: var(--font-display); font-size: 18px; font-weight: 500; display: block; }
section.study { border-top: 1px solid var(--ink); padding-top: 18px; display: grid; gap: 14px; }
.sources { display: grid; gap: 6px; font-size: 13px; color: var(--ink-soft); max-width: 92ch; }
.sources p { margin: 0; }
/* jewelloop.net: one column that never grows wider than the screen */
.wrap { grid-template-columns: minmax(0, 1fr); }
.jl-table-scroll { overflow-x: auto; max-width: 100%; }
/* shown once the page's script has run (static/visual/ready.js): no jump while loading */
html:not(.jl-ready) .wrap { visibility: hidden; }

/* On jewelloop.net the page around it shows the title and the introduction. */
header.top { display: none !important; }
