/*!
 * profile.css — the 2022 state eviction filings page on top of ern-2026.css.
 *
 * ern-2026.css (a copy of the main site's design system; nothing keeps the
 * two in sync) supplies the tokens, header, type scale, and footer. This file
 * lays out the page, following the rebuilt California lockouts page of
 * 2026-10-19: a hero, a full-width map, then one article column with a
 * contents box beside it, and the figures, their controls, and their data
 * tables.
 */

:root {
  --surface:  #ffffff;
  --grid:     #e6e9ee;
  --axis:     #c9cfd6;
  --nodata:   #9aa1a9;
}

/* ─── Hero ─── */
.hero { padding-bottom: 28px; }
.hero .hero-in { max-width: none; }
.hero h1 { margin-bottom: 18px; max-width: 18ch; }
.byline { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0; max-width: 90ch; }
.byline a { color: var(--body); text-decoration: underline; text-underline-offset: 2px; }
.byline a:hover { color: var(--accent-press); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ─── Segmented buttons (map period and geography, race period, chart view) ─── */
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: var(--surface); }
.seg button {
  font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--body); background: transparent; border: 0; cursor: pointer;
  padding: 9px 14px; min-height: 38px; white-space: nowrap;
}
.seg button + button { border-left: 1px solid var(--rule); }
.seg button:hover { background: var(--tint); color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-right: 10px; }
.control { display: inline-flex; align-items: center; }

/* ─── Map ─── */
.map-sec { padding-bottom: 8px; }
.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 0 0 14px; }
.map-search { display: flex; margin-left: auto; min-width: 0; }
.map-search input {
  font: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--rule); border-right: 0; border-radius: 4px 0 0 4px;
  padding: 8px 12px; min-height: 38px; width: 260px; min-width: 0; background: var(--surface);
}
.map-search input:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 0; }
.map-search button {
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  border-radius: 0 4px 4px 0; padding: 8px 14px; min-height: 38px;
}
.map-search button:hover { background: var(--body); }
.map-status { font-size: 13px; color: var(--muted); margin: -6px 0 10px; min-height: 0; }
.map-status:empty { display: none; }

.map-frame {
  position: relative; height: clamp(460px, 72vh, 760px);
  border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: #f2f3f0;
}
.map-canvas { position: absolute; inset: 0; }

/* The legend sits over the map's lower left corner (it is a sibling of the
   frame, so on a phone it can drop out of the map and sit underneath). */
.map-wrap { position: relative; }
.legend {
  position: absolute; left: 12px; bottom: 30px; z-index: 2;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--rule); border-radius: 4px;
  padding: 12px 14px 10px; font-size: 12.5px; line-height: 1.35; color: var(--ink);
  box-shadow: 0 1px 4px rgba(25, 34, 44, 0.08); max-width: 220px;
}
.legend-title { font-weight: 600; margin: 0 0 4px; }
.legend-sub { color: var(--muted); font-size: 11.5px; margin: 0 0 8px; }
.legend ul { list-style: none; margin: 0; padding: 0; }
.legend li { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.legend i { flex: none; width: 18px; height: 12px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(25, 34, 44, 0.16); }

/* MapLibre popups: the hover tip and the click card. */
.maplibregl-popup-content {
  font-family: var(--sans); font-size: 13px; line-height: 1.5; color: var(--ink);
  border-radius: 4px; padding: 10px 14px; box-shadow: 0 2px 10px rgba(25, 34, 44, 0.16);
}
.pf-tip .maplibregl-popup-content { padding: 6px 10px; font-size: 12.5px; pointer-events: none; }
.pf-tip .maplibregl-popup-tip { display: none; }
.pf-card h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; padding-right: 26px; }
.pf-card p { margin: 0; font-variant-numeric: tabular-nums; }
.maplibregl-popup-close-button { font-size: 18px; padding: 2px 7px; color: var(--muted); }
.maplibregl-ctrl-attrib { font-size: 11px; }

/* ─── Article and contents (as on the HPRM explainer) ─── */
.article-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 232px; gap: 64px;
  align-items: start; padding-top: 40px; padding-bottom: 72px;
}
.article { grid-column: 1; grid-row: 1; min-width: 0; max-width: 900px; }
.toc { grid-column: 2; grid-row: 1; position: sticky; top: 104px; min-width: 0; }
.toc details { border-left: 1px solid var(--rule); padding-left: 18px; }
.toc summary {
  list-style: none; cursor: default;
  font-size: 11px; font-weight: 800; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--accent-deep); margin: 0 0 14px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block; padding: 4px 0; font-size: 13px; line-height: 1.4;
  color: var(--muted); text-decoration: none; text-wrap: pretty;
}
.toc a:hover { color: var(--accent-deep); }
.toc a[aria-current] { color: var(--ink); font-weight: 600; }

.article section { scroll-margin-top: 100px; }
.article section + section { padding-top: 40px; margin-top: 44px; border-top: 1px solid var(--rule); }
.article h2 { font-size: 34px; line-height: 1.1; letter-spacing: -0.022em; margin: 0 0 10px; max-width: none; }
.article p { font-size: 16.5px; line-height: 1.7; color: var(--body); margin: 0 0 16px; max-width: 72ch; text-wrap: pretty; }
.article p b, .article p strong { color: var(--ink); font-weight: 600; }
.article a { text-decoration: underline; text-underline-offset: 2px; }
.article .dek { font-size: 15px; color: var(--muted); margin: 0 0 20px; }
.article .note { font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.article .archive-note { font-size: 14px; line-height: 1.65; color: var(--muted); }

/* ─── Figures ─── */
.fig { margin: 8px 0 28px; }
.fig-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 12px; }
.article .fig-title { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0; }
.article .fig-sub { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0 0 12px; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 12.5px; color: var(--body); }
.keys li { display: inline-flex; align-items: center; gap: 7px; }
.keys i { width: 12px; height: 12px; border-radius: 2px; flex: none; }
.chart { position: relative; width: 100%; min-height: 120px; }
.chart svg { display: block; overflow: visible; font-family: var(--sans); }
.chart [aria-label="tip"] { font-family: var(--sans); }

.multiples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; }
/* An author display rule beats the browser's [hidden], so restate it. */
.multiples[hidden], .chart[hidden] { display: none; }
.article .multiples .mini-title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin: 0 0 2px; }

/* The table twin of each chart. */
.tbl { margin: 12px 0 0; }
.tbl summary {
  cursor: pointer; display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--body);
  padding: 4px 0; text-decoration: underline; text-underline-offset: 2px;
}
.tbl summary:hover { color: var(--accent-deep); }
.tbl-wrap { overflow-x: auto; margin-top: 10px; border: 1px solid var(--rule); border-radius: 4px; max-height: 420px; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 6px 12px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl thead th { position: sticky; top: 0; background: #f6f8fa; font-weight: 600; color: var(--ink); }
.tbl caption { text-align: left; font-size: 12.5px; color: var(--muted); padding: 8px 12px; caption-side: top; }

/* ─── Responsive ─── */
@media (max-width: 1000px) {
  .article-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 24px; }
  .article { grid-column: 1; grid-row: 2; }
  .toc { grid-column: 1; grid-row: 1; position: static; }
  .toc details { padding: 0; border: 1px solid var(--rule); border-radius: 4px; }
  .toc summary { cursor: pointer; margin: 0; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; }
  .toc summary::after { content: "+"; font-size: 16px; font-weight: 500; letter-spacing: 0; }
  .toc details[open] summary::after { content: "–"; }
  .toc details[open] summary { border-bottom: 1px solid var(--rule); }
  .toc ul { padding: 10px 18px 6px; }
  .map-search { margin-left: 0; width: 100%; }
  .map-search input { flex: 1; width: auto; }
}
@media (max-width: 900px) {
  .hero { padding-top: 40px; }
  .article h2 { font-size: 28px; }
  .article p { font-size: 16px; }
  .multiples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .map-frame { height: 64vh; min-height: 380px; }
  /* On a phone the legend leaves the map and sits under it. */
  .legend { position: static; max-width: none; margin: 10px 0 0; box-shadow: none; }
  .legend ul { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  .seg button { padding: 8px 10px; font-size: 12px; }
  .control { width: 100%; justify-content: space-between; }
  .seg-label { margin-right: 6px; }
}
@media (max-width: 460px) {
  .multiples { grid-template-columns: minmax(0, 1fr); }
}

/* ─── Additions for the state filings pages ─── */

/* A button set that does not apply to the layer on screen. */
.seg[aria-disabled="true"] { opacity: 0.45; }
.seg[aria-disabled="true"] button { cursor: not-allowed; }
.seg[aria-disabled="true"] button:hover { background: transparent; color: var(--body); }
.seg[aria-disabled="true"] button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--body); cursor: pointer; min-height: 38px; }
.toggle input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }

.map-note { font-size: 13px; line-height: 1.55; color: var(--muted); margin: 10px 0 0; max-width: 90ch; }

/* The legend lists up to eleven classes (the segregation typology). */
.legend { max-height: calc(100% - 60px); overflow-y: auto; }
.legend i.outline { background: transparent !important; border: 1.5px solid #8a939d; }
.legend .legend-extra { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.pf-card p.lead { font-weight: 600; margin-bottom: 6px; }
.pf-card p.gap { margin-top: 6px; }
.pf-tip em { color: var(--muted); font-style: italic; }
.pf-tip .rl { display: block; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--rule); color: var(--muted); }

/* Key takeaways, boxed as in 2022. */
.takeaways { border: 1px solid var(--ink); border-left: 4px solid var(--accent); border-radius: 4px; padding: 22px 26px 6px 22px; margin: 0 0 22px; max-width: 72ch; }
.takeaways ul { margin: 0; padding-left: 20px; }
.takeaways li { font-size: 16.5px; line-height: 1.65; color: var(--body); margin: 0 0 16px; text-wrap: pretty; }
.takeaways li b { color: var(--ink); font-weight: 600; }
.article .lead-in { margin-bottom: 12px; }

/* Figure titles carry the 2022 chart headings. */
.article .fig-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.fig-menu { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--body); }
.fig-menu select {
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 4px; background: var(--surface);
  padding: 7px 10px; min-height: 38px; max-width: 100%;
}
.fig-note { font-size: 13px; line-height: 1.55; color: var(--muted); font-style: italic; margin: 10px 0 18px; }

/* Credits and footnotes. */
.credits { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap-reverse; }
.credits .credit-text { flex: 1 1 380px; }
.article .credits p { font-size: 14px; line-height: 1.65; color: var(--muted); font-style: italic; }
.credits img { width: 220px; height: auto; flex: none; }
.notes { margin: 24px 0 0; padding-left: 20px; }
.notes li { font-size: 13.5px; line-height: 1.6; color: var(--muted); margin: 0 0 12px; max-width: 80ch; scroll-margin-top: 100px; }
.notes a.back { margin-left: 4px; text-decoration: none; }
.article sup a { text-decoration: none; font-weight: 600; padding: 0 1px; }
.article .closing { font-weight: 600; color: var(--ink); }

@media (max-width: 600px) {
  .takeaways { padding: 18px 18px 4px 16px; }
  .credits img { width: 170px; }
  .fig-menu { width: 100%; justify-content: space-between; }
  .toggle { width: 100%; }
}
.article .subsec { scroll-margin-top: 100px; padding-top: 16px; }

/* Dayton: the 2022 credits sit under the map, as they did in 2022. */
.map-credits { margin-top: 18px; align-items: center; }
.map-credits p { font-size: 14px; line-height: 1.65; color: var(--muted); font-style: italic; margin: 0 0 6px; max-width: 90ch; }
.map-credits a { color: var(--body); text-decoration: underline; text-underline-offset: 2px; }
.map-credits img { width: 200px; }
