/* The Trans Policy Atlas (R34): the looks of public-worker/src/pages/atlas.js, on the site's tokens (tokens.css). No page
 * carries an inline style (the CSP allows none): every look, the map's tile positions and the policy colours included,
 * is a class here. Loaded only on atlas pages. */

/* ---- policy classes: one colour per class, the same in both themes (the colour carries meaning on the map and the legend).
 * --c is the fill, --on the text drawn on it; each pair is at least 4.5:1. Colour is never the only cue: every tile and
 * chip also names its class in text, and three classes carry a pattern. */
.cls-accessible    { --c: #236ca6; --on: #ffffff; }
.cls-none_reported { --c: #a5cce7; --on: #0d2233; }
.cls-conditions    { --c: #e7b76b; --on: #2b1d00; }
.cls-restricted    { --c: #ae385f; --on: #ffffff; }
.cls-blocked       { --c: #9e8bc5; --on: #1d1233; }
.cls-pending       { --c: #ebd4c2; --on: #2b1a0c; }
.cls-unknown       { --c: #dce2e9; --on: #1b2430; }
.cls-gap           { --c: #bdcbd7; --on: #1b2430; }

.swatch { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px;
  background-color: var(--c, var(--panel2)); border: 1px solid rgb(127 127 127 / .55); }
.cls-unknown.swatch, .cls-unknown .swatch  {
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, rgb(0 0 0 / .16) 3px 4px); }
.cls-blocked.swatch, .cls-blocked .swatch  {
  background-image: repeating-linear-gradient(45deg, transparent 0 3px, rgb(255 255 255 / .55) 3px 5px); }
.cls-pending.swatch, .cls-pending .swatch  {
  background-image: radial-gradient(rgb(0 0 0 / .28) 1px, transparent 1.5px); background-size: 5px 5px; }

main .eyebrow { margin: 4px 0 0; font-size: 12px; font-weight: 650; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--muted); }
main .eyebrow a { color: inherit; }
.small { font-size: 14px; }
h1 .year { color: var(--muted); font-weight: 400; font-size: .65em; }
.atlas-credit-top { max-width: 72ch; }

/* ======================================================================================================================
 * The hub atlas's own look (policy-worker/public/styles.css), on this site's tokens. The hub's rules are copied with the
 * values it uses; what changes is the scope (".atlas-head" for the heading and tab bar, ".atlas-hub" for a tab's content,
 * so no rule leaks into a site page), the tabs (links here, buttons in the hub), and the three places the hub paints with
 * an inline style: a legend swatch and a status chip take their colour from the class (--c, above), not from a style.
 * ====================================================================================================================== */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---- heading and tabs ---- */
.atlas-head .workspace-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin: 0 0 18px; flex-wrap: wrap; }
.atlas-head .workspace-heading h1, .atlas-head .atlas-title { font-size: 25px; font-weight: 600; letter-spacing: -.4px; line-height: 1.25; margin: 0; color: var(--text); }
.atlas-head .eyebrow, .atlas-hub .eyebrow { letter-spacing: 1.6px; font-size: 11px; font-weight: 650; color: var(--muted); margin: 0 0 7px; text-transform: uppercase; }
.atlas-head .retrieval { text-align: right; font-size: 12.5px; white-space: nowrap; color: var(--muted); }
.atlas-head .retrieval span { display: block; }
.atlas-head .retrieval strong { font-weight: 600; color: var(--text); }
.atlas-head .workspace-nav { border-bottom: 1px solid var(--border-strong); margin-bottom: 18px; }
.atlas-head .tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; overflow-x: auto; }
.atlas-head .tabs a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); background: transparent; text-decoration: none;
  font-size: 13px; padding: 9px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; margin-bottom: -1px; white-space: nowrap; }
.atlas-head .tabs a svg { width: 15px; height: 15px; flex: none; }
.atlas-head .tabs a:hover { color: var(--text); background: var(--panel2); }
.atlas-head .tabs a[aria-current] { color: var(--gold); background: var(--bg); border-color: var(--border-strong); border-bottom: 1px solid var(--bg); font-weight: 600; }

/* ---- filter bar, pickers, search ---- */
.atlas-hub .filter-bar { display: flex; align-items: flex-end; gap: 16px; padding: 4px 0 20px; flex-wrap: wrap; margin: 0; }
.atlas-hub .filter-bar label { display: flex; flex-direction: column; gap: 6px; min-width: 200px; flex: 1 1 200px; color: var(--faint); font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px; }
.atlas-hub .filter-bar select, .atlas-hub .filter-bar input { text-transform: none; letter-spacing: normal; }
.atlas-hub select, .atlas-hub input[type=search] { background: var(--panel2); border: 1px solid var(--control-border); border-radius: 5px; color: var(--text);
  font: inherit; font-size: 12.5px; padding: 8px 10px; min-height: 34px; max-width: 100%; }
.atlas-hub select:focus, .atlas-hub input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.atlas-hub .snapshot-label { margin-left: auto; padding-bottom: 2px; text-align: right; flex: none; }
.atlas-hub .snapshot-label .eyebrow { display: block; margin-bottom: 2px; }
.atlas-hub .snapshot-label strong { font-size: 14px; font-weight: 600; color: var(--text); }
.atlas-hub .search-field > div { display: flex; align-items: center; background: var(--panel2); border: 1px solid var(--control-border); border-radius: 5px;
  min-height: 34px; padding: 0 10px; gap: 7px; }
.atlas-hub .search-field svg { color: var(--faint); width: 15px; height: 15px; flex: none; }
.atlas-hub .search-field input { width: 100%; min-width: 0; font-size: 13px; color: var(--text); outline: none; border: 0; background: transparent; padding: 7px 0; }
.atlas-hub .search-field > div:focus-within { outline: 2px solid var(--gold); outline-offset: 1px; }
.atlas-hub .text-button { background: none; border: 0; padding: 2px 0; min-height: 24px; color: var(--pro); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.atlas-hub .text-button:hover { text-decoration: underline; }
.atlas-hub .text-button svg { width: 14px; height: 14px; }

/* ---- the withdrawn-history note, the small notes ---- */
.atlas-hub .timeline-correction { display: flex; gap: 11px; border: 1px solid var(--border); border-left: 3px solid var(--gold); background: var(--panel);
  border-radius: 0 6px 6px 0; padding: 14px 17px; margin: 0 0 20px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.atlas-hub .timeline-correction svg { flex: none; width: 19px; height: 19px; margin-top: 2px; color: var(--gold); }
.atlas-hub .timeline-correction b { color: var(--text); font-weight: 600; }
.atlas-hub .timeline-correction p { margin: 6px 0 0; }
.atlas-hub .timeline-correction a { color: var(--pro); }
.atlas-hub .small-note { font-size: 12.5px; line-height: 1.7; color: var(--muted); margin: 14px 0; }
.atlas-hub .section-topline { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 4px 0 14px; flex-wrap: wrap; }
.atlas-hub .section-topline h1, .atlas-hub .section-topline h2 { font-size: 19px; font-weight: 600; letter-spacing: -.2px; margin: 0; color: var(--text); }
.atlas-hub .scope-note { font-size: 13px; line-height: 1.6; color: var(--muted); margin: 0 0 16px; max-width: 850px; }

/* ---- the map workspace ---- */
.atlas-hub .map-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 320px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); overflow: hidden; }
.atlas-hub .map-panel { padding: 20px 20px 0; min-width: 0; }
.atlas-hub .map-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.atlas-hub .map-heading h2 { font-size: 18px; line-height: 1.3; letter-spacing: -.2px; margin: 0; font-weight: 600; max-width: 560px; color: var(--text); }
.atlas-hub .count-badge { font-size: 11px; border: 1px solid var(--border-strong); border-radius: 30px; padding: 4px 10px; color: var(--muted); white-space: nowrap; margin-top: 3px; flex: none; }
.atlas-hub .us-map { position: relative; max-width: 1040px; margin: 8px auto 0; }
.atlas-hub .us-map svg { width: 100%; display: block; max-height: 480px; }
.atlas-hub .state-link { cursor: pointer; }
.atlas-hub .state-link:focus-visible { outline: none; }
.atlas-hub .state-shape { stroke: var(--bg); stroke-width: 1.3; stroke-linejoin: round; transition: filter .15s; vector-effect: non-scaling-stroke; }
.atlas-hub .state-link:hover .state-shape { filter: brightness(.9); }
.atlas-hub .state-shape.selected { stroke: var(--text); stroke-width: 2.2; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .45)); }
.atlas-hub .state-link:focus-visible .state-shape { stroke: var(--gold); stroke-width: 2.6; }
.atlas-hub .state-label { font-size: 11.5px; font-weight: 700; fill: #263e52; text-anchor: middle; pointer-events: none; }
.atlas-hub .state-label.light { fill: #fff; }
.atlas-hub .small-state:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.atlas-hub .small-state.selected rect { stroke: var(--text); stroke-width: 2; }
.atlas-hub .map-hint { font-size: 13px; color: var(--muted); padding: 10px 0 4px; min-height: 20px; }
.atlas-hub .map-hint b { color: var(--text); }
.atlas-hub .legend { padding: 13px 0 15px; border-top: 1px solid var(--border); display: flex; gap: 12px 20px; flex-wrap: wrap; margin: 0; list-style: none; flex-direction: row; }
.atlas-hub .legend > div { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.atlas-hub .legend b { font-size: 11.5px; font-weight: 600; background: var(--panel2); padding: 1px 6px; border-radius: 4px; color: var(--text); }
.atlas-hub .legend-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; border: 1px solid var(--border); overflow: hidden; display: inline-block; background-color: var(--c, var(--panel2)); }
.atlas-hub .map-footnote { margin: 0 -20px; background: var(--panel2); border-top: 1px solid var(--border); padding: 13px 20px; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; line-height: 1.6; }
.atlas-hub .map-footnote svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--faint); }

/* ---- the State detail panel ---- */
.atlas-hub .state-panel { border-left: 1px solid var(--border); padding: 22px 20px; background: var(--panel2); max-height: 900px; overflow-y: auto; }
.atlas-hub .state-panel-title { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.atlas-hub .state-code { width: 42px; height: 42px; display: grid; place-items: center; background: var(--panel); color: var(--muted); font-weight: 700; font-size: 16px;
  border-radius: 6px; border: 1px solid var(--border); flex: none; }
.atlas-hub .state-panel-title .eyebrow { margin-bottom: 1px; }
.atlas-hub .state-panel-title h2 { font-size: 20px; font-weight: 600; line-height: 1.2; margin: 0; color: var(--text); }
.atlas-hub .panel-prompt { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0; }
.atlas-hub .status-chip { display: inline-flex; font-size: 12px; font-weight: 700; border-radius: 4px; padding: 4px 8px; line-height: 1.4; margin-bottom: 12px;
  background: var(--panel); background: color-mix(in srgb, var(--c) 14%, transparent); }
.atlas-hub .status-chip[data-cls="accessible"] { color: #236ca6; color: light-dark(#236ca6, #7fc0ea); }
.atlas-hub .status-chip[data-cls="restricted"] { color: #ae385f; color: light-dark(#ae385f, #e6a0b8); }
.atlas-hub .status-chip[data-cls="other"] { color: #453b38; color: light-dark(#453b38, #e8e6e3); }
.atlas-hub .state-panel h3 { font-size: 16px; font-weight: 600; line-height: 1.5; margin: 4px 0 20px; letter-spacing: -.1px; color: var(--text); }
.atlas-hub .detail-block { margin: 0 0 18px; }
.atlas-hub .detail-block > span { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.atlas-hub .detail-block > span svg { width: 13px; height: 13px; }
.atlas-hub .detail-block > p { font-size: 13.5px; margin: 6px 0 0; line-height: 1.6; color: var(--text); }
.atlas-hub .citation-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.atlas-hub .citation-list a { color: var(--blue); font-size: 13px; display: flex; gap: 6px; align-items: flex-start; line-height: 1.45; text-decoration: none; }
.atlas-hub .citation-list a:hover { text-decoration: underline; }
.atlas-hub .citation-list a svg { flex: none; margin-top: 2px; width: 13px; height: 13px; }
.atlas-hub .citation-list a svg:last-of-type { margin-left: auto; }
.atlas-hub .provenance { border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; max-width: none; margin: 0; padding: 15px 0 0;
  display: flex; gap: 9px; font-size: 12.5px; color: var(--muted); }
.atlas-hub .provenance > svg { flex: none; margin-top: 2px; width: 16px; height: 16px; color: var(--faint); }
.atlas-hub .provenance b { font-weight: 600; color: var(--text); }
.atlas-hub .provenance p { margin: 4px 0; }
.atlas-hub .provenance a { display: flex; align-items: center; gap: 5px; text-decoration: none; color: var(--blue); }
.atlas-hub .provenance a:hover { text-decoration: underline; }
.atlas-hub .provenance a svg { width: 12px; height: 12px; }

/* ---- the Policy database table ---- */
.atlas-hub .database-table { border: 1px solid var(--border); background: var(--panel); border-radius: 8px; overflow: hidden; }
.atlas-hub .table-scroll { overflow: auto; }
.atlas-hub table { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 640px; }
.atlas-hub th { text-align: left; padding: 10px 14px; color: var(--faint); font-size: 11px; letter-spacing: .5px; text-transform: uppercase; background: var(--panel2);
  font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--border-strong); }
.atlas-hub td { padding: 14px; border-top: 1px solid var(--border); vertical-align: top; line-height: 1.6; color: var(--text); }
.atlas-hub tbody tr:hover { background: var(--panel2); }
.atlas-hub .database-table a { color: var(--blue); text-decoration: none; }
.atlas-hub .database-table a:hover { text-decoration: underline; }
.atlas-hub .cell-meta { display: block; color: var(--faint); font-size: 11.5px; margin-top: 5px; }
.atlas-hub .nowrap { white-space: nowrap; }
.atlas-hub .policy-status-cell { max-width: 600px; white-space: normal; }
.atlas-hub button[type=submit] { color: var(--text); background: var(--panel2); border: 1px solid var(--control-border); border-radius: 5px; font: inherit; font-size: 12.5px; padding: 8px 13px; min-height: 34px; cursor: pointer; }
.atlas-hub button[type=submit]:hover { border-color: var(--pro); }

@media (min-width: 1600px) { .atlas-hub .map-workspace { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 1100px) {
  .atlas-hub .map-workspace { grid-template-columns: minmax(0, 1fr) 280px; }
  .atlas-hub .map-heading { display: block; }
  .atlas-hub .count-badge { display: none; }
}
@media (max-width: 900px) {
  .atlas-hub .map-workspace { grid-template-columns: 1fr; }
  .atlas-hub .state-panel { border-left: 0; border-top: 1px solid var(--border); max-height: none; }
  .atlas-hub .us-map svg { max-height: 420px; }
}
@media (max-width: 760px) {
  .atlas-head .workspace-heading h1, .atlas-head .atlas-title { font-size: 22px; }
  .atlas-hub .snapshot-label { display: none; }
  .atlas-hub .filter-bar label { min-width: 0; flex: 1 1 45%; }
  .atlas-hub .state-panel-title h2 { font-size: 18px; }
  .atlas-hub .policy-status-cell { min-width: 230px; }
  .atlas-hub table { min-width: 560px; }
}
@media (prefers-reduced-motion: reduce) { .atlas-hub .state-shape { transition: none; } }

/* ---- records: chips, status text, facts, quotes, sources ---- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px 1px 7px; border: 1px solid var(--control-border);
  border-radius: var(--radius-pill); background: var(--panel2); color: var(--text); font-size: 13px; line-height: 1.6;
  white-space: nowrap; vertical-align: 1px; }
.chip .swatch { width: 12px; height: 12px; vertical-align: 0; background-color: var(--c); }
.atlas-table td .chip { display: flex; width: max-content; max-width: 100%; margin: 0 0 4px; }
.atlas-table td:first-child { white-space: nowrap; }
.atlas-table .status { display: block; max-width: 60ch; }
.cell-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.bill-title { display: block; max-width: 70ch; }
.status-line { max-width: 80ch; color: var(--text); font-size: 15px; line-height: 1.45; }
.quote, .events p { white-space: pre-line; }
.quote { margin: 8px 0 16px; padding: 10px 16px; max-width: 72ch; background: var(--panel); border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.provenance { margin: 18px 0; padding: 12px 16px; max-width: 72ch; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); }
.provenance h3 { margin: 0 0 6px; font-size: 14px; }
.provenance p { margin: 0; }
.source-links { margin: 6px 0 14px; padding-left: 20px; }
.source-links li { margin: 3px 0; }
.events > li .links { margin-top: 4px; }
.cell-label { display: none; color: var(--muted); font-size: 13px; }

/* narrow screens: a table of records becomes a list of cards (the column name moves into the cell) */
@media (max-width: 640px) {
  .atlas-cards-narrow, .atlas-cards-narrow tbody, .atlas-cards-narrow tr, .atlas-cards-narrow td { display: block; }
  .atlas-cards-narrow thead, .atlas-cards-narrow caption { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; padding: 0; }
  .table-wrap:has(.atlas-cards-narrow) { overflow: visible; background: transparent; border: 0; }
  .atlas-cards-narrow tr { margin: 0 0 10px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--border);
    border-radius: var(--radius-lg); }
  .atlas-cards-narrow td { padding: 3px 0; border: 0; white-space: normal; }
  .atlas-cards-narrow td:first-child { font-weight: 600; font-size: 14px; white-space: normal; }
  .cell-label { display: inline; }
  .atlas-table .status { max-width: none; }
}

/* ---- bills ---- */
.stage { display: inline-block; padding: 0 9px; border: 1px solid var(--control-border); border-radius: var(--radius-pill);
  color: var(--text); font-size: 13px; line-height: 1.6; white-space: nowrap; }
.stage-passed { border-color: var(--gold); color: var(--gold); }
.year-links { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.year-links a { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 8px 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text);
  text-decoration: none; }
.year-links a:hover, .year-links a[aria-current] { border-color: var(--gold); }
.year-links b { font-size: 15px; font-variant-numeric: tabular-nums; }

/* the site's headings are set in capitals; the hub's atlas sets these in sentence case */
.atlas-hub h1, .atlas-hub h2, .atlas-hub h3, .atlas-head h1 { text-transform: none; }
