/* Country card pages. Generated pages reference this file as ../cards.css.
   Mobile first: every grid is auto-fit, every figure is a viewBox SVG at
   width:100%, and nothing has a fixed pixel width wider than 320px. */

:root {
  --ink: #1f2328;
  --ink-soft: #57606a;
  --rule: #d8dee4;
  --panel: #f6f8fa;
  --na: #8b949e;
  --hi: #1a7f4b;
  --med: #b4690e;
  --lo: #b42318;
  --none: #57606a;
}

/* ---- header strip ---------------------------------------------------- */
.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--rule);
  padding-bottom: 0.6rem;
  margin-bottom: 0.9rem;
}
.card-head .iso {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.card-head .place { color: var(--ink-soft); font-size: 0.95rem; }
.card-head .spacer { flex: 1 1 auto; }

.badge {
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-high { color: var(--hi); }
.badge-medium { color: var(--med); }
.badge-low { color: var(--lo); }
.badge-none { color: var(--none); }

.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem 1rem;
  margin: 0.4rem 0 1rem;
}
.kv .k {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.kv .val { font-size: 0.95rem; overflow-wrap: anywhere; }

.card-note {
  background: var(--panel);
  border-left: 3px solid var(--rule);
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.pill {
  display: inline-block;
  background: #fff4d6;
  border: 1px solid #e2c169;
  border-radius: 4px;
  padding: 0.05rem 0.45rem;
  font-size: 0.8rem;
  margin-right: 0.4rem;
}

/* ---- the vintage stamp ----------------------------------------------- */
/* Small, visible, sourced: which release each headline number on the card is
   from, and the day the card was last refreshed. Wraps rather than scrolls. */
.vintage-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.9rem;
  margin: -0.4rem 0 1rem;
  padding: 0.4rem 0 0.5rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.vintage-strip .k {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
}
.vintage-strip .vt b { color: var(--ink); font-weight: 600; }
.vintage-strip abbr { text-decoration: none; border-bottom: 1px dotted var(--rule); }
.vintage-strip .refreshed { font-style: italic; }
.vintage-strip a { margin-left: auto; }

/* ---- the report shelf ------------------------------------------------ */
table.shelf-tbl th:first-child, table.shelf-tbl td:first-child { width: 42%; }
table.shelf-tbl td { padding-right: 0.9rem; }
.shelf-kind {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}
.shelf-meta, .shelf-src {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}
.shelf-none { font-weight: 600; }
.ch-pill {
  display: inline-block;
  margin: 0.3rem 0.3rem 0 0;
  padding: 0.02rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 0.72rem;
  text-decoration: none;
  color: var(--ink-soft);
}
@media (max-width: 480px) {
  table.shelf-tbl, table.shelf-tbl tbody, table.shelf-tbl tr, table.shelf-tbl td {
    display: block;
    width: auto;
  }
  table.shelf-tbl th { display: none; }
  table.shelf-tbl td { border-bottom: 0; padding-bottom: 0.2rem; }
  table.shelf-tbl tr { border-bottom: 1px solid var(--rule); padding-bottom: 0.5rem; }
  table.shelf-tbl td:first-child { width: auto; }
}

/* ---- figures --------------------------------------------------------- */
.fig { margin: 0.6rem 0 0.4rem; }
.fig svg { width: 100%; height: auto; max-width: 560px; display: block; }
.fig figcaption {
  font-size: 0.78rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin-top: 0.3rem;
}

.legend {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.3rem 1rem;
  font-size: 0.9rem;
}
.legend li { display: flex; align-items: baseline; gap: 0.45rem; }
.swatch {
  flex: 0 0 auto;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  display: inline-block;
}
.swatch-na { background: repeating-linear-gradient(45deg, #fff, #fff 2px, #b9c0c8 2px, #b9c0c8 4px); }
.legend .lab { color: var(--ink-soft); }
.legend .v { margin-left: auto; font-variant-numeric: tabular-nums; }

.v.na { color: var(--na); font-style: italic; }

/* ---- tables ---------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0.4rem 0 1rem; }
table.card-tbl { border-collapse: collapse; width: 100%; min-width: 0; font-size: 0.9rem; }
table.card-tbl th, table.card-tbl td {
  text-align: left;
  padding: 0.35rem 0.6rem 0.35rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
table.card-tbl th { font-weight: 600; color: var(--ink-soft); }
table.card-tbl td { overflow-wrap: anywhere; }
table.card-tbl td.num { font-variant-numeric: tabular-nums; }

.dq-strip {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
}
.dq-strip .rule { display: block; margin-top: 0.5rem; font-size: 0.85rem; color: var(--ink-soft); }

/* ---- index table ----------------------------------------------------- */
table.card-index { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
table.card-index th, table.card-index td {
  padding: 0.3rem 0.55rem 0.3rem 0;
  border-bottom: 1px solid #d8dee4;
  text-align: left;
  white-space: nowrap;
}
table.card-index td.num, table.card-index th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.card-index td.na { color: #8b949e; font-style: italic; }
table.card-index .badge { font-size: 0.72rem; padding: 0.02rem 0.45rem; }

@media (max-width: 480px) {
  .card-head { font-size: 0.95rem; }
  .legend { grid-template-columns: 1fr; }
}

/* The card index sorts on a heading click; the active column is marked. */
table.card-index th { cursor: pointer; user-select: none; white-space: nowrap; }
table.card-index th.sorted::after { content: " \25BE"; color: #888; }
table.card-index th.sorted[data-dir="asc"]::after { content: " \25B4"; }
