/* tour-questions.css: tour-questions.html (js/tour-questions.js). Class prefix tq-.
   Colors come from the tokens in css/pages.css (light and dark) plus the few below; same look as the
   Family Help Center and compare-districts (navy #14324F, accent #F2B33D, rounded cards).
   Print: one or two pages, black on white, a square to tick and a line to write on under each question. */

.tq-page {
  --tq-bg: #F5F7FA; --tq-why-bg: #FFF8E8; --tq-why-border: #F2B33D; --tq-why-text: #5A4100;
  --tq-check: #14324F; --tq-chip: #E8F0FB; --tq-chip-text: #1F4F8F;
  background: var(--tq-bg);
}
[data-theme="dark"] .tq-page {
  --tq-bg: var(--bg); --tq-why-bg: rgba(242,179,61,.10); --tq-why-border: rgba(242,179,61,.55); --tq-why-text: #F5D9A0;
  --tq-check: #6CB0F0; --tq-chip: rgba(108,176,240,.16); --tq-chip-text: #A9D0F5;
}
.tq-page .wrap { max-width: 1000px; }
.tq-page main { padding-bottom: 12px; }
.tq-page main :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tq-h2 { margin: 0 0 6px; font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.tq-sub { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------ intro + picker */
.tq-intro { padding: 28px 0 16px; }
.tq-intro h1 { margin: 4px 0 8px; font-size: 1.85rem; font-weight: 800; }
.tq-lead { margin: 0; max-width: 720px; color: var(--muted); font-size: 1rem; }
.tq-change { margin: 10px 0 0; }
.tq-change a { display: inline-flex; align-items: center; min-height: 24px; font-weight: 600; }
.tq-pick { margin-bottom: 18px; }
.tq-pick[hidden] { display: none; }
.tq-pick-msg { margin: 6px 0 12px; }
.tq-pick-msg[hidden] { display: none; }
.tq-label { display: block; margin: 10px 0 6px; font-size: .9rem; font-weight: 700; color: var(--ink); }
.tq-combo { position: relative; max-width: 560px; }
.tq-combo input { width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; }
.tq-combo input:focus { border-color: var(--accent); }
.tq-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.tq-list[hidden] { display: none; }
.tq-opt { display: flex; flex-direction: column; gap: 1px; min-height: 44px; justify-content: center; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.tq-opt.is-active, .tq-opt:hover { background: var(--hover); }
.tq-opt.is-active { box-shadow: inset 3px 0 0 var(--gold); }
.tq-opt-name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.tq-opt-sub { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.tq-opt-none { padding: 10px; color: var(--muted); }
.tq-pick-help { margin: 8px 0 0; font-size: .86rem; color: var(--muted); }
.tq-loading { padding: 20px 0; }

/* ------------------------------------------------------------ school header */
.tq-head { margin-bottom: 22px; border-top: 4px solid var(--gold); }
.tq-school { margin: 4px 0 6px; font-size: 1.55rem; font-weight: 800; overflow-wrap: anywhere; }
.tq-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; padding: 0; }
.tq-tags span { padding: 2px 10px; border-radius: 999px; background: var(--tq-chip); color: var(--tq-chip-text); font-size: .8rem; font-weight: 700; }
.tq-addr { margin: 0 0 14px; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.tq-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 16px; }
.tq-fact { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.tq-fact dt { font-size: .76rem; font-weight: 700; color: var(--muted); line-height: 1.3; }
.tq-fact dd { margin: 2px 0 0; }
.tq-fact dd b { display: block; font-size: 1.25rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.tq-fact-st, .tq-fact-src { display: block; font-size: .74rem; color: var(--muted); line-height: 1.35; }
.tq-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tq-actions .btn { min-height: 46px; }
.tq-actions .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tq-share-out { margin: 10px 0 0; font-size: .9rem; }
.tq-share-out input { width: 100%; max-width: 520px; min-height: 40px; margin-top: 4px; padding: 6px 10px; font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; }
.tq-progress { margin: 10px 0 0; font-size: .86rem; font-weight: 600; color: var(--muted); }
.tq-progress:empty { display: none; }

/* ------------------------------------------------------------ question sections */
.tq-part { margin: 0 0 22px; }
.tq-sec { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 16px 18px; margin: 0 0 12px; }
.tq-sec-h { margin: 0 0 8px; font-size: 1.02rem; font-weight: 800; color: var(--ink); }
.tq-rule + .tq-rule { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.tq-why { margin: 0 0 8px; padding: 8px 12px; border-left: 4px solid var(--tq-why-border); border-radius: 0 10px 10px 0; background: var(--tq-why-bg);
  color: var(--tq-why-text); font-size: .86rem; line-height: 1.45; }
.tq-why b { color: inherit; }
.tq-line-note { opacity: .85; }
.tq-qs { margin: 0; padding: 0; list-style: none; }
.tq-q { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 10px; padding: 6px 0; }
.tq-q input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--tq-check); cursor: pointer; }
.tq-q label { flex: 1; min-width: 0; color: var(--text); font-size: .97rem; line-height: 1.45; cursor: pointer; overflow-wrap: anywhere; }
.tq-q input:checked + label { color: var(--muted); }
.tq-ans { display: none; }
.tq-more { margin: 6px 0 0 34px; font-size: .84rem; color: var(--muted); }
.tq-more a { display: inline-flex; align-items: center; min-height: 24px; font-weight: 600; }
.tq-none { margin: 0; }
.tq-core { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tq-core .tq-sec { margin: 0; }

/* ------------------------------------------------------------ notes */
.tq-notes { margin: 0 0 22px; }
.tq-notes-label { display: block; font-weight: 700; color: var(--ink); font-size: .92rem; }
.tq-notes-help { margin: 2px 0 8px; font-size: .84rem; color: var(--muted); }
.tq-notes textarea { width: 100%; min-height: 120px; padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; resize: vertical; }
.tq-notes textarea:focus { border-color: var(--accent); }
.tq-notes-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 10px; }
.tq-erase { min-height: 44px; }
.tq-erase:hover { border-color: var(--bad); color: var(--bad); }
.tq-saved { font-size: .86rem; color: var(--muted); }
.tq-print-notes, .tq-print-foot { display: none; }

/* ------------------------------------------------------------ about */
.tq-about { margin: 8px 0 18px; }
.tq-about ul { margin: 0; padding-left: 20px; color: var(--text); font-size: .9rem; display: grid; gap: 6px; }

@media (max-width: 759px) {
  .tq-core { grid-template-columns: 1fr; }
  .tq-intro h1 { font-size: 1.5rem; }
  .tq-page .wrap { padding-left: 16px; padding-right: 16px; }
  .tq-head { padding: 16px; }
  .tq-sec { padding: 14px; }
  .tq-facts { grid-template-columns: 1fr 1fr; }
  .tq-actions .btn { flex: 1 1 calc(50% - 8px); padding-left: 10px; padding-right: 10px; }
  .tq-more { margin-left: 0; }
}

/* ------------------------------------------------------------ print: compact sheet with boxes and lines */
@media print {
  @page { margin: 10mm 12mm; }
  .tq-page { --tq-why-bg: #fff; --tq-why-border: #B98A1F; --tq-why-text: #3B3B3B; --tq-chip: #fff; --tq-chip-text: #12304D; background: #fff; }
  body { font-size: 9.5pt; }
  .tq-intro, .tq-about, .tq-pick, .tq-actions, .tq-progress, .tq-share-out, .tq-more, .tq-notes-row, .tq-notes-help, .tq-sub, .tq-notes textarea { display: none !important; }
  .tq-head { border: 0; border-bottom: 1.5pt solid #12304D; border-radius: 0; padding: 0 0 4pt; margin: 0 0 3pt; }
  .tq-head .rp-kicker { font-size: 7.5pt; }
  .tq-school { font-size: 15pt; margin: 1pt 0 2pt; }
  .tq-tags { display: block; margin: 0; }
  .tq-tags span { padding: 0; border-radius: 0; font-size: 8.5pt; font-weight: 600; }
  .tq-tags span + span::before { content: " · "; }
  .tq-addr { margin: 0 0 2pt; font-size: 8.5pt; }
  .tq-facts { display: flex; flex-wrap: wrap; gap: 3pt 12pt; margin: 0; }
  .tq-fact { padding: 0; border: 0; background: none; border-radius: 0; }
  .tq-fact dt { font-size: 7pt; }
  .tq-fact dd b { display: inline; font-size: 9.5pt; }
  .tq-fact-st, .tq-fact-src { display: inline; font-size: 7pt; margin-left: 3pt; }
  .tq-part { margin: 0 0 3pt; }
  .tq-h2 { font-size: 11pt; margin: 4pt 0 2pt; break-after: avoid; }
  .tq-sec, .tq-core .tq-sec { border: 0; box-shadow: none; border-radius: 0; padding: 0; margin: 0 0 4pt; }
  .tq-sec-h { font-size: 9.5pt; margin: 0 0 2pt; text-transform: uppercase; letter-spacing: .05em; break-after: avoid; }
  .tq-rule { break-inside: avoid; }
  .tq-rule + .tq-rule { margin-top: 4pt; padding-top: 0; border: 0; }
  .tq-why { margin: 0 0 1pt; padding: 1pt 0 1pt 6pt; border-left-width: 2pt; border-radius: 0; font-size: 7.6pt; line-height: 1.3; }
  /* Two columns on paper: up to ~40 questions with a writing line each still fit on two pages. */
  /* The core questions print in two columns; each question's writing line sits beside it when it fits
     (short questions) or under it, so up to ~40 questions fit on two pages. */
  .tq-core { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16pt; align-items: start; }
  .tq-core-sec { break-inside: avoid; }
  .tq-line-note { display: none; }
  .tq-q { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 6pt; position: relative; padding: 1pt 0 0 15pt; break-inside: avoid; }
  .tq-q input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .tq-q label { display: block; flex: 0 1 auto; font-size: 8.9pt; line-height: 1.25; color: #1B2633 !important; }
  .tq-q label::before { content: ""; position: absolute; left: 0; top: 3pt; width: 8.5pt; height: 8.5pt; border: .9pt solid #12304D; border-radius: 1.5pt;
    font-size: 8pt; line-height: 8.5pt; text-align: center; font-weight: 800; }
  .tq-q input:checked + label::before { content: "✓"; }
  .tq-ans { display: block; flex: 1 0 90pt; height: 10pt; margin-bottom: 2pt; border-bottom: .6pt dotted #8C97A3; }
  .tq-notes { border: 0; box-shadow: none; padding: 0; margin: 4pt 0 0; break-inside: avoid; }
  .tq-notes:not(.tq-has-notes) { display: none; }
  .tq-notes-label { display: none; }
  .tq-print-notes { display: block; min-height: 20pt; padding: 3pt 0; white-space: pre-wrap; font-size: 9pt;
    background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 15pt, #B7C0CA 15pt, #B7C0CA 15.6pt); }
  .tq-print-foot { display: block; margin: 3pt 0 0; font-size: 7pt; color: #4A5868; overflow-wrap: anywhere; }
}
