/* Atlas UI — same look as the website: Bricolage Grotesque + Archivo, ink outlines, hard shadows, colour blocks. */
:root {
  --paper: #fbf8f1;
  --paper-2: #f1ece1;
  --ink: #141210;
  --muted: #6f6a62;
  --yellow: #ffcf3d;
  --orange: #ff5b2e;
  --pink: #ff9ec4;
  --mint: #b9efcf;
  --line: 2px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --display: 'Bricolage Grotesque', 'Archivo', system-ui, sans-serif;
  --sans: 'Archivo', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #f3efe4; color: var(--ink); font: 14px/1.4 var(--sans); }
#map { position: absolute; inset: 0; }
button { font: inherit; color: inherit; }

.card { position: absolute; z-index: 2; background: var(--paper); border: var(--line); border-radius: 16px; box-shadow: var(--pop); }
/* Squeezed caps, like the website's labels. */
.label, .panel .label {
  font: 700 11.5px var(--sans); font-stretch: 75%; font-variation-settings: 'wdth' 75;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}

/* ---------- Search ---------- */
.search { top: 12px; left: 12px; display: flex; align-items: center; width: min(400px, calc(100vw - 80px)); }
.brand {
  display: flex; align-items: center; gap: 7px; padding: 0 12px 0 10px; align-self: stretch;
  font: 800 17px var(--display); letter-spacing: -.04em; white-space: nowrap; color: var(--ink); text-decoration: none;
  border-right: var(--line);
}
.brand::before {
  content: ''; width: 24px; height: 24px; border-radius: 50%; border: var(--line); flex: none;
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 18l6-10 3.5 5 2.5-3.5L21 18z' fill='%23141210'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.brand:hover { color: var(--orange); }
.search-box { position: relative; flex: 1; min-width: 0; }
#q { width: 100%; border: 0; background: transparent; padding: 12px; font: 500 14px var(--sans); color: var(--ink); outline: none; }
#q::placeholder { color: var(--muted); }
#results {
  position: absolute; top: calc(100% + 10px); left: -2px; right: -2px; margin: 0; padding: 6px 0; list-style: none;
  background: var(--paper); border: var(--line); border-radius: 14px; box-shadow: var(--pop); max-height: 60vh; overflow-y: auto;
}
#results li { display: flex; align-items: baseline; gap: 8px; padding: 7px 12px; cursor: pointer; }
#results li[aria-selected="true"], #results li:hover { background: var(--yellow); }
#results .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
#results .k { color: var(--muted); font-size: 12px; white-space: nowrap; }
#results li[aria-selected="true"] .k, #results li:hover .k { color: var(--ink); }
#results .empty { color: var(--muted); cursor: default; }

/* ---------- Options panel ---------- */
.panel { right: 12px; bottom: 36px; padding: 12px 14px; min-width: 210px; }
.panel .label { margin: 2px 0 7px; }
.panel label { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; font-weight: 500; }
.panel input[type=checkbox] { appearance: none; width: 16px; height: 16px; margin: 0; border: var(--line); border-radius: 4px; background: #fff; flex: none; display: grid; place-items: center; cursor: pointer; }
.panel input[type=checkbox]:checked { background: var(--ink); }
.panel input[type=checkbox]:checked::after { content: ''; width: 8px; height: 4px; border: solid var(--yellow); border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
.panel input[type=checkbox]:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.seg { display: flex; border: var(--line); border-radius: 99px; padding: 2px; margin-bottom: 12px; background: #fff; }
.seg button { flex: 1; border: 0; background: none; padding: 5px 12px; border-radius: 99px; font: 700 12.5px var(--sans); text-transform: uppercase; letter-spacing: .03em; cursor: pointer; }
.seg button.on { background: var(--ink); color: var(--yellow); }
.panel .status { color: var(--muted); font-size: 11.5px; margin: -2px 0 4px 24px; }
.panel-toggle { display: none; }

/* ---------- Tips ---------- */
.tips-btn {
  position: absolute; z-index: 3; right: 12px; top: 186px; width: 34px; height: 34px; border-radius: 50%;
  border: var(--line); background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); cursor: pointer;
  font: 800 17px var(--display); display: grid; place-items: center; padding: 0;
}
.tips-btn:hover { background: var(--orange); }
.tips { z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; padding: 18px 20px 20px; }
.tips[hidden] { display: none; }
.tips h2 { font: 800 26px/1 var(--display); letter-spacing: -.04em; margin: 4px 0 4px; }
.tips .intro { margin: 0 0 12px; color: var(--muted); }
.tips dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0; align-items: baseline; }
.tips dt { white-space: nowrap; }
.tips dd { margin: 0; }
kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; text-align: center;
  font: 700 12px var(--sans); background: #fff; border: var(--line); border-radius: 6px; box-shadow: 0 2px 0 var(--ink);
}
.tips .group { margin-top: 14px; }
.tips .close {
  margin-top: 16px; width: 100%; padding: 10px; border: var(--line); border-radius: 99px; background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink); font: 800 14px var(--sans); text-transform: uppercase; letter-spacing: .02em; cursor: pointer;
}
.tips .close:hover { background: var(--orange); }
.tips .x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; }
.touch-only { display: none; }
@media (hover: none) { .touch-only { display: block; } .mouse-only { display: none; } }

/* ---------- MapLibre chrome ---------- */
.maplibregl-ctrl-group { border: var(--line) !important; border-radius: 14px !important; box-shadow: 2px 2px 0 var(--ink) !important; overflow: hidden; }
.maplibregl-ctrl-group button + button { border-top: 2px solid var(--ink) !important; }
.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 12px 12px 0 0; }
.maplibregl-ctrl-scale { background: rgba(251, 248, 241, .85); border: 2px solid var(--ink); border-top: 0; color: var(--ink); font: 700 11px var(--sans); }
.maplibregl-ctrl-attrib { font-family: var(--sans); }
.maplibregl-popup-content { background: var(--paper); border: var(--line); border-radius: 14px; padding: 10px 14px; box-shadow: var(--pop); font: 14px/1.4 var(--sans); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--ink) !important; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--ink) !important; }
.pop-name { font: 800 18px/1.1 var(--display); letter-spacing: -.03em; }
.pop-meta { color: var(--muted); font-size: 12px; }
.pop-closed { display: inline-block; background: var(--pink); border: var(--line); border-radius: 99px; padding: 1px 9px; font-weight: 700; font-size: 12px; margin: 4px 0 2px; }
.pop-note { margin-top: 4px; font-size: 12.5px; }
.pop-caveat { margin-top: 6px; font-style: italic; }
.pop-link { display: inline-block; margin-top: 6px; font-weight: 700; color: var(--ink); text-decoration: underline 2px var(--orange); text-underline-offset: 3px; }
.pv .maplibregl-popup-content { max-height: 55vh; overflow-y: auto; padding-right: 26px; }
.maplibregl-popup-close-button { font-size: 20px; color: var(--ink); right: 4px; top: 2px; }
.pop-pv > * + * { margin-top: 5px; }
.pop-grade { font-weight: 700; }
.pop-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { background: var(--mint); border: var(--line); border-radius: 99px; padding: 0 8px; font-size: 11.5px; font-weight: 600; }
.pop-pv details summary { cursor: pointer; font-weight: 700; font-size: 12.5px; text-decoration: underline 2px var(--orange); text-underline-offset: 3px; }

@media (max-width: 600px) {
  .panel { bottom: 32px; padding: 0; }
  .panel-toggle {
    display: block; width: 100%; border: 0; background: none; padding: 10px 14px; cursor: pointer; text-align: left;
    font: 700 12.5px var(--sans); text-transform: uppercase; letter-spacing: .03em;
  }
  .panel-body { padding: 0 14px 12px; }
  .panel.collapsed .panel-body { display: none; }
  .brand { font-size: 0; gap: 0; padding: 0 8px; }
}

/* Embedded in the website: just the map. */
.embed .search, .embed .panel, .embed .tips-btn, .embed .tips { display: none; }
