@charset "UTF-8";

/* ==========================================================================
   Variables & Configuration
   ========================================================================== */
:root {
    /* Layout Constants */
    --sidebar-width: 180px;
    
    /* Colors */
    --bg-color: #fdfdfd;
    --bg-code: #fcfcfc;
    --bg-hover: #f2f8fa;
    
    --text-main: #1a1a1a;
    --text-muted: #737373; /* Original Dark Grey for Headers */
    --accent-color: #0077aa; 
    --border-color: #d0d0d0;
    
    /* Fonts */
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: Menlo, Consolas, Monaco, "Liberation Mono", "Lucida Console", monospace;
}

/* ==========================================================================
   Base Setup & Body
   ========================================================================== */
body {
    max-width: 48.5em;
    margin: 0 auto;
    padding-top: 6em;
    padding-bottom: 4em;

    font-family: var(--font-body);
    line-height: 1.6;
    text-align: left;
    
    background-color: var(--bg-color);
    color: var(--text-main);

    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Typography: Headers & Text
   ========================================================================== */

/* Main Page Title */
h1 {
    margin-top: 2em;
    margin-bottom: 1.5em;
    padding-left: var(--sidebar-width);
    
    line-height: 1.1;
    font-size: 1.7rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* Section Headers (Sidebar Column) */
h2, h3, h4 {
    float: left;
    width: var(--sidebar-width);
    clear: left;
    
    margin-top: 0;
    margin-bottom: 1em;
    padding-top: 0;
    
    font-weight: 400;   
    font-size: 1rem;    
    line-height: 1.6;
    color: var(--text-muted);
}

strong {
    font-weight: 600;
}

span.underline {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

/* Links */
a {
    text-decoration: none;
    color: var(--accent-color);
    transition: background 0.1s ease-in-out;
    border-radius: 3px;
    padding: 0 2px;
    margin: 0 -2px;
}

a:hover {
    background: var(--bg-hover);
    color: var(--accent-color);
}

/* Footnotes */
sub, sup {
    line-height: 0;
    font-size: 0.75em;
    vertical-align: baseline;
    position: relative;
}
sup { top: -0.5em; }
sub { bottom: -0.25em; }
sup + sup { margin-left: 2px; }
.footpara { display: inline; }

/* ==========================================================================
   Layout Engine (Sidebar Offsets)
   ========================================================================== */

/* Push content right to make room for floating headers */
p, .footdef, blockquote, .org-src-container, pre, table {
    margin-top: 0;
    margin-bottom: 1rem;
    position: relative;
    padding-left: var(--sidebar-width);
    box-sizing: border-box;
}

/* Clearfix */
p::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   Lists
   ========================================================================== */

ul, ol {
    margin-left: var(--sidebar-width);
    margin-top: -.5em;
    padding-left: 0;
}

ul li, ol li {
    margin-block-end: 0.5em;
    max-width: 95%;
    color: var(--text-main);
}

/* Unordered Lists (Square Bullet) */
ul {
    list-style: none;
}

ul li {
    position: relative;
    padding-left: 2em; /* Controls gap */
}

ul li::before {
    content: "■";
    position: absolute;
    left: 0;
    color: #A5A5A5;
}

/* Ordered Lists */
ol {
    list-style-type: decimal;
    color: #A5A5A5;
}

/* ==========================================================================
   Blockquotes
   ========================================================================== */
blockquote {
    font-size: 1rem;
    font-style: italic;
    color: #555;
    line-height: 1.4;
    border-left: 3px solid var(--accent-color);
    padding-left: calc(var(--sidebar-width) + 1rem) !important; 
    margin-left: 0;
}

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

tt, code, kbd, samp {
    font-size: 0.9em;
    font-family: var(--font-mono);
}

pre, .org-src-container, pre.code, pre.output {
    font-size: 0.9em;
    font-family: var(--font-mono);
    line-height: 1.4;
    padding-top: 1rem;
    padding-bottom: .5rem;
    overflow-x: auto;
    background: var(--bg-code);
    /* border-radius: 3px; */
}

.org-src-container,
pre.code {
    background: var(--bg-code);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

pre.output {
    background: var(--bg-color);
    border: none;
    border-left: 3px solid var(--border-color);
}

.org-function-name { font-weight: 600;}
.org-comment-delimiter, .org-comment { color: #505050; font-style: italic; }

/* ==========================================================================
   Tables & Media
   ========================================================================== */

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    border: none;
    border-bottom: 1px solid #999; 
}

th {
    text-align: left;
    font-weight: 400; 
    border-bottom: 1px solid black;
    padding: 0.5em 0.3em;
}

td {
    text-align: left;
    border: none;
    padding: 0.5em 0.3em;
}

tr:nth-child(even) td {
    background: #f4f4f4;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   Mobile / Responsive
   ========================================================================== */

@media (max-width: 900px) {
    body {
        padding: 2em 5%;
        max-width: 100%;
    }

    /* Reset Sidebar Indents */
    p, .footdef, blockquote, .org-src-container, pre, table, h1 {
        padding-left: 0 !important;
        margin-left: 0;
    }

    /* --- List Fixes --- */
    
    ul, ol {
        margin-left: 0;
    }

    /* 1. Unordered Lists (Custom Squares) */
    ul {
        padding-left: 0; /* Align container to edge */
    }
    
    ul li {
        /* Create space for the square bullet inside the item */
        padding-left: 1.5em; 
        /* Do NOT use negative indent here, or text will overlap the bullet */
        text-indent: 0; 
    }

    /* 2. Ordered Lists (Native Numbers) */
    ol {
        /* Add padding to the CONTAINER so numbers sit inside the screen */
        padding-left: 2em; 
    }
    
    ol li {
        padding-left: 0.5em;
        text-indent: 0;
    }

    /* Stack Headers */
    h2, h3, h4 {
        float: none;
        width: 100%;
        text-align: left; 
        
        border-bottom: none; 
        margin-top: 2em;
        margin-bottom: 0.5em;
    }
    
    blockquote {
        padding-left: 1rem !important;
    }
}
