/* ==========================================================================
   COMPONENTS · MAP — the choropleth engraved as a figure. Rendered as a tile
   cartogram (a printed plate of jurisdictions) rather than a UI map widget:
   each country is a tile carrying its ISO code, mono score, and band ink, with
   hairline borders and no-data as bare paper under a fine diagonal hatch. Lives
   inside an .op-figure plate. Never colour alone — each tile carries the band
   fill + the mono numeral + a position tick; the printed band word lives in the
   ink-key legend, and an aria-label names the band for assistive tech. data-band.
   ========================================================================== */

.op-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: 1px;                       /* the hairline grid between plates */
  background: var(--rule);        /* shows through the 1px gaps as register lines */
  border: 1px solid var(--rule-strong);
}

.op-map__tile {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: var(--space-3xs);
  min-block-size: 4.5rem;
  padding: var(--space-2xs);
  background: var(--bk-fill, var(--surface-raised));
  color: var(--bk-ink, var(--text));
  text-decoration: none;
  transition: var(--transition-ink);
}
.op-map__tile:hover {
  background: color-mix(in oklab, var(--bk-ink, var(--text)) 16%, var(--surface-raised));
}
.op-map__tile:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* no-data tile: bare paper under the diagonal hatch */
.op-map__tile[data-band="none"] {
  background-color: var(--surface);
  background-image: var(--hatch-image);
  color: var(--text-secondary);
}

.op-map__iso {
  font-family: var(--font-data);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
}
.op-map__score {
  font-family: var(--font-data);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--bk-ink, var(--text));
}
.op-map__score[data-empty]::after { content: "—"; color: var(--text-muted); }

/* A band tick on the right edge whose VERTICAL POSITION encodes the band
   (good=top · moderate=middle · poor=bottom) — a genuine non-hue, non-numeral
   third cue. top + translateY(-pos) keeps the tick inside the tile at 0/50/100%. */
.op-map__tick {
  position: absolute;
  right: var(--space-2xs);
  top: var(--bk-pos, 0%);
  transform: translateY(calc(-1 * var(--bk-pos, 0%)));
  inline-size: 0.55rem;
  block-size: 0.2rem;
  border-radius: var(--radius-xs);
  background: var(--bk-ink, var(--rule-strong));
}
.op-map__tile[data-band="none"] .op-map__tick { background: var(--band-none-line); }
