/* =============================================================================
   TerraNexus Documentation - Custom Furo Theme Styles
   Pangaea Innovations Pty. Ltd.
   ============================================================================= */

/* -- Typography -------------------------------------------------------------- */

:root {
    /* Consistent font stack */
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 
                  "Helvetica Neue", Arial, sans-serif;
    --font-stack-monospace: "JetBrains Mono", "Fira Code", "Consolas", 
                           "Monaco", monospace;
}

body {
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* -- Sidebar refinements ---------------------------------------------------- */

.sidebar-brand {
    padding: 1.2rem 0;
}

.sidebar-logo {
    max-width: 180px;
    margin: 0 auto;
}

.sidebar-tree .reference {
    font-size: 0.9rem;
    line-height: 1.6;
}

.sidebar-tree li > ul {
    margin-left: 0.5rem;
}

/* Subtle left border on active nav item */
.sidebar-tree .current-page > .reference {
    font-weight: 600;
    border-left: 3px solid var(--color-brand-primary);
    padding-left: 0.5rem;
}


/* -- Content area ----------------------------------------------------------- */

/* Constrain line length for readability */
.content {
    max-width: 52rem;
}

/* Improve heading hierarchy */
.content h1 {
    font-weight: 700;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-brand-primary);
    margin-bottom: 1.5rem;
}

.content h2 {
    font-weight: 600;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--color-foreground-border);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.content h3 {
    font-weight: 600;
    margin-top: 2rem;
}


/* -- Admonitions (notes, warnings, etc.) ------------------------------------ */

.admonition {
    border-radius: 6px;
    border-left-width: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
}

.admonition > .admonition-title {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Note admonitions with TerraNexus green accent */
.admonition.note {
    border-left-color: #2E7D32;
}

.admonition.note > .admonition-title::before {
    color: #2E7D32;
}

.admonition.warning {
    border-left-color: #E65100;
}

.admonition.important {
    border-left-color: #1565C0;
}

.admonition.tip {
    border-left-color: #00838F;
}


/* -- Code blocks ------------------------------------------------------------ */

pre {
    border-radius: 6px;
    padding: 1rem 1.2rem;
    font-size: 0.85rem;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

code.literal {
    font-size: 0.88em;
    padding: 0.15em 0.4em;
    border-radius: 3px;
}

/* Function/method signatures */
.sig {
    font-size: 0.92rem;
}

dl.py dt {
    background: rgba(46, 125, 50, 0.04);
    border-left: 3px solid var(--color-brand-primary);
    padding: 0.5rem 0.8rem;
    border-radius: 0 4px 4px 0;
}


/* -- Tables ----------------------------------------------------------------- */

table.docutils {
    border-collapse: collapse;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin: 1.5rem 0;
    width: 100%;
}

table.docutils th {
    background-color: var(--color-brand-primary);
    color: white;
    font-weight: 600;
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.9rem;
}

/* Dark mode table headers */
body[data-theme="dark"] table.docutils th {
    background-color: rgba(102, 187, 106, 0.15);
    color: var(--color-foreground-primary);
}

table.docutils td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--color-foreground-border);
    font-size: 0.9rem;
}

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


/* -- Glossary --------------------------------------------------------------- */

dl.glossary dt {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-brand-primary);
    margin-top: 1rem;
}

dl.glossary dd {
    margin-left: 1.5rem;
    margin-bottom: 0.8rem;
}


/* -- API documentation ------------------------------------------------------ */

.field-list dt {
    font-weight: 600;
}

.field-list dd {
    margin-bottom: 0.5rem;
}

/* Module index improvements */
table.indextable {
    width: 100%;
}


/* -- Footer ----------------------------------------------------------------- */

.bottom-of-page {
    font-size: 0.85rem;
    opacity: 0.8;
}


/* -- Version badge ---------------------------------------------------------- */

.version-info {
    display: inline-block;
    background: var(--color-brand-primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}


/* -- Toggle button (sphinx_togglebutton) refinements ------------------------ */

.toggle-content {
    border-left: 2px solid var(--color-brand-primary);
    padding-left: 1rem;
    margin: 0.5rem 0;
}


/* -- Responsive adjustments ------------------------------------------------- */

@media (max-width: 768px) {
    .content h1 {
        font-size: 1.6rem;
    }
    
    .content h2 {
        font-size: 1.3rem;
    }
    
    table.docutils {
        font-size: 0.85rem;
    }
    
    table.docutils th,
    table.docutils td {
        padding: 0.4rem 0.6rem;
    }
}


/* -- Print styles ----------------------------------------------------------- */

@media print {
    .sidebar-drawer {
        display: none !important;
    }
    
    .content {
        max-width: 100%;
    }
    
    .admonition {
        break-inside: avoid;
    }
    
    table.docutils {
        break-inside: avoid;
    }
}