/*
 * Eulogikon design tokens — the single palette contract for every bundle.
 * Prepended structurally by stylesheet_registry.py (bundle_content).
 * Role-based names only: one signifier, one referent.
 *
 * Palette 2026-09-21 ("ink and paper", docs/plans/appearance_de_ai_2026-09-21.md):
 * light mode is a warm ink-on-paper ramp with one scholarly blue accent
 * (the former palette was the unmodified Tailwind gray ramp, retired).
 * Dark mode keeps the slate-blue night ground the site always had
 * (owner call 2026-09-22: "the blue we had before"; the warm charcoal
 * experiment did not survive the owner's eye) with the same blue accent.
 *
 * Identity face: Gentium Plus (wordmark, headings, Greek) — served as
 * local Greek+Latin woff2 subsets from /assets/, declared here once for
 * every bundle. UI chrome stays Source Sans Pro.
 *
 * Theme resolution (auto + manual toggle):
 *   1. Base `:root`          — light values (default).
 *   2. `@media dark` block   — dark values when the OS prefers dark and the
 *                              user has not forced light.
 *   3. `[data-theme="light"]`— light values re-asserted to defeat the media
 *                              query when the user forces light.
 *   4. `[data-theme="dark"]` — dark values when the user forces dark.
 *
 * By construction the light block appears exactly twice and the dark block
 * exactly twice. When editing either palette, update BOTH of its blocks.
 *
 * Fixed chrome exceptions are gone: the masthead reads tokens like every
 * other surface (flat masthead — see site_chrome.css).
 */
@font-face {
    font-family: "Gentium Plus";
    src: url("/assets/gentium-plus-regular-greek.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Gentium Plus";
    src: url("/assets/gentium-plus-italic-greek.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Gentium Plus";
    src: url("/assets/gentium-plus-bold-greek.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Gentium Plus";
    src: url("/assets/gentium-plus-bold-italic-greek.woff2") format("woff2");
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

:root {
    color-scheme: light;

    /* Surfaces — paper */
    --surface-page: #FAF7F1;
    --surface-card: #FFFEF9;
    --surface-hover: #F0EBE0;
    --surface-recessed: #F4F0E6;
    --surface-code: #2B2620;
    --surface-chip: #F0EBE0;

    /* Text — ink ramp */
    --text-primary: #29241D;
    --text-secondary: #4E4639;
    --text-muted: #756C5D;
    --text-faint: #A69C8A;

    /* Borders */
    --border-default: #DFD8C9;
    --border-strong: #C2B9A5;
    --border-hairline: #EBE5D8;

    /* Accent — scholarly blue */
    --accent: #35618F;
    --accent-strong: #234A73;
    --accent-ink: #234A73;

    /* Chrome */
    --chrome-ink: #29241D;
    --wordmark: #29241D;
    --bar-bg: #F4F0E6;
    --bar-ink: #29241D;

    /* Status */
    --status-danger-ink: #C53030;
    --status-danger-bg: #FFF5F5;
    --status-danger-border: #FED7D7;
    --status-success-ink: #276749;
    --status-success-bg: #F0FFF4;
    --status-success-border: #C6F6D5;
    --pdf-badge: #E31C23;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;

        /* Surfaces — slate-blue night (owner call 2026-09-22: restored) */
        --surface-page: #1A202C;
        --surface-card: #1A202C;
        --surface-hover: #2D3748;
        --surface-recessed: #151922;
        --surface-code: #0D0F12;
        --surface-chip: #2D3748;

        /* Text — cool slate ramp */
        --text-primary: #E2E8F0;
        --text-secondary: #CBD5E0;
        --text-muted: #A0AEC0;
        --text-faint: #718096;

        /* Borders */
        --border-default: #2D3748;
        --border-strong: #3D4552;
        --border-hairline: #171A1F;

        /* Accent — scholarly blue brightened for slate */
        --accent: #8FB3D4;
        --accent-strong: #B3CBDF;
        --accent-ink: #B3CBDF;

        /* Chrome */
        --chrome-ink: #E2E8F0;
        --wordmark: #F0F4F8;
        --bar-bg: #1A1E24;
        --bar-ink: #E2E8F0;

        /* Status */
        --status-danger-ink: #FCA5A5;
        --status-danger-bg: rgba(197, 48, 48, 0.16);
        --status-danger-border: rgba(197, 48, 48, 0.45);
        --status-success-ink: #9AE6B4;
        --status-success-bg: rgba(39, 103, 73, 0.16);
        --status-success-border: rgba(72, 187, 120, 0.45);
        --pdf-badge: #E31C23;
    }
}

:root[data-theme="light"] {
    color-scheme: light;

    /* Surfaces — paper */
    --surface-page: #FAF7F1;
    --surface-card: #FFFEF9;
    --surface-hover: #F0EBE0;
    --surface-recessed: #F4F0E6;
    --surface-code: #2B2620;
    --surface-chip: #F0EBE0;

    /* Text — ink ramp */
    --text-primary: #29241D;
    --text-secondary: #4E4639;
    --text-muted: #756C5D;
    --text-faint: #A69C8A;

    /* Borders */
    --border-default: #DFD8C9;
    --border-strong: #C2B9A5;
    --border-hairline: #EBE5D8;

    /* Accent — scholarly blue */
    --accent: #35618F;
    --accent-strong: #234A73;
    --accent-ink: #234A73;

    /* Chrome */
    --chrome-ink: #29241D;
    --wordmark: #29241D;
    --bar-bg: #F4F0E6;
    --bar-ink: #29241D;

    /* Status */
    --status-danger-ink: #C53030;
    --status-danger-bg: #FFF5F5;
    --status-danger-border: #FED7D7;
    --status-success-ink: #276749;
    --status-success-bg: #F0FFF4;
    --status-success-border: #C6F6D5;
    --pdf-badge: #E31C23;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    /* Surfaces — slate-blue night (owner call 2026-09-22: restored) */
    --surface-page: #1A202C;
    --surface-card: #1A202C;
    --surface-hover: #2D3748;
    --surface-recessed: #151922;
    --surface-code: #0D0F12;
    --surface-chip: #2D3748;

    /* Text — cool slate ramp */
    --text-primary: #E2E8F0;
    --text-secondary: #CBD5E0;
    --text-muted: #A0AEC0;
    --text-faint: #718096;

    /* Borders */
    --border-default: #2D3748;
    --border-strong: #3D4552;
    --border-hairline: #171A1F;

    /* Accent — scholarly blue brightened for slate */
    --accent: #8FB3D4;
    --accent-strong: #B3CBDF;
    --accent-ink: #B3CBDF;

    /* Chrome */
    --chrome-ink: #E2E8F0;
    --wordmark: #F0F4F8;
    --bar-bg: #1A1E24;
    --bar-ink: #E2E8F0;

    /* Status */
    --status-danger-ink: #FCA5A5;
    --status-danger-bg: rgba(197, 48, 48, 0.16);
    --status-danger-border: rgba(197, 48, 48, 0.45);
    --status-success-ink: #9AE6B4;
    --status-success-bg: rgba(39, 103, 73, 0.16);
    --status-success-border: rgba(72, 187, 120, 0.45);
    --pdf-badge: #E31C23;
}
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            /* Greek-optimized fallback stack */
            font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
            line-height: 1.6;
            background-color: var(--surface-page);
            color: var(--text-primary);
        }
        
        .navbar {
            position: sticky;
            top: 0;
        }

        .navbar-subtitle {
            padding-left: 2.7em;
        }

        .container {
            max-width: 1200px;
            margin: 10px auto;
            padding: 0 20px;
        }
        
        .content-wrapper {
            background-color: var(--surface-card);
            padding: 20px 35px;
            border-radius: 0;
            border: 1px solid var(--border-default);
            position: relative;
        }
        
        h1 {
            color: var(--text-primary);
            margin-bottom: 15px;
            margin-top: 30px;
            font-size: 2em;
            font-weight: 600;
            text-align: center;
        }

        .index-intro {
            color: var(--text-primary);
            font-size: 1.08em;
            line-height: 1.65;
            margin: 0 auto 10px;
            max-width: 860px;
            text-align: center;
        }

        .search-section {
            background: var(--surface-card);
            padding: 8px 15px;
            border-radius: 0;
            border: 1px solid var(--border-hairline);
            margin-bottom: 8px;
        }
        
        .search-boxes {
            display: flex;
            justify-content: center;
            margin-bottom: 0;
        }

        .search-boxes .search-box {
            width: 100%;
            max-width: 520px;
        }
        
        .search-box {
            position: relative;
        }
        
        .search-box label {
            display: block;
            margin-bottom: 6px;
            font-weight: 600;
            color: var(--text-primary);
            font-size: 1.15em;
            text-align: center;
        }
        
        .search-box input {
            width: 100%;
            padding: 10px 15px;
            padding-right: 40px;
            font-size: 0.95em;
            border: 1px solid var(--border-strong);
            border-radius: 0;
            transition: border-color 0.3s;
        }
        
        .search-box input:focus {
            outline: none;
            border-color: var(--accent-strong);
        }
        
        .search-box-input-wrapper {
            position: relative;
        }
        
        .search-box .clear-btn {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: var(--text-faint);
            cursor: pointer;
            font-size: 1.2em;
            padding: 5px 8px;
            line-height: 1;
            display: none;
            transition: color 0.3s;
        }
        
        .search-box .clear-btn.visible {
            display: block;
        }
        
        .search-box .clear-btn:hover {
            color: var(--text-secondary);
        }

        #search-status {
            text-align: center;
            color: var(--text-secondary);
            font-variant-numeric: tabular-nums;
            margin: 12px 0 4px;
        }

        #search-error {
            padding: 15px;
            background: var(--status-danger-bg);
            color: var(--status-danger-ink);
            border: 1px solid var(--status-danger-border);
            margin: 12px 0;
        }

        #search-retry {
            display: block;
            margin: 8px auto 16px;
            font: inherit;
            color: var(--text-primary);
            background: var(--surface-card);
            border: 1px solid var(--border-default);
            padding: 11px 16px;
            cursor: pointer;
        }

        #search-retry:hover {
            background: var(--surface-hover);
        }

        #searchResults {
            margin-top: 12px;
        }

        #searchResults .author-group {
            padding: 28px 0;
            border-bottom: 1px solid var(--border-hairline);
        }

        #searchResults .author-group:first-child {
            padding-top: 8px;
        }

        #searchResults .author-heading {
            margin: 0 0 12px;
            font-size: inherit;
            font-weight: inherit;
        }

        #searchResults .author-heading .author-name {
            padding: 0;
        }

        #searchResults .author-heading a {
            color: var(--text-primary);
            text-decoration: none;
        }

        #searchResults .author-heading a:hover {
            text-decoration: underline;
        }

        #searchResults .author-work-count {
            display: block;
            margin-top: 4px;
            color: var(--text-muted);
            font-size: 0.85em;
            font-weight: 400;
        }

        #searchResults .author-works {
            list-style: none;
            margin: 0;
            padding: 4px 0 0 1.2em;
        }

        #searchResults .author-work {
            padding: 6px 0;
        }

        #searchResults .author-work a,
        #searchResults .author-work span {
            color: var(--text-primary);
            text-decoration: none;
            font-size: 1.05em;
        }

        #searchResults .author-work a:hover {
            text-decoration: underline;
        }

        #searchResults .author-work-greek {
            display: block;
            color: var(--text-muted);
            font-size: 0.95em;
            margin-top: 2px;
        }

        #searchResults .alphabetic-empty {
            text-align: center;
            color: var(--text-muted);
            padding: 24px 0;
        }

        #searchResults[hidden],
        #authorIndex[hidden],
        #search-error[hidden],
        #search-retry[hidden] {
            display: none !important;
        }
        
        .letter-section {
            margin-bottom: 20px;
        }
        
        .letter-header {
            background: var(--bar-bg);
            color: var(--bar-ink);
            padding: 10px 15px;
            font-size: 1.8em;
            font-weight: 700;
            margin: 0 0 10px;
            border-radius: 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .letter-count {
            font-size: 0.6em;
            font-weight: 400;
            opacity: 0.9;
        }

        .author-table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 10px;
        }
        
        .author-table thead {
            background-color: var(--surface-recessed);
            border-bottom: 2px solid var(--border-default);
        }
        
        .author-table th {
            padding: 8px 4px;
            text-align: left;
            font-weight: 600;
            color: var(--text-primary);
            font-size: 1.1em;
        }
        
        .author-table th:first-child {
            padding-left: calc(4px + 1.2em);
        }
        
        .author-table th:nth-child(3) {
            text-align: center;
        }
        
        .author-table td:nth-child(2) {
            padding-right: 1em;
        }
        
        .author-table td:nth-child(3) {
            padding-left: 1em;
            padding-right: 1em;
        }
        
        .author-table td:nth-child(4) {
            padding-left: 0;
            padding-top: 6px;
            padding-bottom: 6px;
            vertical-align: top;
        }
        
        .author-table td:nth-child(5) {
            padding: 6px 4px;
            text-align: left;
        }
        
        .author-table th:nth-child(5) {
            padding: 8px 4px;
            text-align: left;
        }
        
        .author-table td:nth-child(6) {
            padding: 6px 4px;
            text-align: left;
        }
        
        .author-table th:nth-child(6) {
            padding: 8px 4px;
            text-align: left;
        }
        
        .author-table td {
            padding: 6px 4px;
            border-bottom: 1px solid var(--border-default);
            vertical-align: top;
        }
        
        .author-table tr:hover {
            background-color: var(--surface-hover);
        }
        
        .author-name {
            font-weight: 600;
            color: var(--text-primary);
            font-size: 1.05em;
            margin: 0;
            padding: 0 0 0 1.2em;
        }

        .author-name-primary {
            color: var(--text-primary);
            font-size: 1.2em;
            font-weight: 600;
        }

        .author-name-greek {
            color: var(--text-muted);
            font-size: 0.95em;
            margin-top: 2px;
        }
        
        .author-name a {
            color: var(--text-primary);
            text-decoration: none;
            transition: color 0.3s;
        }
        
        .author-name a:hover {
            color: var(--text-primary);
            text-decoration: underline;
        }
        
        .author-category {
            color: var(--text-muted);
            font-size: 0.9em;
            font-style: italic;
            margin: 0;
            padding: 0;
        }
        
        .author-location {
            color: var(--text-muted);
            font-size: 0.9em;
        }
        
        .author-date {
            color: var(--text-muted);
            font-size: 0.9em;
            white-space: nowrap;
        }
        
        .work-count {
            color: var(--text-primary);
            font-weight: 600;
            text-align: center;
        }
        
        .work-list {
            margin-top: 0;
            padding-top: 0;
            vertical-align: top;
        }
        
        .work-item {
            padding: 0;
            margin: 0;
            display: block;
        }
        
        .work-item:not(:first-child) {
            margin-top: 5px;
        }
        
        .work-item a {
            color: var(--accent-ink);
            text-decoration: underline;
            font-size: 0.95em;
            display: block;
        }

        .work-item a:hover {
            color: var(--text-primary);
        }
        
        .work-item a:hover {
            text-decoration: underline;
        }
        
        .passage-count {
            color: var(--text-muted);
            font-size: 0.85em;
        }
        
        .works-inner-table {
            width: 100%;
            border-collapse: collapse;
        }
        
        .works-inner-table td {
            padding: 2px 4px;
            vertical-align: top;
        }
        
        .work-title-cell {
            width: 60%;
        }
        
        .work-ref-cell {
            width: 25%;
            color: var(--text-muted);
            font-size: 0.95em;
            font-style: italic;
            white-space: nowrap;
        }
        
        .work-passages-cell {
            width: 15%;
            color: var(--text-muted);
            font-weight: 600;
            font-size: 0.9em;
            white-space: nowrap;
        }
        
        .work-row-greek a:hover {
            text-decoration: underline;
        }
        
        .work-row-english a:hover {
            text-decoration: underline;
        }
        
        .footer {
            text-align: center;
            padding: 15px 20px;
            color: var(--text-muted);
            font-size: 0.9em;
        }
        
        .footer a {
            color: var(--accent-ink);
            text-decoration: underline;
        }

        .footer a:hover {
            color: var(--text-primary);
        }
        
        .icon-inline {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            vertical-align: middle;
        }
        
        .icon-inline svg {
            width: 1em;
            height: 1em;
            stroke-width: 2;
        }
        
        @media (max-width: 768px) {
            .container {
                margin: 5px auto;
                padding: 0 10px;
            }

            .navbar-subtitle {
                padding-left: 0;
            }
            
            .content-wrapper {
                padding: 20px;
            }
            
            h1,
            .index-intro {
                display: none;
            }
            
            .search-section {
                padding: 8px 12px;
                margin-bottom: 8px;
            }
            
            .letter-header {
                font-size: 2em;
                padding: 12px 15px;
            }
            
            .author-table {
                font-size: 1.05em;
                display: block;
                line-height: 1.7;
            }
            
            .author-name {
                font-size: 1.2em !important;
            }
            
            .author-category {
                font-size: 1em;
            }
            
            .author-location {
                font-size: 1em;
            }
            
            .author-date {
                font-size: 1em;
            }
            
            .author-table thead {
                display: none;
            }
            
            .author-table tbody {
                display: block;
            }
            
            .author-table tr {
                display: block;
                background: var(--surface-card);
                border: 1px solid var(--border-default);
                border-radius: 0;
                margin-bottom: 12px;
                padding: 12px;
            }
            
            .author-table td {
                display: block;
                padding: 6px 0;
                border: none;
                border-bottom: 1px solid var(--border-default);
            }
            
            .author-table td:last-child {
                border-bottom: none;
            }
            
            .author-table td:nth-child(1)::before {
                content: "Author: ";
                font-weight: 600;
                color: var(--text-primary);
                display: inline-block;
                min-width: 80px;
            }
            
            .author-table td:nth-child(2)::before {
                content: "Identifier: ";
                font-weight: 600;
                color: var(--text-primary);
                display: inline-block;
                min-width: 80px;
            }
            
            .author-table td:nth-child(3)::before {
                content: "Works: ";
                font-weight: 600;
                color: var(--text-primary);
                display: inline-block;
                min-width: 80px;
            }
            
            .author-table td:nth-child(4)::before {
                content: "Available Works: ";
                font-weight: 600;
                color: var(--text-primary);
                display: block;
                margin-bottom: 8px;
            }
            
            .author-table td:nth-child(5)::before {
                content: "Work Reference: ";
                font-weight: 600;
                color: var(--text-primary);
                display: block;
                margin-bottom: 8px;
            }
            
            .author-table td:nth-child(6)::before {
                content: "Passages: ";
                font-weight: 600;
                color: var(--text-primary);
                display: block;
                margin-bottom: 8px;
            }
            
            /* Remove ::before labels from nested table cells */
            .author-table .works-inner-table td::before {
                content: none !important;
            }
            
            .author-name {
                padding: 0 !important;
            }
            
            .author-name a {
                display: inline;
                padding-left: 0 !important;
            }
            
            .author-category {
                display: inline;
            }
            
            .work-count {
                display: inline;
                text-align: left !important;
            }
            
            .work-list {
                margin-top: 8px;
            }
            
            .work-item {
                margin-top: 6px !important;
                padding-left: 0;
            }
            
            .work-passage-count {
                text-align: left !important;
            }
            
            .author-table td:nth-child(2),
            .author-table td:nth-child(3),
            .author-table td:nth-child(4),
            .author-table td:nth-child(5),
            .author-table td:nth-child(6) {
                padding-left: 0;
                padding-right: 0;
            }
            
            /* Ensure nested table cells don't get the ::before labels */
            .author-table .works-inner-table td::before {
                content: none !important;
            }
            
            /* Ensure works inner table displays properly on mobile */
            .works-inner-table {
                display: block;
                width: 100%;
            }
            
            .works-inner-table tbody {
                display: block;
            }
            
            .work-row-greek,
            .work-row-english {
                display: block;
                width: 100%;
            }
            
            .work-row-greek td,
            .work-row-english td {
                display: inline;
                padding: 0;
                border: none;
            }
            
            /* Greek title row styling */
            .work-row-greek {
                margin-top: 12px;
            }
            
            .work-row-greek .work-title-cell {
                display: block;
                width: 100%;
                margin-bottom: 4px;
            }
            
            .work-row-greek .work-ref-cell,
            .work-row-greek .work-passages-cell {
                display: inline;
                margin-right: 12px;
            }
            
            /* English title row styling - ensure it's visible */
            .work-row-english {
                display: block !important;
                margin-bottom: 8px;
                padding-bottom: 8px;
            }
            
            .work-row-english td {
                display: block !important;
                width: 100%;
            }
        }

        @media (max-width: 480px) {
            .content-wrapper {
                padding: 16px;
            }

            .letter-header {
                font-size: 1.75em;
                padding: 10px 12px;
            }

            .author-table {
                font-size: 1em;
            }

            .author-name {
                font-size: 1.15em !important;
            }
        }
/*
 * Site chrome look — flat masthead, drawer hamburger, theme-toggle, share cluster.
 * Appended last onto every bundle by stylesheet_registry.py (SITE_CHROME_FILE).
 * HTML/JS owner: src/core/site_chrome.py. Do not copy these selectors into
 * page sheets. Navbar position is a page particular (relative vs sticky).
 *
 * Ink-and-paper masthead (docs/plans/appearance_de_ai_2026-09-21.md): page
 * surface, one strong hairline rule, serif wordmark. No gradients, bevels,
 * emboss shadows, or rounded corners anywhere in the chrome.
 */

.navbar {
    background: var(--surface-page);
    color: var(--text-primary);
    padding: 18px 0 14px;
    border-bottom: 1px solid var(--border-strong);
    z-index: 100;
}

.navbar,
.hamburger-menu-panel {
    font-weight: 400;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.nav-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.home-link {
    color: var(--wordmark);
    text-decoration: none;
    font-family: "Gentium Plus", Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: color 0.2s ease;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.home-link:hover {
    color: var(--accent-strong);
    text-decoration: none;
}

.navbar-subtitle {
    color: var(--text-muted);
    font-size: 0.85em;
    margin-top: 2px;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.4;
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

.nav-tabs {
    display: flex;
    gap: 0;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.nav-tab {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 400;
    padding: 8px 14px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont,
        'Segoe UI', Arial, sans-serif;
}

.nav-tab:hover {
    color: var(--accent-strong);
    border-bottom-color: var(--accent-strong);
}

.hamburger-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 350;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-menu-toggle:hover .hamburger-line {
    background-color: var(--accent-strong);
}

.hamburger-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.hamburger-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 17, 12, 0.45);
    z-index: 250;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hamburger-menu-overlay.visible {
    display: block;
    opacity: 1;
}

.hamburger-menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--surface-card);
    border-right: 1px solid var(--border-default);
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.hamburger-menu-panel.open {
    transform: translateX(0);
}

.menu-section {
    margin-bottom: 30px;
}

.menu-section:last-child {
    margin-bottom: 0;
}

.menu-section-title {
    color: var(--text-muted);
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-hairline);
}

.menu-link {
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    padding: 12px 0;
    font-size: 1em;
    transition: color 0.3s;
}

.menu-link:hover {
    color: var(--accent-strong);
}

.theme-toggle {
    position: absolute;
    right: 20px;
    top: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
    z-index: 120;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: var(--accent-strong);
    border-color: var(--border-strong);
    outline: none;
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Share cluster — kept in the masthead by owner call (2026-09-21),
 * flattened to the ink-and-paper language. Desktop-only (the drawer
 * Share section covers mobile). HTML/JS owner: src/core/site_chrome.py. */
.share-cluster {
    position: absolute;
    left: 20px;
    top: 14px;
    display: flex;
    gap: 6px;
    z-index: 120;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.share-btn:hover,
.share-btn:focus-visible {
    color: var(--accent-strong);
    border-color: var(--border-strong);
    outline: none;
}

.share-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Brand fill glyphs sit one optical step smaller than the stroke glyphs. */
.share-btn .icon-fill {
    width: 18px;
    height: 18px;
}

.share-btn .icon-check {
    display: none;
}

.share-btn.copied .icon-link {
    display: none;
}

.share-btn.copied .icon-check {
    display: block;
}

/* Bluesky/Mastodon pop-out — flat card on a hairline. */
.share-popout {
    display: none;
    position: absolute;
    left: 20px;
    top: 58px;
    flex-direction: column;
    min-width: 160px;
    padding: 6px;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: 0;
    z-index: 130;
}

.share-popout.open {
    display: flex;
}

.share-popout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--text-primary);
    font-size: 0.95em;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.share-popout-link:hover,
.share-popout-link:focus-visible {
    color: var(--accent-strong);
    background: var(--surface-hover);
    outline: none;
}

.share-popout-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Visually hidden copy-feedback live region. */
.share-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Drawer Share rows — .menu-link rhythm with a small icon. */
.menu-share-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 0;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1em;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: color 0.3s;
}

.menu-share-link:hover {
    color: var(--accent-strong);
}

.menu-share-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .navbar-content {
        padding: 0 15px;
    }

    .home-link {
        font-size: 2.1em;
        gap: 6px;
    }

    .share-cluster {
        left: 15px;
        gap: 4px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 14px 0 12px;
    }

    .navbar-content {
        padding: 0 15px;
    }

    .hamburger-menu-toggle {
        display: flex;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block;
    }

    .nav-center {
        width: 100%;
    }

    .home-link {
        font-size: 1.8em;
        gap: 6px;
    }

    .navbar-subtitle {
        font-size: 0.78em;
        padding-left: 0;
    }

    /* The drawer Share section is the mobile share surface. */
    .share-cluster,
    .share-popout {
        display: none !important;
    }
}

@media (max-width: 600px) {
    .theme-toggle {
        right: 12px;
        top: 10px;
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 12px 0 10px;
    }

    .navbar-content {
        padding: 0 10px;
    }

    .home-link {
        font-size: 1.6em;
        gap: 8px;
    }

    .navbar-subtitle {
        font-size: 0.72em;
        padding-left: 0;
    }

    .hamburger-menu-toggle {
        width: 40px;
        height: 40px;
        padding: 8px;
    }
}

@media print {
    nav,
    .navbar,
    .navbar-content,
    .hamburger-menu-toggle,
    .hamburger-menu-overlay,
    .hamburger-menu-panel,
    .nav-tabs,
    .theme-toggle,
    .share-cluster,
    .share-popout {
        display: none !important;
    }
}
