/* --- Global Styles --- */
html {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f6f8;
    background-image: linear-gradient(rgba(156, 146, 172, 0.15) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(156, 146, 172, 0.15) 1px, transparent 1px);
    background-size: 25px 25px; 
}
body {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Layout Header & Logo --- */
header {
    background: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    margin-bottom: 30px;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.logo img {
    max-height: 50px; /* Adjust based on your logo size */
    display: block;
}

/* --- Navigation & Pure CSS Dropdown --- */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}
nav a {
    color: #444;
    text-decoration: none;
    font-weight: 600;
    display: block;
    padding: 5px 10px;
}
nav a:hover { color: #0066cc; }

/* Dropdown Container */
.dropdown {
    position: relative;
}
/* Hidden Dropdown Menu Box */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.1);
    border-radius: 6px;
    padding: 10px 0;
    z-index: 1;
    top: 100%;
    left: 0;
    flex-direction: column;
    gap: 0;
}
/* Dropdown Links */
.dropdown-content a {
    padding: 8px 16px;
    font-weight: normal;
}
.dropdown-content a:hover { background-color: #f1f1f1; }
/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
    display: flex;
}

/* --- Main Content Area --- */
main { 
    background: #fff; 
    padding: 40px; 
    border-radius: 8px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.04); 
    min-height: 400px;
}
main img {
    max-width: 100%; /* Prevents images inside pages from breaking mobile view */
    height: auto;
    border-radius: 6px;
}
footer { margin-top: 40px; text-align: center; font-size: 0.9em; color: #666; }

footer a {
  color: inherit;
  text-decoration: none;
  font-weight: bold;
}

/* --- Markup --- */

/* restyle u as overline overline (text-decoration: overline is positioned too high) */
not {
  position: relative;
  display: inline-block;
  text-decoration: none; /* Removes the default underline */
}

not::before {
  content: "";
  position: absolute;
  top: 0.25em; /* Adjust this value to control height */
  left: 0;
  width: 100%;
  height: 1px;
  background-color: currentColor;
}

/* --- Contemporary Code Formatting --- */
:root {
    --font-code: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    
    /* Unified Palette: Both block and inline share these core variables */
    --bg-code-base: #f5f6f8;   /* Soft, modern slate-gray background */
    --text-code-base: #24292e; /* Deep charcoal for high legibility without pitch-black harshness */
    --border-code: #d0d7de;    /* Muted gray divider line */
}

/* Base style for ALL code tags (Inline and inside Blocks) */
code {
    font-family: var(--font-code);
    font-size: 0.9em;
    color: var(--text-code-base);
    background-color: var(--bg-code-base);
    padding: 0.1em 0.2em;
    border-radius: 4px;
    border: 1px solid var(--border-code);
    word-break: break-word;
}

/* Code block container */
pre {
    background-color: var(--bg-code-base);
    border: 1px solid var(--border-code);
    border-left: 4px solid #6e7781; /* A subtle, slate gray accent bar instead of bright blue */
    border-radius: 6px;
    padding: 0.5em 0.75em;
    margin: 1.5em 0;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02); /* Minimalist, subtle depth */
}

/* Code formatting adaptations specifically inside blocks */
pre code {
    font-size: 0.9em;              /* Filled space scaling */
    background-color: transparent !important; /* Strips double backgrounds */
    border: none !important;     /* Strips double borders */
    padding: 0;
    border-radius: 0;
    white-space: pre;
}

/* --- Desktop Defaults for Toggle (Hidden) --- */
.menu-toggle, .menu-button {
    display: none;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row; /* Keeps logo and hamburger button on the same line */
        justify-content: space-between;
        align-items: center;
        width: 100%;
		position: relative;
    }

    /* Display the hamburger button */
    .menu-button {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        z-index: 10;
    }

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

    /* Completely hide the checkbox */
    .menu-toggle {
        display: none;
    }

    /* Hide the menu off-screen or collapse it by default on mobile */
    nav .nav-links {
        display: none; 
        flex-direction: column;
        width: 150px;
        position: absolute;
        top: 100%;
        right: 0;
        background: #fff;
        box-shadow: -2px 4px 12px rgba(0,0,0,0.1);
        padding: 15px 0;
        gap: 10px;
        z-index: 9;
		border-radius: 6px;
    }

    nav a {
        padding: 10px 25px;
		text-align: left;
    }

    /* --- The CSS Toggle Magic --- */
    /* When checkbox is checked, show the menu list */
    .menu-toggle:checked ~ .nav-links {
        display: flex;
    }

    /* Optional: Turns the hamburger icon into an "X" when open */
    .menu-toggle:checked + .menu-button span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .menu-toggle:checked + .menu-button span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle:checked + .menu-button span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Mobile Dropdown submenu tweaks */
    .dropdown-content {
        position: static;
        box-shadow: none;
        background: #f9f9f9;
        padding-left: 20px;
    }
    
    main { padding: 20px; }
}
