/* Testimony: legislative hearing transcripts with their video (testimony.js).
   Built only from the page's colour tokens, so light, dark and auto follow the
   rest of the hub without a second palette. */

/* [hidden] must always win over an author rule of equal specificity -- see
   legislative.html's own [hidden] bug (a .row/label display:flex rule beat
   the UA default here). Most of this file's own [hidden] uses are already
   handled by a specific selector below (.t-list[hidden] etc., #tDlg
   [hidden]); this is the blanket backstop. */
[hidden] { display: none !important; }

/* the badge on bill rows and search hits; hidden until counts say it applies */
button.tbadge {
  display: inline-block; margin: 4px 0 0; padding: 2px 9px;
  font-size: 12px; line-height: 1.5; white-space: nowrap; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--sunken); color: var(--text);
}
button.tbadge:hover { border-color: var(--gold); }
button.tbadge[hidden] { display: none; }
#bTable td.bl button.tbadge { display: block; }
#bTable td.bl button.tbadge[hidden] { display: none; }

/* ---- the Testimony tab */
.t-views { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 12px; }
.t-views button {
  min-height: 32px; padding: 4px 14px; font-size: 13px; border-radius: 0;
  border: 1px solid var(--border-strong); background: var(--sunken); color: var(--muted);
}
.t-views button + button { border-left-width: 0; }
.t-views button:first-child { border-radius: 6px 0 0 6px; }
.t-views button:last-child { border-radius: 0 6px 6px 0; }
.t-views button[aria-pressed="true"] { background: var(--panel2); color: var(--gold); font-weight: 600; }
.t-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 0; }
.t-filters[hidden] { display: none; }
.t-lab { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-right: 2px; }
.t-n { color: var(--muted); font-size: 12px; font-weight: 400; }
.t-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 26px;   /* WCAG 2.5.8 */
  padding: 1px 10px; font-size: 12px; line-height: 1.2; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--sunken); color: var(--text);
}
.t-chip:hover { border-color: var(--gold); }
.t-chip[aria-pressed="true"], .t-chip.on { border-color: var(--gold); background: var(--panel2); font-weight: 600; }
.t-link {
  display: inline-flex; align-items: center; min-height: 24px;   /* WCAG 2.5.8 */
  padding: 0; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer;
  text-decoration: underline dotted var(--muted); text-underline-offset: 3px; text-align: left;
}
.t-link:hover { color: var(--gold); }
/* Talking points' own org/min-states controls: free text and a number, so
   chips (built for a short fixed set of choices) don't fit -- small inline
   labelled inputs instead, sized to sit in the same filter row as the chips
   above them on the other views. */
.t-inline {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
}
.t-inline input {
  background: var(--sunken); color: var(--text); font: inherit; font-size: 12.5px;
  border: 1px solid var(--control-border); border-radius: 5px; padding: 4px 8px;
  min-height: 26px;   /* WCAG 2.5.8, matching .t-chip's own target height */
}
.t-inline .t-num-in { width: 4.5em; }
.t-named { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -2px 0 10px; }
.t-rep-note { color: var(--blue); }
.t-list { display: grid; gap: 10px; margin: 12px 0; }
.t-list[hidden], #tPeopleWrap[hidden] { display: none; }
.t-card {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel); padding: 12px 14px;
}
.t-card-top { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.t-date { font-weight: 600; font-variant-numeric: tabular-nums; }
.t-st { font-weight: 600; color: var(--muted); }
.t-where { font-weight: 600; overflow-wrap: anywhere; }
.t-facts { color: var(--muted); font-size: 13px; }
.t-bills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.t-bill {
  display: inline-flex; align-items: center; min-height: 24px;   /* WCAG 2.5.8 target size */
  font-size: 12px; line-height: 1.2; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text); text-decoration: none;
}
.t-bill.anti { border-color: var(--anti); }
.t-bill.pro { border-color: var(--pro); }
.t-bill.unnamed { border-style: dashed; color: var(--muted); }
a.t-bill:hover { text-decoration: underline; }
.t-card-act { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.t-media { color: var(--muted); font-size: 13px; }

/* the Speakers table, laid out like the bill explorer's */
.t-people { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.t-people th, .t-people td { padding: 7px 10px; border-bottom: 1px solid var(--border);
                             text-align: left; vertical-align: top; }
.t-people thead th {
  position: sticky; top: 0; background: var(--panel2); color: var(--gold);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}
.t-people thead th button {
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
  text-transform: inherit; letter-spacing: inherit; cursor: pointer;
  min-height: 24px; display: inline-flex; align-items: center;   /* WCAG 2.5.8 */
}
.t-people thead th[aria-sort="ascending"] button::after { content: " ▲"; }
.t-people thead th[aria-sort="descending"] button::after { content: " ▼"; }
.t-people tbody th { font-weight: 600; }
.t-people tbody tr:hover > * { background: var(--panel2); }
.t-people .t-name {
  padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 600;
  text-align: left; cursor: pointer; border-bottom: 1px dotted var(--muted);
  min-height: 24px; display: inline-flex; align-items: center;   /* WCAG 2.5.8 */
}
.t-people .t-name:hover { color: var(--gold); }
.t-people .t-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-people .t-det { color: var(--muted); min-width: 180px; }

/* one speaker, above the table */
.t-person {
  border: 1px solid var(--border-strong); border-left: 3px solid var(--gold);
  border-radius: 8px; background: var(--panel); padding: 12px 14px; margin: 12px 0;
}
.t-person[hidden] { display: none; }
.t-person-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.t-person h3 { margin: 0; font-size: 17px; }
.t-person h3:focus { outline: none; }
.t-person h4 { margin: 14px 0 6px; font-size: 12px; text-transform: uppercase;
               letter-spacing: .6px; color: var(--gold); }
.t-person .t-sub { color: var(--muted); font-size: 13px; margin: 3px 0 8px; }
.t-person .t-actions { margin: 0 0 8px; }
.t-apps { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.t-apps > li { border-top: 1px solid var(--border); padding-top: 8px; }
.t-apps .t-bills { margin: 4px 0 6px; }
.t-app { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13px; margin: 3px 0; }
.t-ev { flex-basis: 100%; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.t-plist { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; }
.t-plist q { display: block; color: var(--muted); overflow-wrap: anywhere; }

/* repeated passages */
.t-pass .t-card-top { margin-bottom: 6px; }
.t-tag { font-size: 11px; border: 1px solid var(--blue); color: var(--blue); border-radius: 999px; padding: 0 8px; }
.t-quote {
  margin: 0 0 6px; padding: 6px 12px; border-left: 3px solid var(--blue);
  background: var(--sunken); white-space: pre-line; overflow-wrap: anywhere;
}
.t-quote.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.t-readings { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13px; }
.t-readings li { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }

/* ---- the viewer */
dialog#tDlg {
  width: min(1240px, calc(100vw - 32px)); height: min(920px, calc(100dvh - 32px));
  max-width: none; max-height: none; padding: 0; overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--bg); color: var(--text);
}
dialog#tDlg::backdrop { background: rgb(0 0 0 / 0.6); }
/* the rules below set display on several of these, which would beat [hidden] */
#tDlg [hidden] { display: none !important; }
.t-wrap { display: flex; flex-direction: column; height: 100%; }
.t-head {
  display: flex; gap: 12px; align-items: flex-start; justify-content: space-between;
  padding: 12px 16px 10px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.t-head h2 { margin: 0 0 3px; font-size: 18px; line-height: 1.3; }
.t-head h2:focus { outline: none; }
.t-sub { color: var(--muted); font-size: 13px; }
.t-head .t-bills { margin: 6px 0 0; }
.t-match { color: var(--faint); font-size: 12px; margin-top: 4px; }
.t-pickrow { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; }
.t-pickrow select { max-width: 100%; }
.t-close { font-size: 22px; line-height: 1; padding: 4px 11px; flex: none; }
.t-body {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.t-left { padding: 14px 16px; overflow: auto; border-right: 1px solid var(--border); }
.t-right { display: flex; flex-direction: column; min-height: 0; }
.t-frame { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; overflow: hidden; }
.t-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.t-left video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 6px; }
.t-left audio.t-audio { display: block; width: 100%; }
.t-linkcard {
  border: 1px dashed var(--border-strong); border-radius: 8px;
  padding: 12px 14px; background: var(--sunken);
}
.t-linkcard p { margin: 0 0 8px; }
.t-linkcard p:last-child { margin-bottom: 0; }
.t-jump { font-variant-numeric: tabular-nums; }
.t-src { margin-top: 10px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.t-src button { font-size: 12px; padding: 2px 9px; }
.t-note { font-size: 12px; color: var(--faint); margin: 12px 0 0; line-height: 1.5; }
.t-tools {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.t-tools input[type="search"] { flex: 1 1 160px; min-width: 0; }
.t-tools button { padding: 3px 10px; }
.t-investigation { margin: 10px 0 0; font-size: 13px; }
.t-investigation a, .t-pin-lines a { display: inline-flex; align-items: center; min-height: 28px; }
.t-pin-lines { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  padding: 8px 14px; border-bottom: 1px solid var(--border); font-size: 12px; }
.t-pin-lines label { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; }
.t-pin-lines input { width: 5.5em; min-width: 0; }
.t-pin-lines button { font-size: 12px; min-height: 28px; }
.t-pin-lines a[aria-disabled="true"] { color: var(--muted); text-decoration: none; }
#tPinHint { flex-basis: 100%; color: var(--muted); }
/* the page stacks label text above its control; this one sits inline */
.t-tools label { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; font-size: 13px; }
/* WCAG 2.5.8: a plain native checkbox with no sizing of its own measured
   13x13px. */
#tFollow { width: 24px; height: 24px; margin: 0; accent-color: var(--pro); }
.t-count { font-size: 12px; color: var(--muted); min-width: 5.5em; font-variant-numeric: tabular-nums; }
.t-mentions {
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.t-mentions:empty { display: none; }
.t-mentions button { font-size: 12px; padding: 4px 7px; font-variant-numeric: tabular-nums;
                      min-height: 24px; }   /* WCAG 2.5.8; was 22px */
ol.t-lines { list-style: none; margin: 0; padding: 4px 0 24px; overflow: auto; flex: 1; min-height: 0; }
ol.t-lines li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px;
  padding: 5px 14px 5px 11px; border-left: 3px solid transparent;
  content-visibility: auto; contain-intrinsic-size: auto 52px;
}
ol.t-lines li.now { background: var(--sunken); border-left-color: var(--gold); }
ol.t-lines li.hit { background: color-mix(in srgb, var(--gold) 16%, transparent); }
ol.t-lines li.cur { outline: 2px solid var(--gold); outline-offset: -2px; }
.t-ts { font-size: 12px; padding: 1px 6px; min-height: 24px; align-self: start; font-variant-numeric: tabular-nums; }
.t-ts:disabled { opacity: .55; cursor: default; }
.t-spk { font-weight: 600; font-size: 12px; color: var(--muted); margin-right: 6px; }
.t-spk.named { color: var(--gold); }
.t-voice { font-weight: 400; }
.t-tx { overflow-wrap: anywhere; }
/* a line inside a repeated passage: marked on the right, since the left edge
   marks the line playing now */
ol.t-lines li.rep { box-shadow: inset -3px 0 0 var(--blue); }
.t-repbtn {
  display: block; margin-top: 4px; font-size: 12px; padding: 4px 8px;
  border-color: var(--blue); color: var(--blue); background: transparent;
  min-height: 24px;   /* WCAG 2.5.8; was 22px */
}
.t-repinfo { margin-top: 4px; font-size: 12px; color: var(--muted); }
.t-repinfo .t-readings { margin: 2px 0 0; font-size: 12px; }

/* the viewer's left column: who speaks, and what repeats */
.t-roster h3, .t-reps h3 {
  margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--gold);
}
.t-roster:empty, .t-reps:empty { display: none; }
.t-who { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13px; }
.t-who > li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; }
.t-who .t-ev { font-size: 12px; }
.t-status { padding: 6px 14px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.t-status:empty { display: none; }

@media (max-width: 860px) {
  dialog#tDlg {
    width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh;
    border: 0; border-radius: 0;
  }
  .t-head { padding: 10px 12px 8px; }
  .t-head h2 { font-size: 16px; }
  .t-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .t-left { border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 12px; max-height: 46dvh; }
  .t-tools, .t-mentions, .t-pin-lines { padding-left: 12px; padding-right: 12px; }
  ol.t-lines li { padding-left: 9px; padding-right: 12px; }
}
