/* Y-Squre — sections.css
   Styles for the generated region / subregion / topic pages.

   Kept out of layout.css because these elements only exist on taxonomy-driven
   pages. One file per concern means a section-page change never risks the
   homepage, and the header stays owned by nav.css alone.

   Design intent: these pages are reference surfaces, not reading pages. They
   should feel like a lookup table in a serious reference work — dense,
   scannable, quiet — and must not pretend to be more than they are. The empty
   state below is the load-bearing element: it is what stops an unpopulated
   section from reading as a broken one.
*/

/* ---------------------------------------------------------- page shell */
.page { padding: 30px 0 56px; }

.page h1 {
  font: 700 2.05rem/1.14 var(--sans);
  letter-spacing: -.015em;
  color: var(--navy);
  margin: 0 0 12px;
}

.page-lede {
  font-size: 1.03rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 68ch;
  margin: 0 0 24px;
}

.kicker {
  margin: 0 0 8px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.kicker a { color: var(--c-geo); text-decoration: none; }
.kicker a:hover { color: var(--accent); }

.section-h {
  font: 700 .8rem/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--navy);
  padding-bottom: 8px;
  margin: 34px 0 16px;
  border-bottom: 2px solid var(--navy);
}

.page-note {
  margin: 26px 0 0;
  padding: 13px 16px;
  background: var(--paper-2);
  border-left: 3px solid var(--line);
  font-size: .87rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 76ch;
}
.page-note strong { color: var(--navy); }

.table-note {
  font-size: .86rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 72ch;
  margin: 0 0 14px;
}

/* ------------------------------------------------------- empty states */
/* The honesty mechanism. A section with no verified reporting says so
   plainly instead of showing a spinner, a placeholder, or invented items. */
.empty-state {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--caution);
  padding: 18px 20px;
  margin: 0 0 28px;
  max-width: 76ch;
}
.empty-kicker {
  margin: 0 0 8px;
  font: 700 .76rem/1 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--caution);
}
.empty-state p {
  margin: 0 0 10px;
  font-size: .9rem;
  line-height: 1.65;
  color: var(--ink-2);
}
.empty-state p:last-of-type { margin-bottom: 0; }
.empty-links {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.empty-links a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}
.empty-links a:hover { border-color: var(--accent); color: var(--accent); }

/* -------------------------------------------------------- card grids */
.sec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.sec-card {
  display: block;
  padding: 15px 17px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--navy);
  text-decoration: none;
  transition: border-color .12s ease, background .12s ease;
}
.sec-card:hover { border-color: var(--accent); background: var(--paper-2); }
.sec-card:hover .sec-card-scope { color: var(--ink-2); }

.sec-card h3 {
  font: 700 .95rem/1.25 var(--sans);
  color: var(--navy);
  margin: 0 0 7px;
  letter-spacing: -.005em;
}
.sec-card-scope {
  font-size: .84rem;
  line-height: 1.5;
  color: var(--faint);
  margin: 0 0 9px;
}
.sec-card-meta {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--c-geo);
  margin: 0;
}

/* ------------------------------------------------------ country table */
/* The payload a country anchor deep-links to. Each row states the editorial
   scope rather than repeating it 250 times, so the table stays scannable. */
.country-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.country-table th, .country-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}
.country-table thead th {
  font: 700 .71rem/1.2 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--paper-2);
  border-bottom: 2px solid var(--navy);
}
.country-table tbody th {
  font-weight: 600;
  white-space: nowrap;
  width: 1%;
}
.country-table tbody th a { color: var(--navy); text-decoration: none; }
.country-table tbody th a:hover { color: var(--accent); text-decoration: underline; }
.country-table td { color: var(--ink-2); line-height: 1.5; }
.td-empty { color: var(--faint); font-size: .8rem; white-space: nowrap; }

/* A country deep-link target should be visibly reached, not just present. */
.country-table tr:target th,
.country-table tr:target td { background: #fff8e6; }
.country-table tr:target th a { color: var(--accent); }

/* --------------------------------------------------------- link list */
.link-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.link-list a {
  display: inline-block;
  padding: 7px 11px;
  border: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
}
.link-list a:hover { border-color: var(--accent); color: var(--accent); }

/* ----------------------------------------------------- type legend */
.type-legend { margin: 0 0 8px; }
.type-legend .section-h { margin-top: 0; }

/* ------------------------------------------------------------ a11y */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .page { padding: 22px 0 44px; }
  .page h1 { font-size: 1.7rem; }
  .sec-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

@media (max-width: 620px) {
  .country-table thead { display: none; }
  /* Stack each row: country, then scope, then status. A three-column table
     at 375px puts ~14 characters per line and is unreadable. */
  .country-table, .country-table tbody, .country-table tr,
  .country-table th, .country-table td { display: block; width: auto; }
  .country-table tr {
    border: 1px solid var(--line);
    margin-bottom: 10px;
    padding: 4px 0;
  }
  .country-table tbody th {
    white-space: normal;
    padding: 9px 12px 4px;
    border-bottom: 0;
  }
  .country-table td { padding: 0 12px 5px; }
  .country-table td:last-child { padding-bottom: 10px; }
  .td-empty { white-space: normal; }
  .country-table tr:target { border-color: var(--caution); }
}

@media print {
  .empty-state { border: 1px solid #999; }
  .sec-card { break-inside: avoid; }
}


/* The 'Latest' cell on a country row links to that country's explainer. It is
   styled as a quiet action, not a headline, because it is analysis rather than
   a news report and must not read as one. */
.row-explainer {
  font: 600 .8rem/1 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.row-explainer:hover,
.row-explainer:focus-visible { text-decoration: underline; }
