/* Lesson pages, the offline page, and the home page's offline panel. Builds on styles.css. */

/* ---------- Lesson pages ---------- */
.lesson-page { max-width: 46rem; padding-block: clamp(2rem, 6vw, 3.5rem); }
.lesson-page h1 { margin: .2rem 0 1rem; font-family: var(--serif); font-size: clamp(2rem, 5.5vw, 2.9rem); line-height: 1.15; letter-spacing: -.02em; }
/* A plain task symbol at the start of some lesson titles (scripts/lesson-icons.mjs). It sits in the title's
   own line, so it adds no row, and it is not a control: no box, colour or pointer. Left out of print. */
.lesson-icon { display: inline-block; width: .85em; height: .85em; margin-right: .3em; vertical-align: -.08em; }
.lesson-page h2 { margin: 2rem 0 .75rem; font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0 0 .8rem; padding: 0; list-style: none; font-size: 1.05rem; font-weight: 600; }
.breadcrumbs li + li::before { content: "\203A"; content: "\203A" / ""; margin-right: .5rem; color: var(--ink-soft); }
.note-body > :first-child { margin-top: 0; }
.note-body > :last-child { margin-bottom: 0; }
.note-body p { margin: 0 0 1.1rem; }
.note-body ol { margin: 0 0 1.25rem; padding-left: 2.2rem; }
.note-body ol > li { margin-bottom: 1rem; padding-left: .35rem; }
.note-body ol > li::marker { font-weight: 700; font-size: 1.1em; color: var(--green-dark); }
.note-body strong { color: var(--ink); }
.note-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* A key to press, written <kbd>Shift</kbd> in a handout: a raised key with a rounded border and a thicker
   lower edge. Not a control: it has the text's own colour on a light face, no green, no underline and no
   pointer. Sizes are in em, so it grows with Larger text. */
kbd {
  display: inline-block; margin: 0 .08em; padding: 0 .4em; min-width: 1.6em;
  border: 1.5px solid var(--ink-soft); border-bottom-width: 3.5px; border-radius: .3em;
  background: var(--card); color: var(--ink);
  font: inherit; font-size: .92em; font-weight: 700; line-height: 1.35; text-align: center;
  white-space: nowrap; vertical-align: .05em; cursor: inherit;
}
/* A keyboard picture inside a step (tools/keyboard/). It is not a link, so a click keeps the reader on the lesson. */
.key-picture { margin: .75rem 0 .25rem; }
.key-picture img { display: block; width: 100%; max-width: 30rem; height: auto; }
.key-picture figcaption { margin-top: .35rem; font-size: 1rem; color: var(--ink-soft); }
@media (forced-colors: active) {
  kbd { border-color: CanvasText; }
}

/* A lesson in the guide layout: the computer and step count, the title, Print, then the handout with its
   parts set apart (scripts/build-notes.mjs marks them). */
.guide-main .lesson-page { padding-block: 0; }
.lesson-page .lesson-meta { margin-bottom: .5rem; }
.guide-main .note-actions { margin: 0 0 1.75rem; }
.lesson-need, .lesson-before { padding: .15rem 0 .15rem 1.1rem; border-left: 4px solid var(--brass); }
.lesson-page h2.steps-title { margin: 1.75rem 0 .9rem; }
.lesson-result { margin-top: 1.5rem; padding: 1rem 1.25rem; background: var(--green-wash); border-top: 4px solid var(--green); border-radius: 0 0 8px 8px; }
.lesson-updated { margin: 1rem 0 0; color: var(--ink-soft); }
/* The site's name on a printed lesson only (see @media print). */
.print-source { display: none; }
.lesson-list-page { max-width: none; }

.note-group { margin-top: 2rem; }
.note-group-link { margin: -.25rem 0 1rem; font-weight: 600; }
.note-other-system { margin-top: 2rem; font-weight: 600; }

/* Other lessons on the same topic, below a lesson. Navigation only, so it is not printed. */
.related-lessons { max-width: 46rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 3px solid var(--rule); }
/* Beside a lesson on a wide screen, the sidebar already lists these. */
@media (min-width: 52.0625rem) { .guide-main .related-lessons { display: none; } }
.related-lessons h2 { margin: 0 0 .75rem; font-family: var(--serif); font-size: 1.6rem; line-height: 1.2; }
.related-lessons p { margin: 1rem 0 0; font-weight: 600; }
.note-list { margin: 0; padding-left: 1.4rem; }
.note-list li { margin-bottom: .6rem; }
.note-list a { font-weight: 600; }

/* ---------- Home page: lesson request ---------- */
.request-more { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 2rem; }
.request-more p { margin: 0; font-weight: 600; }

/* ---------- Home page: offline panel ---------- */
.offline-panel { padding-block: clamp(2.5rem, 6vw, 4rem); }
.offline-box { max-width: 46rem; background: var(--card); border: 3px solid var(--ink); border-radius: 14px; padding: clamp(1.25rem, 4vw, 2rem); }
.offline-box h2 { margin: 0 0 .5rem; font-family: var(--serif); font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.2; }
.offline-box p { margin: 0 0 1rem; }
.offline-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0 .5rem; }
.offline-actions .btn[disabled] { opacity: .6; cursor: progress; }
.offline-box .status { font-weight: 600; color: var(--ink); }
.offline-box .hint { color: var(--ink-soft); }

/* ---------- Offline page ---------- */
.offline-banner { display: flex; gap: 1.25rem; align-items: flex-start; }
.offline-banner svg { width: 4.5rem; height: 4.5rem; flex: none; margin-top: .4rem; }
.offline-banner p { margin: 0 0 1rem; color: var(--ink-soft); font-size: 1.3rem; }
.back-online { margin: 0 0 1rem; padding: .75rem 1rem; background: var(--green-wash); border-left: 6px solid var(--green); font-weight: 700; }
#saved-lessons h2:first-child { margin-top: 1.5rem; }
@media (max-width: 30rem) {
  .offline-banner { flex-direction: column; gap: .5rem; }
}

/* ---------- Lesson pages: practice on a pretend computer ---------- */
.demo-start { margin-top: 2rem; padding: clamp(1.25rem, 4vw, 1.75rem); background: var(--green-wash); border: 3px solid var(--green); border-radius: 12px; }
.demo-start h2 { margin-top: 0; }
.demo-start p { margin: 0 0 1rem; }

/* ---------- Computer words: one page per word, and the list of words (scripts/build-notes.mjs) ---------- */
.word-picture { margin: 0 0 1.25rem; padding: clamp(.75rem, 3vw, 1.25rem); background: var(--card); border: 2px solid var(--rule); border-radius: 12px; }
.word-picture img { display: block; width: 100%; height: auto; }
.word-lessons h2 { margin-top: 2rem; }
.word-more { margin: 2rem 0 0; font-weight: 600; }
.word-list { margin: 1.5rem 0 0; }
.word-list > div { padding: .9rem 0; border-top: 2px solid var(--rule); }
.word-list dt { font-size: 1.3rem; font-weight: 700; }
.word-list dd { margin: .2rem 0 0; }

/* ---------- Print: just the steps, large and plain ---------- */
@media print {
  .site-header, .site-footer, .skip-link, .breadcrumbs, .note-actions, .guide-sidebar, .offline-panel, .demo-start, .related-lessons, .lesson-updated, .lesson-icon, .word-lessons, .word-more { display: none !important; }
  .word-picture { background: #fff; border: 1.5px solid #000; break-inside: avoid; }
  .guide-layout { display: block; width: auto; padding: 0; }
  .lesson-need, .lesson-before { border-left-color: #000; }
  .lesson-result { background: #fff; border: 1.5px solid #000; border-radius: 0; }
  body { background: #fff; font-size: 14pt; }
  .lesson-page { max-width: none; padding: 0; }
  .note-body { border: 0; padding: 0; background: #fff; }
  .lesson-page .eyebrow { color: #000; }
  .lesson-page h1 { margin-top: 0; }
  kbd { border-color: #000; background: #fff; color: #000; }
  .key-picture { break-inside: avoid; }
  .key-picture figcaption { color: #000; }
  .lesson-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 1.5rem; }
  .print-source { display: block; margin: 0; font-size: 12pt; font-weight: 700; letter-spacing: .02em; color: #000; }
}
