/* Map: the Witness Atlas on the dark table. Owner: Home + Map agent. */
.atlas-filters { padding-bottom: 18px; }
.atlas-sep { width: 1px; align-self: stretch; background: var(--rule); margin: 0 6px; flex: none; }
.atlas-stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.atlas-board { display: grid; gap: 8px; min-width: 0; }
.atlas-board a { color: var(--edge); }

/* the map: tiles graded dark, the box keeps the tile's proportions */
.atlas-map { position: relative; overflow: hidden; background: #0b0d0d; aspect-ratio: var(--r, 1.42); width: min(100%, calc(72vh * var(--r, 1.42))); margin: 0 auto;
  touch-action: pan-y; cursor: grab; outline: 7px solid var(--film); outline-offset: 0; }
.atlas-map:active { cursor: grabbing; }
.atlas-basemap { position: absolute; max-width: none; filter: grayscale(1) contrast(1.9) brightness(.3) sepia(.12); user-select: none; pointer-events: none; }

/* grease-pencil pins */
.atlas-pin { position: absolute; display: flex; align-items: center; gap: 4px; transform: translate(-15px, -50%); background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); --mk: 22px; }
.atlas-pin svg:first-child { width: 30px; height: 30px; flex: none; overflow: visible; fill: var(--edge); stroke: #050505; stroke-width: 2.2; paint-order: stroke; }
.atlas-pin[data-cluster] svg:first-child { fill: #050505b0; stroke: var(--edge); stroke-width: 2; }
.atlas-pin text { fill: var(--edge); stroke: none; font: 800 9.5px Archivo, sans-serif; text-anchor: middle; }
.atlas-pin .edge { color: var(--ink); white-space: nowrap; background: #050505d9; padding: 2px 5px; }
.atlas-pin .edge { display: none; }   /* names show on the picked pin, and on hover or focus */
.atlas-pin.is-picked .edge, .atlas-pin:hover .edge, .atlas-pin:focus-visible .edge { display: block; }
.atlas-pin:hover, .atlas-pin:focus-visible { z-index: 3; }
.atlas-pin.is-picked { z-index: 2; }   /* its label plate covers neighbours */
.atlas-pin.is-picked svg:first-child { fill: var(--no); }
.atlas-pin.is-picked[data-cluster] svg:first-child { fill: #050505b0; stroke: var(--no); }
.atlas-pin.is-picked text { fill: var(--no); }
.atlas-pin.flip-l { flex-direction: row-reverse; transform: translate(calc(-100% + 15px), -50%); }
.atlas-pin.flip-up { flex-direction: column-reverse; gap: 14px; transform: translate(-50%, calc(-100% + 15px)); }
.atlas-dot { display: flex; flex: none; }   /* the ring circles the pin itself, so it never lies over a neighbour's label */
.atlas-pin .pick { left: -10px; top: -10px; width: calc(100% + 20px); height: calc(100% + 20px); }

.atlas-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; margin-top: 8px; }
.atlas-tools select { background: var(--film); border: 1px solid var(--rule); padding: 6px 10px; max-width: 100%; }
.atlas-zoom { display: flex; gap: 6px; }
.atlas-zoom .chip { min-width: 38px; }
.atlas-selection .neg-cap { font-weight: 500; color: var(--dim); font-size: 14px; }

/* the list */
.atlas-list { display: grid; gap: 12px; }
.atlas-query input { width: min(420px, 100%); }
.atlas .ledger { list-style: none; padding: 0; }
.atlas .ledger a { display: grid; grid-template-columns: 84px 1fr auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); text-decoration: none; }
.atlas .ledger a:hover b { text-decoration: underline; }
.atlas .ledger .lf { width: 84px; aspect-ratio: 16 / 9; object-fit: cover; background: var(--film); }
.atlas .ledger .ly { font-stretch: 62%; font-weight: 800; font-size: 22px; color: var(--dim); }
.atlas .ledger .lt { display: grid; gap: 2px; min-width: 0; }
.atlas .ledger .lt span { font-size: 13px; color: var(--dim); }
.atlas .ledger .lm { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.atlas .ledger .lm .chip { padding: 2px 8px; font-size: 12px; cursor: inherit; }
.atlas .ledger .lm .amber { color: var(--edge); }

@media (max-width: 720px) {
  .atlas-stage { grid-template-columns: 1fr; }
  .atlas-map { outline-width: 4px; }
  .atlas .ledger a { grid-template-columns: 64px 1fr; gap: 12px; }
  .atlas .ledger .lf { width: 64px; }
  .atlas .ledger .lm { grid-column: 2; justify-content: flex-start; }
}
/* place filters steer the map only; the list keeps the year filter */
.atlas:has(#atlas-map-panel[hidden]) :is([data-region], .atlas-sep) { display: none; }
