/* House style shared with danhartropp.com (palette, nav, dark footer) and
   weather.danhartropp.com (hard-shadow buttons, 2px fields, ruled sections). */
:root {
  color-scheme: light;
  --ink: #363636;
  --muted: #6b6b6b;
  --accent: #00d1b2;
  --accent-ink: #00806e;
  --accent-deep: #00695c;
  --bg: #ffffff;
  --panel: #f7f7f7;
  --rule: #e4e4e4;
  --divider: #b9c9c5;
  --dark: #0a0a0a;
  --field-edge: #8c8a82;
  --warn: #9a1c1c;
  --warn-bg: #fbf1f1;
  --hold-bg: #fff8e1;
  --hold-edge: #c9a227;
  --shadow: 2px 2px 0 rgba(54, 54, 54, .25);
  --shadow-deep: 2px 2px 0 rgba(0, 72, 62, .35);
  --radius: 6px;
  --pin: #00806e;
  --wide: 72rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
code { background: var(--panel); padding: .05em .3em; border-radius: 3px; font-size: .9em; }

/* --- header ------------------------------------------------------------ */
header {
  display: flex; align-items: center; gap: .5rem 1.25rem; flex-wrap: wrap;
  padding: .7rem 1.25rem; border-bottom: 1px solid var(--rule); background: var(--bg);
}
.brand { font-size: 1.3rem; font-weight: 700; letter-spacing: .02em; color: var(--accent-ink); }
.brand:hover { text-decoration: none; }
nav { display: flex; gap: .15rem; flex-wrap: wrap; }
nav a { color: var(--accent-ink); padding: .3rem .6rem; border-radius: var(--radius); font-size: .98rem; }
nav a:hover { background: var(--panel); text-decoration: none; }
nav a.on { font-weight: 700; background: var(--panel); }
.poc { margin-left: auto; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* --- page -------------------------------------------------------------- */
main { flex: 1 0 auto; width: 100%; max-width: var(--wide); margin: 0 auto; padding: 2rem 1.25rem 3rem; }
main.narrow { max-width: 46rem; }
main.wide { max-width: none; padding: 0; display: flex; min-height: 0; }
h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .4rem; color: var(--accent-ink); }
h2 { font-size: 1.1rem; line-height: 1.3; margin: 2.2rem 0 .6rem; }
h2::before { content: ""; display: block; width: 3.5rem; height: 2px; background: var(--divider); margin-bottom: .8rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 .3rem; }
.lede { color: var(--muted); font-size: 1.08rem; margin: 0 0 1.4rem; max-width: 42rem; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
p { margin: .6rem 0; }

.banner { background: var(--hold-bg); border-bottom: 1px solid var(--hold-edge); padding: .6rem 1.25rem; font-size: .95rem; }
.notice { margin: .8rem 0; padding: .6rem .8rem; background: var(--hold-bg); border-left: 4px solid var(--hold-edge); font-size: .95rem; }
.note { margin: .8rem 0; padding: .6rem .8rem; background: var(--panel); border-left: 4px solid var(--accent-ink); font-size: .95rem; }
.error { margin: .8rem 0; padding: .6rem .8rem; background: var(--warn-bg); border-left: 4px solid var(--warn); color: var(--warn); font-size: .95rem; }

/* --- controls ---------------------------------------------------------- */
input[type=search], input[type=text], input[type=number], select, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--field-edge); border-radius: 2px; padding: .45rem .6rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-ink); outline: none; }

/* Hard shadows rather than blurred: pressable, not floating. */
button, .button {
  display: inline-block; padding: .45rem 1rem; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent-ink); color: #fff; border: 2px solid var(--accent-deep); border-radius: 2px;
  box-shadow: var(--shadow-deep); text-decoration: none; white-space: nowrap;
}
button:hover, .button:hover { background: var(--accent-deep); text-decoration: none; }
button:active, .button:active { transform: translate(2px, 2px); box-shadow: none; }
button.secondary, .button.secondary { background: #fff; color: var(--ink); border-color: var(--ink); box-shadow: var(--shadow); }
button.secondary:hover, .button.secondary:hover { background: var(--panel); }
button[disabled] { opacity: .55; cursor: default; box-shadow: none; transform: translate(2px, 2px); }

/* Example queries and toggles: flat, square, quiet until hovered. */
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.chip {
  background: #fff; color: var(--ink); border: 1px solid var(--rule); border-radius: 2px;
  box-shadow: none; font-weight: 400; padding: .2rem .55rem; font-size: .9rem;
}
.chip:hover { background: var(--panel); border-color: var(--field-edge); }
.chip:active { transform: none; }
.chip.on { border-color: var(--accent-ink); color: var(--accent-ink); font-weight: 600; background: #fff; }

.searchbox { position: relative; display: flex; gap: .5rem; margin-bottom: .5rem; }
.searchbox input { flex: 1; min-width: 0; padding: .55rem .7rem; font-size: 1.05rem; }
.suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin: 2px 0 0; padding: 0; list-style: none;
  background: #fff; border: 2px solid var(--ink); box-shadow: var(--shadow);
}
.suggest li { padding: .4rem .7rem; cursor: pointer; border-top: 1px solid var(--rule); }
.suggest li:first-child { border-top: 0; }
.suggest li.active, .suggest li:hover { background: var(--panel); }
.suggest li.foot { cursor: default; font-size: .78rem; color: var(--muted); background: none; }

label.check { font-size: .92rem; display: flex; gap: .4rem; align-items: center; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; }

/* --- gallery ----------------------------------------------------------- */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .5rem 2rem; margin: 0 0 1rem; }
.group h3 { margin: 1rem 0 0; }
.group p { font-size: .85rem; color: var(--muted); margin: 0; }

/* --- results: ruled rows, not cards ------------------------------------ */
.meta { font-size: .88rem; color: var(--muted); margin: .4rem 0 .6rem; min-height: 1.4em; }
ol.results { list-style: none; padding: 0; margin: 0; border-bottom: 1px solid var(--rule); }
ol.results:empty { border: 0; }
.result { padding: .55rem .2rem; border-top: 1px solid var(--rule); display: flex; gap: .8rem; align-items: baseline; }
.result.pickable { cursor: pointer; }
.result.pickable:hover { background: var(--panel); }
.result.sel { background: var(--panel); box-shadow: inset 3px 0 0 var(--accent-ink); }
.rank { color: var(--muted); font-size: .8rem; min-width: 1.2rem; font-variant-numeric: tabular-nums; text-align: right; }
.body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.name { font-weight: 600; }
.detail { font-size: .85rem; color: var(--muted); }
.tags { display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; justify-content: flex-end; font-size: .8rem; }
.tag { color: var(--muted); border: 1px solid var(--rule); padding: 0 .35rem; border-radius: 2px; white-space: nowrap; }
.score { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.result.answer .score { color: var(--accent-ink); font-weight: 600; }
.wrong { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.wrong:hover { color: var(--warn); }

details { margin: 1rem 0; }
summary { cursor: pointer; color: var(--accent-ink); width: fit-content; }
pre, textarea.code {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 2px;
  padding: .7rem; overflow: auto; font: .8rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; max-height: 26rem;
  white-space: pre;
}
textarea.code { width: 100%; height: 16rem; resize: vertical; }

/* code panel tabs */
.codepanel { margin: 1rem 0; }
.codepanel .tabs { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin-bottom: .4rem; }
.codepanel pre { margin: 0; }

/* --- landing ------------------------------------------------------------ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0 2rem; margin: 1.5rem 0 1rem; }
.card { display: block; padding: .9rem 0; border-top: 2px solid var(--ink); color: var(--ink); }
.card:hover { text-decoration: none; }
.card strong { display: block; font-size: 1.15rem; color: var(--accent-ink); margin-bottom: .2rem; }
.card:hover strong { text-decoration: underline; }
.card span { color: var(--muted); font-size: .95rem; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .4rem .5rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { border-bottom: 2px solid var(--ink); white-space: nowrap; }
tr.flag td { background: var(--hold-bg); }
tr.miss td { background: var(--warn-bg); }
.tablewrap { overflow-x: auto; }

/* --- map pages: sidebar + map, stacked on phones ------------------------ */
.side { width: 24rem; flex-shrink: 0; overflow-y: auto; padding: 1.25rem; border-right: 2px solid var(--ink); max-height: calc(100dvh - 3.4rem); }
.side h1 { font-size: 1.5rem; }
.side h2 { margin-top: 1.4rem; }
.mapwrap { flex: 1; position: relative; min-height: 26rem; }
#map { position: absolute; inset: 0; }
@media (max-width: 760px) {
  main.wide { flex-direction: column; }
  .side { width: 100%; max-height: none; border-right: 0; border-bottom: 2px solid var(--ink); }
  .mapwrap { min-height: 60vh; }
  .poc { display: none; }
}
.pin {
  width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #fff; color: var(--ink); border: 2px solid var(--pin);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; cursor: pointer;
}
.pin > * { transform: rotate(45deg); }
.pin.answer { background: var(--pin); color: #fff; }
.pin.store { background: var(--dark); border-color: #fff; color: #fff; }
.pin.origin { background: #1a73e8; border: 2px solid #fff; border-radius: 50%; transform: none; width: 16px; height: 16px; box-shadow: 0 0 0 4px rgb(26 115 232 / .25); }
.panel { border-top: 2px solid var(--ink); padding: .6rem 0 0; margin-top: 1rem; font-size: .92rem; }
.panel h3 { margin: 0 0 .4rem; }
.panel dl { display: grid; grid-template-columns: max-content 1fr; gap: .1rem .8rem; margin: 0; }
.panel dt { color: var(--muted); }
.panel dd { margin: 0; }

/* --- style editor ------------------------------------------------------- */
.field { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .3rem 0; border-top: 1px solid var(--rule); font-size: .95rem; }
.field input[type=color] { width: 2.75rem; height: 1.8rem; border: 2px solid var(--ink); border-radius: 2px; background: none; padding: 0; cursor: pointer; }
.field select { padding: .2rem .4rem; }

/* --- footer, as danhartropp.com ---------------------------------------- */
footer { background: var(--dark); color: #b5b5b5; padding: 1.5rem 1.25rem 2rem; font-size: .85rem; }
footer a { color: #dbdbdb; text-decoration: underline; }
footer p { margin: .3rem auto; max-width: var(--wide); }
#attribution { color: #8a8a8a; font-size: .78rem; }
.pin.store { width: 12px; height: 12px; border-radius: 50%; transform: none; background: var(--dark); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--dark); }
.popup { font: .88rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); }
.popup strong { display: block; font-size: .95rem; }
.maplibregl-popup-content { border-radius: 2px; border: 2px solid var(--ink); box-shadow: var(--shadow); padding: .5rem .7rem; }
.chip { white-space: normal; text-align: left; max-width: 100%; }
