/* data-guide.css: data-guide.html ("Understanding school data", js/data-guide.js). Class prefix dg-.
   Colors are the site tokens in css/pages.css (light and dark via html[data-theme]); the example charts use the
   same school/district/Washington colors as the charts on school and district pages (css/seo.css --cx-*).
   Wide screens: sticky contents column with the current section highlighted. Under 960px: an "On this page"
   menu that stays at the top while scrolling. Print: no menus or search, every measure shown. */

:root { --dg-a: #2468A8; --dg-b: #D9622B; --dg-ref: #5A6878; --dg-tip-bg: #EAF2FB; }
:root[data-theme="dark"] { --dg-a: #3F8FDB; --dg-b: #D35F2A; --dg-ref: #9AAABB; --dg-tip-bg: rgba(108,176,240,.14); }

.data-guide .wrap { max-width: 1160px; }
.dg-main { padding-bottom: 32px; }

/* ------------------------------------------------------------ intro */
.dg-intro { padding-top: 28px; padding-bottom: 18px; }
.dg-intro h1 { margin: 4px 0 8px; font-size: 1.9rem; font-weight: 800; }
.dg-lead { margin: 0; max-width: 720px; color: var(--muted); font-size: 1.02rem; }

/* ------------------------------------------------------------ layout + contents */
.dg-layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 40px; align-items: start; }
.dg-content { min-width: 0; }
.dg-aside { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 4px 4px 12px 0; }
.dg-toc-h { margin: 0 0 8px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.dg-toc ol { list-style: none; margin: 0; padding: 0; }
.dg-toc-list { border-left: 2px solid var(--border); }
.dg-toc a { display: block; margin-left: -2px; padding: 6px 10px 6px 14px; min-height: 24px; border-left: 2px solid transparent;
  color: var(--text); font-size: .9rem; font-weight: 600; line-height: 1.35; text-decoration: none; border-radius: 0 8px 8px 0; }
.dg-toc a:hover { background: var(--hover); color: var(--ink); }
.dg-toc a[aria-current] { border-left-color: var(--accent); background: var(--hover); color: var(--accent); }
.dg-toc-sub a { padding: 4px 10px 4px 26px; font-size: .84rem; font-weight: 500; color: var(--muted); }
.dg-toc-sub a[aria-current] { color: var(--accent); font-weight: 600; }

.dg-jump { display: none; }

/* ------------------------------------------------------------ sections */
.dg-sec { margin: 0 0 40px; scroll-margin-top: 16px; }
.dg-h2 { margin: 0 0 14px; font-size: 1.35rem; font-weight: 800; }
.dg-sec:focus { outline: none; }

/* tips */
.dg-tips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.dg-tip { position: relative; padding: 16px 16px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.dg-tip-wide { grid-column: 1 / -1; }
.dg-tip-i, .dg-realtors-i { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--dg-tip-bg); color: var(--accent); }
.dg-tip-i svg, .dg-realtors-i svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dg-tip h3 { margin: 10px 0 4px; font-size: 1rem; font-weight: 700; }
.dg-tip p { margin: 0; font-size: .9rem; line-height: 1.5; }
.dg-tip-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 8px !important; }
.dg-tip-links a { display: inline-flex; align-items: center; min-height: 24px; font-weight: 600; }
.dg-tip-links a::after { content: " →"; white-space: pre; }

/* reading the numbers: term cards with a small example picture */
.dg-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -4px 0 14px; font-size: .88rem; color: var(--muted); }
.dg-ex-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); }
.dg-terms { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dg-term { display: flex; flex-direction: column; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); min-width: 0; }
.dg-term-wide { grid-column: 1 / -1; }
.dg-term h3 { margin: 0 0 6px; font-size: 1.02rem; font-weight: 700; }
.dg-term p { margin: 0 0 10px; font-size: .9rem; line-height: 1.5; }
.dg-term .dg-term-also { margin-top: -4px; font-weight: 600; color: var(--ink); }
.dg-ex { position: relative; margin-top: auto; padding: 26px 12px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.dg-ex > .dg-ex-tag { position: absolute; top: 7px; left: 10px; }
.dg-svg { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; overflow: visible; }
.dg-svg-strip { max-width: 520px; }
.dg-svg text { fill: var(--muted); font-family: var(--font); font-size: 11px; }
.dg-svg .dg-v { fill: var(--ink); font-weight: 700; font-size: 11.5px; }
.dg-svg .dg-in { fill: var(--surface); font-weight: 700; }
.dg-svg .dg-yr text { font-size: 10px; }
.dg-f circle { fill: var(--dg-a); }
.dg-o circle { fill: none; stroke: var(--dg-ref); stroke-width: 2; }
.dg-track { fill: var(--track); }
.dg-bar { fill: var(--dg-a); }
.dg-bar-o { fill: var(--dg-ref); }
.dg-guide { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.dg-brace { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.dg-sd circle { fill: var(--dg-a); fill-opacity: .7; stroke: var(--surface-2); stroke-width: 1.5; }
.dg-med { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.dg-avg { stroke: var(--dg-b); stroke-width: 2; stroke-dasharray: 4 3; }
.dg-svg .dg-avg-t { fill: var(--dg-b); }
:root[data-theme="dark"] .dg-svg .dg-avg-t { fill: #F09A6E; }
.dg-axis { fill: none; stroke: var(--muted); stroke-width: 1.25; }
.dg-grid { fill: none; stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 3; }
.dg-line { fill: none; stroke: var(--dg-a); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dg-pt circle { fill: var(--dg-a); stroke: var(--surface-2); stroke-width: 1.5; }
.dg-hid { fill: var(--surface); stroke: var(--dg-ref); stroke-width: 1.25; stroke-dasharray: 4 3; }
.dg-gapband { fill: var(--track); fill-opacity: .7; }
.dg-band { fill: var(--dg-a); fill-opacity: .2; }
.dg-st { stroke: var(--dg-ref); stroke-width: 2.5; }
.dg-di { fill: var(--dg-b); stroke: var(--surface-2); stroke-width: 2; }
.dg-me { fill: var(--dg-a); stroke: var(--surface-2); stroke-width: 2; }
.dg-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin: 8px 0 0 !important; font-size: .8rem !important; color: var(--muted); }
.dg-key span { display: inline-flex; align-items: center; gap: 6px; }
.dg-key span::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--dg-a); }
.dg-key .k-di::before { width: 9px; height: 9px; border-radius: 1px; background: var(--dg-b); transform: rotate(45deg); }
.dg-key .k-st::before { width: 2.5px; height: 14px; border-radius: 0; background: var(--dg-ref); }
.dg-key .k-band::before { width: 16px; height: 10px; border-radius: 2px; background: var(--dg-a); opacity: .25; }

/* the measures: search, topic chips, cards */
.dg-tools { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
.dg-q-label { display: block; margin-bottom: 6px; font-size: .86rem; font-weight: 700; color: var(--ink); }
.dg-q-box { position: relative; }
.dg-q-box svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.dg-q-box input { width: 100%; min-height: 44px; padding-left: 38px; box-sizing: border-box; }
.dg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dg-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; }
.dg-chip:hover { background: var(--hover); color: var(--ink); }
.dg-chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .dg-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0B1520; }
.dg-chip-n { font-size: .74rem; font-weight: 700; opacity: .8; font-variant-numeric: tabular-nums; }
.dg-count { margin: 0; font-size: .82rem; color: var(--muted); }
.dg-none { padding: 18px; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; }
.dg-none p { margin: 0 0 10px; }
.dg-reset { min-height: 40px; padding: 6px 16px; border: 1px solid var(--accent); border-radius: 10px; background: transparent; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.dg-reset:hover { background: var(--hover); }

.dg-group { margin: 0 0 22px; }
.dg-group-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dg-group-h::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.dg-mlist { display: grid; gap: 12px; }
.dg-measure { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); scroll-margin-top: 16px; }
.dg-measure:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.dg-measure:target { border-color: var(--accent); }
.dg-m-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0 0 6px; }
.dg-measure h4 { margin: 0; font-size: 1.08rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.dg-m-avg { font-size: .8rem; color: var(--muted); }
.dg-m-avg b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dg-measure > p { margin: 0 0 10px; }
.dg-dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 10px; }
.dg-dl > div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--good); }
.dg-dl > .dg-dl-no { border-left-color: var(--dg-ref); }
.dg-dl dt { margin: 0 0 2px; font-size: .8rem; font-weight: 700; color: var(--ink); }
.dg-dl dd { margin: 0; font-size: .88rem; line-height: 1.5; }
.dg-meta { margin: 0; font-size: .82rem; color: var(--muted); }
.dg-meta span { font-weight: 700; }
.dg-links { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 6px 0 0; font-size: .86rem; font-weight: 600; }
.dg-links a { display: inline-flex; align-items: center; min-height: 24px; }

/* realtors */
.dg-realtors { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: start; }
.dg-realtors h2 { margin: 4px 0 8px; font-size: 1.15rem; }
.dg-realtors p { margin: 0 0 10px; }
.dg-out { font-weight: 600; margin-bottom: 0 !important; }

/* sources + downloads */
.dg-src-list { list-style: none; margin: 0 0 12px; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); overflow: hidden; }
.dg-src-list li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto; gap: 4px 16px; align-items: baseline; padding: 11px 16px; border-top: 1px solid var(--border); font-size: .88rem; }
.dg-src-list li:first-child { border-top: 0; }
.dg-src-what { font-weight: 700; color: var(--ink); }
.dg-src-from { color: var(--text); overflow-wrap: anywhere; }
.dg-src-yr { justify-self: end; padding: 1px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .78rem; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dg-fine { margin: 0 0 8px; font-size: .86rem; color: var(--muted); max-width: 760px; }
.dg-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; }
.dg-files a { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  color: var(--ink); font-weight: 600; font-size: .9rem; text-decoration: none; box-shadow: var(--shadow-sm); }
.dg-files a:hover { border-color: var(--accent); background: var(--hover); }
.dg-file-i { flex: none; display: inline-grid; place-items: center; min-width: 40px; height: 26px; padding: 0 4px; border-radius: 6px; background: var(--dg-tip-bg); color: var(--accent);
  font-size: .66rem; font-weight: 800; letter-spacing: .04em; }

/* ------------------------------------------------------------ narrower screens */
@media (max-width: 959px) {
  .dg-layout { display: block; }
  .dg-aside { display: none; }
  .dg-jump { display: block; position: sticky; top: 0; z-index: 30; margin: 0 -20px 20px; padding: 0 20px;
    background: var(--bg); border-bottom: 1px solid var(--border); }
  .dg-jump summary { display: flex; align-items: center; gap: 8px; min-height: 48px; cursor: pointer; list-style: none; font-weight: 700; color: var(--ink); }
  .dg-jump summary::-webkit-details-marker { display: none; }
  .dg-jump-label { flex: none; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
  .dg-jump-cur { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92rem; }
  .dg-jump-chev { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
  .dg-jump[open] .dg-jump-chev { transform: rotate(180deg); }
  .dg-jump ol { list-style: none; margin: 0; padding: 0 0 10px; display: grid; gap: 2px; }
  .dg-jump a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--text); font-weight: 600; text-decoration: none; }
  .dg-jump a:hover { background: var(--hover); }
  .dg-jump a[aria-current] { background: var(--hover); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
  .dg-sec, .dg-measure { scroll-margin-top: 60px; }
}
@media (max-width: 720px) {
  .dg-terms { grid-template-columns: minmax(0, 1fr); }
  .dg-dl { grid-template-columns: minmax(0, 1fr); }
  .dg-src-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .dg-src-from { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 560px) {
  .dg-intro { padding-top: 20px; }
  .dg-intro h1 { font-size: 1.5rem; }
  .dg-jump { margin-left: -20px; margin-right: -20px; }
  .dg-term, .dg-measure, .dg-tip { padding: 14px; }
  .dg-realtors { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px; }
  .dg-tools { padding: 12px; }
}

/* ------------------------------------------------------------ print: no menus or search, every measure shown */
@media print {
  .dg-aside, .dg-jump, .dg-tools, .dg-none { display: none !important; }
  .dg-layout { display: block; }
  .dg-group[hidden], .dg-measure[hidden] { display: block !important; }
  .dg-intro { padding: 0 0 8pt; }
  .dg-intro h1 { font-size: 18pt; }
  .dg-sec { margin-bottom: 14pt; }
  .dg-h2 { font-size: 13pt; break-after: avoid; }
  .dg-tips, .dg-terms { display: block; }
  .dg-tip, .dg-term, .dg-measure, .dg-realtors, .dg-src-list li, .dg-ex { break-inside: avoid; box-shadow: none; }
  .dg-tip, .dg-term, .dg-measure { margin: 0 0 6pt; padding: 8pt 10pt; }
  .dg-tip-i { display: none; }
  .dg-tip h3 { margin-top: 0; }
  .dg-ex { max-width: 340px; }
  .dg-files a { box-shadow: none; min-height: 0; }
}
