/* ── Countries (/countries/ and its 195 pages) ───────────────────────────
   Written by scripts/build-country-pages.py's pages; every colour is a token
   except inside the print sheets, which print black on white whatever the
   theme. The locator map is an inline SVG whose shapes carry loc-* classes:
   the country in the accent green, its land neighbours outlined, the rest of
   the world in the map's "unseen" tone, capitals as ink dots. */
.cs-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin: 0 0 18px;
}
@media (min-width: 720px) {
  .cs-visual { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); }
}
.cs-visual figure { margin: 0; }
.cs-visual figcaption {
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-tertiary);
}
.cs-flag img {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--bg-card-border);
}
.cs-locator { display: block; width: 100%; height: auto; border-radius: 12px; overflow: hidden; }
.cs-locator .loc-sea { fill: var(--ocean-mid); }
.cs-locator .loc-land { fill: var(--map-unseen); stroke: var(--map-border); stroke-width: 0.6; }
.cs-locator .loc-nb { fill: var(--bg-primary); stroke: var(--text-tertiary); stroke-width: 1.1; }
.cs-locator .loc-c { fill: var(--accent-green); stroke: var(--accent-green); stroke-width: 1; }
.cs-locator .loc-ring { fill: none; stroke: var(--accent-green); stroke-width: 2; }
.cs-locator .loc-cap { fill: var(--text-primary); stroke: var(--bg-primary); stroke-width: 1.2; }
.cs-locator .loc-frame { fill: none; stroke: var(--bg-card-border); stroke-width: 1; }

.cs-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 8px; }
.cs-status { font-family: var(--font-sans); font-size: 13px; color: var(--text-tertiary); }
article.prose .cs-facts th[scope="row"] {
  width: 32%;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  color: var(--text-secondary);
}
article.prose .cs-facts td { color: var(--text-primary); font-size: 14.5px; line-height: 1.55; }
.cs-note {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-tertiary);
}
.cs-nbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
  gap: 10px;
  margin: 12px 0 26px;
}
article.prose a.cs-nb {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
}
article.prose a.cs-nb:hover { border-color: var(--text-quaternary); }
.cs-nb img { grid-row: 1 / span 2; width: 28px; height: 21px; border-radius: 2px; border: 1px solid var(--bg-card-border); }
.cs-nb span { font-family: var(--font-sans); font-size: 14px; line-height: 1.3; }
.cs-nb small { font-family: var(--font-sans); font-size: 12px; color: var(--text-tertiary); }
.cs-lens { min-height: 0; margin: 14px 0 20px; padding: 26px 24px; }
.cs-lens .reveal { max-height: none; }
.cs-more { margin-top: 4px; font-family: var(--font-sans); font-size: 13.5px; color: var(--text-secondary); }
.cs-more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--text-primary); }
.cs-more p { margin: 0 0 4px; line-height: 1.65; }
.cs-teasers { list-style: none; margin: 10px 0 8px; padding: 0; display: grid; gap: 8px; }
article.prose .cs-teasers li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-primary);
}
.cs-teasers .tag { flex: 0 0 auto; transform: translateY(-2px); }
article.prose .cs-small { font-family: var(--font-sans); font-size: 13px; line-height: 1.6; color: var(--text-tertiary); }
.cs-compare { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.cs-compare .q-input { flex: 1 1 220px; min-width: 0; }
.cs-pager {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 30px 0 10px;
}
article.prose .cs-pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-primary);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.cs-pager a[rel="next"] { text-align: right; }
.cs-pager a[data-cs-random] { text-align: center; }
.cs-pager small { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary); }
@media (max-width: 460px) {
  .cs-pager { grid-template-columns: minmax(0, 1fr); }
  .cs-pager a[rel="next"], .cs-pager a[data-cs-random] { text-align: left; }
}

/* Hub */
.cs-hub-tools { display: grid; gap: 4px; margin: 0 0 18px; }
.cs-hub-tools > .q-input { width: 100%; margin-bottom: 12px; }
.cs-regions { margin-top: -6px; }
.cs-sortrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cs-sortrow label { font-family: var(--font-sans); font-size: 13.5px; color: var(--text-secondary); }
.cs-sortrow select { width: auto; }
.cs-count { margin: 0; font-family: var(--font-sans); font-size: 13px; color: var(--text-tertiary); }
.cs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 10px;
  margin: 0 0 40px;
}
a.cs-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--bg-card-border);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
}
a.cs-card:hover { border-color: var(--text-quaternary); }
a.cs-card[hidden] { display: none; }
.cs-card img { grid-row: 1 / span 2; width: 40px; height: 30px; border-radius: 3px; border: 1px solid var(--bg-card-border); }
.cs-card-name { font-family: var(--font-serif); font-size: 17px; line-height: 1.25; }
.cs-card-meta { font-family: var(--font-sans); font-size: 12.5px; line-height: 1.4; color: var(--text-tertiary); }

/* Print sheets: hidden on screen, one page in print. */
.cs-print { display: none; }
@media print {
  @page { margin: 0.45in; }
  html, body { background: #fff !important; color: #1a1a1a; }
  body > :not(main), main > :not(.cs-print) { display: none !important; }
  .cs-print { display: block; }
  .cs-sheet { display: none; }
  html:not([data-cs-print="report"]) .cs-sheet-fact,
  html[data-cs-print="report"] .cs-sheet-report {
    display: flex;
    flex-direction: column;
    height: 9.9in;
    overflow: hidden;
    font-family: var(--font-sans);
    color: #1a1a1a;
    font-size: 9pt;
    line-height: 1.4;
    break-inside: avoid;
  }
  .pr-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12pt;
    border-bottom: 0.75pt solid #1a1a1a; padding-bottom: 5pt; margin-bottom: 8pt; flex-wrap: wrap; }
  .pr-eyebrow { margin: 0 0 2pt; font-size: 6.8pt; letter-spacing: .16em; text-transform: uppercase; color: #2E8B4F; font-weight: 600; width: 100%; }
  .pr-title { margin: 0; font-family: var(--font-serif); font-weight: 500; font-size: 24pt; line-height: 1.05; color: #1a1a1a; }
  .pr-who { display: flex; gap: 12pt; font-size: 8.6pt; }
  .pr-who span { display: inline-block; min-width: 1.5in; border-bottom: 0.6pt solid #1a1a1a; padding-top: 10pt; }
  .pr-top { display: grid; grid-template-columns: 1.9in minmax(0, 1fr); gap: 12pt; align-items: start; }
  .pr-flag { width: 100%; height: auto; border: 0.75pt solid #9a9a9a; }
  .pr-map { width: 100%; height: auto; max-height: 3.2in; object-fit: contain; }
  .cs-sheet-report .pr-map { max-height: 2.6in; }
  .cs-sheet-report .pr-flagbox { height: 1.25in; }
  .pr-flagbox { height: 1.4in; border: 0.75pt solid #1a1a1a; display: flex; align-items: flex-end; justify-content: center; }
  .pr-flagbox span { font-size: 7pt; color: #6b6b6b; padding: 3pt; }
  .pr-lede { margin: 8pt 0 6pt; font-family: var(--font-serif); font-size: 10.5pt; line-height: 1.45; }
  .pr-facts { width: 100%; border-collapse: collapse; font-size: 8.4pt; }
  .pr-facts th { text-align: left; font-weight: 600; width: 1.45in; padding: 2.5pt 6pt 2.5pt 0; vertical-align: top; }
  .pr-facts td { padding: 2.5pt 0; border-bottom: 0.4pt solid #c9c9c9; vertical-align: top; }
  .pr-facts th { border-bottom: 0.4pt solid #c9c9c9; }
  .pr-lens { margin-top: 8pt; padding: 7pt 9pt; border: 0.6pt solid #1a1a1a; font-size: 8.8pt; }
  .pr-lens p { margin: 0 0 3pt; }
  .pr-lens-t { font-family: var(--font-serif); font-style: italic; font-size: 11pt; }
  .pr-small { margin: 6pt 0 2pt; font-size: 8pt; color: #4a4a4a; }
  .pr-sub { margin: 8pt 0 0; font-size: 7.4pt; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
  .pr-lines { display: grid; gap: 0; }
  .pr-line { display: grid; grid-template-columns: 1.35in minmax(0, 1fr); align-items: end; height: 19pt; font-size: 9pt; }
  .pr-line span { border-bottom: 0.6pt solid #1a1a1a; height: 14pt; }
  .pr-foot { margin-top: auto; padding-top: 6pt; border-top: 0.5pt solid #9a9a9a; display: grid;
    grid-template-columns: 0.72in minmax(0, 1fr); gap: 10pt; align-items: center; font-size: 7.6pt; line-height: 1.45; }
  .pr-foot span { color: #555; font-size: 6.8pt; }
  .pr-qr svg { display: block; width: 0.72in; height: 0.72in; }
}
