/* Study tools on course pages (assets/js/study-tools.js): highlights and
   notes, the notebook, course search and glossary views, the listening bar,
   and the dialogs they open. Colours come from the site's own variables, so
   the dark and high-contrast themes apply. */

.st-link:focus-visible,.st-hit:focus-visible,.st-dot:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
/* a lesson bookmarked before 2026-11-16 keeps its mark in the contents list */
.rail-lesson.st-bm .rl-title::after{content:" \1F516";font-size:.78em}

/* ---- highlight colours: one variable, used by marks, cards and dots ---- */
.st-hl-y{--st-c:250,204,21}
.st-hl-g{--st-c:74,190,120}
.st-hl-b{--st-c:86,160,240}
.st-hl-p{--st-c:240,120,170}
mark.st-hl{background:rgba(var(--st-c),.42);color:inherit;border-radius:2px;cursor:pointer;
  -webkit-box-decoration-break:clone;box-decoration-break:clone}
mark.st-hl:hover{background:rgba(var(--st-c),.6)}
mark.st-hl:focus-visible{outline:2px solid var(--brand);outline-offset:1px}
mark.st-hl.st-noted{border-bottom:2px solid rgb(var(--st-c))}
mark.st-hl.st-noted.st-hl-end::after{content:"\1F4DD";font-size:.68em;vertical-align:super;margin-left:2px}
/* Someone else's highlight: underlined, not filled, so it never looks like the reader's own. */
mark.st-hl.st-shared{background:rgba(var(--st-c),.14);border-bottom:2px dashed rgb(var(--st-c))}
html[data-theme="dark"] mark.st-hl{background:rgba(var(--st-c),.34)}
body.a11y-contrast mark.st-hl{outline:1px solid #000}
mark.st-flash,.st-flash{animation:st-flash 2.4s ease-out}
@keyframes st-flash{0%,35%{box-shadow:0 0 0 4px rgba(201,162,39,.7)}100%{box-shadow:0 0 0 4px rgba(201,162,39,0)}}
@media(prefers-reduced-motion:reduce){mark.st-flash,.st-flash{animation:none;outline:3px solid var(--accent)}}
body.a11y-reduce-motion mark.st-flash,body.a11y-reduce-motion .st-flash{animation:none;outline:3px solid var(--accent)}

/* ---- the sentence being read aloud, and a search hit just opened ---- */
::highlight(atlas-reading){background-color:rgba(27,77,143,.2)}
html[data-theme="dark"] ::highlight(atlas-reading){background-color:rgba(95,149,217,.38)}
::highlight(atlas-find){background-color:rgba(255,170,0,.55);color:#12203a}
.st-reading{background:var(--brand-light);box-shadow:-4px 0 0 var(--brand);border-radius:3px}

/* ---- bars that float above the page ---- */
.st-select,.st-player,.st-toast{position:fixed;left:12px;right:12px;margin:0 auto;width:-moz-fit-content;width:fit-content;display:flex;align-items:center;gap:4px;
  background:#12203a;color:#fff;border-radius:12px;box-shadow:var(--shadow-lg);padding:6px;max-width:calc(100vw - 24px)}
.st-select[hidden],.st-player[hidden]{display:none}
.st-select{bottom:84px;z-index:82}
.st-player{bottom:22px;z-index:75;flex-wrap:wrap;justify-content:center}
.st-select button,.st-player button{font:inherit;font-size:.9rem;font-weight:700;color:#fff;background:transparent;border:none;
  border-radius:8px;padding:9px 13px;cursor:pointer;white-space:nowrap}
.st-select button:hover,.st-player button:hover{background:rgba(255,255,255,.16)}
.st-select button:focus-visible,.st-player button:focus-visible{outline:2px solid #fff;outline-offset:-2px}
.st-player-t{font-size:.86rem;padding:0 10px 0 8px;max-width:26ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.st-toast{bottom:84px;z-index:320;padding:11px 16px;font-size:.92rem;gap:10px;opacity:0;pointer-events:none;transition:opacity .2s ease}
.st-toast.show{opacity:1;pointer-events:auto}
.st-toast .st-link{color:#ffd966}
@media(max-width:700px){
  /* Clear of the accessibility and back-to-top buttons in the bottom corners. */
  .st-player{bottom:80px;flex-wrap:nowrap}
  .st-player-t{display:none}   /* the lesson is named on the page; the four controls then fit one row */
  .st-player button{padding:9px 9px;font-size:.86rem}
  .st-select,.st-toast{bottom:140px}
}

/* ---- dialogs ---- */
.st-back{position:fixed;inset:0;z-index:300;background:rgba(12,22,44,.5)}
.st-dialog{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:301;width:min(520px,calc(100vw - 24px));
  max-height:calc(100vh - 32px);overflow:auto;background:var(--paper);color:var(--ink);border:1px solid var(--line);
  border-radius:14px;box-shadow:var(--shadow-lg);padding:18px 20px 20px}
.st-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.st-dialog-head h2{font-size:1.2rem;margin:0}
.st-x{font:inherit;font-size:1.05rem;background:none;border:none;color:var(--muted);cursor:pointer;padding:4px 8px;border-radius:8px}
.st-x:hover{background:var(--bg-tint)}
.st-dialog p{margin:0 0 10px}
.st-field{display:block;font-weight:700;font-size:.9rem;margin:12px 0 0}
.st-field[hidden]{display:none}
.st-opt{font-weight:400;color:var(--muted)}
.st-field textarea,.st-field input,.st-row input{display:block;width:100%;margin-top:6px;border:1px solid var(--line);border-radius:9px;
  padding:10px 13px;font:inherit;font-size:.98rem;font-weight:400;line-height:1.5;color:var(--ink);background:var(--bg)}
.st-field textarea{resize:vertical;min-height:96px}
.st-field input[type="file"]{padding:8px;background:var(--paper)}
.st-field textarea:focus,.st-field input:focus,.st-row input:focus{outline:2px solid var(--brand);outline-offset:1px;border-color:var(--brand)}
.st-actions{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0 4px}
.st-actions .btn[disabled]{opacity:.5;cursor:not-allowed;transform:none}
.st-hint{font-size:.86rem;color:var(--muted)}
.st-status{font-size:.92rem;font-weight:600;color:var(--ink-soft);margin:10px 0}
.st-status:empty{display:none}
.st-quote{margin:0 0 6px;padding:8px 14px;border-left:4px solid rgb(var(--st-c));background:rgba(var(--st-c),.14);border-radius:0 8px 8px 0;
  max-height:9.5em;overflow:auto;font-size:.95rem}
.st-shared-note{white-space:pre-wrap}
.st-colors{display:flex;gap:10px;margin:12px 0 0}
.st-dot{width:30px;height:30px;border-radius:50%;border:2px solid var(--line);background:rgb(var(--st-c));cursor:pointer;padding:0}
.st-dot[aria-pressed="true"]{border-color:var(--ink);box-shadow:0 0 0 2px var(--paper),0 0 0 4px var(--ink)}
.st-link{font:inherit;font-size:.88rem;font-weight:600;color:var(--brand);background:none;border:none;padding:2px 0;cursor:pointer;text-decoration:underline}
.st-preview{margin:0 0 10px;padding-left:1.1em;font-size:.92rem;color:var(--ink-soft)}

/* ---- search, glossary and notebook views ---- */
.st-view .lv-head{margin-bottom:14px}
/* The heading takes focus when the view opens, so a screen reader starts there; it is not a control. */
.st-view .lv-title:focus{outline:none}
.st-row{display:flex;gap:8px;align-items:stretch}
.st-row input{margin-top:6px;flex:1;min-width:0}
.st-row .btn{margin-top:6px}
.st-result{border-top:1px solid var(--line-soft);padding:12px 0 6px}
.st-result h3{font-family:var(--font);font-size:1.02rem;margin:0 0 6px}
.st-n{font-size:.78rem;font-weight:600;color:var(--muted);margin-left:6px;white-space:nowrap}
.st-term{font-size:.94rem;margin:0 0 6px;color:var(--ink-soft)}
.st-hit{display:block;width:100%;text-align:left;font:inherit;font-size:.94rem;line-height:1.5;color:var(--ink-soft);background:var(--paper);
  border:1px solid var(--line);border-radius:9px;padding:9px 12px;margin:6px 0;cursor:pointer}
.st-hit:hover{background:var(--bg-tint);border-color:var(--brand)}
.st-view mark:not(.st-hl){background:rgba(250,204,21,.5);color:inherit;border-radius:2px;padding:0 1px}
.st-more{font-size:.84rem;color:var(--muted);margin:2px 0 0}
.st-az{display:flex;flex-wrap:wrap;gap:4px;margin:6px 0 4px}
.st-az[hidden]{display:none}
.st-az a{min-width:32px;text-align:center;padding:5px 6px;border:1px solid var(--line);border-radius:8px;font-weight:700;font-size:.9rem}
.st-az a:hover{background:var(--brand-light);text-decoration:none}
/* The site pads every <section> for its home page bands; these are small groups inside a view. */
.st-gl-group{scroll-margin-top:84px;padding:0}
.st-gl-group h3{font-size:1.25rem;color:var(--brand-dark);border-bottom:2px solid var(--line-soft);padding-bottom:4px;margin:20px 0 8px}
.st-gl-group dl{margin:0}
.st-gl dt{font-weight:700}
.st-gl dd{margin:0 0 12px;color:var(--ink-soft)}
.st-gl-in{font-size:.82rem;white-space:nowrap;margin-left:4px}
.st-private{background:var(--bg-tint);border-radius:10px;padding:10px 14px}
.st-empty{border:1px dashed var(--line);border-radius:12px;padding:14px 18px;margin-top:14px}
.st-empty ul{margin:0;padding-left:1.2em}
.st-h{font-family:var(--font);font-size:.8rem;text-transform:uppercase;letter-spacing:.08em;color:var(--brand);margin:22px 0 8px}
.st-bms{list-style:none;margin:0;padding:0}
.st-bms li{padding:5px 0}
.st-group{border-top:1px solid var(--line-soft);padding:12px 0 0;margin-top:12px}
.st-group h4{font-size:1.02rem;margin:0 0 8px}
.st-items{list-style:none;margin:0;padding:0}
.st-item,.st-lnote{border:1px solid var(--line);border-left:4px solid rgb(var(--st-c,95,108,132));border-radius:0 10px 10px 0;
  padding:9px 13px;margin:8px 0;background:var(--paper)}
.st-item.st-shared{border-left-style:dashed}
.st-item q{display:block;quotes:none;color:var(--ink)}
.st-item-note{margin:6px 0 0;white-space:pre-wrap;color:var(--ink-soft)}
.st-item-note::before{content:"\1F4DD  "}
.st-item .st-hint{margin:6px 0 0}
.st-item-acts{display:flex;flex-wrap:wrap;gap:4px 16px;margin-top:6px}
.st-by{display:block;font-size:.74rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-bottom:3px}

/* ---- print: the tools stay off paper; "Print" in the notebook prints only the notebook ---- */
@media print{
  .st-ui,.st-noprint,.st-view{display:none !important}
  mark.st-hl{background:rgba(var(--st-c),.42) !important;border-bottom:1.5px solid rgb(var(--st-c));-webkit-print-color-adjust:exact;print-color-adjust:exact}
  body.st-printing .lesson-view,body.st-printing .course-topbar,body.st-printing .site-header,body.st-printing .site-footer{display:none !important}
  body.st-printing #lesson-notebook{display:block !important}
}
