/* Workbook leader guide readers. build.py links this file only for the two guide pages, after
   reference-system.css and site-refinement.css, and every value comes from their tokens. The intro reuses the
   book page (.book-detail, .facts, .book-actions, .related-resource); gd- classes cover the reader.
   The markup is generated by export_workbook_guides.py. */
.site-page.workbook-guide-page { --page-width:var(--measure-display); --gutter:var(--space-10); --guide-side:240px; --guide-gap:var(--space-12); }
.workbook-guide-page .subpage { padding-block:var(--space-8) var(--space-16); }
:where(.workbook-guide-page) :where(h3,h4,h5,dl,dd,figure,blockquote,fieldset,form) { margin:0; }
:where(.workbook-guide-page) :where(fieldset) { min-width:0; padding:0; border:0; }
:where(.workbook-guide-page) :where(legend) { padding:0; }
:where(.workbook-guide-page) :where(input,button) { font:inherit; }
:where(.workbook-guide-page) :where(li,h3,h4,h5,dt,legend,label) { word-break:keep-all; }
.gd-sr { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0; }

/* Introduction: the book page layout with the guide's facts and actions. */
.gd-intro,.gd-layout { max-width:calc(var(--guide-side) + var(--guide-gap) + var(--measure-reading)); }
.workbook-guide-page .gd-intro { column-gap:var(--guide-gap); padding-block:var(--space-2) var(--space-12); }
.gd-intro .book-detail-copy { max-width:var(--measure-reading); }
.gd-intro .book-description { margin-top:var(--space-4); }
.gd-facts { margin:var(--space-6) 0 0; }
.gd-facts>div { margin-bottom:var(--space-1); }
.gd-intro .primary-link { gap:0; }
.gd-size { margin-left:var(--space-2); font-weight:400; font-variant-numeric:tabular-nums; }
.gd-intro-links { display:flex; flex-wrap:wrap; gap:0 var(--space-6); }
.gd-button { display:inline-flex; align-items:center; justify-content:center; min-height:var(--target-control); max-width:100%; margin:0; padding:10px 24px; border:1px solid var(--ink); border-radius:var(--radius-action); background:var(--paper); color:var(--ink); font-size:var(--text-control); font-weight:500; line-height:1.6; text-align:center; white-space:normal; cursor:pointer; }
.gd-button:hover { background:var(--surface-ash); }
.gd-button:focus-visible { outline:2px solid var(--ink); outline-offset:3px; }
.gd-button[hidden] { display:none; }
.gd-print { display:none; }
.gd-js .gd-print { display:inline-flex; }

/* Contents and reading column. One block column until the desktop grid below. */
.gd-layout { display:block; }
.gd-article { min-width:0; max-width:var(--measure-reading); }
.gd-side { position:relative; min-width:0; }
.gd-side__toggle { display:none; }
.gd-toc { margin-bottom:var(--space-12); padding-block:var(--space-4); border-block:1px solid var(--line); }
.gd-toc__title { padding-bottom:var(--space-2); font-size:var(--text-caption); font-weight:600; color:var(--muted); }
.gd-toc ol { margin:0; padding:0; list-style:none; }
.gd-toc a { display:flex; align-items:flex-start; gap:var(--space-2); min-height:var(--target-control); padding:10px var(--space-2); border-radius:4px; font-size:var(--text-caption); line-height:1.6; color:var(--ink); }
.gd-toc a:hover { background:var(--surface-ash); color:var(--ink); }
.gd-toc a:focus-visible { outline:2px solid var(--ink); outline-offset:-2px; }
.gd-toc a[aria-current="location"] { background:var(--surface-ash); box-shadow:inset 2px 0 0 var(--ink); }
.gd-toc__no { flex-shrink:0; min-width:3.25em; color:var(--muted); font-variant-numeric:tabular-nums; }
.gd-toc__unit>a { margin-top:var(--space-2); font-weight:500; }
.gd-toc__lessons a { padding-left:var(--space-6); }
.gd-toc__lessons .gd-toc__no { min-width:2.75em; }

/* Sections and prose */
.gd-section { padding-block:var(--space-12); border-top:1px solid var(--line); }
.gd-article>.gd-section:first-child { padding-top:0; border-top:0; }
.gd-h2 { font-size:var(--text-section); font-weight:600; line-height:1.5; letter-spacing:-.025em; text-wrap:pretty; }
.gd-h3 { margin-top:var(--space-8); font-size:var(--text-body); font-weight:600; line-height:1.6; }
.gd-p { margin-top:var(--space-4); line-height:1.85; }
.gd-h3+.gd-p { margin-top:var(--space-2); }
.gd-list { margin:var(--space-4) 0 0; padding-left:var(--space-6); list-style:disc outside; }
.gd-list li { line-height:1.85; }
.gd-list li+li { margin-top:var(--space-2); }
.gd-terms { margin-top:var(--space-6); }
.gd-terms>div { padding-block:var(--space-4); border-top:1px solid var(--line); }
.gd-terms>div:last-child { border-bottom:1px solid var(--line); }
.gd-terms dt { font-weight:500; line-height:1.7; }
.gd-terms dd { margin-top:var(--space-1); line-height:1.85; }
.gd-note,.gd-verse,.gd-unit__closing { padding-left:var(--space-4); border-left:2px solid var(--ink); }
.gd-note { margin-top:var(--space-6); }
.gd-note p { line-height:1.85; }
.gd-note__link a,.gd-unit__reading a,.gd-book__title a,.gd-lesson__back { display:inline-flex; align-items:center; min-height:var(--target-control); text-decoration:underline; text-underline-offset:.2em; text-decoration-thickness:1px; }
.gd-verse { margin-top:var(--space-8); }
.gd-verse__text { font-size:var(--text-lead); font-weight:500; line-height:1.7; }
.gd-verse__ref { margin-top:var(--space-2); font-size:var(--text-caption); color:var(--muted); }

/* Preparation checklist */
.gd-check-group { margin-top:var(--space-6); }
.gd-check-group__title { font-size:var(--text-caption); font-weight:600; color:var(--muted); }
.gd-check { display:flex; align-items:flex-start; gap:var(--space-3); min-height:var(--target-row); padding-block:var(--space-3); border-bottom:1px solid var(--line); cursor:pointer; }
.gd-check-group__title+.gd-check { margin-top:var(--space-1); border-top:1px solid var(--line); }
.gd-check__box { flex-shrink:0; width:20px; height:20px; margin:6px 0 0; accent-color:var(--ink); cursor:pointer; }
.gd-check__label { flex:1; min-width:0; line-height:1.85; }
.gd-check__term { font-weight:600; }
.gd-checklist__tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--space-3) var(--space-6); margin-top:var(--space-6); }
.gd-checklist__hint { font-size:var(--text-caption); color:var(--muted); }

/* Lesson guide: legend, quick jump and search */
.gd-legend { margin-top:var(--space-6); }
.gd-legend__item { padding-block:var(--space-3); border-top:1px solid var(--line); }
.gd-legend__item:last-child { border-bottom:1px solid var(--line); }
.gd-legend dt { font-weight:600; }
.gd-legend dd { margin-top:var(--space-1); font-size:var(--text-caption); line-height:1.8; }
.gd-part__en { margin-left:var(--space-1); font-size:var(--text-caption); font-weight:400; color:var(--muted); }
.gd-jump { margin-top:var(--space-8); }
.gd-jump__title { font-size:var(--text-caption); font-weight:600; color:var(--muted); }
.gd-jump__list { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--space-1); margin:var(--space-2) 0 0; padding:0; list-style:none; }
.gd-jump__link { display:flex; align-items:center; justify-content:center; min-height:var(--target-control); border-radius:4px; font-size:var(--text-control); font-variant-numeric:tabular-nums; white-space:nowrap; }
.gd-jump__link:hover { background:var(--surface-ash); color:var(--ink); }
.gd-jump__link:focus-visible { outline:2px solid var(--ink); outline-offset:-2px; }
.gd-search { display:none; margin-top:var(--space-8); }
.gd-js .gd-search { display:block; }
.gd-search__label { display:block; font-weight:600; }
.gd-search__hint { margin-top:var(--space-1); font-size:var(--text-caption); line-height:1.8; color:var(--muted); }
.gd-search__row { display:flex; gap:var(--space-2); margin-top:var(--space-3); }
.gd-search__input { flex:1; min-width:0; min-height:48px; padding:0 var(--space-4); border:1px solid var(--ink); border-radius:4px; background:var(--paper); color:var(--ink); font-size:var(--text-control); -webkit-appearance:none; appearance:none; }
.gd-search__input::placeholder { color:var(--muted); opacity:1; }
.gd-search__input:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.gd-search__reset { flex-shrink:0; min-height:48px; }
.gd-search__status { margin-top:var(--space-2); font-size:var(--text-caption); line-height:1.8; }
.gd-search__status:empty { display:none; }
.gd-empty { margin-top:var(--space-6); padding-block:var(--space-6); border-block:1px solid var(--line); }
.gd-empty[hidden] { display:none; }
.gd-empty__title { font-weight:600; }
.gd-empty__text { margin-top:var(--space-2); line-height:1.85; }
.gd-empty__button { margin-top:var(--space-4); }

/* Units and lessons */
.gd-unit { margin-top:var(--space-16); }
.gd-unit__head { padding-top:var(--space-6); border-top:1px solid var(--ink); }
.gd-unit__num { display:block; font-size:var(--text-caption); font-weight:500; color:var(--muted); font-variant-numeric:tabular-nums; }
.gd-unit__title { font-size:var(--text-section); font-weight:500; line-height:1.55; letter-spacing:-.025em; text-wrap:pretty; }
.gd-unit__summary { margin-top:var(--space-3); line-height:1.85; }
.gd-unit__reading { margin-top:var(--space-2); font-size:var(--text-caption); color:var(--muted); }
.gd-unit__reading a { margin-left:var(--space-2); color:var(--ink); }
.gd-lesson { margin-top:var(--space-10); padding-top:var(--space-8); border-top:1px solid var(--line); }
.gd-unit__head+.gd-lesson { margin-top:var(--space-8); }
.gd-lesson__title { font-size:var(--text-lead); font-weight:500; line-height:1.6; letter-spacing:-.02em; text-wrap:pretty; }
.gd-lesson__num { display:block; font-size:var(--text-caption); font-weight:400; color:var(--muted); font-variant-numeric:tabular-nums; }
.gd-lesson__refs { margin-top:var(--space-3); font-size:var(--text-caption); line-height:1.8; }
.gd-lesson__refs>div { display:grid; grid-template-columns:7em minmax(0,1fr); gap:var(--space-4); }
.gd-lesson__refs dt { color:var(--muted); }
.gd-lesson__focus { margin-top:var(--space-4); line-height:1.85; }
.gd-parts { margin-top:var(--space-6); }
.gd-part+.gd-part { margin-top:var(--space-6); }
.gd-part__title { font-size:var(--text-body); font-weight:600; line-height:1.6; }
.gd-part__list { margin:var(--space-2) 0 0; padding-left:var(--space-6); }
ol.gd-part__list { list-style:decimal outside; }
ul.gd-part__list { list-style:disc outside; }
.gd-part__list li { padding-left:var(--space-1); line-height:1.85; }
.gd-part__list li+li { margin-top:var(--space-3); }
.gd-part__list li::marker { color:var(--muted); font-variant-numeric:tabular-nums; }
.gd-lesson__foot { margin-top:var(--space-3); }
.gd-lesson__back { font-size:var(--text-caption); color:var(--muted); }
.gd-unit__closing { margin-top:var(--space-10); }
.gd-unit__closing-title { font-size:var(--text-body); font-weight:600; line-height:1.6; }
.gd-unit__closing p { margin-top:var(--space-2); line-height:1.85; }

/* Search states. Print styles below always show every lesson. */
.gd-lesson.is-filtered,.gd-unit.is-empty { display:none; }
.gd-searching .gd-unit__closing { display:none; }
::highlight(gd-search) { background-color:#25274329; color:#252743; }

/* References, purchase links and related pages */
.gd-books__group .gd-h3 { margin-top:var(--space-8); }
.gd-books,.gd-links { margin:var(--space-3) 0 0; padding:0; list-style:none; }
.gd-book,.gd-links li { border-top:1px solid var(--line); }
.gd-book:last-child,.gd-links li:last-child { border-bottom:1px solid var(--line); }
.gd-book { padding-block:var(--space-2) var(--space-4); }
.gd-book__title a { font-weight:500; }
.gd-book__meta { font-size:var(--text-caption); color:var(--muted); }
.gd-book__text { margin-top:var(--space-1); line-height:1.85; }
.gd-links { margin-top:var(--space-6); }
.gd-links__link { display:flex; flex-wrap:wrap; align-items:baseline; gap:0 var(--space-4); min-height:var(--target-row); padding-block:var(--space-3); }
.gd-links__label { font-weight:500; }
.gd-links__text { font-size:var(--text-caption); color:var(--muted); }
.gd-article .related-resource { margin-top:0; }

/* Below the desktop width the contents become a bar that stays at the top while reading. */
@media (max-width:1000px) {
 .gd-js:has(.workbook-guide-page) { scroll-padding-top:80px; }
 .gd-js .gd-side { position:sticky; top:0; z-index:20; margin:0 calc(-1 * var(--gutter)) var(--space-8); padding-inline:var(--gutter); background:var(--paper); border-block:1px solid var(--line); }
 .gd-js .gd-side__toggle { display:flex; align-items:center; gap:var(--space-3); width:100%; min-height:var(--target-row); padding:0; border:0; background:transparent; color:var(--ink); font-size:var(--text-control); font-weight:500; text-align:left; cursor:pointer; }
 .gd-side__toggle:focus-visible { outline:2px solid var(--ink); outline-offset:-2px; }
 .gd-side__label { flex-shrink:0; }
 .gd-side__current { flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:var(--text-caption); font-weight:400; color:var(--muted); }
 .gd-side__toggle::after { content:""; flex:none; width:.5em; height:.5em; margin:0 var(--space-1) .25em auto; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); transition:transform .15s ease; }
 .gd-side__toggle[aria-expanded="true"]::after { margin-bottom:-.25em; transform:rotate(-135deg); }
 .gd-js .gd-toc { display:none; position:absolute; top:100%; left:0; right:0; max-height:calc(100vh - 80px); max-height:calc(100dvh - 80px); margin:0; padding:var(--space-2) var(--gutter) var(--space-6); overflow-y:auto; overscroll-behavior:contain; background:var(--paper); border-top:0; border-bottom:1px solid var(--line); box-shadow:0 12px 40px #15182a26; }
 .gd-js .gd-side.is-open .gd-toc { display:block; }
 .gd-js .gd-toc__title { display:none; }
}
@media (min-width:561px) {
 .gd-jump__list { grid-template-columns:repeat(8,minmax(0,1fr)); }
}
@media (min-width:761px) and (max-width:1000px) {
 .site-page.workbook-guide-page { --gutter:var(--space-8); }
}
@media (max-width:760px) {
 .site-page.workbook-guide-page { --gutter:var(--space-6); }
 .workbook-guide-page .subpage { padding-block:var(--space-6) var(--space-12); }
 .workbook-guide-page .gd-intro { padding-bottom:var(--space-8); }
 .gd-intro .gd-facts,.gd-intro .gd-intro-links { grid-column:1 / -1; }
 .gd-section { padding-block:var(--space-10); }
 .gd-unit { margin-top:var(--space-12); }
 .gd-lesson { margin-top:var(--space-8); padding-top:var(--space-6); }
 .gd-search__row { flex-wrap:wrap; }
}
@media (max-width:350px) {
 .site-page.workbook-guide-page { --gutter:20px; }
}

/* Desktop: contents beside the reading column */
@media (min-width:1001px) {
 .gd-layout { display:grid; grid-template-columns:var(--guide-side) minmax(0,var(--measure-reading)); column-gap:var(--guide-gap); }
 .gd-side { position:sticky; top:var(--space-6); align-self:start; max-height:calc(100vh - var(--space-12)); overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; }
 .gd-toc { margin:0; padding-block:0 var(--space-4); border:0; }
}

@media (prefers-reduced-motion:reduce) {
 .gd-side__toggle::after { transition:none; }
}
@media (forced-colors:active) {
 .gd-toc a[aria-current="location"] { outline:2px solid CanvasText; outline-offset:-2px; }
 .gd-button,.gd-search__input { border:1px solid ButtonText; }
}

/* Print: every lesson, regardless of the on-screen search; no navigation or controls */
@media print {
 @page { margin:16mm 14mm; }
 .site-page.workbook-guide-page { --gutter:0px; }
 .workbook-guide-page .skip,.workbook-guide-page .site-header,.workbook-guide-page .site-menu,.workbook-guide-page .noscript-navigation,.workbook-guide-page .site-footer,
 .workbook-guide-page .breadcrumb,.gd-intro .book-detail-cover,.gd-intro .book-actions,.gd-intro-links,.gd-side,.gd-jump,.gd-search,.gd-empty,
 .gd-checklist__tools,.gd-lesson__foot,.gd-unit__reading,.workbook-guide-page .related-resource { display:none !important; }
 .gd-lesson.is-filtered,.gd-unit.is-empty,.gd-searching .gd-unit__closing { display:block !important; }
 .workbook-guide-page .subpage { padding:0; }
 .workbook-guide-page .gd-intro { display:block; max-width:none; padding:0 0 12pt; border-bottom:1px solid var(--ink); }
 .gd-layout { display:block; max-width:none; }
 .gd-article { max-width:none; }
 .gd-section { padding-block:16pt; }
 .gd-unit { margin-top:0; break-before:page; }
 .gd-lesson { margin-top:16pt; padding-top:12pt; }
 .gd-part,.gd-check,.gd-book,.gd-unit__closing,.gd-terms>div,.gd-legend__item { break-inside:avoid; }
 .gd-h2,.gd-h3,.gd-unit__head,.gd-lesson__head,.gd-part__title,.gd-check-group__title { break-after:avoid; }
 .gd-book__title a::after,.gd-links__link::after { content:" " attr(href); font-size:8pt; font-weight:400; color:var(--muted); overflow-wrap:anywhere; }
 ::highlight(gd-search) { background-color:transparent; color:inherit; }
}
