@import url("../styles.css");

.course-header { border-bottom: 1px solid var(--border-subtle); }
.course-header nav { flex-wrap: wrap; }
.course-header nav a[aria-current="page"] { color: var(--accent-primary); text-decoration: underline; text-underline-offset: .4em; }
.course-header--lesson { position: sticky; top: 0; z-index: 20; max-width: none; min-height: 4.25rem; padding-top: .55rem; padding-bottom: .55rem; display: grid; grid-template-columns: minmax(7rem, 1fr) auto minmax(7rem, 1fr); gap: 1rem; background: var(--bg-canvas); }
.course-context { display: flex; align-items: baseline; gap: .55rem; min-width: 0; margin: 0; line-height: 1.2; white-space: nowrap; }
.context-number, .menu-number { color: var(--accent-primary); font: 400 .75rem/1.4 var(--font-mono); font-variant-numeric: tabular-nums; }
.context-title { font-size: 1.05rem; font-weight: 600; }
.context-view { padding-left: .55rem; border-left: 1px solid var(--border-subtle); color: var(--text-muted); font-size: .82rem; }
.module-menu { position: relative; justify-self: end; }
.module-menu summary { min-height: 44px; padding: .4rem .65rem; border: 1px solid var(--border-subtle); font-size: .87rem; white-space: nowrap; }
.module-menu summary::after { font-size: 1.1rem; }
.module-menu[open] summary { color: var(--accent-primary); border-color: var(--accent-primary); }
.course-header--lesson .module-menu nav { position: absolute; top: calc(100% + .4rem); right: 0; z-index: 2; display: block; width: min(19rem, calc(100vw - 2.5rem)); max-height: calc(100vh - 5rem); overflow-y: auto; padding: .45rem .85rem; border: 1px solid var(--border-subtle); background: var(--bg-canvas); }
.course-header--lesson .module-menu nav a { display: flex; align-items: center; gap: .7rem; min-height: 44px; padding: .45rem .25rem; border-bottom: 1px solid var(--border-subtle); font-size: .9rem; text-decoration: none; opacity: 1; }
.course-header--lesson .module-menu nav a:last-child { border-bottom: 0; }
.course-header--lesson .module-menu nav a:hover { color: var(--accent-primary); opacity: 1; }
.course-header--lesson .module-menu nav a[aria-current="step"] { padding-left: .55rem; border-left: 2px solid var(--accent-primary); color: var(--accent-primary); font-weight: 600; }
.course-header--lesson .module-menu nav .menu-switch { margin-top: .4rem; border-top: 1px solid var(--border-subtle); }
.course-header--lesson ~ main .contents { top: 5.25rem; max-height: calc(100vh - 6rem); overflow-y: auto; }
.course-header--lesson ~ main .prose > section { scroll-margin-top: 5.5rem; }
.course-shell { max-width: 1440px; margin: 0 auto; padding: 0 clamp(1.25rem, 4.5vw, 5rem); }
.course-hero { padding-top: clamp(3.5rem, 8vw, 7rem); padding-bottom: clamp(3.5rem, 7vw, 6rem); }
.eyebrow, .meta, .number, .source-id { font: 400 .8rem/1.5 var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow, .meta, .number { color: var(--text-muted); }
.course-hero h1 { max-width: 11ch; font-size: clamp(3.4rem, 8.4vw, 7.8rem); line-height: .98; margin: 1.2rem 0 2rem; overflow-wrap: anywhere; }
.course-hero .lead { max-width: 46rem; font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.4; letter-spacing: -.015em; }
.status-line { display: flex; flex-wrap: wrap; gap: .8rem 2rem; border-top: 1px solid var(--border-subtle); padding-top: 1rem; margin-top: 2.5rem; color: var(--text-muted); font-size: .9rem; }
.read-layout { display: grid; grid-template-columns: minmax(12rem, 17rem) minmax(0, 48rem); gap: clamp(2rem, 6vw, 7rem); align-items: start; padding-bottom: 7rem; }
.contents { position: sticky; top: 1rem; border-top: 1px solid var(--border-subtle); padding-top: .9rem; }
.contents p { margin: 0 0 .7rem; color: var(--text-muted); font: 400 .78rem/1.4 var(--font-mono); }
.contents a { display: block; padding: .46rem 0; font-size: .9rem; line-height: 1.3; text-decoration: none; }
.contents a:hover, .text-link:hover { color: var(--accent-primary); }
.prose { min-width: 0; font-size: 1.05rem; line-height: 1.68; }
.prose > section { scroll-margin-top: 2rem; border-top: 1px solid var(--border-subtle); padding-top: 2rem; margin-top: 3.5rem; }
.prose > section:first-child { margin-top: 0; }
.prose h2 { font-size: clamp(2.2rem, 4vw, 3.75rem); line-height: 1.1; margin: 0 0 1.5rem; }
.prose h3 { font-size: clamp(1.45rem, 2vw, 2rem); line-height: 1.2; margin: 2.5rem 0 .8rem; }
.prose h4 { font-size: 1.08rem; margin: 1.8rem 0 .55rem; }
.prose p, .prose ul, .prose ol { max-width: 44rem; margin-bottom: 1.15rem; }
.prose li { padding-left: .25rem; margin: .3rem 0; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose .compact li { margin: .1rem 0; }
.prose a { text-underline-offset: .25em; }
.prose small, .source-note { font-size: .88rem; color: var(--text-muted); }
.callout { padding: 1.2rem 1.35rem; border-left: 3px solid var(--accent-primary); background: var(--bg-surface); margin: 2rem 0; }
.callout p:last-child { margin-bottom: 0; }
.row-list { list-style: none; padding: 0 !important; border-top: 1px solid var(--border-subtle); }
.row-list li { padding: 1.3rem 0; border-bottom: 1px solid var(--border-subtle); display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; }
.row-list h3 { margin: 0 0 .4rem; }
.row-list p { margin: 0 0 .6rem; }
.row-list .meta { margin-bottom: .4rem; }
.row-list .text-link { font-size: .95rem; font-weight: 500; }
.status { color: var(--accent-primary); font: 400 .78rem/1.3 var(--font-mono); }
.prose details { border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); margin: 2rem 0; }
.prose details summary { font-size: 1rem; }
.prose details > div { padding: .5rem 0 1rem; }
.prose details p { font-size: 1rem; color: var(--text-primary); }
.practice { border-top: 1px solid var(--border-subtle); margin-top: 2.5rem; padding-top: 1rem; }
.practice h3 { margin-top: .6rem; }
.step-list { counter-reset: steps; list-style: none; padding: 0 !important; }
.step-list li { counter-increment: steps; display: grid; grid-template-columns: 2rem minmax(0,1fr); gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--border-subtle); }
.step-list li::before { content: counter(steps, decimal-leading-zero); color: var(--text-muted); font: 400 .8rem/1.8 var(--font-mono); }
.table-scroll { overflow-x: auto; margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
th, td { text-align: left; vertical-align: top; padding: .8rem .65rem; border-top: 1px solid var(--border-subtle); }
th { font-weight: 600; }
td:first-child { white-space: nowrap; font-family: var(--font-mono); font-size: .8rem; }
.source-list { font-size: .9rem; }
.source-list li { margin-bottom: .7rem; }
.course-footer { max-width: 1440px; margin: auto; padding: 1.5rem clamp(1.25rem, 4.5vw, 5rem); border-top: 1px solid var(--border-subtle); display: flex; justify-content: space-between; gap: 1rem; font-size: .86rem; }
.course-footer a { text-decoration: none; }
.course-footer a:hover { color: var(--accent-primary); }
.row-sep { color: var(--text-muted); }
.module-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--border-subtle); padding: 1.3rem 0 3rem; margin-top: 3rem; }
.module-nav a { font-weight: 500; }
.lesson-meta { color: var(--text-muted); font-size: .9rem; }
.lesson-meta strong { color: var(--text-primary); font-weight: 500; }
.prose blockquote { margin: 1.2rem 0; padding-left: 1.2rem; border-left: 2px solid var(--border-subtle); font-size: 1.04rem; }
.guide-block { margin: 2.5rem 0; border-top: 1px solid var(--border-subtle); padding-top: 1rem; }
.guide-block h3 { margin-top: .5rem; }
@media (max-width: 760px) {
  .course-header--lesson { min-height: 3.75rem; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
  .course-header--lesson .wordmark { display: none; }
  .course-context { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .1rem .45rem; }
  .context-number { font-size: .67rem; }
  .context-title { overflow: hidden; font-size: .94rem; text-overflow: ellipsis; }
  .context-view { grid-column: 1 / -1; padding: 0; border: 0; font-size: .72rem; }
  .course-header--lesson ~ main .contents { max-height: none; overflow: visible; }
  .read-layout { display: block; padding-bottom: 4rem; }
  .contents { position: static; margin-bottom: 3rem; }
  .contents nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
  .course-hero { padding-top: 3.5rem; }
}
@media (max-width: 520px) {
  .course-header { align-items: flex-start; }
  .course-header--lesson { align-items: center; }
  .course-header nav { justify-content: flex-end; gap: .45rem 1rem; }
  .course-header nav a { font-size: .8rem; }
  .course-hero h1 { font-size: clamp(3.2rem, 15vw, 4.7rem); }
  .course-hero h1.long-title { font-size: clamp(2.55rem, 12vw, 3.2rem); overflow-wrap: normal; }
  .row-list li { grid-template-columns: 2.2rem minmax(0,1fr); gap: .5rem; }
  .contents nav { grid-template-columns: 1fr; }
  .course-footer { display: block; }
  .course-footer a { display: block; padding: .35rem 0; }
}
@media print {
  @page { margin: 16mm; }
  body { background: white; color: black; font-size: 10.5pt; }
  .site-header, .contents, .course-footer, .skip-link { display: none !important; }
  .course-shell { max-width: none; padding: 0; }
  .course-hero { padding: 0 0 1rem; }
  .course-hero h1 { font-size: 28pt; margin: .5rem 0; }
  .read-layout { display: block; padding: 0; }
  .prose > section { margin-top: 1.5rem; padding-top: 1rem; break-inside: avoid-page; }
  .prose h2 { font-size: 18pt; }
  .prose h3 { font-size: 13pt; }
  .callout { background: none; border-color: black; }
  .prose details { display: block !important; }
  .prose details > summary { display: none; }
  .prose details > div { display: block !important; content-visibility: visible !important; }
  a { text-decoration: none; }
}
