:root {
    /* Flat Dark Earth (FDE) Inspired Palette - Lightened for Readability */
    --fde-dark: #3c362e;
    --fde-medium: #4b443c;
    --fde-light: #7a7164;
    --fde-tan: #a69685;
    --fde-bg: #ffffff; /* Black text on white */
    
    /* Earthy Accents */
    --earth-green: #4a5d4e;
    --earth-green-light: #6b8271;
    --earth-clay: #8d5b4c;
    
    /* UI Colors */
    --text-primary: #1a1c1e; /* Near black */
    --text-secondary: #4b443c;
    --text-muted: #7a7164;
    --border-color: #e6e1da;
    --sidebar-bg: #f8f6f4; /* Subtle off-white for sidebar */
    --code-bg: #f4f2f0;
    --accent-color: #8d5b4c; /* Using clay for accent on light bg */
    
    /* Link Colors - Robin's Egg Blue (from main site) */
    --link-color: #0077b6; /* Darker blue for light theme accessibility */
    --link-hover: #0096c7;
    
    /* Layout */
    --sidebar-width: 280px;
    --header-height: 64px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--fde-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout Structure */
.docs-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.docs-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.logo-image {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 0.25rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fde-dark);
    letter-spacing: -0.02em;
    line-height: 1;
}

.logo-subtext {
    font-size: 0.875rem;
    color: var(--earth-clay);
    letter-spacing: 0.05em;
    font-weight: 600;
    text-transform: none; /* Sentence case */
}

.logo-subtext {
    font-size: 0.875rem;
    color: var(--earth-clay);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.sidebar-nav {
    padding: 2rem 1.5rem;
}

.nav-group {
    margin-bottom: 2rem;
}

.nav-title-button {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    margin-bottom: 0.75rem;
}

.nav-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0;
}

.chevron {
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-right: 4px;
}

.nav-group.collapsed .chevron {
    transform: rotate(-45deg);
}

.collapsible-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease;
}

.nav-group.collapsed .collapsible-content {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

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

.nav-list li {
    margin-bottom: 0.5rem;
}

.nav-list a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    display: block;
    padding: 0.25rem 0;
}

.nav-list a:hover, .nav-list a.active {
    color: var(--link-color);
    padding-left: 4px;
}

/* Main Content */
.docs-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.docs-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb .separator {
    margin: 0 0.5rem;
}

.breadcrumb .current-page {
    color: var(--text-secondary);
}

.back-link {
    font-size: 0.875rem;
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
}

.docs-content-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 2rem;
    flex: 1;
}

/* Typography */
.docs-article h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--fde-dark);
    letter-spacing: -0.02em;
}

.docs-article h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    color: var(--fde-dark);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.docs-article h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--fde-medium);
}

.docs-article p {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.docs-article ul, .docs-article ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.docs-article li {
    margin-bottom: 0.5rem;
}

/* Links in content */
.docs-article a {
    color: var(--link-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.docs-article a:hover {
    color: var(--link-hover);
    text-decoration-thickness: 2px;
}

/* Code Blocks */
.docs-article pre {
    background-color: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.docs-article code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--earth-clay);
}

.docs-article pre code {
    padding: 0;
    background-color: transparent;
    color: var(--fde-dark);
}

/* Tables */
.docs-article table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

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

.docs-article th {
    background-color: var(--sidebar-bg);
    font-weight: 600;
    color: var(--fde-dark);
}

/* Footer */
.docs-footer {
    margin-top: 6rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
}

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

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 768px) {
    .docs-sidebar {
        display: none;
    }
    .docs-main {
        margin-left: 0;
    }
}
