/* Family Filter TV — film pages and the titles index.
   Loaded after ../style.css and built only from its tokens. Data is cyan
   (--signal); a muted stretch is --hush; amber stays reserved for the one main
   action on a page, so nothing here uses it. */

/* Text for screen readers only. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- language level pill ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: var(--field);
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Every colour below is at least 4.5:1 on --field. */
.pill-clean { color: #8DEBC2; }
.pill-mild { color: var(--signal); }
.pill-moderate { color: #9CC3FF; }
.pill-strong { color: #FFA3B5; }

/* ---------- result block ---------- */

.result {
  background: linear-gradient(160deg, var(--field-2), var(--field));
  border: 1px solid var(--field-line);
  border-radius: var(--radius);
  padding: 26px 28px 28px;
  margin: 1.4em 0 1.8em;
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
}

.result p { margin: 0; max-width: none; }

.result-total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 12px; }

.result-figure {
  font-size: clamp(3.25rem, 14vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
}

.result-unit { font-size: 1.125rem; font-weight: 700; color: var(--ink-soft); }

.result-calm {
  font-size: clamp(1.6rem, 6vw, 2.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* a flat, steady line: the sound never drops out */
.calm-line {
  height: 2px;
  margin-top: 22px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--signal) 12%, var(--signal) 88%, transparent);
  opacity: 0.7;
}

.bars {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(8.5rem, 13rem) 1fr 3.25rem;
  align-items: center;
  gap: 4px 14px;
  margin: 0;
}

.bar-label { font-size: 0.9375rem; font-weight: 700; color: var(--ink); }

.bar-track {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: rgba(7, 11, 20, 0.55);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: 999px;
  background: var(--signal);
}

.bar-num {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

@media (max-width: 520px) {
  .result { padding: 22px 18px 24px; border-radius: 16px; }
  .bar-row { grid-template-columns: 1fr 3rem; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .bar-num { grid-column: 2; grid-row: 1; }
}

/* ---------- timeline chart ---------- */

.chart {
  margin: 1.4em 0 1em;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.chart-svg {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
  margin-inline: auto;
}

.chart-svg .bar { fill: var(--signal); }
.chart-svg .bar-q { fill: var(--field-line); }
.chart-svg .hush { fill: var(--hush); stroke: var(--signal); stroke-width: 0.8; }
.chart-svg .grid { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-svg .axis-line { stroke: var(--muted); stroke-width: 1; }
.chart-svg .axis { fill: var(--muted); font-size: 13.5px; font-weight: 600; font-family: inherit; }

.chart figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--muted);
}

.chart .key { display: inline-flex; align-items: center; gap: 8px; }
.chart .chart-note { flex-basis: 100%; }

.sw { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 3px; }
.sw-bar { background: var(--signal); }
.sw-hush {
  background: repeating-linear-gradient(0deg, var(--hush) 0 5px, transparent 5px 8px);
  border: 1px solid var(--signal);
}

/* the stand-alone table lives in a disclosure; the text stays in the page */
.numbers { margin: 0 0 1.6em; }

.numbers summary {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
}

.numbers summary:hover { border-color: var(--signal); color: var(--signal); }
.numbers[open] summary { margin-bottom: 4px; }

/* ---------- lines muted per filter profile ---------- */

.tiles {
  list-style: none;
  margin: 0 0 1.05em;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tile {
  margin: 0;
  padding: 16px 16px 18px;
  background: var(--field);
  border: 1px solid var(--field-line);
  border-radius: 14px;
}

.tile-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tile-num {
  display: block;
  margin: 4px 0 2px;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
}

.tile-of { display: block; font-size: 0.875rem; color: var(--ink-soft); line-height: 1.4; }

@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
  .tile-name, .tile-num, .tile-of { display: inline; margin: 0; }
  .tile-name { flex: 1 1 100%; }
}

/* ---------- titles index ---------- */

main.wrap > .title-grid { max-width: none; }

.title-grid {
  list-style: none;
  margin: 0 0 1.6em;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 14px;
}

.title-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong);
  border-radius: 16px;
}

/* the author's display:flex would otherwise beat the hidden attribute used by the search box */
.title-row[hidden] { display: none; }

.title-row:hover, .title-row:focus-within { border-color: var(--signal); }

.title-link {
  font-weight: 800;
  font-size: 1.0625rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-decoration: none;
}

/* the whole card is the link */
.title-link::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }

.title-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.title-count { font-size: 0.9375rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.title-bar {
  display: block;
  height: 6px;
  margin-top: auto;
  border-radius: 999px;
  background: rgba(7, 11, 20, 0.7);
  overflow: hidden;
}

.title-bar > span { display: block; height: 100%; min-width: 0; background: var(--signal); border-radius: 999px; }

@media (prefers-reduced-motion: no-preference) {
  .title-row { transition: border-color 0.15s ease; }
}

#title-search {
  width: 100%;
  max-width: 420px;
  margin-top: 6px;
  padding: 11px 16px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
}

#title-search::placeholder { color: var(--muted); }
