/*
 * Shared course presentation
 *
 * Load after Font Awesome 7 Free Classic Solid.
 * Pages must load Lato 400, 400 italic, 700, and 900.
 */

/* ==========================================================================
   Browser baseline
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

button,
input,
optgroup,
select,
textarea {
    color: inherit;
    font: inherit;
}

img,
svg {
    max-width: 100%;
}

/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
    --font-sans: "Lato", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: Consolas, Monaco, "Courier New", monospace;

    --surface-0: #ffffff;
    --surface-1: #f4f7f9;
    --surface-2: #e6edf2;
    --surface-3: #d8e2e9;
    --course-dark-blue: #173f63;
    --text-primary: #17212b;
    --text-secondary: #4c545b;
    --border-color: #bcc8d1;
    --link-color: #075fbe;
    --focus-color: #005fcc;

    --info-bg: #eaf4fb;
    --info-border: #4aa9df;
    --warning-bg: #fff1bd;
    --warning-border: #f59e0b;
    --critical-bg: #fdecea;
    --critical-border: #e74c3c;
    --success-bg: #eaf7ee;
    --success-border: #2e9d50;

    --row-odd-bg: #eef2f5;
    --row-even-bg: #e4e9ee;
    --checkbox-accent: #2e78c7;

    --code-bg: #ffffff;
    --code-text: #111111;
    --step-icon: #40566b;
    --step-title: #40566b;
    --step-detail-text: #40566b;
    --nav-bg: #40566b;
    --nav-highlight: #536c83;

    /* Shared semantic palettes.
       Each hue stores its light/dark background and highlight exactly once.
       Callouts and resource cards select from these active aliases below. */
    --orange-light-background: #f7e4d6;
    --orange-light-highlight: #b85f24;
    --orange-dark-background: #432d22;
    --orange-dark-highlight: #f0a267;

    --purple-light-background: #efe1f6;
    --purple-light-highlight: #8450aa;
    --purple-dark-background: #392a45;
    --purple-dark-highlight: #caa2e2;

    --yellow-light-background: #fff0c5;
    --yellow-light-highlight: #a66f00;
    --yellow-dark-background: #40351c;
    --yellow-dark-highlight: #e4bd4f;

    --green-light-background: #ddf2e5;
    --green-light-highlight: #347b54;
    --green-dark-background: #233a2c;
    --green-dark-highlight: #7fc39a;

    --blue-light-background: #dceffa;
    --blue-light-highlight: #2877a6;
    --blue-dark-background: #203c50;
    --blue-dark-highlight: #78c1e8;

    --red-light-background: #f8dfe4;
    --red-light-highlight: #ae4359;
    --red-dark-background: #44272e;
    --red-dark-highlight: #e78999;

    /* Steel: a restrained blue-gray derived from the slate structure.
       Its stronger accent keeps frequent instructional callouts distinct. */
    --steel-light-background: #dde5ea;
    --steel-light-highlight: #5e707d;
    --steel-dark-background: #2c373f;
    --steel-dark-highlight: #a8b8c2;

    /* Active palette values: light mode by default. */
    --orange-background: var(--orange-light-background);
    --orange-highlight: var(--orange-light-highlight);
    --purple-background: var(--purple-light-background);
    --purple-highlight: var(--purple-light-highlight);
    --yellow-background: var(--yellow-light-background);
    --yellow-highlight: var(--yellow-light-highlight);
    --green-background: var(--green-light-background);
    --green-highlight: var(--green-light-highlight);
    --blue-background: var(--blue-light-background);
    --blue-highlight: var(--blue-light-highlight);
    --red-background: var(--red-light-background);
    --red-highlight: var(--red-light-highlight);
    --steel-background: var(--steel-light-background);
    --steel-highlight: var(--steel-light-highlight);
    --panel-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.16);
    --resource-card-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
    --resource-card-hover-shadow: 0 6px 12px rgba(0, 0, 0, 0.28);
    --tooltip-z-index: 1000;
    --page-gutter: 1.5rem;
}

html:has(body.dark-mode),
body.dark-mode {
    --surface-0: #101214;
    --surface-1: #171a1e;
    --surface-2: #21262c;
    --surface-3: #2a3037;
    --text-primary: #f5f7f9;
    --text-secondary: #b8c0c8;
    --border-color: #59636d;
    --link-color: #86bfff;
    --focus-color: #9ac7ff;

    --info-bg: #173247;
    --info-border: #55b8f0;
    --warning-bg: #3a3215;
    --warning-border: #ffb020;
    --critical-bg: #401e1e;
    --critical-border: #ff7373;
    --success-bg: #173524;
    --success-border: #67c587;

    --row-odd-bg: #242a30;
    --row-even-bg: #2b3138;
    --checkbox-accent: #66aef5;

    --code-bg: #000000;
    --code-text: #f5f7f9;
    --step-icon: #b9cedd;
    --step-title: #b9cedd;
    --step-detail-text: #b9cedd;
    --nav-bg: #33495d;
    --nav-highlight: #46647d;

    /* Switch the shared semantic palettes to their dark-mode values. */
    --orange-background: var(--orange-dark-background);
    --orange-highlight: var(--orange-dark-highlight);
    --purple-background: var(--purple-dark-background);
    --purple-highlight: var(--purple-dark-highlight);
    --yellow-background: var(--yellow-dark-background);
    --yellow-highlight: var(--yellow-dark-highlight);
    --green-background: var(--green-dark-background);
    --green-highlight: var(--green-dark-highlight);
    --blue-background: var(--blue-dark-background);
    --blue-highlight: var(--blue-dark-highlight);
    --red-background: var(--red-dark-background);
    --red-highlight: var(--red-dark-highlight);
    --steel-background: var(--steel-dark-background);
    --steel-highlight: var(--steel-dark-highlight);
}

/* ========================================================================== 
   Unified v2 page nodes and fixed display options
   ========================================================================== */

.site-options {
    position: fixed;
    right: 1rem;
    top: 1rem;
    z-index: 1200;
}

.site-options .options-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
}

.site-options .option-control > span {
    display: grid;
    gap: 0.15rem;
}

.site-options .option-control small {
    color: var(--text-secondary);
}

.page-node {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 0.55rem;
    box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.1);
    margin: 1.15rem 0;
    overflow: hidden;
}

body.assignment-page {
    padding: 0.9rem var(--page-gutter) 1.5rem;
}

body.content-page {
    padding: 52px var(--page-gutter) 1.5rem;
}

.page-level-a {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 0.55rem;
    box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.1);
    margin: 0 auto 1.15rem;
    max-width: 1180px;
    overflow: hidden;
}

body.content-page .page-level-a,
body.assignment-page .page-level-a {
    margin: 0 auto 1.15rem;
    max-width: 1180px;
}

.page-level-a > .page-node-heading {
    background: var(--surface-2);
    border-bottom: 0;
    font-size: 1.3rem;
    padding: 0.7rem 0.9rem;
}

.page-level-a > .page-node-content {
    padding: 0.75rem 1rem 1rem;
}

.page-node-heading {
    align-items: center;
    background: var(--surface-2);
    display: flex;
    font-weight: 800;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
}

.page-node-content {
    padding: 0.75rem 1rem 1rem;
}

.page-level-b {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    overflow: visible;
}

.page-level-b > .page-node-heading {
    background: transparent;
    font-size: 1.08rem;
    padding: 0.6rem 0.35rem 0.25rem;
}

.page-level-b > .page-node-content {
    padding: 0 0.35rem 0.4rem 1.55rem;
}

.content-page .page-node-content .fa-ul,
.assignment-page .page-node-content .fa-ul {
    --fa-li-margin: 2em;
}

.page-level-a > .page-node-content > .page-level-b ~ .page-level-b {
    border-top: 1px solid var(--border-color);
}

.page-level-c,
.page-level-d {
    background: transparent;
    border: 0;
    border-top: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    overflow: visible;
}

.page-level-c > .page-node-heading,
.page-level-d > .page-node-heading {
    background: transparent;
    color: var(--step-detail-text);
    font-size: calc(1rem - 1px);
    font-weight: 400;
    padding: 0.3rem 0.35rem;
}

.page-level-c > .page-node-content,
.page-level-d > .page-node-content {
    padding: 0 0.35rem 0.2rem 2.25rem;
}

.page-level-a > .page-node-heading .page-node-title,
.page-level-b > .page-node-heading .page-node-title { color: var(--step-title); }

.page-level-a > .page-node-heading .page-node-title a,
.page-level-b > .page-node-heading .page-node-title a { color: inherit; }

.content-node.page-level-a > .page-node-heading > .fa-solid { color: var(--step-icon); }

.content-node.page-level-b > .page-node-heading::before {
    color: var(--step-icon);
    display: inline-block;
    flex: 0 0 1.2em;
    content: "\f15c";
    font: var(--fa-font-solid);
    text-align: center;
}
.content-node.content-explanation > .page-node-heading::before { content: "\f05a"; }
.content-node.content-example > .page-node-heading::before { content: "\f0c3"; }
.content-node.content-detail > .page-node-heading::before { content: "\f002"; }
.content-node.content-practice > .page-node-heading::before { content: "\f044"; }
.content-node.content-summary > .page-node-heading::before { content: "\f0ae"; }
.content-node.content-category > .page-node-heading::before { content: "\f07c"; }

/* The book glyph is reserved for Content A headings. */
.assignment-section > .page-node-heading::before { content: "\f024"; }
.assignment-user-story > .page-node-heading::before { content: "\f0c0"; }
.assignment-node.assignment-level-b > .page-node-heading::before { content: "\f15c"; }
.assignment-node.assignment-task > .page-node-heading::before { content: "\f085"; }
.assignment-node.assignment-setup > .page-node-heading::before { content: "\f0ad"; }
.assignment-node.assignment-submit > .page-node-heading::before { content: "\f093"; }
.assignment-node.assignment-reflect > .page-node-heading::before { content: "\f086"; }
.assignment-action > .page-node-heading::before { content: "\f04b"; }
.assignment-check > .page-node-heading::before { content: "\f00c"; }

.assignment-node > .page-node-heading::before {
    color: var(--step-icon);
    display: inline-block;
    font: var(--fa-font-solid);
    font-size: 1.1em;
    width: 1.2em;
}

/* Assignment B headings use typography and numbering rather than glyphs. */
.assignment-page .assignment-level-b > .page-node-heading {
    font-size: 1.14rem;
    margin-left: -0.4rem;
}

.assignment-page .assignment-level-b > .page-node-heading::before {
    content: none;
    display: none;
}

body:not(.assignment-page) .assignment-only-option {
    display: none;
}

.assignment-page.assignment-b-accordion .assignment-level-b > .page-node-heading {
    border-radius: 0.3rem;
    cursor: pointer;
    position: relative;
}

.assignment-page.assignment-b-accordion .assignment-level-b > .page-node-heading:hover {
    background: var(--surface-2);
}

.assignment-page.assignment-b-accordion .assignment-level-b:not(.accordion-open) > .page-node-content {
    display: none;
}

.assignment-page.assignment-b-accordion .assignment-level-b > .page-node-heading:focus-visible {
    outline: 2px solid var(--step-title);
    outline-offset: 2px;
}

.assignment-level-c > .page-node-heading::before,
.assignment-level-d > .page-node-heading::before {
    content: none;
    display: none;
}

.under-construction {
    background: var(--warning-bg);
    border: 2px dashed var(--warning-border);
    border-radius: 0.6rem;
    padding: 1.25rem;
    text-align: center;
}

.under-construction img {
    display: block;
    margin: 1rem auto 0;
    max-width: min(28rem, 90%);
}

.cs-keyword { color: #0000ff; }
.cs-type { color: #267f99; }
.cs-string { color: #a31515; }
.cs-number { color: #098658; }
.cs-comment { color: #008000; }
.cs-method { color: #795e26; }
.cs-property { color: #001080; }

body.dark-mode .cs-keyword { color: #569cd6; }
body.dark-mode .cs-type { color: #4ec9b0; }
body.dark-mode .cs-string { color: #ce9178; }
body.dark-mode .cs-number { color: #b5cea8; }
body.dark-mode .cs-comment { color: #6a9955; }
body.dark-mode .cs-method { color: #dcdcaa; }
body.dark-mode .cs-property { color: #9cdcfe; }

/* ==========================================================================
   Typography
   ========================================================================== */

html {
    background: var(--surface-0);
    line-height: 1.15;
    min-width: 720px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--surface-0);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.55;
    margin: 0;
}

body.layout-standard {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
}

h1,
h2,
h3,
h4 {
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.25;
}

h1 {
    font-size: clamp(1.75rem, 2.5vw, 2.15rem);
    font-weight: 900;
    margin: 0;
}

h2 {
    font-size: clamp(1.35rem, 2vw, 1.6rem);
    font-weight: 700;
    margin: 0 0 0.65rem;
}

h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 1.15rem 0 0.45rem;
}

h4 {
    font-size: 1rem;
    font-weight: 700;
    margin: 1rem 0 0.4rem;
}

p {
    margin: 0.55rem 0;
}

li {
    margin-bottom: 5px;
}

small,
.small,
.caption {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.caption {
    font-style: italic;
    margin-top: 0.35rem;
}

strong {
    font-weight: 700;
}

/* ==========================================================================
   Links and resource cards
   ========================================================================== */

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
}

.callout-title {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.external-page-link {
    align-items: baseline;
    display: inline-flex;
    gap: 0.3rem;
    max-width: 100%;
}

.external-page-link::after {
    content: "↗";
    flex: 0 0 auto;
    font-size: 0.82em;
    font-weight: 700;
    line-height: 1;
}

.link-row {
    margin: 0.25rem 0;
}

/* ==========================================================================
   Code
   ========================================================================== */

code,
pre,
samp {
    font-family: var(--font-mono);
}

code {
    font-size: 0.95em;
}

code:not(pre code) {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.2rem;
    color: var(--code-text);
    padding: 0.08em 0.3em;
}

pre {
    white-space: pre;
}

pre.code-block,
.code-example > pre,
.code-example > div > pre {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    color: var(--code-text);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0.65rem 0;
    overflow-x: auto;
    padding: 1rem;
    tab-size: 4;
    overflow-wrap: normal;
    word-break: normal;
    word-wrap: normal;
    white-space: pre;
}

pre.code-block code,
.code-example > pre.code-frame > code {
    background: transparent;
    border: 0;
    color: inherit;
    display: block;
    font: inherit;
    padding: 0;
}

.code-example > div > pre > code,
.code-example > pre > code {
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    padding: 0;
}

/* ColorCode.HTML emits descriptive token classes at build time. */
.code-example :is(.keyword, .preprocessor-keyword) { color: #0000ff; font-weight: 700; }
.code-example :is(.string, .string-literal, .character) { color: #a31515; }
.code-example :is(.comment, .xml-doc-comment) { color: #008000; font-style: italic; }
.code-example :is(.number, .numeric-literal) { color: #098658; }
.code-example :is(.class, .type, .struct, .interface, .enum, .method) { color: #267f99; }
.code-example .excluded-code { color: #66717d; }

body.dark-mode .code-example :is(.keyword, .preprocessor-keyword) { color: #569cd6; }
body.dark-mode .code-example :is(.string, .string-literal, .character) { color: #ce9178; }
body.dark-mode .code-example :is(.comment, .xml-doc-comment) { color: #6a9955; }
body.dark-mode .code-example :is(.number, .numeric-literal) { color: #b5cea8; }
body.dark-mode .code-example :is(.class, .type, .struct, .interface, .enum, .method) { color: #4ec9b0; }

samp {
    display: block;
    overflow-x: auto;
    white-space: normal;
}

/* ==========================================================================
   Images, screenshots, and UML diagrams
   ========================================================================== */

.image-block {
    margin: 0.75rem 0;
    max-width: none;
}

.image-block img {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.3rem;
    display: block;
    height: auto;
    max-height: none;
    max-width: calc(100vw - 6rem);
    object-fit: contain;
    padding: 0.35rem;
    width: auto;
}

@media (max-width: 1000px) {
    .image-block img {
        max-width: calc(100% - 10px);
    }
}

.screenshot,
.screenshot-location {
    margin-inline: auto;
}

.screenshot img,
.screenshot-location img,
.vs-screenshot {
    cursor: zoom-in;
    filter: none !important;
}

.screenshot img:focus-visible,
.screenshot-location img:focus-visible,
.vs-screenshot:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 3px;
}

.plantuml-diagram,
.uml-diagram,
.theme-aware-diagram {
    background: transparent;
    margin: 0.75rem 0;
    max-width: 100%;
    overflow-x: auto;
}

.plantuml-diagram img,
.uml-diagram img,
.theme-aware-diagram .diagram-active-image,
.ending-diagram img {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: block;
    height: auto;
    margin: 0;
    max-height: none;
    max-width: 100%;
    object-fit: contain;
    padding: 0;
    width: auto;
}

.diagram-change-legend,
.diagram-legend-list {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    list-style: none;
    margin: 0.65rem 0 0;
    padding: 0;
}

.diagram-legend-item,
.legend-item {
    align-items: center;
    display: inline-flex;
    gap: 0.4rem;
}

.diagram-marker,
.legend-new-marker {
    border: 1px solid transparent;
    border-radius: 0.12rem;
    display: inline-flex;
    flex: 0 0 0.85rem;
    height: 0.85rem;
    min-height: 0.85rem;
    min-width: 0.85rem;
    width: 0.85rem;
}

.diagram-marker-n,
.legend-new-marker {
    background: #2e9d50;
    border-color: #16652f;
    color: #fff;
}

.diagram-marker-c {
    background: #246fbd;
    border-color: #164a80;
    color: #fff;
}

.diagram-marker-r {
    background: #c83a3a;
    border-color: #852323;
    color: #fff;
}

.legend-letter-marker {
    align-items: center;
    display: none;
    font-size: 0.72rem;
    justify-content: center;
    line-height: 1;
}

.legend-color-marker {
    display: inline-flex;
}

body.diagram-accessible .legend-color-marker {
    display: none;
}

body.diagram-accessible .legend-letter-marker {
    display: inline-flex;
}

/* ==========================================================================
   Options menu
   ========================================================================== */

.options {
    margin-left: auto;
    position: relative;
}

#optionsBtn,
.option-action {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 0.3rem;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 700;
    min-height: 2.5rem;
    padding: 0.45rem 0.75rem;
}

.options-menu {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    box-shadow: var(--panel-shadow);
    color: var(--text-primary);
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    width: min(22rem, calc(100vw - 2rem));
    z-index: var(--tooltip-z-index);
}

.options-menu.hidden,
.hidden {
    display: none;
}

.option-control {
    align-items: flex-start;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: auto minmax(0, 1fr);
    line-height: 1.35;
}

.option-line {
    align-items: center;
    display: flex;
    gap: 0.4rem;
}

.option-description {
    color: var(--text-secondary);
    display: block;
    font-size: 0.875rem;
    margin: -0.35rem 0 0 1.65rem;
}

#resetBtn {
    background: #b42318;
    border-color: #b42318;
    color: #fff;
}

#resetBtn:hover {
    background: #8f1c13;
}

.option-help {
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: help;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    height: 1.15rem;
    justify-content: center;
    padding: 0;
    width: 1.15rem;
}

.help-tooltip {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 0.35rem;
    box-shadow: var(--panel-shadow);
    color: var(--text-primary);
    display: none;
    font-size: 0.875rem;
    padding: 0.65rem 0.75rem;
}

.help-tooltip.is-visible {
    display: block;
}

/* ==========================================================================
   Screenshot lightbox
   ========================================================================== */

.image-lightbox {
    align-items: center;
    display: none;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 5000;
}

.image-lightbox.is-open {
    display: flex;
}

.image-lightbox-backdrop {
    background: rgba(0, 0, 0, 0.82);
    border: 0;
    cursor: zoom-out;
    inset: 0;
    padding: 0;
    position: absolute;
}

.image-lightbox-panel {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    height: min(92vh, 64rem);
    max-width: 96vw;
    overflow: hidden;
    position: relative;
    width: min(96vw, 90rem);
    z-index: 1;
}

.image-lightbox-toolbar {
    align-items: center;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    padding: 0.65rem 0.8rem;
}

.image-lightbox-controls {
    align-items: center;
    display: flex;
    gap: 0.4rem;
}

.lightbox-control {
    align-items: center;
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 0.3rem;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 700;
    justify-content: center;
    min-height: 2.2rem;
    min-width: 2.5rem;
    padding: 0.35rem 0.6rem;
}

.lightbox-close {
    font-size: 1.45rem;
    line-height: 1;
}

.image-lightbox-viewport {
    align-items: flex-start;
    background: #111;
    display: flex;
    flex: 1;
    justify-content: center;
    overflow: auto;
    padding: 1rem;
}

.image-lightbox-image {
    display: block;
    height: auto;
    max-width: none;
    transform-origin: top center;
    user-select: none;
}

.image-lightbox-hint {
    background: var(--surface-2);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    margin: 0;
    padding: 0.55rem 0.8rem;
    text-align: center;
}

body.lightbox-open {
    overflow: hidden;
}

/* ==========================================================================
   Tables, navigation, and utilities
   ========================================================================== */

/* Generic tables retain a compact, readable baseline. Structured tables below
   add the full instructional-table treatment used by {table|...} macros. */
table {
    background: var(--surface-1);
    border-collapse: collapse;
    margin: 0.75rem 0;
    width: 100%;
}

th,
td {
    border: 1px solid var(--border-color);
    padding: 0.55rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface-2);
    font-weight: 700;
}

blockquote {
    border-left: 0.3rem solid var(--border-color);
    color: var(--text-secondary);
    margin: 0.75rem 0;
    padding: 0.25rem 1rem;
}

.go-to-top,
.back-to-top a {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 0.3rem;
    color: var(--text-primary);
    display: inline-block;
    font-weight: 700;
    margin-top: 0.75rem;
    padding: 0.45rem 0.7rem;
}

.footer,
footer {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 1.25rem;
    text-align: center;
}

.navBar {
    align-items: center;
    background: var(--nav-bg);
    box-shadow: 0 5px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    inset: 0 0 auto;
    justify-content: center;
    line-height: normal;
    list-style: none;
    margin: 0;
    padding: 0;
    position: fixed;
    width: 100%;
    z-index: 100;
}

.navList {
    display: inline-block;
    margin: 0;
    padding: 10px;
}

.heading {
    color: #fff;
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    padding-inline: 5px;
    text-align: center;
}

.heading:hover {
    color: #eef4f8;
    text-decoration: none;
}

.fa-caret-down {
    padding: 0 5px;
}

.dropdown-content,
.rightDropdown {
    background: #f9f9f9;
    box-shadow: var(--panel-shadow);
    box-sizing: content-box;
    display: none;
    padding: 5px;
    position: absolute;
    width: 16rem;
    z-index: 101;
}

.navList:hover .dropdown-content,
.dropdown-content a:hover + .rightDropdown {
    display: block;
}

.dropdown-content a {
    color: #17212b;
    display: block;
    padding: 10px;
}

.dropdown-content a:hover {
    background: var(--nav-highlight);
    color: #fff;
    text-decoration: none;
}

.pageLink {
    display: block;
    margin-block: 0.65rem;
}

#instructors {
    float: right;
    width: 12%;
}

#leftInfo {
    float: left;
    width: 85%;
}

#navInfo {
    font-size: 1.1rem;
    list-style: none;
}

#container,
#assignmentContainer,
.readDiv {
    display: flex;
    flex-flow: row wrap;
}

#container {
    justify-content: center;
}

#assignmentContainer {
    justify-content: space-evenly;
    width: 95%;
}

.topic {
    display: inline-flex;
    flex-direction: column;
    margin-bottom: 0.15rem;
    width: 37.5rem;
}

.chapter {
    font-size: 1.25rem;
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.chapter + .fa-ul {
    margin-top: 0.15rem;
}

.chapter + .fa-ul li {
    line-height: 1.3;
    margin-bottom: 0.15rem;
}

.readDiv {
    justify-content: space-between;
    margin-inline: auto;
}

.read {
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: 0.4rem;
    display: inline-flex;
    margin-inline: 0.65rem;
    width: 50%;
}

.assignmentTrack {
    margin: 0.65rem;
    width: 25rem;
}

/* ==========================================================================
   Assignment outline
   ========================================================================== */

.assignment-title,
.content-title,
.assignment-node {
}

.assignment-title,
.content-title {
    align-items: center;
    display: flex;
    gap: 0.9rem;
    margin: 0 auto 0.35rem;
    max-width: 1180px;
    padding: 0.25rem 0.3rem 0.75rem;
}

.assignment-title h1,
.content-title h1 {
    color: var(--step-title);
    font-family: var(--font-sans);
    font-size: clamp(1.25rem, 1.8vw, 1.45rem);
    font-weight: 900;
    line-height: 1.25;
    margin: 0;
    text-align: left;
}

.page-kind-icon {
    color: var(--step-icon);
    flex: 0 0 auto;
    font-size: 2.4rem;
    line-height: 1;
}

/* ==========================================================================
   Content outline
   ========================================================================== */

body.content-page .content-title {
    margin-top: 0.25rem;
}

.assignment-node-number {
    flex: 0 0 auto;
    white-space: nowrap;
}

.assignment-node-checkbox {
    accent-color: var(--step-title);
    flex: 0 0 auto;
    height: 1.2rem;
    margin: 0;
    width: 1.2rem;
}

.assignment-level-c > .page-node-heading,
.assignment-level-d > .page-node-heading {
    display: grid;
    grid-template-columns: 2.4rem 1.2rem minmax(0, 1fr);
    column-gap: 0.4rem;
    left: -25px;
    position: relative;
    width: calc(100% + 25px);
}

.assignment-level-c > .page-node-heading { padding-left: 0.35rem; }
.assignment-level-d > .page-node-heading { padding-left: 0.35rem; }
.assignment-level-c > .page-node-heading > .assignment-node-number,
.assignment-level-d > .page-node-heading > .assignment-node-number {
    color: var(--step-icon);
    font-weight: 700;
    grid-column: 1;
    text-align: right;
}
.assignment-level-c > .page-node-heading > .assignment-node-checkbox,
.assignment-level-d > .page-node-heading > .assignment-node-checkbox { grid-column: 2; }
.assignment-level-c > .page-node-heading > .page-node-title,
.assignment-level-d > .page-node-heading > .page-node-title { grid-column: 3; }
.assignment-level-c > .page-node-heading:not(:has(.assignment-node-checkbox)),
.assignment-level-d > .page-node-heading:not(:has(.assignment-node-checkbox)) {
    grid-template-columns: 2.4rem minmax(0, 1fr);
}
.assignment-level-c > .page-node-heading:not(:has(.assignment-node-checkbox)) > .page-node-title,
.assignment-level-d > .page-node-heading:not(:has(.assignment-node-checkbox)) > .page-node-title { grid-column: 2; }

.assignment-progress {
    background: #d6dee4;
    height: 0.525rem;
    inset: 0 0 auto;
    overflow: hidden;
    position: fixed;
    width: 100%;
    z-index: 1300;
}

.assignment-progress-fill {
    background: #4f7f78;
    height: 100%;
    transition: width 180ms ease-out;
    width: 0;
}

body.dark-mode .assignment-progress {
    background: #35404a;
}

body.dark-mode .assignment-progress-fill {
    background: #79b1a8;
}

/* Completion is applied exactly once by the outermost checked step. Visual
   muting is placed on rendered content rather than the step container so
   checkboxes remain full-strength, active progress controls. */
.assignment-node.step-complete:not(.assignment-node.step-complete .assignment-node.step-complete) > .page-node-heading > :not(.assignment-node-checkbox),
.assignment-node.step-complete:not(.assignment-node.step-complete .assignment-node.step-complete) > .page-node-content > :not(.assignment-node),
.assignment-node.step-complete:not(.assignment-node.step-complete .assignment-node.step-complete) > .page-node-content > .assignment-node > .page-node-heading > :not(.assignment-node-checkbox),
.assignment-node.step-complete:not(.assignment-node.step-complete .assignment-node.step-complete) > .page-node-content > .assignment-node > .page-node-content > * {
    filter: grayscale(1);
    opacity: 0.45;
}

.assignment-node.step-complete:not(.assignment-node.step-complete .assignment-node.step-complete) > .page-node-content {
    pointer-events: none;
    user-select: none;
}

/* Checkboxes remain fully visible and operable anywhere inside a completed
   subtree, including child D steps beneath a completed C step. */
.assignment-node.step-complete:not(.assignment-node.step-complete .assignment-node.step-complete) .assignment-node-checkbox {
    pointer-events: auto;
}

.assignment-step-part {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    margin: 0.55rem 0;
    padding: 0.5rem 0 0;
}

.assignment-step-part-title {
    color: var(--text-secondary);
    font-weight: 800;
    margin-bottom: 0.35rem;
}

/* Shared callout/resource-card geometry. Both components use the same explicit
   icon/content structure; semantic classes only choose palettes. */
.accent-card {
    align-items: start;
    background: var(--accent-card-bg);
    border: 1px solid var(--accent-card-border);
    border-left: 5px solid var(--accent-card-accent);
    border-radius: 0.35rem;
    column-gap: 0;
    display: grid;
    font-size: 1rem;
    grid-template-columns: calc(2.85rem - 5px) minmax(0, 1fr);
    line-height: 1.65rem;
    margin: 0.75rem 0;
    min-height: calc(1.65rem + 1.2rem + 2px);
    padding: 0.6rem 1rem 0.6rem 0;
}

.accent-card > .accent-card-icon {
    align-items: center;
    align-self: start;
    color: var(--accent-card-accent);
    display: flex;
    font-size: 1.5rem;
    grid-column: 1;
    justify-content: center;
    justify-self: stretch;
    line-height: 1;
    margin-top: 0.1rem;
    text-align: center;
    width: 100%;
}

.accent-card-content {
    grid-column: 2;
    min-width: 0;
}

.assignment-callout {
    --accent-card-accent: var(--purple-highlight);
    --accent-card-bg: var(--purple-background);
    --accent-card-border: color-mix(in srgb, var(--accent-card-accent) 42%, white);
}

.assignment-callout-content > :first-child { margin-top: 0; }
.assignment-callout-content > :last-child { margin-bottom: 0; }

.assignment-callout-hint,
.assignment-callout-success,
.assignment-callout-checkpoint {
    --accent-card-accent: var(--green-highlight);
    --accent-card-bg: var(--green-background);
}

.assignment-callout-caution {
    --accent-card-accent: var(--yellow-highlight);
    --accent-card-bg: var(--yellow-background);
}

.assignment-callout-alert,
.assignment-callout-bug,
.assignment-callout-troubleshoot {
    --accent-card-accent: var(--red-highlight);
    --accent-card-bg: var(--red-background);
}

.assignment-callout-userstory,
.assignment-callout-task,
.assignment-callout-tryit {
    --accent-card-accent: var(--steel-highlight);
    --accent-card-bg: var(--steel-background);
}

.assignment-callout-focus,
.assignment-callout-important,
.assignment-callout-takeaway {
    --accent-card-accent: var(--blue-highlight);
    --accent-card-bg: var(--blue-background);
}

.assignment-callout-note,
.assignment-callout-definition,
.assignment-callout-why {
    --accent-card-accent: var(--purple-highlight);
    --accent-card-bg: var(--purple-background);
}

.assignment-callout-example,
.assignment-callout-refresher {
    --accent-card-accent: var(--orange-highlight);
    --accent-card-bg: var(--orange-background);
}

.assignment-image {
    background: var(--surface-0);
    border: 1px solid var(--border-color);
    border-radius: 0.4rem;
    box-shadow: 0 2px 8px rgba(28, 61, 91, 0.1);
    margin: 1rem auto;
    max-width: 1000px;
    padding: 0.65rem;
}

.assignment-image img {
    display: block;
    height: auto;
    margin: auto;
    max-width: 100%;
}

.assignment-image figcaption {
    color: var(--text-secondary);
    font-weight: 700;
    padding: 0.55rem 0.25rem 0.1rem;
    text-align: center;
}

.assignment-list {
    background: #f7f8f9;
    border: 1px solid #ccd3d9;
    border-radius: 0.35rem;
    margin: 0.8rem 0;
    padding: 0.7rem 0.9rem;
}

.assignment-list-title {
    color: #334a5e;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.assignment-list-items {
    margin: 0.25rem 0 0.1rem 1.4rem;
    padding: 0;
}

.assignment-list-items li {
    margin: 0.3rem 0;
}

.structured-list {
    background: transparent;
    border: 0;
    border-radius: 0;
    margin: 0.45rem 0;
    padding: 0;
}

.structured-list-y {
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 0.35rem;
    margin: 0.8rem 0;
    padding: 0.7rem 0.9rem;
}

.structured-list-title {
    color: var(--step-title);
    font-weight: 800;
    margin-bottom: 0.35rem;
}

.structured-list-items {
    margin: 0.2rem 0 0.1rem 1.25rem;
    padding: 0;
}

.structured-list-items li {
    margin: 0.3rem 0;
}

/* ==========================================================================
   Structured instructional tables
   ========================================================================== */

.structured-table-wrap {
    --table-accent: #2e6f9f;
    --table-accent-strong: #22577f;
    --table-border: #ccd6de;
    --table-border-soft: #d6dee5;
    --table-caption: #174f80;
    --table-header-bg: #e2edf5;
    --table-header-text: #173f63;
    --table-header-top: #b8c8d4;
    --table-row-alt: #f5f8fa;
    align-items: start;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: 2rem minmax(0, 1fr);
    margin: 0.9rem 0 1.05rem 0.65rem;
    max-width: calc(100% - 0.65rem);
}

.structured-table-icon {
    align-items: center;
    color: var(--table-accent-strong);
    display: inline-flex;
    font-size: 1.45rem;
    height: 2rem;
    justify-content: center;
    line-height: 1;
    margin-top: 0.05rem;
    width: 2rem;
}

.structured-table-scroll {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
}

.structured-table {
    background: var(--surface-0);
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.96rem;
    line-height: 1.4;
    margin: 0;
    min-width: 32rem;
    width: 100%;
}

.structured-table caption {
    caption-side: top;
    color: var(--table-caption);
    font-size: 1.04rem;
    font-weight: 800;
    line-height: 1.3;
    padding: 0.05rem 0 0.55rem;
    text-align: left;
}

.structured-table th,
.structured-table td {
    border: 0;
    border-bottom: 1px solid var(--table-border);
    border-right: 1px solid var(--table-border-soft);
    padding: 0.62rem 0.72rem;
}

.structured-table th:first-child,
.structured-table td:first-child {
    border-left: 1px solid var(--table-border);
}

.structured-table thead th {
    background: var(--table-header-bg);
    border-top: 1px solid var(--table-header-top);
    color: var(--table-header-text);
    font-weight: 800;
    letter-spacing: 0.01em;
    text-align: left;
    vertical-align: bottom;
}

.structured-table thead th:first-child {
    border-top-left-radius: 0.3rem;
}

.structured-table thead th:last-child {
    border-top-right-radius: 0.3rem;
}

.structured-table tbody tr:nth-child(even) td {
    background: var(--table-row-alt);
}

.structured-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.3rem;
}

.structured-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.3rem;
}

.structured-table tbody td:first-child {
    font-weight: 700;
}

body.dark-mode .structured-table-wrap {
    --table-accent: #69a9da;
    --table-accent-strong: #8fc8f2;
    --table-border: #52606c;
    --table-border-soft: #52606c;
    --table-caption: #c8e6ff;
    --table-header-bg: #243746;
    --table-header-text: #c8e6ff;
    --table-header-top: #52606c;
    --table-row-alt: #1b2025;
}

body.dark-mode .structured-table {
    background: var(--surface-1);
}

/* ==========================================================================
   Responsive and print presentation
   ========================================================================== */

@media (max-width: 48rem) {
    .structured-table-wrap {
        gap: 0.4rem;
        grid-template-columns: 1.7rem minmax(0, 1fr);
        margin-left: 0.35rem;
        max-width: calc(100% - 0.35rem);
    }

    .structured-table-icon {
        font-size: 1.2rem;
        width: 1.6rem;
    }

    .structured-table {
        min-width: 28rem;
    }

    .top-bar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .options-menu {
        max-width: calc(100vw - 1rem);
        width: 19rem;
    }

    .level-2 {
        padding-left: 0.75rem;
    }

    .level-3,
    .level-4,
    .level-5 {
        padding-left: 1.25rem;
    }

    .image-block img,
    .screenshot img,
    .screenshot-location img,
    .vs-screenshot {
        max-width: 100%;
    }

    .image-lightbox {
        padding: 0;
    }

    .image-lightbox-panel {
        border-radius: 0;
        height: 100vh;
        max-width: 100vw;
        width: 100vw;
    }

    .image-lightbox-controls {
        width: 100%;
    }

    .lightbox-control {
        flex: 1;
    }

    .readDiv {
        display: block;
    }

    .read,
    .topic,
    .assignmentTrack {
        margin-inline: 0;
        width: 100%;
    }
}

@media print {
    :root {
        --surface-0: #fff;
        --surface-1: #fff;
        --surface-2: #fff;
        --text-primary: #000;
        --text-secondary: #333;
        --border-color: #777;
        --link-color: #000;
    }

    body,
    body.dark-mode {
        background: #fff !important;
        color: #000 !important;
    }

    .options,
    .options-menu,
    .image-lightbox,
    input[type="checkbox"],
    .back-to-top,
    .go-to-top {
        display: none !important;
    }

    main.container,
    .walkthrough {
        margin: 0;
        max-width: none;
        width: 100%;
    }

    .section-card,
    .note,
    .task-resources,
    .task-support {
        break-inside: avoid;
        box-shadow: none !important;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    pre,
    code {
        white-space: pre-wrap;
        word-break: break-word;
    }
}

/* Framework indexes: align each link icon with its containing heading. */
.framework-page .page-node-content .fa-ul {
    --fa-li-margin: 0;
    margin-bottom: 0;
    margin-left: 0;
    margin-top: 0;
    padding-left: 0;
    list-style: none;
}
.framework-page .page-node-content .fa-ul > li {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.18rem;
}
.framework-page .page-node-content .fa-ul > li:last-child { margin-bottom: 0; }
.framework-page .page-node-content .fa-ul > li > .fa-li {
    color: var(--step-icon);
    flex: 0 0 1.25em;
    position: static;
    width: 1.25em;
}
.framework-page .page-node-content .fa-ul > li > a {
    color: var(--step-title);
}
.framework-page .page-node-content .fa-ul > li > a:hover {
    color: #000;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

/* Resource cards share accent-card geometry with callouts. Interaction and the
   stronger accent-colored outer border are resource-card-specific. */
.resource-card-link {
    --accent-card-border: var(--accent-card-accent);
    color: var(--text-primary);
    display: inline-grid;
    max-width: 100%;
    box-shadow: var(--resource-card-shadow);
    text-decoration: none;
    transition: box-shadow 0.15s ease, filter 0.15s ease, transform 0.15s ease;
    width: fit-content;
}

.resource-card-link:hover {
    box-shadow: var(--resource-card-hover-shadow);
    filter: brightness(0.96);
    text-decoration: none;
    transform: translate(2px, -4px);
}

.resource-card-page {
    --accent-card-accent: var(--orange-highlight);
    --accent-card-bg: var(--orange-background);
}

.resource-card-reference {
    --accent-card-accent: var(--green-highlight);
    --accent-card-bg: var(--green-background);
}

.resource-card-external {
    --accent-card-accent: var(--purple-highlight);
    --accent-card-bg: var(--purple-background);
}

.resource-card-file {
    --accent-card-accent: var(--yellow-highlight);
    --accent-card-bg: var(--yellow-background);
}

.resource-card-video {
    --accent-card-accent: var(--red-highlight);
    --accent-card-bg: var(--red-background);
}

.resource-card-group {
    align-items: flex-start;
    background: transparent;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
    max-width: 100%;
    padding: 0;
    width: max-content;
}

.resource-card-group .resource-card-link { margin: 0; }
.resource-card-video .video-duration { font-weight: 400; }

/* A linked page may contain an indexed video. */
.resource-card-page > .accent-card-content {
    align-items: center;
    display: flex;
    gap: 0.55rem;
}

.page-video-indicator {
    align-items: center;
    align-self: center;
    color: var(--accent-card-accent);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 0.75em;
    justify-content: center;
    line-height: 1;
    margin-left: auto;
    padding-left: 0.35rem;
}

@media (prefers-reduced-motion: reduce) {
    .resource-card-link:hover {
        animation: none;
        transition: none;
    }
}

