/* v2-countries: styles for ext/v2-countries.js. Every part of the page is a site component; the only addition is the
   country page's own tile on its tile map, marked with the selected tile's outline (styles.css .tile[aria-pressed]). */
/* The index's sections (South Asia, Southeast Asia, the map) sit further apart than a hub's */
.v2c-gap { padding-top: var(--sp-section); }

/* The region on a map: a centred heading, the map at about half the width, a compact table beside it */
.v2c-region .sec-center { margin-bottom: clamp(var(--sp-4), 4vw, var(--sp-7)); }
.v2c-region .map-page { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--sp-3); padding-top: 0; align-items: stretch; }
.v2c-region .mp-map { padding: var(--sp-1) var(--sp-1) var(--sp-2); }
.v2c-region .mp-map .mp-leg { margin: var(--sp-1-5) var(--sp-1) 0; }
/* The table is exactly as tall as the map card and scrolls inside: size containment stops its rows from setting the height */
.v2c-region .table-wrap { max-height: none; contain: size; overflow: auto; }
.v2c-region .dtable { table-layout: fixed; }
.v2c-region .dtable thead th:first-child { width: 34%; }
.v2c-region .dtable th, .v2c-region .dtable td { padding-inline: var(--sp-2); }
.v2c-region .dtable thead th { white-space: nowrap; }
.v2c-cap { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.v2c-cap .btn { flex: none; }
/* Shared by every region table (this page, the enabler pages' By country): the caption is the table's head on a deeper
   warm band, and country names read as row labels (the matrix's: 500, ink), underlined only on hover or focus */
.v2c-region .dtable caption { background: var(--b-tile); }
.v2c-region .dtable caption span { color: var(--b-ink-2); }
.v2c-region .dtable tbody th a { color: var(--b-ink); font-weight: 500; text-decoration: none; }
.v2c-region .dtable tbody th a:hover, .v2c-region .dtable tbody th a:focus-visible { color: var(--b-ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1100px) {
  .v2c-region .map-page { grid-template-columns: minmax(0, 1fr); }
  .v2c-region .mp-map { justify-self: stretch; }
  .v2c-region .table-wrap { contain: none; max-height: 480px; }
}
@media (max-width: 560px) {
  .v2c-cap { flex-wrap: wrap; gap: var(--sp-1); }
  .v2c-region .dtable th, .v2c-region .dtable td { padding-inline: 10px; }
  .v2c-region .dtable thead th { white-space: normal; }
}

/* OBS.emptyCards (app.js): three faint blank entry cards sharing the row, one plain message centred over them */
.ec-empty { position: relative; }
.ec-empty .rel-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%); mask-image: linear-gradient(to bottom, #000 0%, transparent 85%); }  /* the cards fade out downward */
.ec-sk { pointer-events: none; opacity: .4; }
.ec-sk .nw-art { background: var(--b-tile); }
.ec-sk .nw-body { gap: var(--sp-1); }
.ec-sk .sk { background: var(--b-tile); }
.ec-sk .sk::after { display: none; }
.ec-sk .sk-t { height: 12px; border-radius: 4px; }
.ec-sk .sk-t + .sk:not(.sk-t) { margin-top: var(--sp-1); }
.ec-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max-content; max-width: calc(100% - 32px); margin: 0; color: var(--b-ink-2); font-weight: 500; text-align: center; text-wrap: balance; }
@media (max-width: 640px) { .ec-sk:nth-child(n+2) { display: none; } }  /* one blank card on phones, the message over it */

/* A country page's Data section: the region map focused on the country (regionMap o.focus), the rest only context */
[data-v2c-map="inert"] .mp-c { cursor: default; pointer-events: none; }
[data-v2c-map="inert"] .mp-c.v2c-focus { --sc: var(--b-ink); --sw: 2; }
.v2c-side { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; padding: var(--sp-card); border-radius: 24px; background: var(--b-surface); }
.v2c-side .hd-chips { justify-content: flex-start; }
.v2c-region .v2c-side .table-wrap { contain: none; }
.v2c-region .dtable tr.is-on > * { background: var(--b-tile); }
.v2c-region .dtable tr.is-on > th { box-shadow: inset 3px 0 0 var(--b-primary); }
/* The country tabs' pager (.seg): prev points back */
[data-v2c-pg="prev"] .ico { transform: scaleX(-1); }
[data-v2c-pg]:disabled { opacity: .4; cursor: default; }
nav.cty-more { margin-top: var(--sp-6); }  /* the pager sits twice the grid gap below the cards */
