/* =========================================
    Imports, Reset & Base Styles
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
    --color-bg: #ffffff;
    --color-bg-soft: #f8fafc;
    --color-text-main: #334155; 
    --color-text-muted: #64748b; 
    --color-heading: #0f172a;    
    --color-primary: #2563eb;    
    --color-primary-hover: #000000; 
    --color-border: #e2e8f0;
    --width-content: 1000px; 
    --width-sidebar: 300px;
    --gap-layout: 4rem;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: "Space Grotesk", system-ui, sans-serif;
    font-size: 18px; 
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   Main Layout Grid
   ========================================= */
.menubar-main-sidebar-container {
    display: flex;
    flex-direction: column; 
    width: 100%;
    max-width: 1600px; 
    margin: 0 auto;
    padding: 0 0.9rem;
}



/* =========================================
   Content Container & Typography
   ========================================= */
.container {
    width: 100%;
}

h1, h2, h3, h4, h5 {
    color: var(--color-heading);
    font-weight: 700;
    line-height: 1.2; 
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

h1 { font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 4vw, 2rem); letter-spacing: -0.02em; border-bottom: none; }
h3 { font-size: clamp(1.35rem, 3vw, 1.6rem); font-weight: 600; }
h4 { font-size: clamp(1.15rem, 2.5vw, 1.35rem); font-weight: 600; color: var(--color-text-main); }

p, address, dl, dd {
    margin-bottom: 1.5rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    overflow-wrap: break-word;
    word-break: break-word; 
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

a:hover {
    color: var(--color-primary-hover); 
    text-decoration: underline;
}

blockquote {
    border-left: 4px solid var(--color-primary);
    background: var(--color-bg-soft);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--color-text-muted);
    border-radius: 0 8px 8px 0;
}

pre, code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

p code {
    background-color: var(--color-bg-soft);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: var(--color-heading);
    border: 1px solid var(--color-border);
}

/* =========================================
    Mobile Table of Contents Button
   ========================================= */
.mobile-toc-btn {
    display: none; 
    margin-top: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    background-color: #f1f5f9;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 99px;
    text-decoration: none;
    width: fit-content;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.mobile-toc-btn:hover {
    background-color: #e2e8f0;
    color: #000000;
    text-decoration: none;
}

/* =========================================
    RESPONSIVE Code
   ========================================= */

@media (min-width: 1024px) {
    .menubar-main-sidebar-container {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start; 
        gap: var(--gap-layout);
    }

    .menubar-main-sidebar-container > .container {
        flex: 1; 
        max-width: var(--width-content);
        margin: 0; 
        padding: 0;
    }

    .menubar-main-sidebar-container > div:last-child {
        flex: 0 0 var(--width-sidebar); 
        width: var(--width-sidebar);
    }
}

@media (max-width: 1279px) {
    .mobile-toc-btn {
        display: inline-block;
    }
}


@media (max-width: 640px) {
    body { font-size: 16px; }
    h1 { margin-top: 1.5rem; }
    h2 { margin-top: 2rem; }
    .menubar-main-sidebar-container { padding: 0 0.9rem; }
    blockquote { padding: 0.75rem 1rem; margin: 1.5rem 0; }
}


/* ================================================
    Prevent Overflow & Maintain Responsive Design
   ================================================ */
pre {
    max-width: 100%;
    overflow-x: auto;   
    white-space: pre; 
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 5px;
}

pre code {
    white-space: pre; 
    display: block;
}

.content img, .post-content img {
    max-width: 100%;      
    height: auto;       
    object-fit: contain;   
    display: block;        
    margin: 0 auto;        
}