/* 1. BASICS */
:root {
    --bg-color: #000000;
    --text-color: #f8fafc;
    --card-bg: #111111;
    --border: #222222;
}

body.light-mode {
    --bg-color: #ffffff;
    --text-color: #0f172a;
    --card-bg: #f8fafc;
    --border: #e2e8f0;
}

body {
    background-color: var(--bg-color) !important;
    color: var(--text-color);
    margin: 0;
    font-family: sans-serif;
    overflow-x: hidden;
}

a {
    color: white;
    text-decoration: none;
}

a:visited {
    color: white;
}

/* 2. HEADER BAR */
.site-header {
    display: flex;
    justify-content: space-between; /* Logo Left / Burger Right */
    align-items: center;
    padding: 15px 5%;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 1000;
}

.site-branding {
    flex-shrink: 0;
}

.site-title a {
    text-decoration: none;
    font-size: 2rem;
    font-weight: bold;
    color: #a855f7;
}

/* 3. MENU WRAPPER (Desktop) */
.header-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* --- UPDATED NAVIGATION SELECTORS (Catch-All) --- */
/* Targets ANY list inside the navigation, whether it's a Menu or Page List */
.main-navigation ul,
.main-navigation div > ul { 
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.main-navigation li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    display: block;
}

/* 4. ACTIONS (Socials + Toggle) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-left: 20px;
    border-left: 1px solid var(--border);
}

.header-socials {
    display: flex;
    gap: 15px;
}

.header-socials a i {
    font-size: 22px;
    color: var(--text-color);
}

/* 5. THEME TOGGLE */
.theme-details {
    position: relative;
    z-index: 2000;
}

.theme-details summary {
    list-style: none;
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
}

.theme-details summary::-webkit-details-marker {
    display: none;
}

.theme-menu-list {
    position: absolute;
    right: 0;
    top: 120%;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    list-style: none;
    padding: 10px;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-width: 60px;
}

.theme-menu-list li {
    padding: 10px;
    text-align: center;
    cursor: pointer;
}

.theme-menu-list li i {
    font-size: 1.2rem;
    color: var(--text-color);
}

/* 6. BURGER BUTTON (Desktop Hidden) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle i {
    font-size: 28px;
    color: var(--text-color);
}

/* --- MOBILE RESPONSIVE LOGIC --- */
@media screen and (max-width: 992px) {

    /* Show Burger */
    .menu-toggle {
        display: block;
    }

    /* Hide the wrapper by default */
    .header-menu-wrapper {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        flex-direction: column;
        padding: 30px 0;
        border-bottom: 1px solid var(--border);
        z-index: 9999;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    }

    /* THIS IS THE CLASS THE JS ADDS */
    .header-menu-wrapper.open {
        display: flex !important;
    }

    /* Stack items vertically - Using Catch-All Selector */
    .main-navigation ul,
    .main-navigation div > ul {
        flex-direction: column;
        width: 100%;
        align-items: center;
        gap: 20px;
    }
    
    .main-navigation li a {
        font-size: 1.5rem; /* Bigger links on mobile */
        padding: 10px;
    }

    .header-actions {
        border: none;
        padding-left: 0;
        flex-direction: column;
        gap: 25px;
    }
}