/* Homepage: snapshot, issue tiles, issue view, rows, filters. Colors come from base.css tokens only. */

html:not(.js) .js-only { display: none !important; }
.anchor { display: block; height: 0; scroll-margin-top: 16px; }

/* 1. Snapshot */
.snapshot { margin-bottom: 56px; }
.snapshot h1 { max-width: 20ch; margin-bottom: 20px; }
.snapshot-counts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, auto); justify-content: start; border-top: 1px solid var(--rule); }
.snapshot-counts li { display: flex; flex-direction: column; gap: 2px; padding: 14px clamp(14px, 4vw, 32px) 14px 0; }
.snapshot-counts li + li { padding-left: clamp(14px, 4vw, 32px); border-left: 1px solid var(--border); }
.snapshot-counts strong { font-size: clamp(30px, 6vw, 44px); font-weight: 600; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); }
.swatch { display: inline-block; width: 8px; height: 8px; flex: none; }
.swatch-law { background: var(--law); }
.swatch-vetoed { background: var(--vetoed); }
.swatch-did_not_pass { background: var(--did_not_pass); }
.bar { display: flex; gap: 2px; height: 6px; margin: 0 0 12px; }
.bar-seg { display: block; min-width: 4px; }
.bar-law { background: var(--law); }
.bar-vetoed { background: var(--vetoed); }
.bar-did_not_pass { background: var(--did_not_pass); }
.intro { max-width: 68ch; margin: 0 0 32px; }
.intro p:first-child { font-size: 19px; line-height: 1.5; }
.intro p:last-child { margin-bottom: 0; }

/* 2. Issue tiles */
.choose h2, .browse h2 { font-size: 24px; }
.choose > p { margin-bottom: 16px; color: var(--muted); }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.tiles li { display: flex; }
.tile {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; width: 100%; min-height: 76px;
  padding: 12px 14px; border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0;
  background: var(--bg); color: var(--text); text-decoration: none; text-align: left; cursor: pointer;
}
.tile:hover { background: var(--surface-2); text-decoration: none; }
.tile-name { font-weight: 600; line-height: 1.25; }
.tile-meta { font-size: 14px; color: var(--muted); }
.tile[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.tile[aria-pressed="true"] .tile-meta { color: var(--bg); opacity: .8; }

/* 3. Issue view */
.browse { margin-top: 56px; scroll-margin-top: 16px; }
.view-head { max-width: 68ch; }
.view-head h2:focus { outline: none; }
.view-head h2:focus-visible { outline: 3px solid var(--focus); }
.overview { font-size: 18px; }

.more-filters { margin: 8px 0 16px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.more-filters > summary {
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0; cursor: pointer;
  font-weight: 600; color: var(--text); list-style: none;
}
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters > summary::before { content: "+"; display: inline-block; width: 1em; font-size: 20px; line-height: 1; }
.more-filters[open] > summary::before { content: "\2212"; }
.filters { display: grid; gap: 14px; padding: 4px 0 16px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field select {
  width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--bg); border: 1px solid var(--muted); border-radius: var(--radius);
}
.btn, .btn-link, .group-toggle {
  min-height: 44px; padding: 8px 16px; border-radius: var(--radius); cursor: pointer; font-weight: 600;
  border: 1px solid var(--text); background: var(--bg); color: var(--text);
}
.btn-link { justify-self: start; border-color: transparent; background: none; padding-left: 0; text-decoration: underline; text-underline-offset: 2px; }
.btn:hover, .group-toggle:hover { background: var(--surface-2); }

.results-count { font-weight: 600; margin: 0 0 4px; }
.order-note { margin: 0 0 8px; }
.empty { padding: 20px 0; margin: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.empty p { margin-bottom: 12px; }

.group { margin-top: 40px; }
.group[hidden] { display: none; }
.group-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 18px; }
.group-count { font-weight: 400; color: var(--muted); }
.group-toggle { margin-bottom: 8px; }
.rows[hidden] { display: none; }

/* 4. Rows */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.row { border-bottom: 1px solid var(--border); }
.row[hidden] { display: none; }
.row summary {
  position: relative; display: block; min-height: 44px; padding: 16px 36px 16px 0;
  cursor: pointer; list-style: none;
}
.row summary::-webkit-details-marker { display: none; }
.row summary::after {
  content: ""; position: absolute; right: 12px; top: 24px; width: 7px; height: 7px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg);
}
.row details[open] > summary::after { transform: rotate(45deg); top: 20px; }
.row summary:hover .row-head { text-decoration: underline; text-underline-offset: 2px; }
.row-top { display: flex; margin-bottom: 4px; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.row-num { font-size: 14px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.row-head { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
.row-one { display: block; margin-top: 3px; color: var(--muted); font-size: 16px; }
.row-body { max-width: 68ch; padding: 0 0 20px; }
.row-body p { margin-bottom: .8em; }
.row-links { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 0; }
.row-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

@media (min-width: 640px) {
  .filters { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
  .btn-link { padding-left: 16px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

@media print {
  .choose, .more-filters, .results-count, .group-toggle { display: none !important; }
  .rows[hidden] { display: block; }
}
