/* Course catalogue and reading layout; supplements styles.css. */
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid var(--purple); outline-offset: 4px; }
.breadcrumb { flex-wrap: wrap; }
.catalog-notice { padding: 22px 26px; border: 1px solid #dcd4f2; border-radius: 16px; background: var(--purple-soft); margin: 24px 0; }
.catalog-notice a, .lesson-content a, .source-panel a { color: var(--purple-dark); text-decoration: underline; text-underline-offset: 3px; }
.catalog-notice p + p { margin-top: 8px; }
.catalog-tools { display: flex; flex-wrap: wrap; gap: 18px; padding-block: 20px; align-items: end; }
.catalog-tools label { display: grid; gap: 6px; font-size: 13px; font-weight: 650; }
.catalog-tools label:first-child { flex: 1 1 280px; }
.catalog-tools input, .catalog-tools select, .simulation input { background: white; color: var(--ink); border: 1px solid #bcb7c7; border-radius: 9px; padding: 12px; min-width: 0; width: 100%; min-height: 46px; }
.result-count { font-size: 13px; color: var(--muted); margin: 8px 0 20px; }
.catalog-group { margin-block: 32px 42px; }
.catalog-group > h2 { font-size: 26px; letter-spacing: -.7px; }
.catalog-group > p { color: var(--muted); margin: 8px 0 22px; max-width: 760px; }
.lesson-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.lesson-card { border: 1px solid var(--line); border-radius: 17px; background: white; padding: 23px; display: flex; flex-direction: column; min-width: 0; transition: border-color .15s, transform .15s; }
.lesson-card:hover { border-color: var(--purple); transform: translateY(-2px); }
.lesson-card .course-code { color: var(--purple-dark); font-size: 11px; font-weight: 750; letter-spacing: 1px; }
.lesson-card h3 { font-size: 20px; line-height: 1.3; margin: 11px 0; }
.lesson-card p { font-size: 13px; line-height: 1.75; color: var(--muted); }
.lesson-card .read-link { margin-top: auto; padding-top: 18px; font-size: 12px; font-weight: 700; color: var(--purple-dark); }
.lesson-page { padding-block: 28px 60px; }
.lesson-heading { max-width: 900px; margin: 28px 0 36px; }
.lesson-heading h1 { font-size: clamp(32px, 4.3vw, 53px); letter-spacing: -1.6px; line-height: 1.15; margin: 12px 0 20px; overflow-wrap: break-word; }
.lesson-heading .lead { max-width: 770px; color: var(--muted); font-size: 17px; }
.lesson-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: start; gap: 32px; }
.lesson-layout:has(.lesson-toc[hidden]) { grid-template-columns: minmax(0, 1fr); }
.lesson-toc { position: sticky; top: 24px; padding: 20px 16px; border: 1px solid var(--line); border-radius: 15px; max-height: calc(100vh - 48px); overflow-y: auto; }
.lesson-toc h2 { font-size: 14px; margin-bottom: 12px; }
.lesson-toc nav { display: grid; gap: 4px; }
.lesson-toc nav a { font-size: 12px; padding: 7px 4px; border-radius: 5px; line-height: 1.55; }
.lesson-toc nav a:hover { color: var(--purple-dark); background: var(--purple-soft); }
.print-button { border: 1px solid #cac3df; background: white; color: var(--purple-dark); border-radius: 8px; padding: 10px 12px; margin-top: 18px; font-size: 12px; }
.lesson-content { background: white; padding: clamp(22px, 3.3vw, 42px); border: 1px solid var(--line); border-radius: 20px; min-width: 0; overflow-wrap: break-word; font-size: 16px; line-height: 1.85; }
.lesson-content > h2, .lesson-content > section > h2 { font-size: 25px; line-height: 1.3; margin: 38px 0 16px; letter-spacing: -.5px; scroll-margin-top: 28px; }
.lesson-content h3 { font-size: 18px; line-height: 1.4; margin: 24px 0 10px; }
.lesson-content p { margin: 12px 0; }
.lesson-content ul, .lesson-content ol { padding-left: 24px; margin: 12px 0 18px; }
.lesson-content li + li { margin-top: 7px; }
.lesson-content .objectives { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 26px; }
.lesson-content .objectives h2 { margin-top: 0; }
.lesson-content .prerequisites { color: var(--muted); font-size: 13px; }
.formula { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 1.15em; background: #f5f2fc; border-left: 3px solid var(--purple); padding: 15px 18px; margin: 18px 0; line-height: 1.9; overflow-wrap: anywhere; }
.math-inline { display: inline-block; white-space: nowrap; overflow-wrap: normal; }
.callout, .example, .warning, .recap { padding: 18px 22px; border-radius: 12px; margin: 24px 0; }
.callout { background: #f5f2fc; border: 1px solid #e5dcf5; }
.example { background: #eef6f2; border: 1px solid #d5e8dc; }
.warning { background: #fcf7e9; border: 1px solid #e9d9ab; }
.recap { background: #f7f6f9; border: 1px solid var(--line); }
.lesson-content .callout > h3:first-child, .lesson-content .example > h3:first-child, .lesson-content .warning > h3:first-child, .lesson-content .recap > h2:first-child { margin-top: 0; }
.table-wrap { max-width: 100%; overflow-x: auto; margin: 22px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
caption { text-align: left; font-weight: 650; margin-bottom: 10px; color: var(--ink); }
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: center; }
th { background: #f3f0fa; font-weight: 650; }
pre { white-space: pre; overflow: auto; max-width: 100%; background: #242335; color: #f7f5ff; padding: 20px; border-radius: 12px; font-size: 13px; line-height: 1.7; margin: 20px 0; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
p code, li code { background: #f2f0f6; color: #46348b; border-radius: 4px; padding: 2px 4px; font-size: .88em; }
.check { border: 1px solid #d9d2e8; border-radius: 12px; margin: 20px 0; padding: 0 18px; }
.check summary { cursor: pointer; font-weight: 650; padding: 16px 0; color: var(--purple-dark); }
.check[open] { padding-bottom: 10px; }
.figure { margin: 26px 0; }
.figure svg { width: 100%; height: auto; max-height: 360px; border: 1px solid var(--line); border-radius: 12px; background: #faf9fd; }
.figure figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.course-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.course-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 15px; margin-top: 22px; }
.course-pagination a { padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; max-width: 100%; }
.source-panel { background: white; padding: 28px; border-radius: 18px; border: 1px solid var(--line); margin-block: 26px; }
.source-panel h2 { margin-bottom: 14px; font-size: 24px; }
.source-panel p { margin-block: 12px; }
.source-panel li { margin: 10px 0; }
.simulation { border: 1px solid #d4c9ee; border-radius: 12px; padding: 20px; margin: 24px 0; background: #faf8ff; }
.sim-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sim-fields label { display: grid; gap: 5px; font-size: 13px; }
.simulation button { border: 0; margin-top: 18px; }
.simulation-output { font-size: 14px; }
.sim-bars { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); align-items: end; gap: 4px; height: 160px; border-bottom: 1px solid var(--ink); margin-top: 20px; }
.sim-bars span { display: block; min-height: 1px; background: var(--purple); }
.tree-list { line-height: 1.9; border-left: 2px solid #d7cdee; padding-left: 20px; }
.no-results { padding: 30px; text-align: center; border: 1px dashed #bdb2d9; border-radius: 12px; }
@media (max-width: 960px) { .lesson-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lesson-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 20px; } .lesson-content { padding: 26px; } }
@media (max-width: 740px) { .lesson-layout { grid-template-columns: minmax(0, 1fr); } .lesson-toc { position: static; max-height: none; } .lesson-toc nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; } .lesson-heading { margin-top: 20px; } }
@media (max-width: 520px) { .lesson-cards { grid-template-columns: minmax(0, 1fr); } .lesson-content { padding: 22px 18px; font-size: 15px; } .lesson-content > h2 { font-size: 23px; } .lesson-toc nav { grid-template-columns: minmax(0, 1fr); } .catalog-notice, .source-panel { padding: 20px; } .formula { padding: 12px; font-size: 1.08em; } .callout, .example, .warning, .recap { padding: 16px; } .sim-fields { grid-template-columns: minmax(0, 1fr); } .lesson-heading h1 { letter-spacing: -1px; } }
@media (prefers-reduced-motion: reduce) { .lesson-card { transition: none; } .lesson-card:hover { transform: none; } }
@media print { :root { --ink: #000; --muted: #333; } body { background: white; font-size: 11pt; } .site-header, .site-footer, .skip-link, .lesson-toc, .catalog-tools, .course-pagination, .breadcrumb, .simulation, .print-button { display: none !important; } .container { width: 100%; } .lesson-layout { display: block; } .lesson-content, .source-panel { border: none; padding: 0; } .lesson-heading h1 { font-size: 26pt; } .lesson-content h2 { break-after: avoid; } .lesson-content h3 { break-after: avoid; } .formula, .example, .warning, .check { break-inside: avoid; } .table-wrap, pre { overflow: visible; } pre { white-space: pre-wrap; color: black; background: #eee; } .lesson-content a { color: black; } th, td { padding: 6px; } .figure svg { max-height: 240px; } @page { margin: 18mm; } }
