/* swift-docc-static generated stylesheet - DocC-style layout */
:root {
    --docc-bg: #ffffff;
    --docc-bg-secondary: #f5f5f7;
    --docc-fg: #1d1d1f;
    --docc-fg-secondary: #6e6e73;
    --docc-accent: #0066cc;
    --docc-border: #d2d2d7;
    --sidebar-width: 320px;
    --header-height: 52px;

    /* Typography */
    --typeface-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
    --typeface-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
    --typeface-headline: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;

    /* Swift syntax colours */
    --swift-keyword: #ad3da4;
    --swift-type: #703daa;
    --swift-literal: #d12f1b;
    --swift-comment: #707f8c;
    --swift-string: #d12f1b;
    --swift-number: #272ad8;

    /* Symbol badge colours - monochrome like DocC */
    --badge-bg: #f5f5f7;
    --badge-fg: #6e6e73;
    --badge-border: #d2d2d7;

    /* Aside colours */
    --aside-note-bg: #e3f2fd;
    --aside-note-border: #2196f3;
    --aside-warning-bg: #fff3e0;
    --aside-warning-border: #ff9800;
    --aside-important-bg: #fce4ec;
    --aside-important-border: #e91e63;

    /* Decorative colours */
    --hero-decoration: #d2d2d7;
}


@media (prefers-color-scheme: dark) {
    :root {
        --docc-bg: #1d1d1f;
        --docc-bg-secondary: #2c2c2e;
        --docc-fg: #f5f5f7;
        --docc-fg-secondary: #a1a1a6;
        --docc-border: #424245;

        /* Swift syntax colours - dark mode */
        --swift-keyword: #ff7ab2;
        --swift-type: #dabaff;
        --swift-literal: #ff8170;
        --swift-comment: #7f8c8d;
        --swift-string: #ff8170;
        --swift-number: #d9c97c;

        /* Symbol badge colours - dark mode (monochrome) */
        --badge-bg: #2c2c2e;
        --badge-fg: #a1a1a6;
        --badge-border: #424245;

        /* Aside colours - dark mode */
        --aside-note-bg: rgba(59, 130, 246, 0.15);
        --aside-note-border: #3b82f6;
        --aside-warning-bg: rgba(245, 158, 11, 0.15);
        --aside-warning-border: #f59e0b;
        --aside-important-bg: rgba(239, 68, 68, 0.15);
        --aside-important-border: #ef4444;

        /* Decorative colours - dark mode */
        --hero-decoration: #4a4a4a;
    }
}

/* Explicit theme selection via data-theme attribute */
html[data-theme="light"] {
    --docc-bg: #ffffff;
    --docc-bg-secondary: #f5f5f7;
    --docc-fg: #1d1d1f;
    --docc-fg-secondary: #6e6e73;
    --docc-border: #d2d2d7;
    --swift-keyword: #ad3da4;
    --swift-type: #703daa;
    --swift-literal: #d12f1b;
    --swift-comment: #707f8c;
    --swift-string: #d12f1b;
    --swift-number: #272ad8;
    --badge-bg: #f5f5f7;
    --badge-fg: #6e6e73;
    --badge-border: #d2d2d7;
    --hero-decoration: #d2d2d7;
}

html[data-theme="dark"] {
    --docc-bg: #1d1d1f;
    --docc-bg-secondary: #2c2c2e;
    --docc-fg: #f5f5f7;
    --docc-fg-secondary: #a1a1a6;
    --docc-border: #424245;
    --swift-keyword: #ff7ab2;
    --swift-type: #dabaff;
    --swift-literal: #ff8170;
    --swift-comment: #7f8c8d;
    --swift-string: #ff8170;
    --swift-number: #d9c97c;
    --badge-bg: #2c2c2e;
    --badge-fg: #a1a1a6;
    --badge-border: #424245;
    --hero-decoration: #4a4a4a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--typeface-body);
    background: var(--docc-bg);
    color: var(--docc-fg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--docc-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    font-family: var(--typeface-mono);
    font-size: 0.875em;
    background: var(--docc-bg-secondary);
    padding: 0.125em 0.25em;
    border-radius: 4px;
}

pre {
    font-family: var(--typeface-mono);
    font-size: 0.8125rem;
    background: var(--docc-bg-secondary);
    padding: 1rem;
    border-radius: 12px;
    overflow-x: auto;
    line-height: 1.6;
    margin: 1rem 1.5rem;
}

pre code {
    display: block;
    position: relative;
    left: -1.5rem;
    background: none;
    padding: 0;
}

/* Code blocks inside list items: no left offset since list provides indentation */
li pre {
    margin-left: 0;
    margin-right: 0;
}

li pre code {
    position: static;
    left: 0;
}

/* Code blocks inside declarations: no left offset to prevent truncation */
.declaration pre {
    margin-left: 0;
    margin-right: 0;
}

.declaration pre code {
    position: static;
    left: 0;
}

table {
    border-collapse: collapse;
    margin: 1rem 1.5rem;
    font-size: 0.9375rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--docc-border);
}

th {
    font-weight: 600;
    color: var(--docc-fg-secondary);
}

tr:last-child td {
    border-bottom: none;
}

/* Syntax highlighting */
.syntax-keyword {
    color: var(--swift-keyword);
    font-weight: 500;
}

.syntax-string {
    color: var(--swift-string);
}

.syntax-number {
    color: var(--swift-number);
}

.syntax-comment {
    color: var(--swift-comment);
    font-style: italic;
}

.syntax-type {
    color: var(--swift-type);
}

.syntax-attribute {
    color: var(--swift-keyword);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--typeface-headline);
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.125rem; margin-top: 0; }
h2 { font-size: 1.5rem; border-bottom: 1px solid var(--docc-border); padding-bottom: 0.5rem; }
h3 { font-size: 1.1875rem; }

p { margin-bottom: 1em; }
ul, ol { margin-bottom: 1em; padding-left: 1.5em; }
li { margin-bottom: 0.5em; }

/* Syntax highlighting */
.keyword { color: var(--swift-keyword); font-weight: 500; }
.type { color: var(--swift-type); }
.identifier { color: #4b21b0; }
.param { color: #5d6c79; }
.literal { color: var(--swift-literal); }
.comment { color: var(--swift-comment); font-style: italic; }
.string { color: var(--swift-string); }
.number { color: var(--swift-number); }
.attribute { color: #947100; }
.label { color: var(--docc-fg); }

/* Header bar */
.doc-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--docc-bg);
    border-bottom: 1px solid var(--docc-border);
    z-index: 100;
}

.header-content {
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--docc-fg);
    text-decoration: none;
}

.header-title:hover {
    text-decoration: none;
}

.header-icon {
    display: flex;
    align-items: center;
}

.header-icon svg {
    width: 20px;
    height: 20px;
}

.header-language {
    font-size: 0.875rem;
    color: var(--docc-fg-secondary);
}

/* Sidebar toggle (hidden checkbox) */
.sidebar-toggle-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Toggle button (hamburger) */
.sidebar-toggle-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.sidebar-toggle-button:hover {
    background: var(--docc-bg-secondary);
}

.toggle-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 14px;
}

.toggle-icon .bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--docc-fg);
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Hamburger to X animation when sidebar is collapsed */
.sidebar-toggle-checkbox:checked ~ .doc-header .toggle-icon .bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.sidebar-toggle-checkbox:checked ~ .doc-header .toggle-icon .bar:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle-checkbox:checked ~ .doc-header .toggle-icon .bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Two-column layout */
.doc-layout {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* Sidebar */
.doc-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    border-right: 1px solid var(--docc-border);
    background: var(--docc-bg);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, width 0.3s ease;
    will-change: transform;
}

/* Sidebar collapsed state */
.sidebar-toggle-checkbox:checked ~ .doc-layout .doc-sidebar {
    transform: translateX(-100%);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.sidebar-module {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1.25rem;
    margin: 0 0 0.5rem 0;
    border: none;
}

.sidebar-section {
    margin-bottom: 0.5rem;
}

/* Module section in multi-module sidebar */
.module-section {
    position: relative;
    padding-left: 0;
}

.module-section .module-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.module-section .module-header .disclosure-chevron {
    position: static;
    margin-right: 0.5rem;
}

.module-section .module-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--docc-fg);
    margin: 0;
    padding: 0;
}

.module-section .module-contents {
    display: none;
    padding-left: 1rem;
    margin: 0;
}

.module-section > .disclosure-checkbox:checked ~ .module-contents {
    display: block;
}

.module-section > .disclosure-checkbox:checked ~ .module-header .disclosure-chevron svg {
    transform: rotate(90deg);
}

.sidebar-heading {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--docc-fg-secondary);
    padding: 0.75rem 1.25rem 0.25rem;
    margin: 0;
    border: none;
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.1875rem 1rem 0.1875rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.sidebar-item a {
    color: var(--docc-fg);
    text-decoration: none;
}

.sidebar-item:hover {
    background: var(--docc-bg-secondary);
}

.sidebar-item a:hover {
    text-decoration: none;
}

.sidebar-item.active,
.sidebar-item.selected {
    background: rgba(0, 102, 204, 0.1);
}

.sidebar-item.selected > .nav-link {
    font-weight: 500;
}

/* Sidebar module link */
.sidebar-module-link {
    text-decoration: none;
    color: inherit;
}

.sidebar-module-link:hover {
    text-decoration: none;
}

/* Disclosure chevron for expandable items */
.disclosure-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.disclosure-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--docc-fg-secondary);
}

.disclosure-chevron svg {
    width: 8px;
    height: 8px;
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

.disclosure-checkbox:checked + .disclosure-chevron svg {
    transform: rotate(90deg);
}

.sidebar-item.expandable {
    flex-wrap: wrap;
}

.sidebar-item.expandable > .nav-link {
    flex: 1;
}

/* Nested children (collapsed by default with animation) */
.nav-children {
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
    margin-left: 1.125rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.2s ease, opacity 0.15s ease;
}

.disclosure-checkbox:checked ~ .nav-children {
    max-height: 2000px;
    opacity: 1;
}

/* Nested group headers */
.nav-group-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--docc-fg-secondary);
    padding: 0.5rem 0 0.25rem;
    list-style: none;
}

/* Collapsible group headers with disclosure */
.nav-group-header.expandable {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0 0.25rem;
}

.nav-group-header.expandable .disclosure-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.nav-group-header.expandable > .disclosure-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-group-header.expandable > .disclosure-chevron svg {
    width: 10px;
    height: 10px;
    transition: transform 0.15s ease;
    transform-origin: center;
}

.nav-group-header.expandable > .disclosure-checkbox:checked + .disclosure-chevron svg {
    transform: rotate(90deg);
}

.nav-group-header.expandable .group-title,
.nav-group-header.expandable .nav-link.group-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--docc-fg-secondary);
    text-decoration: none;
}

.nav-group-header.expandable .nav-link.group-link:hover {
    color: var(--docc-accent);
}

.nav-group-header.expandable .nav-children {
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.2s ease, opacity 0.15s ease;
    padding-left: 0.5rem;
    margin-top: 0.25rem;
}

.nav-group-header.expandable .disclosure-checkbox:checked ~ .nav-children {
    max-height: 2000px;
    opacity: 1;
}

/* Nested child items */
.nav-child-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0;
    font-size: 0.8125rem;
    line-height: 1.3;
}

.nav-child-item a {
    color: var(--docc-fg);
    text-decoration: none;
}

.nav-child-item:hover a {
    color: var(--docc-accent);
}

.nav-child-item.selected a {
    font-weight: 500;
    color: var(--docc-accent);
}

/* Symbol icon for articles/tutorials */
.symbol-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--docc-fg-secondary);
}

.symbol-icon svg {
    width: 14px;
    height: 14px;
}

/* Filter with shortcut indicator - hidden by default, shown via JS */
.sidebar-filter {
    display: none;  /* JS sets to flex when available */
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--docc-border);
    background: var(--docc-bg);
    flex-shrink: 0;
}

.filter-icon {
    display: flex;
    align-items: center;
    color: var(--docc-fg-secondary);
}

.filter-shortcut {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--docc-border);
    border-radius: 4px;
    color: var(--docc-fg-secondary);
}

/* Symbol type badges - monochrome like DocC */
.symbol-badge {
    width: 17px;
    height: 17px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 600;
    flex-shrink: 0;
    background: var(--badge-bg);
    color: var(--badge-fg);
    border: 1px solid var(--badge-border);
}

.badge-article,
.badge-tutorial {
    background: transparent;
    border: none;
    width: auto;
    height: auto;
}

.filter-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--docc-border);
    border-radius: 6px;
    background: var(--docc-bg-secondary);
}

.filter-input:focus {
    outline: none;
    border-color: var(--docc-accent);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* Filter hidden state for navigation items */
.filter-hidden {
    display: none !important;
}

/* Highlight matching items during filter */
.filter-match > a,
.filter-match > .nav-link {
    background: rgba(0, 102, 204, 0.1);
    border-radius: 4px;
}

/* Search results sections in sidebar */
.search-results-sections {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--docc-border);
}

.search-result-section {
    margin-bottom: 0.75rem;
}

.search-result-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--docc-fg-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
    padding: 0.5rem 0.75rem 0;
}

.search-result-subheading {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--docc-fg-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0.5rem 0 0.25rem 0;
    padding: 0 0.75rem;
}

.search-result-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result-item {
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 2px;
}

.search-result-item:hover {
    background: var(--docc-bg-secondary);
}

.search-result-link {
    display: block;
    color: var(--docc-fg);
    text-decoration: none;
    font-size: 0.875rem;
}

.search-result-link:hover {
    color: var(--docc-accent);
}

.search-result-title {
    display: block;
    font-weight: 500;
}

.search-result-summary {
    margin: 0.25rem 0 0 0;
    font-size: 0.75rem;
    color: var(--docc-fg-secondary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Footer - accounts for fixed sidebar */
.doc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-left: var(--sidebar-width);
    border-top: 1px solid var(--docc-border);
    background: var(--docc-bg);
    font-size: 0.8125rem;
    color: var(--docc-fg-secondary);
    transition: margin-left 0.3s ease;
}

/* Footer expands when sidebar is collapsed */
.sidebar-toggle-checkbox:checked ~ .doc-footer {
    margin-left: 0;
}

.footer-content {
    flex: 1;
}

.footer-content a {
    color: var(--docc-accent);
}

/* Appearance selector */
.appearance-selector {
    display: inline-flex;
    border: 1px solid var(--docc-accent);
    border-radius: 6px;
    overflow: hidden;
}

.appearance-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--docc-accent);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.appearance-btn:not(:last-child) {
    border-right: 1px solid var(--docc-accent);
}

.appearance-btn:hover {
    background: rgba(0, 102, 204, 0.1);
}

.appearance-btn.active {
    background: var(--docc-accent);
    color: white;
}

/* Hide appearance selector until JS runs (shows noscript fallback) */
.appearance-selector {
    visibility: hidden;
}

/* Main content */
.doc-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    max-width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s ease, max-width 0.3s ease;
}

/* Main content expanded when sidebar is collapsed */
.sidebar-toggle-checkbox:checked ~ .doc-layout .doc-main {
    margin-left: 0;
    max-width: 100%;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--docc-fg-secondary);
    padding: 1rem 3rem;
    border-bottom: 1px solid var(--docc-border);
}

.breadcrumbs a {
    color: var(--docc-accent);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs .separator {
    color: var(--docc-fg-secondary);
}

/* Hero section */
.hero-section {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--docc-bg-secondary);
    padding: 2rem 3rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    flex: 1;
    max-width: 70%;
}

.hero-decoration {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    color: var(--hero-decoration);
    opacity: 0.6;
    margin-left: 2rem;
}

.hero-decoration svg {
    width: 100%;
    height: 100%;
}

.eyebrow {
    font-size: 0.8125rem;
    color: var(--docc-fg-secondary);
    margin-bottom: 0.25rem;
    text-transform: capitalize;
}

.hero-section h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.hero-section .abstract {
    font-size: 1.1875rem;
    color: var(--docc-fg-secondary);
    margin-bottom: 0;
}

.abstract {
    font-size: 1.1875rem;
    color: var(--docc-fg-secondary);
    margin-bottom: 1.5rem;
}

/* Content sections within main */
.doc-main section,
.doc-main .declaration,
.doc-main > p,
.doc-main > ul,
.doc-main > ol,
.doc-main > pre,
.doc-main > h2,
.doc-main > h3 {
    padding-left: 3rem;
    padding-right: 3rem;
}

.topics,
.relationships,
.see-also,
.discussion,
.parameters {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* Legacy single-column layout (for index page) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.declaration {
    background: var(--docc-bg-secondary);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

nav.breadcrumbs {
    font-size: 0.8125rem;
    color: var(--docc-fg-secondary);
    margin-bottom: 1rem;
}

nav.breadcrumbs a {
    color: var(--docc-fg-secondary);
}

/* Symbol cards in Topics section */
.symbol-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.symbol-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
}

.symbol-card .symbol-badge {
    margin-top: 0.125rem;
}

.symbol-info {
    flex: 1;
    min-width: 0;
}

.symbol-name {
    font-family: var(--typeface-body);
    font-weight: 400;
    display: block;
    margin-bottom: 0.25rem;
}

.symbol-summary {
    color: var(--docc-fg-secondary);
    font-size: 0.875rem;
    margin: 0;
    line-height: 1.4;
}

/* Aside boxes */
.aside {
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.aside.note {
    background: var(--aside-note-bg);
    border-left: 3px solid var(--aside-note-border);
}

.aside.warning {
    background: var(--aside-warning-bg);
    border-left: 3px solid var(--aside-warning-border);
}

.aside.important {
    background: var(--aside-important-bg);
    border-left: 3px solid var(--aside-important-border);
}

.aside .label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Index page styles */
.index-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--docc-border);
}

.index-header .subtitle {
    color: var(--docc-fg-secondary);
    font-size: 1.1rem;
}

.index-intro {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 1rem 0;
    line-height: 1.6;
}

.index-intro p {
    margin-bottom: 1rem;
}

.index-intro h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: var(--docc-fg);
    border-bottom: none;
    padding-bottom: 0;
}

.index-intro h3 {
    font-size: 1.25rem;
    margin: 1.25rem 0 0.75rem;
    color: var(--docc-fg);
}

.index-intro ul, .index-intro ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.index-intro li {
    margin-bottom: 0.5rem;
}

.index-intro code {
    background: var(--docc-bg-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--typeface-mono);
    font-size: 0.9em;
}

.index-intro pre {
    background: var(--docc-bg-secondary);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: var(--typeface-mono);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.index-intro pre code {
    background: none;
    padding: 0;
    position: static;
    left: 0;
}

.index-intro a {
    color: var(--docc-link);
}

.index-intro a:hover {
    text-decoration: underline;
}

.search-form {
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--docc-border);
    border-radius: 8px;
    background: var(--docc-bg);
    color: var(--docc-fg);
}

.search-results {
    margin-top: 1rem;
    background: var(--docc-bg);
    border: 1px solid var(--docc-border);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--docc-border);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--docc-bg-secondary);
}

.result-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-title {
    font-weight: 500;
}

.result-type {
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: var(--docc-bg-secondary);
    color: var(--docc-fg-secondary);
}

.result-type-symbol {
    background: #e3f2fd;
    color: #1565c0;
}

.result-type-article {
    background: #e8f5e9;
    color: #2e7d32;
}

.result-type-tutorial {
    background: #fff3e0;
    color: #ef6c00;
}

.result-summary {
    font-size: 0.875rem;
    color: var(--docc-fg-secondary);
    margin-top: 0.25rem;
}

.no-results {
    padding: 1rem;
    color: var(--docc-fg-secondary);
    text-align: center;
}

.search-unavailable {
    color: var(--docc-fg-secondary);
    font-size: 0.875rem;
}

.module-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.module-card {
    padding: 1.25rem;
    border: 1px solid var(--docc-border);
    border-radius: 12px;
    background: var(--docc-bg);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.module-card:hover {
    border-color: var(--docc-accent);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.module-name {
    font-family: var(--typeface-mono);
    font-size: 1.1rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.module-abstract {
    color: var(--docc-fg-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.module-stats {
    color: var(--docc-fg-secondary);
    font-size: 0.8rem;
}

/* Tutorials section on index page */
.tutorials-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--docc-border);
}

.tutorials-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: none;
    padding-bottom: 0;
}

.tutorial-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.tutorial-collection-card {
    padding: 1.25rem;
    border: 1px solid var(--docc-border);
    border-radius: 12px;
    background: var(--docc-bg);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.tutorial-collection-card:hover {
    border-color: var(--docc-accent);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.tutorial-collection-name {
    font-size: 1.0625rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.tutorial-collection-stats {
    color: var(--docc-fg-secondary);
    font-size: 0.8rem;
}

/* ========================================
   Tutorial Page Styles
   Based on swift-docc-render structure
   ======================================== */

/* Tutorial pages have no sidebar */
body.tutorial-page {
    --sidebar-width: 0px;
}

body.tutorial-page .doc-sidebar {
    display: none;
}

body.tutorial-page .doc-main {
    margin-left: 0;
    max-width: 100%;
    padding: 0;
}

body.tutorial-page .doc-footer,
body.tutorial-overview-page .doc-footer,
body.index-page .doc-footer {
    margin-left: 0;
}

body.tutorial-page .doc-layout {
    padding-top: var(--header-height);
}

/* Tutorial Navigation Bar */
.tutorial-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--docc-bg);
    border-bottom: 1px solid var(--docc-border);
    z-index: 100;
    display: flex;
    align-items: center;
}

.tutorial-nav-content {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 1.5rem;
    gap: 1rem;
}

.tutorial-nav-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--docc-fg);
    text-decoration: none;
    white-space: nowrap;
}

.tutorial-nav-title:hover {
    color: var(--docc-accent);
    text-decoration: none;
}

.nav-separator {
    color: var(--docc-fg-secondary);
    font-size: 0.875rem;
}

.tutorial-nav-dropdowns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* Tutorial dropdowns - pure CSS using details/summary */
details.tutorial-dropdown {
    position: relative;
}

/* Hide the default disclosure triangle */
details.tutorial-dropdown > summary {
    list-style: none;
}
details.tutorial-dropdown > summary::-webkit-details-marker {
    display: none;
}
details.tutorial-dropdown > summary::marker {
    display: none;
}

.tutorial-dropdown-toggle {
    background: var(--docc-bg);
    border: 1px solid var(--docc-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--docc-fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 180px;
    max-width: 280px;
}

.tutorial-dropdown-toggle:hover {
    background: var(--docc-bg-secondary);
}

.dropdown-label {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-chevron {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

details.tutorial-dropdown[open] .dropdown-chevron {
    transform: rotate(180deg);
}

.tutorial-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-width: 320px;
    background: var(--docc-bg);
    border: 1px solid var(--docc-border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.5rem 0;
    z-index: 200;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-item {
    display: block;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: var(--docc-fg);
    text-decoration: none;
}

.dropdown-item:hover {
    background: var(--docc-bg-secondary);
    text-decoration: none;
}

.dropdown-item.selected {
    font-weight: 600;
    color: var(--docc-accent);
}

/* Dropdown chapter grouping */
.dropdown-chapter {
    padding: 0.25rem 0;
}

.dropdown-chapter:not(:first-child) {
    border-top: 1px solid var(--docc-border);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
}

.dropdown-chapter-title {
    display: block;
    padding: 0.375rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--docc-fg-secondary);
}

.dropdown-chapter .dropdown-item {
    padding-left: 1.25rem;
}

/* ========================================
   Tutorial Hero Section
   Large dark section with left-aligned content
   ======================================== */
.tutorial-hero {
    background: #1d1d1f;
    color: #ffffff;
    min-height: 420px;
    padding: 3rem 2rem;
    position: relative;
    display: flex;
    align-items: center;
}

.tutorial-hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    padding-left: 2rem;
}

.tutorial-chapter {
    font-size: 1.0625rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 0.5rem 0;
    padding-top: 0.5rem;
}

.tutorial-hero h1,
.tutorial-hero .tutorial-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 1.25rem 0;
    color: #ffffff;
}

.tutorial-hero .tutorial-abstract {
    font-size: 1.0625rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
}

.tutorial-hero .tutorial-time {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.tutorial-hero .time-value {
    font-size: 1.5rem;
    font-weight: 600;
}

.tutorial-hero .time-label {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
}

.tutorial-hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    overflow: hidden;
}

.tutorial-hero-background picture {
    display: block;
    width: 100%;
    height: 100%;
}

.tutorial-hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    opacity: 0.5;
}

/* ========================================
   Tutorial Intro Section
   ======================================== */
.tutorial-intro-section {
    padding: 3rem 4rem;
    max-width: 900px;
}

.tutorial-intro-section p {
    font-size: 1.0625rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.intro-media {
    margin-top: 2rem;
}

.intro-media img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ========================================
   Tutorial Section with Steps
   Two-column layout: steps left, sticky asset right
   ======================================== */
.tutorial-section {
    border-top: 1px solid var(--docc-border);
    padding: 0;
}

.section-header {
    padding: 3rem 4rem 2rem;
    max-width: 900px;
}

.section-number {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--docc-fg-secondary);
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Section intro content row */
.section-content-row {
    display: flex;
    gap: 3rem;
    padding: 0 4rem 2rem;
    align-items: flex-start;
}

.section-text {
    flex: 0 0 auto;
    width: 40%;
    min-width: 300px;
    max-width: 450px;
}

.section-text p {
    font-size: 1rem;
    line-height: 1.6;
}

.section-media {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    min-height: 250px;
}

.section-media picture {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.section-media img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
}

/* ========================================
   Steps Layout (Two-Column with Sticky Asset)
   ======================================== */
.tutorial-steps-wrapper {
    display: flex;
    position: relative;
}

.steps-content {
    flex: 0 0 45%;
    max-width: 500px;
    padding: 0 2rem 0 4rem;
}

.steps-asset-container {
    flex: 1;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
    height: calc(100vh - var(--header-height) - 2rem);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 2rem;
}

/* Individual Step */
.tutorial-step {
    padding: 1.5rem 0;
    border-left: 3px solid transparent;
    padding-left: 1.5rem;
    margin-left: -1.5rem;
}

.tutorial-step.active {
    border-left-color: var(--docc-accent);
}

.step-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--docc-accent);
    margin-bottom: 0.75rem;
}

.step-content {
    font-size: 1rem;
    line-height: 1.6;
}

.step-content p {
    margin: 0 0 1rem 0;
}

.step-content p:last-child {
    margin-bottom: 0;
}

.step-caption {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--docc-border);
    font-size: 0.9375rem;
    color: var(--docc-fg-secondary);
}

/* ========================================
   Code Preview Panel (Right Side)
   ======================================== */
.code-preview {
    background: #1d1d1f;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - var(--header-height) - 4rem);
}

.code-preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: #2d2d2f;
    border-bottom: 1px solid #3d3d3f;
}

.file-icon {
    color: #8e8e93;
}

.file-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.file-name {
    font-family: var(--typeface-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #ffffff;
}

.code-preview-content {
    flex: 1;
    overflow: auto;
    padding: 1rem 0;
}

.code-preview-content pre {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: 0.8125rem;
    line-height: 1.7;
}

.code-preview-content code {
    display: block;
    background: transparent;
    padding: 0;
    color: #ffffff;
}

.code-line {
    display: flex;
    padding: 0 1rem;
}

.code-line:hover {
    background: rgba(255, 255, 255, 0.05);
}

.line-number {
    flex-shrink: 0;
    width: 3rem;
    text-align: right;
    padding-right: 1rem;
    color: #5d5d5f;
    user-select: none;
}

.line-content {
    flex: 1;
    white-space: pre;
}

/* Code syntax highlighting for dark theme */
.code-preview .syntax-keyword { color: #ff7ab2; }
.code-preview .syntax-type { color: #dabaff; }
.code-preview .syntax-string { color: #ff8170; }
.code-preview .syntax-number { color: #d9c97c; }
.code-preview .syntax-comment { color: #7f8c8d; }

/* ========================================
   Media Preview Panel
   ======================================== */
.media-preview {
    background: var(--docc-bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.media-preview img,
.media-preview video {
    max-width: 100%;
    max-height: calc(100vh - var(--header-height) - 8rem);
    height: auto;
    border-radius: 8px;
}

/* ========================================
   Fallback: Simple Step Row Layout
   Used when steps don't have associated media
   ======================================== */
.tutorial-steps-container {
    padding: 0 4rem 2rem;
}

.tutorial-step-row {
    display: flex;
    gap: 3rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.step-card {
    flex: 0 0 auto;
    width: 40%;
    min-width: 300px;
    max-width: 450px;
}

.step-code-panel {
    flex: 1;
    background: var(--docc-bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--docc-border);
}

.code-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: var(--docc-bg);
    border-bottom: 1px solid var(--docc-border);
}

.code-panel-header .file-icon {
    color: var(--docc-fg-secondary);
}

.code-panel-header .file-name {
    font-family: var(--typeface-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--docc-fg);
}

.code-panel-content {
    flex: 1;
    overflow: auto;
    padding: 1rem 0;
}

.code-panel-content pre {
    margin: 0;
    padding: 0;
    background: transparent;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.code-panel-content code {
    display: block;
    background: transparent;
    padding: 0;
    color: var(--docc-fg);
}

.code-panel-content .line {
    display: flex;
    padding: 0 1rem;
    margin: 0;
    line-height: 1.4;
}

.code-panel-content .line:hover {
    background: var(--docc-bg);
}

.code-panel-content .line-number {
    flex-shrink: 0;
    width: 3rem;
    text-align: right;
    padding-right: 1rem;
    color: var(--docc-fg-secondary);
    user-select: none;
}

.code-panel-content .line-content {
    flex: 1;
    white-space: pre;
}

/* Step media panel */
.step-media-panel {
    flex: 1;
    background: var(--docc-bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    max-height: 500px;
}

.step-media-panel img {
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
}

/* ========================================
   Tutorial Assessments
   ======================================== */
.tutorial-assessments {
    padding: 3rem 4rem;
    max-width: 900px;
}

.tutorial-assessments h3 {
    font-size: 1.5rem;
    margin: 0 0 2rem 0;
}

.assessment {
    background: var(--docc-bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.question-number {
    font-size: 0.875rem;
    color: var(--docc-fg-secondary);
    margin-bottom: 1rem;
}

.question {
    font-size: 1.0625rem;
    margin-bottom: 1.5rem;
}

.choices {
    border: none;
    padding: 0;
    margin: 0;
}

.choice {
    display: flex;
    align-items: flex-start;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--docc-border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    position: relative;
}

.choice:hover {
    border-color: var(--docc-accent);
    background: rgba(0, 102, 204, 0.05);
}

/* Hide the radio input but keep it accessible */
.choice-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    cursor: pointer;
    margin: 0;
    z-index: 1;
}

/* Choice indicator (circle/checkmark area) */
.choice-indicator {
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    width: 18px;
    height: 18px;
    border: 2px solid var(--docc-border);
    border-radius: 50%;
    background: var(--docc-bg);
    transition: all 0.15s ease;
}

.choice-indicator::after {
    content: '';
    position: absolute;
    display: none;
}

.choice-content {
    flex: 1;
}

.choice-content p {
    margin: 0;
}

/* Hide justification by default */
.choice-justification {
    display: none;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid currentColor;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Correct answer styling when selected */
.choice.correct-answer:has(.choice-input:checked) {
    border-color: #34c759;
    background: rgba(52, 199, 89, 0.1);
}

.choice.correct-answer:has(.choice-input:checked) .choice-indicator {
    border-color: #34c759;
    background: #34c759;
}

.choice.correct-answer:has(.choice-input:checked) .choice-indicator::after {
    display: block;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.choice.correct-answer:has(.choice-input:checked) .choice-justification {
    display: block;
    border-color: rgba(52, 199, 89, 0.3);
}

/* Incorrect answer styling when selected */
.choice.incorrect-answer:has(.choice-input:checked) {
    border-color: #ff3b30;
    background: rgba(255, 59, 48, 0.1);
}

.choice.incorrect-answer:has(.choice-input:checked) .choice-indicator {
    border-color: #ff3b30;
    background: #ff3b30;
}

.choice.incorrect-answer:has(.choice-input:checked) .choice-indicator::after {
    display: block;
    left: 3px;
    top: 3px;
    width: 8px;
    height: 8px;
    background: white;
    clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%);
}

.choice.incorrect-answer:has(.choice-input:checked) .choice-justification {
    display: block;
    border-color: rgba(255, 59, 48, 0.3);
}

/* Disable pointer events on other choices once one is selected */
.choices:has(.choice-input:checked) .choice:not(:has(.choice-input:checked)) {
    pointer-events: none;
    opacity: 0.6;
}

/* ========================================
   Tutorial Call-to-Action (Next Tutorial)
   ======================================== */
.tutorial-cta {
    padding: 3rem 4rem 4rem;
    border-top: 1px solid var(--docc-border);
    max-width: 900px;
}

.tutorial-cta h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.tutorial-cta .cta-abstract {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--docc-fg-secondary);
    margin: 0 0 1.5rem 0;
}

.tutorial-cta .cta-action a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--docc-accent);
    text-decoration: none;
}

.tutorial-cta .cta-action a:hover {
    text-decoration: underline;
}

.tutorial-cta .cta-action a::after {
    content: '→';
}

/* ========================================
   Tutorial Overview Page
   ======================================== */
.tutorial-overview-page {
    background: var(--docc-bg);
    color: var(--docc-fg);
    min-height: 100vh;
}

.tutorial-overview-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.overview-hero {
    text-align: center;
    padding: 4rem 2rem;
    border-bottom: 1px solid var(--docc-border);
}

.overview-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.overview-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--docc-fg);
}

.overview-hero p {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--docc-fg-secondary);
    margin-bottom: 1rem;
}

.overview-volume {
    padding: 3rem 0;
}

.overview-chapter {
    margin-bottom: 3rem;
}

.chapter-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--docc-accent);
}

.chapter-description {
    color: var(--docc-fg-secondary);
    margin-bottom: 1.5rem;
}

.chapter-tutorials,
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.overview-tutorials {
    padding: 3rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tutorial-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--docc-bg-secondary);
    border-radius: 12px;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tutorial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tutorial-card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--docc-fg);
    margin-bottom: 0.5rem;
}

.tutorial-card-abstract {
    font-size: 0.875rem;
    color: var(--docc-fg-secondary);
    line-height: 1.5;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 1024px) {
    .tutorial-hero-content {
        max-width: 500px;
    }

    .tutorial-hero-background {
        opacity: 0.3;
    }

    .section-content-row {
        flex-direction: column;
        padding: 0 2rem 2rem;
    }

    .section-text {
        flex: none;
        min-width: auto;
        max-width: none;
        margin-bottom: 2rem;
    }

    .section-media {
        width: 100%;
    }

    .tutorial-steps-wrapper {
        flex-direction: column;
    }

    .steps-content {
        flex: none;
        max-width: none;
        padding: 0 2rem;
    }

    .steps-asset-container {
        position: relative;
        top: auto;
        height: auto;
        padding: 2rem;
    }

    .tutorial-step-row {
        flex-direction: column;
    }

    .step-card {
        flex: none;
        max-width: none;
    }

    .step-code-panel,
    .step-media-panel {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .tutorial-nav-content {
        padding: 0 1rem;
    }

    .tutorial-nav-title {
        font-size: 0.8125rem;
    }

    .tutorial-dropdown-toggle {
        min-width: 120px;
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }

    .tutorial-hero {
        min-height: 320px;
        padding: 2rem 1rem;
    }

    .tutorial-hero-content {
        padding-left: 1rem;
        max-width: 100%;
    }

    .tutorial-hero h1,
    .tutorial-hero .tutorial-title {
        font-size: 1.75rem;
    }

    .tutorial-hero-background {
        display: none;
    }

    .tutorial-intro-section,
    .section-header,
    .tutorial-steps-container,
    .tutorial-assessments,
    .tutorial-cta {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Spotlight search overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-container {
    width: 90%;
    max-width: 600px;
    background: var(--docc-bg);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.15s;
}

.search-overlay.active .search-overlay-container {
    transform: translateY(0);
}

.search-overlay-input-wrapper {
    padding: 1rem;
    border-bottom: 1px solid var(--docc-border);
}

.search-overlay-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    border: 1px solid var(--docc-border);
    border-radius: 8px;
    background: var(--docc-bg-secondary);
    color: var(--docc-fg);
    outline: none;
}

.search-overlay-input:focus {
    border-color: var(--docc-accent);
}

.search-overlay-input::placeholder {
    color: var(--docc-fg-secondary);
}

.search-overlay-results {
    max-height: 60vh;
    overflow-y: auto;
}

.search-overlay-empty {
    padding: 2rem;
    text-align: center;
    color: var(--docc-fg-secondary);
}

.search-overlay-section {
    padding: 0.5rem 0;
}

.search-overlay-section-title {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--docc-fg-secondary);
}

.search-overlay-item {
    display: block;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--docc-fg);
    cursor: pointer;
}

.search-overlay-item:hover,
.search-overlay-item.selected {
    background: var(--docc-bg-secondary);
}

.search-overlay-item-title {
    display: block;
    font-weight: 500;
}

.search-overlay-item-path {
    display: block;
    font-size: 0.8rem;
    color: var(--docc-fg-secondary);
    margin-top: 0.25rem;
}

.search-overlay-hint {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--docc-border);
    font-size: 0.75rem;
    color: var(--docc-fg-secondary);
    display: flex;
    gap: 1rem;
}

.search-overlay-hint kbd {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: var(--docc-bg-secondary);
    border: 1px solid var(--docc-border);
    border-radius: 4px;
    font-family: var(--typeface-mono);
    font-size: 0.7rem;
}

