/* Layout: where you are (city + distance) on top; the map with a "near you" circle beside the event list;
   a twelve-month ribbon; then how events reach the page and the CMS review queue with the monthly email.
   Palette follows the JewelLoop site: white paper, ink, ruby accent, gold for events. */
:root {
  --paper: #ffffff; --ink: #16161a; --ink-soft: #3d3d45; --muted: #6b6b75; --rule: #e4e2de; --mist: #f4f3f1;
  --ruby: #9b1b30; --gold: #b8892f; --good: #2f7d4f; --warn: #b7791f;
  --land: #e9e6df; --land-edge: #ffffff; --sea: #f7f6f3; --near: rgba(155, 27, 48, .10); --near-edge: rgba(155, 27, 48, .45);
  --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; --good: #5fbf86; --warn: #e3a948;
  --land: #26262d; --land-edge: #121216; --sea: #18181d; --near: rgba(224, 86, 108, .14); --near-edge: rgba(224, 86, 108, .55);
  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: 26px; }
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; 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; text-wrap: balance; }
.lede { max-width: 64ch; 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; }
.mini { font: 600 12px var(--font-body); letter-spacing: .14em; text-transform: uppercase; margin: 0; color: var(--ink-soft); }
.help { font-size: 12.5px; color: var(--muted); margin: 0; }
p.copy { margin: 0; color: var(--ink-soft); max-width: 68ch; }
section.study { border-top: 1px solid var(--ink); padding-top: 18px; display: grid; gap: 16px; }
button:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--ruby); outline-offset: 2px; }

/* where you are */
.where { display: grid; gap: 14px 28px; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
@media (max-width: 900px) { .where { grid-template-columns: 1fr 1fr; } .where .city { grid-column: 1 / -1; } }
@media (max-width: 560px) { .where { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field > .lab { font-size: 13px; font-weight: 600; }
select { font: 500 15px var(--font-body); color: var(--ink); background: var(--paper); border: 1px solid var(--ink); padding: 7px 8px; border-radius: 0; width: 100%; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: 600 13px var(--font-body); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 6px 11px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button .n { font: 500 12px var(--font-data); opacity: .7; margin-left: 4px; }
.guess { font-size: 12.5px; color: var(--muted); }
.guess b { color: var(--ink-soft); font-weight: 600; }

/* map + list */
.main { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 920px) { .main { grid-template-columns: 1fr; } }
.mapbox { background: var(--sea); position: relative; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); }
#map { display: block; width: 100%; height: auto; }
#map .land { fill: var(--land); stroke: var(--land-edge); stroke-width: .6; }
#map .near { fill: var(--near); stroke: var(--near-edge); stroke-width: 1.2; stroke-dasharray: 4 3; }
#map .home { fill: var(--paper); stroke: var(--ruby); stroke-width: 2.5; }
#map .dot { cursor: pointer; }
#map .dot circle { stroke: var(--paper); stroke-width: 1.5; }
#map .dot.in circle { fill: var(--ruby); }
#map .dot.out circle { fill: var(--muted); opacity: .55; }
#map .dot.sel circle { stroke: var(--ink); stroke-width: 2.5; }
#map text { font: 600 11px var(--font-body); fill: var(--ink); paint-order: stroke; stroke: var(--sea); stroke-width: 3px; pointer-events: none; }
.maplegend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--ink-soft); padding: 8px 2px 0; }
.maplegend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.list { display: grid; gap: 0; min-width: 0; }
.listhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.listhead h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 22px; }
.clear { font: 600 12px var(--font-body); background: none; border: 0; color: var(--ruby); cursor: pointer; padding: 0; }
.ev { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.ev .date { font-family: var(--font-data); text-align: center; border: 1px solid var(--rule); padding: 6px 2px; align-self: start; }
.ev .date b { display: block; font: 500 24px var(--font-display); line-height: 1; }
.ev .date span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ev h4 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.25; }
.ev .meta { font-size: 13px; color: var(--ink-soft); margin: 2px 0 6px; }
.ev .tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { font: 600 12px var(--font-body); letter-spacing: .04em; border: 1px solid var(--rule); padding: 1px 7px; color: var(--ink-soft); white-space: nowrap; }
.tag.tbc { border-color: var(--warn); color: var(--warn); }
.tag.dist { font-family: var(--font-data); font-weight: 500; }
.tag.near { border-color: var(--ruby); color: var(--ruby); }
.ev .acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 13px; }
.ev .acts button { font: 600 13px var(--font-body); background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--ruby); text-underline-offset: 3px; cursor: pointer; }
.empty { padding: 18px 0; color: var(--ink-soft); font-size: 14px; }
.ics { margin: 8px 0 0; background: var(--mist); border-left: 3px solid var(--gold); padding: 8px 10px; font: 12px/1.45 var(--font-data); white-space: pre-wrap; overflow-x: auto; }

/* twelve months */
.ribbon { overflow-x: auto; }
#ribbon { display: block; min-width: 760px; width: 100%; height: auto; }
#ribbon text { font: 500 11px var(--font-body); fill: var(--muted); }
#ribbon .mlabel { font: 600 12px var(--font-body); fill: var(--ink-soft); letter-spacing: .06em; }

/* how events get here */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, .9fr); gap: 0; align-items: stretch; }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr; } }
.src { border: 1px solid var(--rule); border-right: 0; padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
@media (max-width: 900px) { .src { border-right: 1px solid var(--rule); border-bottom: 0; } }
.src h3 { margin: 0; font-size: 15px; }
.src p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.src .when { font: 500 12px var(--font-data); color: var(--muted); }
.gate { border: 2px solid var(--ink); padding: 12px 14px; display: grid; gap: 6px; align-content: center; background: var(--mist); }
.gate h3 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 21px; }
.gate p { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.checks div { border-top: 2px solid var(--gold); padding-top: 8px; font-size: 14px; color: var(--ink-soft); }
.checks b { display: block; color: var(--ink); font-size: 14.5px; }

/* CMS queue */
.cms { border: 1px solid var(--rule); }
.cmsbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--ink); color: var(--paper); padding: 8px 12px; font-size: 13px; }
.cmsbar b { font-weight: 600; }
.cmsbody { padding: 12px; display: grid; gap: 10px; }
.q { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; border: 1px solid var(--rule); padding: 10px 12px; }
@media (max-width: 640px) { .q { grid-template-columns: 1fr; } }
.q h4 { margin: 0; font-size: 15px; }
.q .from { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }
.q .why { font-size: 13px; color: var(--ink-soft); margin: 4px 0 0; }
.q .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.q .btns button { font: 600 13px var(--font-body); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 6px 11px; cursor: pointer; }
.q .btns button.ok { background: var(--ink); color: var(--paper); }
.q.done { opacity: .6; }
.q .state { font: 600 12px var(--font-body); color: var(--good); }
.example { font: 600 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--warn); border: 1px solid var(--warn); padding: 0 5px; margin-left: 6px; vertical-align: 2px; }
.mail { border: 1px solid var(--rule); background: var(--mist); padding: 14px 16px; display: grid; gap: 8px; max-width: 62ch; font-size: 14px; }
.mail .hd { font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: 6px; }
.mail ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.sources { font-size: 13px; color: var(--ink-soft); display: grid; gap: 4px; padding-left: 18px; margin: 0; }
footer.note { font-size: 12px; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; max-width: 95ch; }
/* 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; }
/* The planned event pipeline, the CMS demo and the review note are for the owner. */
section[aria-labelledby="f-h"], section[aria-labelledby="c-h"], footer.note { display: none !important; }
