﻿/* ============================================
   Docs Stylesheet
   Dark Grey + Forest Green Theme
   Mozilla Docs Inspired
   ============================================ */

@import url('/css/shared.css');

/* ============================================
   Layout Structure
   ============================================ */

.docs-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.docs-main {
    flex: 1;
    padding-top: var(--header-height);
    width: 100%;
    max-width: 100%;
}

/* ============================================
   Sidebar Navigation
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height); /* Start below header */
    width: 280px;
    height: calc(100vh - var(--header-height)); /* Full height minus header */
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    z-index: 50; /* Below header */
    overflow-x: hidden;
    overflow-y: auto;
}

    .sidebar.collapsed {
        width: 56px;
    }

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px;
}

.sidebar-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--green-light);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease, width 0.3s ease;
}

.sidebar.collapsed .sidebar-title {
    display: none;
}

.sidebar-toggle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .sidebar-toggle:hover {
        background: var(--green-muted);
        border-color: var(--green-primary);
        color: var(--text-primary);
    }

    .sidebar-toggle svg {
        width: 16px;
        height: 16px;
        transition: transform 0.3s ease;
    }

.sidebar.collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-item {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .nav-item:hover {
        color: var(--text-primary);
        background: var(--green-glow);
        border-left-color: var(--green-muted);
    }

    .nav-item.active {
        color: var(--green-light);
        background: var(--green-glow);
        border-left-color: var(--green-primary);
        font-weight: 500;
    }

    .nav-item.sub-item {
        padding-left: 28px;
        font-size: 12px;
    }

.sidebar.collapsed .nav-item {
    opacity: 0;
    pointer-events: none;
}

.toc-empty {
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 56px;
}

.content-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 48px 32px;
}

/* ============================================
   Mobile Toggle
   ============================================ */

.mobile-toggle {
    display: none;
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 16px;
    z-index: 51;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
}

    .mobile-toggle svg {
        width: 20px;
        height: 20px;
    }

/* ============================================
   Header
   ============================================ */

.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(26, 29, 33, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
}

.header-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--spacing-unit) * 4);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 500;
    transition: color var(--transition-fast);
}

    .header-logo:hover {
        color: var(--green-light);
    }

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--green-primary);
}

.logo-divider {
    color: var(--text-muted);
    font-weight: 400;
}

.logo-section {
    color: var(--green-light);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.5);
}

.nav-link {
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
    font-size: 16px;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

    .nav-link:hover {
        color: var(--text-primary);
        background: var(--green-glow);
    }

    .nav-link.active {
        color: var(--green-light);
        background: var(--green-glow);
    }

.header-actions {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.search-trigger {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    transition: all var(--transition-fast);
    min-width: 240px;
}

    .search-trigger:hover {
        border-color: var(--green-muted);
        color: var(--text-secondary);
    }

    .search-trigger svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

.search-placeholder {
    flex: 1;
    text-align: left;
}

.search-shortcut {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

    .mobile-menu-toggle:hover {
        background: var(--green-glow);
        color: var(--text-primary);
    }

    .mobile-menu-toggle svg {
        width: 20px;
        height: 20px;
    }

/* ============================================
   Mobile Navigation
   ============================================ */

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 29, 33, 0.95);
    backdrop-filter: blur(8px);
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

    .mobile-nav-overlay.open {
        opacity: 1;
        visibility: visible;
    }

.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
}

.mobile-nav-link {
    font-size: 24px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 3);
    transition: color var(--transition-fast);
}

    .mobile-nav-link:hover {
        color: var(--green-light);
    }

/* ============================================
   Tables
   ============================================ */

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: calc(var(--spacing-unit) * 3) 0;
    font-size: 0.95rem;
}

.article-content thead {
    border-bottom: 2px solid var(--green-muted);
}

.article-content th {
    text-align: left;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--green-light);
    background: var(--bg-tertiary);
}

    .article-content th:first-child {
        border-radius: 6px 0 0 0;
    }

    .article-content th:last-child {
        border-radius: 0 6px 0 0;
    }

.article-content td {
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.article-content tbody tr:last-child td {
    border-bottom: none;
}

.article-content tbody tr:hover {
    background: var(--green-glow);
}

/* ============================================
   Footer
   ============================================ */

.docs-footer {
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.footer-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copyright {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: calc(var(--spacing-unit) * 3);
}

    .footer-links a {
        font-size: 12px;
        color: var(--text-secondary);
        transition: color var(--transition-fast);
    }

        .footer-links a:hover {
            color: var(--green-light);
        }

/* ============================================
   Search Modal
   ============================================ */

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

    .search-modal.open {
        opacity: 1;
        visibility: visible;
    }

.search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.search-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    transform: translateY(-20px);
    transition: transform var(--transition-normal);
}

.search-modal.open .search-modal-content {
    transform: translateY(0);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 2.5);
    border-bottom: 1px solid var(--border-subtle);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-primary);
}

    .search-input::placeholder {
        color: var(--text-muted);
    }

.search-esc {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: calc(var(--spacing-unit) * 2);
}

.search-empty {
    text-align: center;
    padding: calc(var(--spacing-unit) * 4);
    color: var(--text-muted);
    font-size: 16px;
}

/* ============================================
   Landing Page - Hero
   ============================================ */

.docs-landing {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
    box-sizing: border-box;
    width: 100%;
}

.landing-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 8);
    align-items: center;
    min-height: calc(100vh - var(--header-height) - 100px);
    padding: calc(var(--spacing-unit) * 8) 0;
}

.hero-content {
    max-width: 540px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1.5);
    background: var(--green-glow);
    border: 1px solid var(--green-muted);
    border-radius: 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--green-light);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

    .hero-badge svg {
        width: 16px;
        height: 16px;
    }

.hero-title {
    font-size: 3.2rem;
    font-weight: 600;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.hero-accent {
    color: var(--green-light);
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.hero-actions {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    background: var(--green-primary);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 16px;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

    .btn-primary:hover {
        background: var(--green-light);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(74, 124, 89, 0.3);
    }

    .btn-primary svg {
        width: 16px;
        height: 16px;
        transition: transform var(--transition-fast);
    }

    .btn-primary:hover svg {
        transform: translateX(4px);
    }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 16px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

    .btn-secondary:hover {
        border-color: var(--green-muted);
        color: var(--text-primary);
        background: var(--green-glow);
    }

/* Hero Visual - Code Window */
.hero-visual {
    display: flex;
    justify-content: center;
}

.code-window {
    width: 100%;
    max-width: 480px;
    background: var(--bg-code);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 24px 48px rgba(0, 0, 0, 0.2);
}

.code-window-header {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-subtle);
}

.window-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-strong);
}

    .window-dot:nth-child(1) {
        background: #ff5f56;
    }

    .window-dot:nth-child(2) {
        background: #ffbd2e;
    }

    .window-dot:nth-child(3) {
        background: #27ca40;
    }

.window-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 36px;
}

.code-window-body {
    padding: calc(var(--spacing-unit) * 2.5);
}

    .code-window-body pre {
        margin: 0;
    }

    .code-window-body code {
        font-family: var(--font-mono);
        font-size: 12px;
        line-height: 1.7;
        color: var(--text-secondary);
    }

    .code-window-body .token-comment {
        color: var(--green-light);
        font-weight: 500;
    }

    .code-window-body .token-keyword {
        color: var(--text-muted);
    }

    .code-window-body .token-string {
        color: #c3e88d;
    }

    .code-window-body .token-accent {
        color: var(--text-primary);
        font-weight: 500;
    }

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--green-light);
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ============================================
   Landing Page - Featured
   ============================================ */

.landing-featured {
    padding: calc(var(--spacing-unit) * 10) 0;
}

.section-header {
    margin-bottom: calc(var(--spacing-unit) * 5);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 3);
}

.featured-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: calc(var(--spacing-unit) * 3.5);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

    .featured-card:hover {
        border-color: var(--green-muted);
        transform: translateY(-4px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    }

    .featured-card.featured-primary {
        grid-column: 1 / -1;
        background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
        border-color: var(--green-muted);
    }

.card-meta {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1.5);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.card-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--green-light);
    padding: 4px 10px;
    background: var(--green-glow);
    border-radius: 4px;
}

.card-date {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    line-height: 1.4;
}

.featured-primary .card-title {
    font-size: 1.5rem;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: calc(var(--spacing-unit) * 3);
    padding-top: calc(var(--spacing-unit) * 2);
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.card-tags {
    display: flex;
    gap: calc(var(--spacing-unit) * 1);
}

    .card-tags span {
        font-family: var(--font-mono);
        font-size: 12px;
        color: var(--text-muted);
        padding: 4px 8px;
        background: var(--bg-tertiary);
        border-radius: 4px;
        border: 1px solid var(--border-subtle);
    }

.card-read-more {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.5);
    font-size: 12px;
    font-weight: 500;
    color: var(--green-light);
    transition: gap var(--transition-fast);
}

.featured-card:hover .card-read-more {
    gap: calc(var(--spacing-unit) * 1.25);
}

.card-read-more svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Landing Page - Categories
   ============================================ */

.landing-categories {
    padding: calc(var(--spacing-unit) * 6) 0 calc(var(--spacing-unit) * 10);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: calc(var(--spacing-unit) * 2.5);
}

.category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: calc(var(--spacing-unit) * 3);
    text-align: center;
    transition: all var(--transition-fast);
}

    .category-card:hover {
        border-color: var(--green-muted);
        background: var(--green-glow);
    }

.category-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto calc(var(--spacing-unit) * 2);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green-glow);
    border-radius: 10px;
    color: var(--green-light);
}

    .category-icon svg {
        width: 24px;
        height: 24px;
    }

.category-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.category-count {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   Landing Page - About
   ============================================ */

.landing-about {
    padding: calc(var(--spacing-unit) * 8) 0;
    border-top: 1px solid var(--border-subtle);
}

.about-content {
    max-width: var(--content-narrow);
    margin: 0 auto;
    text-align: center;
}

.about-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: calc(var(--spacing-unit) * 2);
    line-height: 1.8;
}

.about-signature {
    font-style: italic;
    color: var(--green-light);
    margin-top: calc(var(--spacing-unit) * 3);
}

/* Scrollbar and Selection styles are in shared.css */

/* ============================================
   Articles Page
   ============================================ */

.docs-articles {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
    box-sizing: border-box;
    width: 100%;
}

.articles-header {
    padding: calc(var(--spacing-unit) * 6) 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: calc(var(--spacing-unit) * 5);
}

.page-title {
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
}

.articles-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: calc(var(--spacing-unit) * 6);
    padding-bottom: calc(var(--spacing-unit) * 8);
}

.articles-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    height: fit-content;
}

.filter-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: calc(var(--spacing-unit) * 2.5);
}

.filter-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.filter-tags {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 0.5);
}

.filter-tag {
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1.5);
    font-size: 12px;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

    .filter-tag:hover {
        background: var(--green-glow);
        color: var(--text-primary);
    }

    .filter-tag.active {
        background: var(--green-glow);
        color: var(--green-light);
        font-weight: 500;
    }

.filter-indicator {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    margin-bottom: calc(var(--spacing-unit) * 3);
    font-size: 12px;
    color: var(--text-secondary);
}

.filter-value {
    color: var(--green-light);
    font-weight: 500;
}

.filter-clear {
    margin-left: auto;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

    .filter-clear:hover {
        color: var(--text-primary);
    }

    .filter-clear svg {
        width: 16px;
        height: 16px;
    }

/* ============================================
   Empty State Component
   ============================================ */

.docs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: calc(var(--spacing-unit) * 10) calc(var(--spacing-unit) * 4);
    min-height: 400px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green-glow);
    border: 1px solid var(--green-muted);
    border-radius: 16px;
    margin-bottom: calc(var(--spacing-unit) * 4);
}

    .empty-state-icon svg {
        width: 40px;
        height: 40px;
        color: var(--green-light);
        opacity: 0.8;
    }

.empty-state-content {
    max-width: 400px;
}

.empty-state-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.empty-state-message {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0;
}

.empty-state-link {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
    margin-top: calc(var(--spacing-unit) * 4);
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2.5);
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    transition: all var(--transition-fast);
}

    .empty-state-link:hover {
        color: var(--green-light);
        border-color: var(--green-muted);
        background: var(--green-glow);
    }

    .empty-state-link svg {
        width: 16px;
        height: 16px;
    }

/* Legacy articles-empty support */
.articles-empty {
    text-align: center;
    padding: calc(var(--spacing-unit) * 8) 0;
    color: var(--text-secondary);
}

    .articles-empty svg {
        width: 48px;
        height: 48px;
        color: var(--text-muted);
        margin-bottom: calc(var(--spacing-unit) * 2);
    }

    .articles-empty p {
        margin-bottom: calc(var(--spacing-unit) * 3);
    }

.articles-list {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
}

.article-card {
    display: block;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: calc(var(--spacing-unit) * 3);
    transition: all var(--transition-fast);
}

    .article-card:hover {
        border-color: var(--green-muted);
        transform: translateX(4px);
    }

.article-meta {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    font-family: var(--font-mono);
    font-size: 12px;
}

.article-category {
    color: var(--green-light);
    font-weight: 500;
}

.article-date,
.article-read-time {
    color: var(--text-muted);
}

.article-card .article-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 1);
    line-height: 1.4;
}

.article-card .article-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 1);
}

.tag {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}

a.tag:hover {
    border-color: var(--green-muted);
    color: var(--green-light);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 2);
    margin-top: calc(var(--spacing-unit) * 5);
    padding-top: calc(var(--spacing-unit) * 4);
    border-top: 1px solid var(--border-subtle);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
    font-size: 16px;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

    .pagination-btn:hover {
        color: var(--text-primary);
        background: var(--green-glow);
    }

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

.pagination-pages {
    display: flex;
    gap: calc(var(--spacing-unit) * 0.5);
}

.pagination-page {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

    .pagination-page:hover {
        background: var(--green-glow);
        color: var(--text-primary);
    }

    .pagination-page.active {
        background: var(--green-primary);
        color: var(--text-primary);
    }

/* ============================================
   Code Blocks
   ============================================ */

.code-block-wrapper {
    position: relative;
    margin-bottom: 24px;
}

    .code-block-wrapper pre {
        margin: 0;
        background: var(--bg-code) !important;
        border: 1px solid var(--border-subtle);
        border-radius: 8px;
        padding: 20px;
        padding-top: 40px;
        overflow-x: auto;
    }

        .code-block-wrapper pre code {
            font-family: var(--font-mono) !important;
            font-size: 12px !important;
            line-height: 1.6 !important;
            background: transparent !important;
            border: none !important;
            padding: 0 !important;
            text-shadow: none !important;
        }

.code-label {
    position: absolute;
    top: 0;
    right: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 0 8px 0 8px;
    border-left: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 1;
}

/* Inline code */
.article-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-code);
    color: var(--green-light);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

/* Reset for code inside pre */
.article-content pre code,
.code-block-wrapper pre code {
    font-size: 12px;
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* ============================================
   Prism Theme Override
   ============================================ */

pre[class*="language-"],
code[class*="language-"] {
    color: var(--text-primary) !important;
    background: transparent !important;
    text-shadow: none !important;
    font-family: var(--font-mono) !important;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #5c6370 !important;
    font-style: italic;
}

.token.keyword {
    color: #c678dd !important;
}

.token.string,
.token.attr-value {
    color: #98c379 !important;
}

.token.function {
    color: #61afef !important;
}

.token.number,
.token.boolean {
    color: #d19a66 !important;
}

.token.class-name {
    color: #e5c07b !important;
}

.token.operator {
    color: #56b6c2 !important;
}

.token.punctuation {
    color: #abb2bf !important;
}

.token.property {
    color: #e06c75 !important;
}

.token.variable {
    color: #e06c75 !important;
}

.token.builtin {
    color: #e5c07b !important;
}

.token.attr-name {
    color: #d19a66 !important;
}

.token.tag {
    color: #e06c75 !important;
}

.token.namespace {
    color: #e5c07b !important;
}

/* ============================================
   Single Article Page
   ============================================ */

.docs-article {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
}

    .docs-article .article-header {
        padding: calc(var(--spacing-unit) * 5) 0;
        border-bottom: 1px solid var(--border-subtle);
        margin-bottom: calc(var(--spacing-unit) * 5);
    }

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

    .header-breadcrumb a {
        color: var(--text-secondary);
        transition: color var(--transition-fast);
    }

        .header-breadcrumb a:hover {
            color: var(--green-light);
        }

    .header-breadcrumb svg {
        width: 16px;
        height: 16px;
    }

.docs-article .article-title {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.docs-article .article-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: calc(var(--spacing-unit) * 3);
    max-width: 720px;
}

.docs-article .article-meta {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.5);
    font-size: 16px;
    color: var(--text-secondary);
}

    .meta-item svg {
        width: 16px;
        height: 16px;
        color: var(--green-primary);
    }

.meta-updated {
    color: var(--text-muted);
}

.docs-article .article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 1);
}

/* Article Layout with TOC */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: calc(var(--spacing-unit) * 6);
    padding-bottom: calc(var(--spacing-unit) * 6);
}

.article-toc {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    height: fit-content;
}

.toc-nav {
    padding: calc(var(--spacing-unit) * 2);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.toc-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

    .toc-item.toc-sub {
        padding-left: calc(var(--spacing-unit) * 1.5);
    }

.toc-link {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit) * 1);
    border-radius: 4px;
    transition: all var(--transition-fast);
    line-height: 1.4;
}

    .toc-link:hover {
        color: var(--text-primary);
        background: var(--green-glow);
    }

    .toc-link.active {
        color: var(--green-light);
        background: var(--green-glow);
    }

/* Article Content Styles */
.article-content {
    max-width: var(--content-narrow);
}

    .article-content h2 {
        font-size: 1.6rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-top: calc(var(--spacing-unit) * 8);
        margin-bottom: calc(var(--spacing-unit) * 4);
        padding-bottom: calc(var(--spacing-unit) * 1.5);
        border-bottom: 1px solid var(--border-subtle);
    }

    .article-content h3 {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-top: calc(var(--spacing-unit) * 4);
        margin-bottom: calc(var(--spacing-unit) * 2);
    }

    .article-content h4 {
        font-size: 1.05rem;
        font-weight: 600;
        color: var(--green-light);
        margin-top: calc(var(--spacing-unit) * 3);
        margin-bottom: calc(var(--spacing-unit) * 1.5);
    }

    .article-content p {
        margin-bottom: calc(var(--spacing-unit) * 2);
        color: var(--text-primary);
    }

    .article-content ul,
    .article-content ol {
        margin-bottom: calc(var(--spacing-unit) * 2);
        padding-left: calc(var(--spacing-unit) * 3);
    }

    .article-content li {
        margin-bottom: calc(var(--spacing-unit) * 1);
        color: var(--text-primary);
    }

        .article-content li::marker {
            color: var(--green-primary);
        }

    .article-content code {
        font-family: var(--font-mono);
        font-size: 0.875em;
        background: var(--bg-code);
        color: var(--green-light);
        padding: 0.15em 0.4em;
        border-radius: 4px;
        border: 1px solid var(--border-subtle);
    }

    .article-content pre {
        background: var(--bg-code);
        border: 1px solid var(--border-subtle);
        border-radius: 8px;
        padding: calc(var(--spacing-unit) * 2.5);
        overflow-x: auto;
        margin-bottom: calc(var(--spacing-unit) * 2.5);
    }

        .article-content pre code {
            background: transparent;
            border: none;
            padding: 0;
            font-size: 12px;
            line-height: 1.6;
            color: var(--text-primary);
        }

    .article-content blockquote {
        border-left: 3px solid var(--green-muted);
        padding-left: calc(var(--spacing-unit) * 2.5);
        margin: calc(var(--spacing-unit) * 2.5) 0;
        color: var(--text-secondary);
        font-style: italic;
    }

    .article-content hr {
        border: none;
        height: 1px;
        background: var(--border-subtle);
        margin: calc(var(--spacing-unit) * 4) 0;
    }

    .article-content a {
        color: var(--green-light);
        border-bottom: 1px solid var(--green-muted);
        transition: all var(--transition-fast);
    }

        .article-content a:hover {
            color: var(--text-primary);
            border-bottom-color: var(--green-light);
        }

/* Article Footer */
.article-footer {
    border-top: 1px solid var(--border-subtle);
    padding: calc(var(--spacing-unit) * 4) 0;
}

.footer-nav {
    margin-bottom: calc(var(--spacing-unit) * 4);
    display: flex;
    justify-content: space-between;
}

.footer-back {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
    font-size: 16px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

    .footer-back:hover {
        color: var(--green-light);
    }

    .footer-back svg {
        width: 16px;
        height: 16px;
    }

.back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    margin-top: 24px;
    transition: color 0.15s ease;
}

    .back-to-top:hover {
        color: var(--green-light);
    }

    .back-to-top svg {
        width: 16px;
        height: 16px;
    }

.related-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: calc(var(--spacing-unit) * 2);
}

.related-card {
    display: block;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: calc(var(--spacing-unit) * 2.5);
    transition: all var(--transition-fast);
}

    .related-card:hover {
        border-color: var(--green-muted);
        transform: translateY(-2px);
    }

.related-category {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--green-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.related-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: calc(var(--spacing-unit) * 1) 0;
    line-height: 1.4;
}

.related-read-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   Projects Page
   ============================================ */

.docs-projects {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 8);
    box-sizing: border-box;
    width: 100%;
}

.projects-header {
    padding: calc(var(--spacing-unit) * 6) 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: calc(var(--spacing-unit) * 5);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: calc(var(--spacing-unit) * 3);
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: calc(var(--spacing-unit) * 3.5);
    transition: all var(--transition-fast);
}

    .project-card:hover {
        border-color: var(--green-muted);
    }

.project-header {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.5);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 4px 10px;
    border-radius: 20px;
}

    .project-status svg {
        width: 12px;
        height: 12px;
    }

    .project-status.status-active {
        background: rgba(74, 124, 89, 0.15);
        color: var(--green-light);
    }

    .project-status.status-complete {
        background: rgba(99, 179, 237, 0.15);
        color: #63b3ed;
    }

    .project-status.status-inprogress {
        background: rgba(236, 201, 75, 0.15);
        color: #ecc94b;
    }

    .project-status.status-archived {
        background: rgba(160, 160, 160, 0.15);
        color: #a0a0a0;
    }

.project-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: calc(var(--spacing-unit) * 2.5);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 1);
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.project-links {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    padding-top: calc(var(--spacing-unit) * 2);
    border-top: 1px solid var(--border-subtle);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 0.5);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

    .project-link:hover {
        color: var(--text-primary);
    }

    .project-link svg {
        width: 16px;
        height: 16px;
    }

.project-link-live {
    color: var(--green-light);
}

    .project-link-live:hover {
        color: var(--green-lighter);
    }



/* ============================================
   Callout Boxes
   ============================================ */

.callout {
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    border-left: 4px solid;
    background: var(--bg-tertiary);
}

.callout-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .callout-title svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

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

.callout.info {
    background: rgba(74, 124, 89, 0.1);
    border-color: var(--green-primary);
}

    .callout.info .callout-title {
        color: var(--green-light);
    }

.callout.warning {
    background: rgba(214, 158, 46, 0.1);
    border-color: #d69e2e;
}

    .callout.warning .callout-title {
        color: #ecc94b;
    }

.callout.danger {
    background: rgba(197, 48, 48, 0.1);
    border-color: #c53030;
}

    .callout.danger .callout-title {
        color: #fc8181;
    }

.callout.tip {
    background: rgba(74, 124, 89, 0.1);
    border-color: var(--green-primary);
}

    .callout.tip .callout-title {
        color: var(--green-light);
    }

.callout.note {
    background: rgba(99, 179, 237, 0.1);
    border-color: #63b3ed;
}

    .callout.note .callout-title {
        color: #90cdf4;
    }

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

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

.tldr-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--green-muted);
    border-radius: 8px;
    padding: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.tldr-title {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--green-light);
    margin-bottom: calc(var(--spacing-unit) * 1.5);
    display: flex;
    align-items: center;
    gap: calc(var(--spacing-unit) * 1);
}

    .tldr-title svg {
        width: 20px;
        height: 20px;
    }

.tldr-content p:last-child {
    margin-bottom: 0;
}
/* ============================================
   Responsive for New Views
   ============================================ */

@media (max-width: 1024px) {
    .articles-layout {
        grid-template-columns: 1fr;
    }

    .articles-sidebar {
        position: static;
    }

    .filter-tags {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-toc {
        display: none;
    }

    .card-footer {
        gap: calc(var(--spacing-unit) * 2);
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
    .landing-hero {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing-unit) * 6);
        min-height: auto;
        padding: calc(var(--spacing-unit) * 6) 0;
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
        display: none;
    }

    .code-window {
        max-width: 100%;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0;
    }

    .sidebar.collapsed ~ .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: flex;
    }

    .content-container {
        padding: 32px 24px;
    }
}

@media (max-width: 768px) {
    .header-nav,
    .header-actions {
        display: none;
    }

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

    /* Main page containers - proper mobile width handling */
    .docs-landing,
    .docs-articles,
    .docs-projects,
    .docs-article {
        width: 100%;
        max-width: 100%;
        padding: 0 16px;
        margin: 0;
    }

    /* Header and footer need mobile constraints too */
    .header-inner,
    .footer-inner {
        padding: 0 16px;
        max-width: 100%;
        width: 100%;
    }

    /* Grids and flex containers need constraints */
    .featured-grid,
    .categories-grid,
    .projects-grid,
    .articles-list,
    .hero-actions,
    .card-footer,
    .card-tags,
    .article-tags,
    .project-tech {
        width: 100%;
        max-width: 100%;
    }

    /* Cards need to stay within bounds */
    .featured-card,
    .category-card,
    .article-card,
    .project-card {
        width: 100%;
        max-width: 100%;
    }

    /* Override ALL fixed max-width values that could cause overflow */
    .hero-content,
    .code-window,
    .about-content,
    .content-container,
    .search-modal-content,
    .page-description,
    .empty-state-content,
    .article-content,
    .docs-article .article-subtitle {
        max-width: 100%;
        width: 100%;
    }

    .landing-hero {
        padding: 48px 0 40px;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 24px;
    }

    .hero-description {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 32px;
    }

    .hero-actions {
        gap: 12px;
    }

    /* Featured section mobile */
    .landing-featured {
        padding: 48px 0;
    }

    .section-header {
        margin-bottom: 24px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .featured-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .featured-card {
        padding: 24px;
    }

    .featured-card.featured-primary {
        grid-column: 1;
    }

    .card-title {
        font-size: 1.15rem;
        margin-bottom: 12px;
    }

    .featured-primary .card-title {
        font-size: 1.25rem;
    }

    .card-meta {
        margin-bottom: 16px;
    }

    .card-footer {
        margin-top: 24px;
        padding-top: 16px;
    }

    .card-tags {
        gap: 8px;
    }

    /* Categories section mobile */
    .landing-categories {
        padding: 40px 0 48px;
    }

    .categories-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .category-card {
        padding: 20px 16px;
    }

    .category-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 12px;
    }

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

    .category-title {
        margin-bottom: 4px;
    }

    .category-count {
        font-size: 12px;
    }

    /* About section mobile */
    .landing-about {
        padding: 40px 0;
    }

    .about-content {
        padding: 0 4px;
    }

    .about-title {
        font-size: 1.25rem;
        margin-bottom: 24px;
    }

    .about-content p {
        line-height: 1.7;
        margin-bottom: 16px;
    }

    /* Articles page mobile */
    .articles-header {
        padding: 32px 0;
        margin-bottom: 24px;
    }

    .page-title {
        font-size: 1.75rem;
        margin-bottom: 12px;
    }

    .articles-layout {
        gap: 24px;
    }

    .filter-section {
        padding: 16px;
    }

    .filter-tags {
        gap: 8px;
    }

    .filter-tag {
        padding: 8px 12px;
    }

    .article-card {
        padding: 20px;
    }

    .article-card .article-title {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .article-meta {
        gap: 12px;
        margin-bottom: 12px;
    }

    /* Single article page mobile */
    .docs-article .article-title {
        font-size: 1.75rem;
    }

    /* Projects page mobile */
    .projects-header {
        padding: 32px 0;
        margin-bottom: 24px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .project-card {
        padding: 24px;
    }

    .project-title {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .project-tech {
        margin-bottom: 24px;
    }

    /* Footer mobile */
    .footer-inner {
        flex-direction: column;
        gap: 16px;
        padding: 24px 16px;
        text-align: center;
    }

    .footer-links {
        gap: 24px;
    }
}

@media (max-width: 480px) {
    /* Extra small screen adjustments */
    .docs-landing,
    .docs-articles,
    .docs-projects {
        padding: 0 12px;
    }

    .landing-hero {
        padding: 40px 0 32px;
    }

    .hero-title {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .hero-actions {
        flex-direction: column;
        gap: 12px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 16px 20px;
    }

    /* Featured cards extra small */
    .featured-card {
        padding: 20px;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .featured-primary .card-title {
        font-size: 1.15rem;
    }

    .card-tags span {
        padding: 4px 8px;
    }

    /* Categories extra small - single column */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .category-card {
        padding: 16px;
        display: flex;
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 16px;
    }

    .category-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        margin: 0;
    }

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

    .category-title {
        margin-bottom: 4px;
    }

    /* Articles page extra small */
    .articles-header {
        padding: 24px 0;
        margin-bottom: 20px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .filter-section {
        padding: 12px;
    }

    .filter-tag {
        padding: 8px 12px;
    }

    .article-card {
        padding: 16px;
    }

    .article-card .article-title {
        font-size: 1rem;
    }

    .tag {
        padding: 4px 8px;
    }

    /* Single article extra small */
    .docs-article .article-title {
        font-size: 1.5rem;
    }

    .content-container {
        padding: 24px 12px;
    }

    /* Projects extra small */
    .projects-header {
        padding: 24px 0;
        margin-bottom: 20px;
    }

    .project-card {
        padding: 20px;
    }

    .project-title {
        font-size: 1.1rem;
    }

    .tech-tag {
        padding: 4px 8px;
    }

    /* Footer extra small */
    .footer-inner {
        padding: 20px 12px;
    }

    .code-window-body code {
        font-size: 12px;
    }
}
