/* Traven Docs Public Theme — Neue Deutsche Härte Edition */

:root {
    --font-sans: 'Mozilla Headline', system-ui, -apple-system, sans-serif;
    --font-serif: 'Atkinson', system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    /*
     * Palette: Stahl & Feuer — maximum-contrast Traven light mode
     * Slate canvas, near-black text, light slate nav + sidebar,
     * blood-rust primary, vibrant blue secondary. Clean, modern, readable.
     */

    --bg-canvas: #f8fafc;
    /* Lighter slate-50 canvas */
    --bg-card: #ffffff;
    /* Pure white */
    --bg-sidebar: #f1f5f9;
    /* Light slate-100 sidebar */
    --bg-nav: #ffffff;
    /* Pure white navigation header */

    --text-primary: #0f172a;
    /* Slate 900 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #64748b;
    /* Slate 500 */

    /* Sidebar / nav now light-bg */
    --text-sidebar: #334155;
    /* Slate 700 */
    --text-sidebar-muted: #64748b;
    --text-nav: #0f172a;

    --accent-color: #cc4a0a;
    /* Traven brand accent: Rust */
    --accent-hover: #a83808;
    /* Deeper rust hover */
    --accent-light: #fff0e8;
    /* Very soft rust tint */
    --accent-on-dark: #cc4a0a;
    /* Accent on light sidebar is same rust */

    --border-color: #e2e8f0;
    /* Slate 200 border */
    --border-accent: #f0c8a0;
    /* Rust-kissed border */
    --border-strong: #0f172a;
    /* Slate 900 border */
    --border-sidebar: #e2e8f0;
    /* Sidebar internal borders on light */

    /* Shadows are hard and real */
    --shadow-sm: 0 1px 3px 0 rgba(15, 8, 4, 0.15);
    --shadow-md: 0 4px 8px -1px rgba(15, 8, 4, 0.20), 0 2px 4px -1px rgba(15, 8, 4, 0.12);
    --shadow-lg: 0 10px 20px -3px rgba(15, 8, 4, 0.18), 0 4px 8px -2px rgba(15, 8, 4, 0.10);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* Base resets & styles */
*,
::before,
::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Heavy Iron Top Nav — this is the machine's top rail */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--bg-nav);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 5px solid var(--accent-color);
    /* Blood rust stripe under the black */
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem 0 0;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-nav);
}

.brand-logo {
    width: 32px;
    height: 32px;
    background-color: var(--accent-color);
    border-radius: 3px;
    /* Nearly square — industrial, not friendly */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-family: var(--font-sans);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

.brand-text {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0.04em;
    /* NDH: slightly spaced, not compressed */
    color: var(--text-nav);
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-sidebar);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.8rem;
}

.nav-link:hover {
    color: var(--accent-on-dark);
}

.nav-link.github-btn {
    background: #ffffff;
    color: var(--text-primary);
    border: 2px solid var(--border-strong);
    padding: 0.35rem 0.85rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link.github-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: rgba(204, 74, 10, 0.08);
}

/* Landing/Archive Page Layout */
.hero-section {
    padding: 6rem 2rem 2rem 2rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-tag {
    display: inline-block;
    background-color: rgba(204, 74, 10, 0.06);
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 6px 14px;
    border-radius: 0;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    font-family: var(--font-sans);
}

.hero-heading {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0 0 1.25rem 0;
    color: var(--text-primary);
    line-height: 1.15;
}

.hero-deck {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.hero-link {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 700;
    transition: color var(--transition-fast);
}

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

.list-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem 6rem 2rem;
}

.list-group-title {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 0.5rem;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
}

.list-group-title:first-of-type {
    margin-top: 1.75rem;
}

.list-group-description {
    font-family: var(--font-sans);
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.doc-list-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-strong);
    border-radius: 0;
    padding: 1.25rem 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
}

.doc-list-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
    border-left-color: var(--accent-color);
    border-color: var(--border-color);
    background-color: var(--accent-light);
}

.list-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
}

.list-item-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.doc-list-item:hover .list-item-title {
    color: var(--accent-color);
}

.list-item-description {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.list-item-action {
    display: flex;
    align-items: center;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: transform var(--transition-fast);
}

.doc-list-item:hover .list-item-action {
    transform: translateX(4px);
}

/* Three-Column Article Layout */
.docs-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    width: 100%;
    flex-grow: 1;
    /* As a flex child of <body>, min-width:0 prevents it from
       overflowing the viewport even when grid children are wide */
    min-width: 0;
    max-width: 100vw;
}

/* Left Sidebar — dark forge chassis */
.docs-sidebar {
    background-color: var(--bg-sidebar);
    border-right: 3px solid var(--accent-color);
    /* Rust seam between dark sidebar and light canvas */
    padding: 2.5rem 1.5rem;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
}

.sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-sidebar-muted);
    margin-bottom: 1.25rem;
    padding-left: 0.75rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0.15rem;
}

.sidebar-nav-item {
    margin-bottom: 0.15rem;
    width: 100%;
}

.sidebar-link {
    display: block;
    text-decoration: none;
    color: var(--text-sidebar);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.45rem 0.75rem;
    border-radius: 0;
    /* No rounding — hard edges */
    transition: all var(--transition-fast);
    line-height: 1.3;
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: var(--accent-color);
    background-color: rgba(204, 74, 10, 0.05);
    border-left-color: var(--accent-color);
}

.sidebar-link.active {
    color: var(--accent-color);
    background-color: rgba(204, 74, 10, 0.08);
    font-weight: 700;
    border-left: 3px solid var(--accent-color);
    padding-left: calc(0.75rem - 1px);
}

.sidebar-divider {
    margin: 1.5rem 0 0.5rem 0;
    border-top: 1px solid var(--border-sidebar, #e2e8f0);
}

.sidebar-section-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-sidebar-muted, #64748b);
}

/* Main Main reading panel + right TOC sidebar */
.main-wrapper {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 3rem;
    padding: 3rem;
    width: 100%;
    max-width: 1200px;
    /* Group content and right TOC cohesively */
    margin: 0 auto;
    /* Center reading pane in the remaining viewport space */
    /* Prevent this grid child from overflowing its own parent */
    min-width: 0;
    box-sizing: border-box;
}

/* Main Prose Content Typography (Bitter Serif Focus) */
.docs-content-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    /* Grid/flex children need min-width:0 to respect overflow containment */
    min-width: 0;
}

.prose {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.55;
    /* Down from 1.75 — tighter, denser, more purposeful */
    color: var(--text-secondary);
    /* Needed so pre/table scroll containers work inside grid children */
    min-width: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    font-family: var(--font-sans);
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.15;
}

.prose h1 {
    font-size: 2.25rem;
    font-weight: 900;
    border-bottom: 3px solid var(--text-primary);
    /* Black rule — not grey, not subtle */
    padding-bottom: 0.5rem;
    margin-top: 100px;
    /* Generous editorial breathing room at the top */
    letter-spacing: -0.02em;
}

.prose h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid var(--border-strong);
    padding-bottom: 0.35rem;
}

.prose h3 {
    font-size: 1.2rem;
    letter-spacing: 0;
}

.prose p {
    margin-top: 0;
    margin-bottom: 0.9rem;
    /* Tighter paragraph breaks */
}

.prose ul,
.prose ol {
    margin-top: 0;
    margin-bottom: 0.9rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.25rem;
    /* Tight list items */
    line-height: 1.5;
}

.prose li>ul,
.prose li>ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.prose strong {
    color: var(--text-primary);
    font-weight: 600;
}

.prose a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.prose a:hover {
    color: var(--accent-hover);
}

/* Code block styles */
.prose pre {
    position: relative;
    background-color: #111008;
    /* Near-black with warm undertone — forge dark */
    color: #e8e4dc;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 1.1rem 3rem 1.1rem 1.25rem;
    border-radius: 0;
    /* Square — industrial, no softening */
    overflow-x: auto;
    border: 1px solid #2a2418;
    border-left: 4px solid var(--accent-color);
    /* Rust stripe marks the code zone */
    box-shadow: var(--shadow-md);
    margin: 1.25rem 0;
    /* Prevent code blocks from overflowing the page on mobile */
    max-width: 100%;
    word-break: normal;
    white-space: pre;
}

.copy-code-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: 1px solid rgba(232, 228, 220, 0.2);
    color: #e8e4dc;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
    width: 28px;
    height: 28px;
}

.copy-code-btn:hover {
    background-color: rgba(232, 228, 220, 0.1);
    border-color: rgba(232, 228, 220, 0.4);
    color: var(--accent-color);
}

.copy-code-btn svg {
    width: 16px;
    height: 16px;
}

.copy-code-btn.copied {
    color: #4ade80;
    /* Green color when copied */
    border-color: #4ade80;
    background-color: rgba(74, 222, 128, 0.08);
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background-color: var(--accent-light);
    color: var(--accent-hover);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid var(--border-accent);
    font-weight: 500;
}

.prose pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    border: none;
    font-size: inherit;
    font-weight: normal;
}

/* Alert Boxes (GitHub Alerts styled beautifully) */
.prose blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: 2px;
    font-size: 0.975rem;
    font-family: var(--font-sans);
    line-height: 1.6;
    border-left: 4px solid var(--accent-color);
    background-color: var(--accent-light);
    color: var(--text-secondary);
}

.prose blockquote p:last-child {
    margin-bottom: 0;
}

.prose blockquote.docs-deck {
    background-color: transparent;
    border-left: 4px solid var(--accent-color);
    font-size: 1.1rem;
    padding: 0.25rem 0 0.25rem 1.25rem;
}

/* Target alert indicators (NOTE, TIP, IMPORTANT, WARNING, CAUTION) */
.prose blockquote.note {
    border-left-color: #3b82f6;
    /* Blue */
    background-color: #eff6ff;
}

.prose blockquote.tip {
    border-left-color: #06b6d4;
    /* Cyan */
    background-color: #ecfeff;
}

.prose blockquote.important {
    border-left-color: #8b5cf6;
    /* Purple */
    background-color: #f5f3ff;
}

.prose blockquote.warning {
    border-left-color: #f59e0b;
    /* Amber */
    background-color: #fffbeb;
}

.prose blockquote.caution {
    border-left-color: #ef4444;
    /* Red */
    background-color: #fef2f2;
}

/* Tables styling */
/* JS (in index.html) wraps every .prose table in a .table-scroll-wrapper
   div at DOMContentLoaded. The wrapper is the scroll container so the
   table can stay a real table (border-collapse etc. intact). */
.prose .table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
    max-width: 100%;
    width: 100%;
}

.prose .table-scroll-wrapper table {
    margin: 0;
    /* Wrapper owns the margin */
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.925rem;
    font-family: var(--font-sans);
    /* Do NOT use display:block — it breaks border-collapse.
       Scrolling is handled by .table-scroll-wrapper. */
}

.prose th,
.prose td {
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.prose th {
    background-color: var(--bg-sidebar);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.prose tr:nth-child(even) {
    background-color: rgba(148, 163, 184, 0.08);
    /* Soft slate stripe */
}

/* Right Sidebar TOC — stark white annotation block, rust stripe anchor */
.docs-toc-container {
    position: sticky;
    top: 196px;
    /* Align with the 100px H1 headline top margin */
    align-self: start;
    /* CRITICAL: Prevents stretching down to the bottom of the grid row */
    max-height: calc(100vh - 240px);
    /* Adjust height to prevent bottom overflow with the new top position */
    overflow-y: auto;
    padding: 1.25rem 1rem;
    background-color: #ffffff;
    border-left: 3px solid var(--accent-color);
    box-shadow: var(--shadow-sm);
    /* Clean tactile shadow to support floating card aesthetic */
}

.toc-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.toc-link {
    display: block;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    transition: color var(--transition-fast);
    line-height: 1.3;
}

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

.toc-link.active {
    color: var(--accent-color);
    font-weight: 700;
}

.toc-link.indent-3 {
    padding-left: 0.85rem;
}

/* Responsive hamburgers & collapses */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-nav);
    cursor: pointer;
    padding: 0.5rem;
}

/* Footer — Light Rust (NDH Warm technical block style) */
.docs-footer {
    border-top: 5px solid var(--accent-color);
    padding: 2rem 1.5rem;
    text-align: center;
    background-color: var(--accent-light);
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-top: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

.docs-footer a {
    color: var(--accent-color) !important;
    text-decoration: underline !important;
    font-weight: 800;
}

.docs-footer a:hover {
    color: var(--accent-hover) !important;
    text-decoration: underline !important;
}

/* Scrollbar customizations */
.docs-sidebar::-webkit-scrollbar,
.docs-toc-container::-webkit-scrollbar,
.prose pre::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.docs-sidebar::-webkit-scrollbar-track,
.docs-toc-container::-webkit-scrollbar-track,
.prose pre::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 0;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

.docs-toc-container::-webkit-scrollbar-thumb,
.prose pre::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 0;
}

.docs-toc-container::-webkit-scrollbar-thumb:hover,
.prose pre::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Media Queries for Responsive adjustments */
@media (max-width: 1200px) {
    .docs-layout {
        grid-template-columns: 170px 1fr;
        /* Reduce left sidebar width symmetrically to 170px */
    }

    .docs-sidebar {
        padding: 2.5rem 1rem;
        /* Squeeze horizontal padding to prevent link overflow */
    }

    .main-wrapper {
        grid-template-columns: 1fr 170px;
        /* Reduce width of the Right TOC to give prose room to breathe */
        gap: 1.5rem;
        /* Tighten gap on intermediate screen widths */
    }
}

@media (max-width: 960px) {
    .main-wrapper {
        grid-template-columns: 1fr;
        /* Hide TOC and span prose full width */
        padding: 2rem;
    }

    .docs-toc-container {
        display: none;
        /* Hide TOC on tablet & mobile viewports */
    }
}

@media (max-width: 768px) {

    /* Grid children default to min-width:auto, letting content blow past
       the container. Setting min-width:0 on every grid/flex child is the
       prerequisite for overflow-x:auto to actually work inside them. */
    .docs-layout {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .main-wrapper {
        padding: 1rem;
        /* Was 1.5rem — saves 1rem total horizontal */
        min-width: 0;
    }

    .docs-content-container {
        min-width: 0;
        max-width: 100%;
    }

    .docs-sidebar {
        display: none;
        position: fixed;
        left: 0;
        top: 64px;
        z-index: 30;
        width: 280px;
        height: calc(100vh - 64px);
    }

    .docs-sidebar.active {
        display: block;
    }

    .mobile-nav-toggle {
        display: block;
    }

    .nav-brand img {
        height: 30px !important;
    }

    .nav-links {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.75rem;
    }

    .nav-link.github-btn {
        padding: 0.2rem 0.4rem;
        gap: 0.25rem;
        font-size: 0.75rem;
    }

    .nav-link.github-btn svg {
        width: 14px !important;
        height: 14px !important;
    }

    .hero-heading {
        font-size: 2.25rem;
    }

    .prose {
        font-size: 1rem;
    }

    .prose h1 {
        margin-top: 40px;
    }
}

/* ==========================================================================
   Custom Shortcode & Component Enhancements (NDH Brutalist Edition)
   ========================================================================== */

/* 1. Redactions */
.redact {
    background-color: var(--text-primary);
    color: var(--text-primary);
    padding: 0.15rem 0.35rem;
    border-radius: 2px;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    -webkit-user-select: none;
}

.redact:hover {
    background-color: var(--accent-color);
    color: #ffffff;
}

.marker-redacted {
    background-color: var(--text-primary);
    color: #ffffff;
    padding: 0.15rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    border-radius: 2px;
    display: inline-block;
}

/* 2. Image & Figure Layouts */
.gallery-single {
    margin: 2rem 0;
    clear: both;
    display: flex;
    flex-direction: column;
}

.gallery-single.inline-image-left,
.gallery-single.vignette-left,
.gallery-single.landscape-left,
.gallery-single.vignette-landscape-left {
    float: left;
    margin-right: 2rem;
    margin-bottom: 1rem;
    clear: left;
}

.gallery-single.inline-image-right,
.gallery-single.vignette-right,
.gallery-single.landscape-right,
.gallery-single.vignette-landscape-right {
    float: right;
    margin-left: 2rem;
    margin-bottom: 1rem;
    clear: right;
}

.photo-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    border: 3px solid var(--border-strong);
    box-shadow: 6px 6px 0 var(--text-primary);
    transition: all var(--transition-fast);
}

.photo-wrapper:hover {
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0 var(--accent-color);
}

.photo-wrapper img {
    display: block;
    width: 100%;
    height: auto;
}

.caption {
    text-align: center;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 700;
    color: var(--text-muted);
    margin-top: 0.75rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.img--xsmall {
    width: 100%;
    max-width: 250px;
}

@media (min-width: 640px) {
    .img--xsmall {
        width: 25%;
    }
}

.img--small {
    width: 100%;
    max-width: 350px;
}

@media (min-width: 640px) {
    .img--small {
        width: 37.5%;
    }
}

.img--medium {
    width: 100%;
    max-width: 450px;
}

@media (min-width: 640px) {
    .img--medium {
        width: 50%;
    }
}

.img--large {
    width: 100%;
    max-width: 550px;
}

@media (min-width: 640px) {
    .img--large {
        width: 62.5%;
    }
}

.img--xlarge {
    width: 100%;
    max-width: 650px;
}

@media (min-width: 640px) {
    .img--xlarge {
        width: 75%;
    }
}

.figure-full {
    width: 100%;
    margin: 3rem 0;
    clear: both;
}

/* 3. Highlights & Intents */
.intent-primary {
    color: var(--accent-color);
    font-weight: 700;
}

.intent-warning {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #f59e0b;
    padding: 0.15rem 0.35rem;
    font-size: 0.9em;
    font-family: var(--font-sans);
    font-weight: 700;
    display: inline-block;
}

.intent-danger {
    background-color: var(--accent-light);
    color: var(--accent-color);
    border: 1px solid var(--border-accent);
    padding: 0.15rem 0.35rem;
    font-size: 0.9em;
    font-family: var(--font-sans);
    font-weight: 700;
    display: inline-block;
}

.intent-secondary {
    color: var(--text-muted);
    font-weight: 500;
}

/* 4. Typewriter / Sidebar Blocks */
.typewriter-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
    background-color: var(--bg-nav);
    color: var(--text-sidebar);
    border-left: 5px solid var(--accent-color);
    padding: 1.5rem;
    margin: 2rem 0;
    clear: both;
    box-shadow: var(--shadow-md);
}

.typewriter-text p {
    color: inherit;
    font-size: inherit;
    margin-bottom: 0.75rem;
}

.typewriter-text p:last-child {
    margin-bottom: 0;
}

/* 5. Infobox Blocks */
.infobox-text {
    padding: 1.5rem;
    margin: 2rem 0;
    border: 2px dashed var(--border-color);
    clear: both;
    font-family: var(--font-sans);
    line-height: 1.5;
}

.infobox-text p {
    color: inherit;
    margin-bottom: 0.75rem;
}

.infobox-text p:last-child {
    margin-bottom: 0;
}

.infobox-text.intent-warning {
    background-color: #fffbeb;
    border-color: #f59e0b;
    color: #b45309;
    display: block;
}

.infobox-text.intent-danger {
    background-color: var(--accent-light);
    border-color: var(--accent-color);
    color: var(--accent-color);
    display: block;
}

/* 6. Quotes & Citations */
blockquote.pullquote {
    float: right;
    width: 100%;
    margin: 1.5rem 0;
    border-left: none;
    border-top: 3px solid var(--border-strong);
    border-bottom: 3px solid var(--border-strong);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 1.5rem;
    font-family: var(--font-sans);
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

@media (min-width: 640px) {
    blockquote.pullquote {
        width: 50%;
        margin-left: 2rem;
    }
}

blockquote.epigraph {
    max-width: 500px;
    margin: 2rem auto;
    border-left: none;
    border-right: 4px solid var(--accent-color);
    padding: 0.5rem 1.5rem 0.5rem 0;
    text-align: right;
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-secondary);
    background-color: transparent;
}

blockquote.excerpt {
    background-color: var(--accent-light);
    border-left: 6px solid var(--accent-color);
    font-weight: 700;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
    font-size: 1.15rem;
    line-height: 1.5;
}

.attribution {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.7rem;
    font-family: var(--font-sans);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-color);
    font-style: normal;
}

.attribution::before {
    content: "— SOURCE: ";
}

/* 7. Specialized Layout Components */
.component-team_bio {
    background-color: var(--bg-card);
    padding: 2rem;
    margin: 2.5rem 0;
    border: 3px solid var(--border-strong);
    border-left: 24px solid var(--bg-sidebar);
    position: relative;
    box-shadow: 6px 6px 0 var(--text-primary);
}

.component-team_bio::before {
    content: "PERSONNEL FILE // RESTR.";
    position: absolute;
    top: 1rem;
    left: -18px;
    transform: rotate(90deg);
    transform-origin: left;
    font-size: 0.55rem;
    font-weight: 800;
    color: var(--text-sidebar);
    letter-spacing: 0.15em;
    white-space: nowrap;
}

.component-report_cta {
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    padding: 2.5rem;
    margin: 3rem 0;
    border-top: 8px solid var(--accent-color);
    position: relative;
    box-shadow: var(--shadow-lg);
}

.component-report_cta h3 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-family: var(--font-sans);
    font-weight: 800;
    text-transform: uppercase;
    margin-top: 0;
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.component-report_cta .cta-button {
    display: inline-block;
    margin-top: 1.5rem;
    background-color: var(--accent-color);
    color: #ffffff;
    font-family: var(--font-sans);
    font-weight: 700;
    padding: 0.75rem 2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    border: 2px solid var(--accent-color);
    transition: all var(--transition-fast);
}

.component-report_cta .cta-button:hover {
    background-color: transparent;
    color: var(--accent-on-dark);
    border-color: var(--accent-on-dark);
}

.component-specialCTA {
    border: 4px double var(--accent-color);
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
    background-color: var(--bg-card);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
}

.component-specialCTA h3 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-family: var(--font-sans);
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.component-report_header {
    border-top: 2px solid var(--text-primary);
    border-bottom: 2px solid var(--text-primary);
    padding: 1rem 0;
    margin: 2rem 0;
    text-align: center;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(15, 13, 11, 0.04) 10px, rgba(15, 13, 11, 0.04) 20px);
}

/* ==========================================================================
   Mobile — Code Block & Table Overflow Fixes
   ========================================================================== */

@media (max-width: 768px) {

    /* Code blocks scroll within their own box. max-width:100% + overflow-x:auto
       on the pre works because its ancestor chain now has min-width:0 (set above). */
    .prose pre {
        font-size: 0.8rem;
        padding: 0.9rem 1rem;
        max-width: 100%;
        overflow-x: auto;
        /* Browsers: overflow-x:auto on pre is respected when parents have
           min-width:0. No overflow-x:hidden on .prose (that would clip this). */
    }

    /* Inline code: let long identifiers wrap rather than stretch the line */
    .prose code {
        word-break: break-word;
    }

    /* Table cells: tighter padding buys a little extra column space before scroll kicks in */
    .prose th,
    .prose td {
        padding: 0.5rem 0.65rem;
        font-size: 0.875rem;
    }

    /* Typewriter / monospace blocks get the same internal-scroll treatment */
    .typewriter-text {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        word-break: break-word;
        max-width: 100%;
    }
}