/* ============================================================
   COURSE — Orbital Ranch Studios
   Course-only styles. Layers on top of styles.css (chrome +
   tokens), library.css (.lib-post* article body) and
   tools.css (.hub-* path/step furniture). Nothing here
   redefines anything those three own.
   Ed. 01 / 2026
   ============================================================ */

/* ---------- progress panel (course hub) ---------- */

.course-progress-panel {
  border: 1px solid var(--ors-line-strong);
  background: var(--ors-glass);
  border-radius: 4px;
  padding: 26px 28px 24px;
  margin: 0 0 34px;
  position: relative;
  overflow: hidden;
}

.course-progress-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--ors-cyan), var(--ors-magenta));
}

.course-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.course-progress-head .hub-label { margin: 0; }

.course-progress-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ors-lime);
  white-space: nowrap;
}

.course-progress-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.25;
  margin: 10px 0 18px;
  color: var(--ors-ink);
}

.course-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--ors-line);
  overflow: hidden;
}

.course-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ors-cyan), var(--ors-magenta) 70%, var(--ors-lime));
  transition: width 0.35s ease;
}

.course-progress-note {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.75;
  letter-spacing: 0.02em;
  color: var(--ors-dim);
  margin: 14px 0 0;
}

.course-progress-note code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ors-ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ors-line);
  border-radius: 3px;
  padding: 1px 5px;
}

.course-progress-reset {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ors-cyan);
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(37, 99, 255, 0.5);
  padding: 0 0 1px;
  margin-left: 4px;
  cursor: pointer;
}

.course-progress-reset:hover { color: var(--ors-magenta); border-bottom-color: var(--ors-magenta); }

/* ---------- part dividers inside the lesson path ---------- */

.course-path { counter-reset: none; }

.course-part-break {
  list-style: none;
  margin: 44px 0 10px;
  padding: 0;
  border: 0;
  background: none;
}

.course-part-break::before,
.course-part-break::marker { content: none; }

.course-part {
  border-top: 1px solid var(--ors-line-strong);
  padding-top: 20px;
}

.course-part-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--ors-lime);
  margin-bottom: 8px;
}

.course-part h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.8vw, 28px);
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--ors-ink);
}

.course-part p {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ors-dim);
  margin: 0;
  max-width: 60ch;
}

/* ---------- completed-lesson state on the syllabus ---------- */

.course-step-check {
  display: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ors-lime);
  margin-left: 14px;
  white-space: nowrap;
}

.course-step.is-done .course-step-check { display: inline; }
.course-step.is-done .hub-step-num { color: var(--ors-lime); opacity: 1; }
.course-step.is-done .hub-step-body > h2 { opacity: 0.72; }

/* ---------- lesson page: byline + position rail ---------- */

.course-byline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ors-dim);
  margin-top: 14px;
}

.course-rail {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 760px;
  margin: 26px auto 0;
  padding: 0 4px;
}

.course-rail-track {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.course-rail-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--ors-cyan), var(--ors-magenta));
}

.course-rail-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ors-dim);
}

/* ---------- mark-complete control ---------- */

.course-complete {
  max-width: 760px;
  margin: 40px auto 0;
  padding: 24px 26px;
  border: 1px solid var(--ors-line-strong);
  background: var(--ors-glass);
  border-radius: 4px;
  text-align: center;
}

.course-complete-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ors-ink);
  background: rgba(37, 99, 255, 0.12);
  border: 1px solid rgba(37, 99, 255, 0.55);
  border-radius: 3px;
  padding: 13px 26px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.course-complete-btn:hover {
  background: rgba(37, 99, 255, 0.22);
  border-color: var(--ors-cyan);
}

.course-complete-btn.is-done {
  color: #0b1005;
  background: var(--ors-lime);
  border-color: var(--ors-lime);
}

.course-complete-note {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--ors-dim);
  margin: 14px 0 0;
}

/* ---------- prev / next ---------- */

.course-lesson-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 760px;
  margin: 34px auto 0;
}

.course-lnav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 18px 20px;
  border: 1px solid var(--ors-line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.course-lnav:hover {
  border-color: var(--ors-line-strong);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.course-lnav-next { text-align: right; align-items: flex-end; }

.course-lnav-dir {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--ors-cyan);
}

.course-lnav-next .course-lnav-dir { color: var(--ors-magenta); }

.course-lnav-title {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--ors-ink);
}

@media (max-width: 640px) {
  .course-lesson-nav { grid-template-columns: 1fr; }
  .course-lnav-next { text-align: left; align-items: flex-start; }
}

/* ---------- complete-guide page ---------- */

.cg-toc {
  border: 1px solid var(--ors-line-strong);
  background: var(--ors-glass);
  border-radius: 4px;
  padding: 22px 26px;
  margin: 0 0 40px;
}

.cg-toc ol {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.cg-toc li {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.9;
  margin: 0;
}

.cg-toc-part {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ors-lime);
  margin-top: 16px !important;
}

.cg-toc-part:first-child { margin-top: 0 !important; }

.cg-toc-lesson {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ors-dim);
  margin-left: 8px;
}

.cg-part {
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  letter-spacing: 0.2em !important;
  text-transform: uppercase;
  color: var(--ors-lime) !important;
  border-top: 1px solid var(--ors-line-strong);
  padding-top: 26px;
  margin-top: 54px !important;
}

.cg-chapter { margin-top: 30px !important; }

.cg-chapter-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ors-dim);
  margin-top: -6px !important;
}

@media print {
  .cg-toc-lesson,
  .cg-chapter-link,
  .course-lesson-nav,
  .course-complete,
  .course-progress-panel,
  .course-rail { display: none !important; }
}

/* ---------- multi-paragraph intro cards ----------
   The reference hubs only ever put a single <p> in .hub-intro, so tools.css
   never needed to space siblings. The course intro cards run three or four. */

.course-hub-page .hub-intro p + p { margin-top: 1.05em; }

/* ============================================================
   WORKSHEETS — Scribbler's Playbook
   Interactive fill-in sheets. On screen they follow the site's
   dark chrome; in print they drop to black ink on white paper
   with the answers rendered as text (a printed <textarea> only
   shows what fits in its scroll box, so every control has a
   mirror element that print swaps in).
   ============================================================ */

.ws-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 22px 80px;
}

.ws-head { padding: 26px 0 0; }

.ws-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.05;
  margin: 10px 0 0;
  color: var(--ors-ink);
}

.ws-dek {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.9vw, 17px);
  line-height: 1.55;
  color: var(--ors-dim);
  margin: 14px 0 0;
  max-width: 62ch;
}

/* ---------- toolbar ---------- */

.ws-toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 28px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--ors-line-strong);
  border-radius: 4px;
  background: rgba(7, 6, 18, 0.92);
  backdrop-filter: blur(8px);
}

.ws-status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ors-lime);
}

.ws-toolbar-actions { display: flex; gap: 8px; }

.ws-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ors-ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ors-line-strong);
  border-radius: 3px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ws-btn-print { border-color: rgba(37, 99, 255, 0.55); background: rgba(37, 99, 255, 0.12); }
.ws-btn-print:hover { border-color: var(--ors-cyan); background: rgba(37, 99, 255, 0.22); }
.ws-btn-clear:hover { border-color: var(--ors-magenta); color: var(--ors-magenta); }

.ws-privacy {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.75;
  color: var(--ors-dim);
  margin: 12px 0 0;
}

/* ---------- sections ---------- */

.ws-section,
.ws-section-collapse {
  margin: 34px 0 0;
  padding: 24px 26px;
  border: 1px solid var(--ors-line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.018);
}

.ws-section-collapse > summary {
  cursor: pointer;
  list-style: none;
}

.ws-section-collapse > summary::-webkit-details-marker { display: none; }

.ws-section-collapse > summary::after {
  content: "▸ EXPAND";
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ors-cyan);
  margin-top: 6px;
}

.ws-section-collapse[open] > summary::after { content: "▾ COLLAPSE"; }

.ws-section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ors-ink);
  margin: 0;
}

.ws-section-num {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0;
  color: var(--ors-lime);
}

.ws-section-note {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ors-dim);
  margin: 12px 0 0;
  max-width: 66ch;
}

/* ---------- fields ---------- */

.ws-field { margin: 22px 0 0; }

.ws-label {
  display: block;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ors-ink);
}

.ws-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--ors-dim);
  margin: 5px 0 0;
  max-width: 66ch;
}

.ws-input,
.ws-area,
.ws-select {
  display: block;
  width: 100%;
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ors-ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ors-line-strong);
  border-radius: 3px;
  padding: 10px 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ws-area { resize: vertical; overflow: hidden; min-height: 62px; }

.ws-input:focus,
.ws-area:focus,
.ws-select:focus {
  outline: none;
  border-color: var(--ors-cyan);
  background: rgba(37, 99, 255, 0.07);
}

.ws-select { appearance: none; cursor: pointer; }
.ws-select option { background: #0d0b1c; color: var(--ors-ink); }

/* ---------- checkboxes ---------- */

.ws-field-check { margin-top: 14px; }

.ws-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
}

.ws-check input { position: absolute; opacity: 0; width: 0; height: 0; }

.ws-check-box {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  border: 1px solid var(--ors-line-strong);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  position: relative;
}

.ws-check input:focus-visible + .ws-check-box { outline: 2px solid var(--ors-cyan); outline-offset: 2px; }

.ws-check input:checked + .ws-check-box {
  background: var(--ors-lime);
  border-color: var(--ors-lime);
}

.ws-check input:checked + .ws-check-box::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #0b1005;
}

.ws-check-label {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ors-ink);
}

/* ---------- footer bits ---------- */

.ws-print-value { display: none; }

.ws-source {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.8;
  color: var(--ors-dim);
  margin: 40px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--ors-line);
}

.ws-back-link {
  display: inline-block;
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ors-cyan);
  text-decoration: none;
  border-bottom: 1px dotted rgba(37, 99, 255, 0.5);
}

.ws-back-link:hover { color: var(--ors-magenta); border-bottom-color: var(--ors-magenta); }

/* ---------- worksheet callout on a lesson page ---------- */

.course-ws-callout {
  max-width: 760px;
  margin: 44px auto 0;
  padding: 26px 28px;
  border: 1px solid rgba(190, 242, 100, 0.35);
  border-radius: 4px;
  background: rgba(190, 242, 100, 0.05);
}

.course-ws-callout h2 {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.6vw, 25px);
  line-height: 1.2;
  margin: 8px 0 10px;
  color: var(--ors-ink);
}

.course-ws-callout p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ors-dim);
  margin: 0 0 16px;
}

.course-ws-note {
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  margin: 14px 0 0 !important;
}

.hub-support-note { color: var(--ors-dim); }

.cg-toc-foot {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  margin: 16px 0 0 !important;
}

/* ============================================================
   PRINT — worksheets go to paper as a fillable/filled document
   ============================================================ */

@media print {
  .ors-vhs, .ors-scanlines, .ors-grain, .ors-glow, .ors-gridnoise,
  .ors-nav, .hub-breadcrumb, .ors-foot,
  .ws-toolbar, .ws-privacy, .ws-back-link { display: none !important; }

  html, body { background: #fff !important; color: #000 !important; }

  .ws-main { max-width: none; padding: 0; }

  .ws-title, .ws-check-label, .ws-label, .ws-section-title { color: #000 !important; }
  .ws-dek, .ws-hint, .ws-section-note, .ws-source { color: #333 !important; }
  .ws-section-num { color: #000 !important; }

  .ws-section, .ws-section-collapse {
    background: none !important;
    border: 0;
    border-top: 1px solid #000;
    border-radius: 0;
    padding: 14px 0 0;
    margin: 20px 0 0;
    break-inside: avoid;
  }

  /* Collapsed recipe sections still print in full. */
  .ws-section-collapse > summary::after { display: none; }
  .ws-section-collapse > *:not(summary) { display: block !important; }

  .ws-field { break-inside: avoid; margin-top: 14px; }

  /* Swap live controls for their printed text. */
  .ws-input, .ws-area, .ws-select, .ws-check input { display: none !important; }

  .ws-print-value {
    display: block;
    min-height: 20px;
    margin-top: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid #999;
    font-family: var(--font-body);
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    white-space: pre-wrap;
  }

  /* The printed tick box already carries the answer; the text mirror would
     just repeat it, and would print "No" on every blank form. */
  .ws-field-check .ws-print-value { display: none; }

  .ws-check-box { border-color: #000 !important; background: none !important; }
  .ws-check input:checked + .ws-check-box { background: none !important; }
  .ws-check input:checked + .ws-check-box::after { color: #000 !important; }

  a[href]::after { content: ""; }
}

/* Off-screen measuring element for textarea auto-grow. Must match the
   textarea's typography and box metrics; see the worksheet script. */
.ws-ghost {
  position: absolute;
  top: 0;
  left: -99999px;
  visibility: hidden;
  box-sizing: border-box;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  border-color: transparent;
}

/* The reference hubs only ever use two or three breadcrumb segments, so
   tools.css leaves the row on flex-wrap:nowrap. Course worksheets run to
   four (COURSES / PLAYBOOK / WORKSHEETS / TITLE) and overflow a phone. */
.course-index-page .hub-breadcrumb,
.course-hub-page .hub-breadcrumb,
.course-lesson-page .hub-breadcrumb,
.course-guide-page .hub-breadcrumb,
.course-ws-index .hub-breadcrumb,
.ws-page .hub-breadcrumb {
  flex-wrap: wrap;
  row-gap: 4px;
}
