/* --- GLOBAL RESETS & DARK SCHEME BASE --- */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #121212; /* Deep charcoal background */
    color: #e0e0e0;            /* Light gray accessible text */
}

/* Header & Typography */
header {
    border-bottom: 1px solid #2d2d2d;
    padding-bottom: 15px;
    margin-bottom: 10px;
}

/* This structural box ensures the button aligns perfectly opposite your logo */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/*header a, .logo a {*/
header a{
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.3rem;
}

.logo a {
    display: inline-block;
    vertical-align: middle;
}

.logo img {
    display: block;
    width: 222px;          /* Preserves your original desktop size constraint */
    height: auto;           /* Automatically calculates proportional height scaling */
    max-width: 100%;       /* Ensures the image will never bleed outside its bounds */
}



h1, h2, h3 {
    /*color: #ffffff;   */         /* Pure white contrast headers */
    color: #caf200;            /* STS Green */
}

/* --- LAYOUT GRID --- */
.site-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

aside {
    flex: 1;
    min-width: 240px;
    max-width: 300px;
}

main {
    flex: 3;
}


/* --- ACCORDION SIDEBAR BOX --- */
.sidebar-box {
    background: #1e1e1e;       /* Elevated dark panel background */
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #2d2d2d; /* Subtle dark border border lines */
}

.sidebar-box h3 {
    margin-top: 0;
    border-bottom: 1px solid #2d2d2d;
    padding-bottom: 8px;
}

.sidebar-search-form {
    display: flex;
    margin-bottom: 20px;
    background: #2d2d2d;       /* Dark background for input */
    border: 1px solid #444444;
    border-radius: 4px;
    overflow: hidden;
}

.sidebar-search-form input {
    flex: 1;
	min-width: 0; 
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #ffffff;
    outline: none;
}

.sidebar-search-form button {
    flex-shrink: 0;           /* CRITICAL FIX: Stops the button text from compressing or clipping */
    border: none;
    background: #3b82f6;       
    color: #ffffff;
    padding: 0 16px;          /* Slightly generous horizontal room for the word "Search" */
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;      /* Prevents the word from wrapping onto a hidden second line */
    transition: background 0.15s ease;
}

.sidebar-search-form button:hover {
    background: #2563eb;
}

/* Dropdown Accordion Elements */
.sidebar-box summary {
    font-size: 1.1rem;
    cursor: pointer;
    user-select: none;
    padding: 4px 0;
    outline: none;
    color: #e0e0e0;
}

.sidebar-box summary:hover {
    /*color: #3b82f6;*/
    color: #4c93fa;
}

.sidebar-box ul {
    list-style: none;
    padding-left: 15px;
    margin: 5px 0 10px 0;
}

/* Separator line on your classy "Section Overview" links */
.sidebar-box ul li:first-child {
    border-bottom: 1px solid #2d2d2d;
   /* padding-bottom: 6px;
    margin-bottom: 8px;*/
}

.sidebar-box ul li{
    padding-bottom: 6px;
    margin-bottom: 8px;
}


.sidebar-box a {
    text-decoration: none;
    color: #aaaaaa;            /* Soft muted gray links */
}

.sidebar-box a:hover {
    text-decoration: underline;
    color: #3b82f6;
}

/* Active Highlight Elements */
.active-section summary {
    color: #ffffff;
}

.active-page {
    font-weight: bold;
    color: #3b82f6 !important; /* Forces active blue visibility */
}

/* --- BREADCRUMBS --- */
.breadcrumb-trail {
    font-size: 0.9rem;
    color: #888888;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #2d2d2d;
}

.breadcrumb-trail a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb-trail a:hover {
    text-decoration: underline;
}

.current-crumb {
    color: #ffffff;
}

/* --- TABLE OF CONTENTS & RECENT POST PANELS --- */
.toc-container, .recent-articles-container {
    background-color: #1e1e1e; /* Matching dark sheet panels */
    border: 1px solid #2d2d2d;
    border-radius: 6px;
    padding: 25px;
    margin-top: 30px;
}

.toc-container h2, .recent-articles-container h2 {
    font-size: 1.35rem;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 2px solid #3b82f6;
    display: inline-block;
    padding-bottom: 4px;
}

.toc-list, .recent-articles-list {
    padding-left: 20px;
}

.toc-list li, .recent-articles-list li {
    margin-bottom: 18px;
    color: #aaaaaa;
}

.toc-link, .recent-article-link, .result-link, .articleContentWrapper a{
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.toc-link:hover, .recent-article-link:hover, .result-link:hover, .articleContentWrapper a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.toc-snippet, .recent-article-snippet {
    margin: 4px 0 0 0;
    font-size: 0.92rem;
    color: #888888;           /* Clean dark readability scale */
    line-height: 1.4;
}

/* --- NEXT / PREVIOUS BUTTON PAGINATION --- */
.page-pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #2d2d2d;
}

.nav-btn {
    display: inline-block;
    padding: 10px 18px;
    background-color: #1e1e1e;
    color: #3b82f6;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background-color: #3b82f6;
    color: #ffffff;
}

.prev-btn { margin-right: auto; }
.next-btn { margin-left: auto; }

/* --- GLOBAL FOOTER --- */
footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #2d2d2d;
    color: #666666;
    font-size: 0.85rem;
}



.back{float:left;}
.forward{float:right;}
.clearBoth{clear:both;}


.articleContentWrapper p{line-height: 24px;}
.articleContentWrapper ol li {
  margin-bottom: 8px; /* Adjust this value for more or less space */
}

/* Optional: Remove margin from the very last item to prevent extra bottom spacing */
.articleContentWrapper ol li:last-child {
  margin-bottom: 0;
}

.inlineImg{margin:2em 1em;}




/* Hide the structural mobile checkbox control by default on desktop */
.menu-toggle-input, .menu-button-label {
    display: none;
}

/* ======================================================================
   RESPONSIVE MOBILE BREAKPOINT (768px and down)
   ====================================================================== */
@media screen and (max-width: 768px) {
    /* 1. Stack the Master Grid Layout into a single row */
	.logo img {
        width: 160px;       /* Shrinks the desktop width layout bounds down to a clean 160px */
        height: auto;       /* Prevents your logo from squishing or distorting */
    }
	
    .site-layout {
        flex-direction: column;
        gap: 20px;
        margin-top: 15px;
        padding: 0 10px;
    }

    /* 2. Show the hamburger toggle trigger button in header bar */
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .menu-button-label {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 1001;
    }

    /* Three lines making up the hamburger icon shape */
    .menu-button-label span {
        display: block;
        height: 3px;
        width: 100%;
        background-color: #ffffff;
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    /* 3. Turn the Sidebar into a modern slide-out drawer panel */
    .sidebar-canvas {
        position: fixed;
        top: 0;
        left: -320px; /* Completely hidden offscreen by default */
        width: 280px;
        height: 100vh;
        background-color: #121212;
        z-index: 1000;
        padding: 80px 20px 20px 20px;
        box-sizing: border-box;
        border-right: 1px solid #2d2d2d;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto; /* Allow scrolling if accordion has many open items */
    }

    /* Force the inner sidebar container box to occupy full available width flat */
    .sidebar-box {
        max-width: 100%;
        border: none;
        background: transparent;
        padding: 0;
    }

    /* 4. Increase Interactive Tap Target Sizes (Prevents fat-finger misclicks) */
    .sidebar-box summary, .sidebar-box a {
        padding: 12px 10px; /* Expand physical clickable padding canvas */
        display: block;
        font-size: 1.05rem;
    }
    
    .sidebar-box ul li:first-child {
        padding-bottom: 0;
        margin-bottom: 0;
    }

    /* 5. INTERACTIVE TOGGLE STATE ENGINE (Pure CSS Magic) */
    /* When the checkbox is ticked by tapping the label, slide the side-box out */
    .menu-toggle-input:checked ~ .site-layout .sidebar-canvas {
        left: 0;
    }

    /* Transform the hamburger icon lines into an 'X' close indicator when menu opens */
    .menu-toggle-input:checked ~ header .menu-button-label span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle-input:checked ~ header .menu-button-label span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle-input:checked ~ header .menu-button-label span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* 6. Content Panels adjustments */
    main {
        flex: unset;
        width: 100%;
        box-sizing: border-box;
    }

    .toc-container, .recent-articles-container {
        padding: 15px;
    }

    /* Ensure the inline canvas results form splits into a spacious stack on narrow phones */
    .search-form-inline {
        flex-direction: column; /* Stacks input on top, button on bottom */
        width: 100%;
    }
    
    .search-form-inline input {
        width: 100%;
        box-sizing: border-box;
    }
    
    .search-form-inline button {
        width: 100%; /* Spans the full viewport width elegantly on mobile tap states */
    }
	
	/* Create the structural backdrop dark overlay engine */
    .site-layout::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black tint */
        backdrop-filter: blur(4px);          /* Clean glass modern blur blur frost */
        -webkit-backdrop-filter: blur(4px);   /* Safari rendering safety block */
        z-index: 999;                        /* Sits right below the sidebar drawer canvas */
        
        /* Hidden by default */
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    /* PURE CSS MAGIC TOGGLE: Fade the backdrop mask in when the hidden checkbox is ticked */
    .menu-toggle-input:checked ~ .site-layout::after {
        opacity: 1;
        pointer-events: auto; /* Intercepts taps so clicking the dark space shuts the menu */
    }
	
}