/* Copyright (c) 2026 Goldeneye Technologies LLC. All rights reserved. */
/*
State hub pages (templates/html/hub_index.html + hub_state.html, batch-5 P13).
Token-driven; loaded ONLY on the two hub routes, which is why the .content-page
width override below is safe here and would not be in global.css.
*/

/* The hub pages carry a four-column company table (up to ~700 rows), which the
   720px long-form measure squeezes. Widened for these two routes only. */
.content-page {
  max-width: 960px;
}

.hub-page {
  color: var(--color-text);
}

.hub-lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-base);
}

/* Aggregate stat block — the quotable part (addendum §2.3) ---------------- */
.hub-summary {
  margin: var(--space-4) 0 var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.hub-figure {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-2);
}

.hub-figure-number {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-accent);
}

.hub-figure-label {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
}

.hub-summary .hub-lead {
  margin: 0;
  font-size: var(--font-size-base);
  color: var(--color-text-muted);
}

/* Ranked lists (largest states on the index, siblings on a state page) ---- */
.hub-rank-list,
.hub-sibling-list {
  list-style: none;
  margin: var(--space-2) 0 var(--space-4);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-1) var(--space-5);
}

.hub-rank-list li,
.hub-sibling-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--color-border);
  line-height: var(--line-height-base);
}

.hub-rank-count {
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Tables ------------------------------------------------------------------ */
/* Every table lives in a .hub-table-wrap so a wide one scrolls in its own
   container instead of forcing the page sideways on a phone. */
.hub-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--space-2) 0 var(--space-4);
}

/* The scroll container is a focusable region (keyboard users must be able to
   reach the overflow). Inset the ring so it is not clipped by the container's
   own overflow — the same pattern the map toolbar uses. */
.hub-table-scroll:focus-visible {
  outline-offset: -3px;
}

.hub-table {
  border-collapse: collapse;
  width: 100%;
  font-size: var(--font-size-sm);
}

.hub-table th,
.hub-table td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  line-height: var(--line-height-base);
  vertical-align: top;
}

.hub-table thead th {
  border-bottom: 1px solid var(--color-border-strong);
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.hub-table tbody th {
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

.hub-col-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Four columns of real content: below this width the cells wrap into an
   unreadable stack, so the container scrolls instead. */
.hub-company-table {
  min-width: 560px;
}

/* Below-floor roll-up on the index ---------------------------------------- */
.hub-small-state {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  margin: var(--space-4) 0 var(--space-1);
}

.hub-company-list {
  margin: 0 0 var(--space-3);
  padding-left: var(--space-5);
  line-height: var(--line-height-base);
}

/* Provenance / footer notes ----------------------------------------------- */
.hub-provenance,
.hub-note,
.hub-disclaimer {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  line-height: var(--line-height-base);
}

.hub-provenance {
  margin: 0 0 var(--space-5);
}

.hub-links {
  margin: var(--space-5) 0 var(--space-4);
}

.hub-disclaimer {
  font-size: var(--font-size-xs);
}

/* Mobile ------------------------------------------------------------------ */
/* Additive overrides only (Lane E convention) — nothing above is restructured;
   the layout already reflows, so this only tightens the stat block and lets the
   ranked lists collapse to a single column. */
@media (max-width: 768px),
       (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .hub-summary {
    padding: var(--space-3) var(--space-4);
  }

  .hub-rank-list,
  .hub-sibling-list {
    grid-template-columns: 1fr;
  }

  .hub-table th,
  .hub-table td {
    padding: var(--space-2);
  }
}
