/* Wikipedia-like CSS (Vector Skin inspired) */

@import url('fonts.css');

:root {
    --wiki-bg: #f6f6f6;
    --wiki-content-bg: #ffffff;
    --wiki-border: #a7d7f9;
    --wiki-border-secondary: #c8ccd1;
    --wiki-link: #0645ad;
    --wiki-link-visited: #0b0080;
    --wiki-text: #202122;
    --wiki-panel-text: #444;
    --wiki-heading: #000;
    --wiki-meta: #54595d;
    --panel-width: 11em;
}

[data-theme="dark"] {
    --wiki-bg: #202124;
    --wiki-content-bg: #121212;
    --wiki-border: #3c4043;
    --wiki-border-secondary: #5f6368;
    --wiki-link: #8ab4f8;
    --wiki-link-visited: #c58af9;
    --wiki-text: #e8eaed;
    --wiki-panel-text: #9aa0a6;
    --wiki-heading: #ffffff;
    --wiki-meta: #9aa0a6;
}

b, strong {
    font-weight: normal;
}

i, em, dfn, var, address, cite {
    font-style: normal;
}

th {
    font-weight: normal;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--wiki-bg);
    color: var(--wiki-text);
    font-family: 'Latin Modern Roman', serif;
    font-size: 0.875em;
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* Sidebar / Panel */
#mw-panel {
    width: var(--panel-width);
    flex-shrink: 0;
    padding: 0 0.5em;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    font-size: 0.9em;
    z-index: 100;
    background-color: var(--wiki-bg);
    font-family: 'Latin Modern Roman', serif;
}

#mw-panel .portal {
    margin: 0.5em 0.5em 1em 0.5em;
}

#mw-panel h3 {
    font-size: 0.75em;
    color: var(--wiki-panel-text);
    font-weight: normal;
    margin: 0 0 0.5em 0;
    padding: 0.25em 0;
    cursor: default;
    border-bottom: none;
}

#mw-panel .body {
    margin: 0 0 0 1.25em; /* Indent */
}

#mw-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#mw-panel li {
    margin: 0;
    padding: 0.2em 0;
    font-size: 0.85em;
}

#mw-panel li a {
    color: var(--wiki-link);
    text-decoration: none;
}

#mw-panel li a:hover {
    text-decoration: underline;
}

/* Logo */
#p-logo {
    display: block;
    width: 10em;
    height: 160px; /* Standard Wiki logo height */
    margin: 0 auto 1em auto;
    position: relative;
}
#p-logo a {
    display: flex;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: var(--wiki-heading);
    font-weight: normal;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-family: 'Latin Modern Roman', serif;
    background-image: url('../assets/images/favicon.png'); /* Fallback or use actual logo */
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    text-indent: -9999px; /* Hide text if image is loaded, simplified */
}
/* Just showing text for now if image is generic */
#p-logo a {
    text-indent: 0;
    background-image: none;
}


/* Main Wrapper (Right side) */
.mw-body-wrapper {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow shrinking */
    margin-left: var(--panel-width);
    width: auto;
}

/* Content Area */
#content {
    background-color: var(--wiki-content-bg);
    border: 1px solid var(--wiki-border);
    border-right: none;
    margin-top: 3.5em; /* Increased to make room for personal links */
    margin-left: 0; /* Attached to sidebar space */
    padding: 1.25em 1.5em 1.5em 1.5em;
    flex-grow: 1;
    position: relative;
    color: var(--wiki-text);
}

/* Top Navigation / Tabs */
#p-personal {
    position: absolute;
    top: 0.5em;
    right: 0.75em;
    font-size: 0.75em;
    z-index: 10;
    font-family: 'Latin Modern Roman', serif;
}

#p-personal ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

#p-personal li {
    margin-left: 1em;
}

#left-navigation, #right-navigation {
    position: absolute;
    top: 1em; /* Pushed down to avoid overlap with personal tools */
    height: 2.5em;
    z-index: 1;
    font-family: 'Latin Modern Roman', serif;
}

#left-navigation {
    left: 1em;
}

#right-navigation {
    right: 0;
    margin-right: 1em;
    display: flex;
    align-items: flex-end;
}

.vector-menu-tabs {
    float: left;
    height: 2.5em;
    background-image: linear-gradient(to bottom,rgba(167,215,249,0) 0,#a7d7f9 100%);
    background-position: bottom left;
    background-repeat: repeat-x;
    background-size: 1px 1px;
    margin-right: 1em; /* Space between tabs and search */
}

.vector-menu-tabs ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    height: 100%;
    align-items: flex-end; /* Align bottom */
}

.vector-menu-tabs li {
    margin: 0 2px;
    background-color: var(--wiki-bg);
    border: 1px solid var(--wiki-border);
    border-bottom: none;
    white-space: nowrap;
    display: block;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
}

.vector-menu-tabs li.selected {
    background-color: var(--wiki-content-bg);
    border-bottom: 1px solid var(--wiki-content-bg);
    margin-bottom: -1px;
    font-weight: normal;
    padding-bottom: 1px;
}

.vector-menu-tabs li a {
    display: block;
    height: 1.9em; /* Adjusted height */
    line-height: 1.9em;
    padding: 0 0.8em;
    color: var(--wiki-link);
    text-decoration: none;
    font-size: 0.85em;
}

.vector-menu-tabs li.selected a {
    color: var(--wiki-text);
}

/* Search Box */
#p-search {
    float: left;
    margin-bottom: 0.5em;
}

#searchInput {
    margin-top: 0.25em;
    border: 1px solid var(--wiki-border-secondary);
    padding: 0.3em;
    font-size: 0.8em;
    background: var(--wiki-content-bg);
    color: var(--wiki-text);
}

/* Typography in Content */
#firstHeading {
    font-family: 'Latin Modern Roman', serif;
    font-size: 1.8em;
    margin-bottom: 0.25em;
    padding-bottom: 0;
    border-bottom: 1px solid var(--wiki-border-secondary);
    font-weight: normal;
    line-height: 1.3;
    color: var(--wiki-heading);
}

#siteSub {
    font-size: 0.8em;
    color: var(--wiki-meta);
    margin-bottom: 0.5em;
    display: block;
}

#contentSub {
    font-size: 84%;
    line-height: 1.2em;
    margin: 0 0 1.4em 1em;
    color: var(--wiki-meta);
    width: auto;
}

#content p {
    margin: 0.5em 0 1em 0;
}

#content h2 {
    font-family: 'Latin Modern Roman', serif;
    font-weight: normal;
    font-size: 1.5em;
    margin: 1em 0 0.25em 0;
    padding-bottom: 0.25em;
    border-bottom: 1px solid var(--wiki-border-secondary);
    overflow: hidden;
    color: var(--wiki-heading);
}

#content h3 {
    font-weight: normal;
    font-size: 1.2em;
    margin: 1em 0 0.25em 0;
    font-family: 'Latin Modern Roman', serif;
    color: var(--wiki-heading);
}

/* Table of Contents */
#toc {
    background-color: var(--wiki-bg);
    border: 1px solid var(--wiki-border-secondary);
    padding: 7px;
    display: table;
    margin-bottom: 1em;
    min-width: 200px;
}

.toctitle {
    text-align: center;
    font-weight: normal;
    margin-bottom: 0.5em;
}

.toctitle h2 {
    font-family: 'Latin Modern Roman', serif !important;
    font-size: 1em !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline;
}

#toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#toc ul ul {
    margin-left: 1.5em;
}

#toc li {
    margin-bottom: 0.1em;
    font-size: 0.95em;
}

.tocnumber {
    color: var(--wiki-text);
    margin-right: 0.3em;
}

/* Images */
.thumb {
    border: 1px solid var(--wiki-border-secondary);
    background-color: var(--wiki-bg);
    padding: 3px;
    margin-bottom: 0.5em;
    text-align: center;
    font-size: 0.94em;
}

.tright {
    float: right;
    clear: right;
    margin: 0.5em 0 1.3em 1.4em;
}

.tleft {
    float: left;
    clear: left;
    margin: 0.5em 1.4em 1.3em 0;
}

.thumbinner {
    width: auto;
    display: table; /* Shrink fit */
    margin: 0 auto;
}

.thumbcaption {
    font-size: 0.94em;
    padding: 3px;
    text-align: left;
    line-height: 1.4;
    color: var(--wiki-text);
}

/* Links inside content */
#content a {
    color: var(--wiki-link);
    text-decoration: none;
}
#content a:visited {
    color: var(--wiki-link-visited);
}
#content a:hover {
    text-decoration: underline;
}
#content a.new {
    color: #ba0000;
}

/* Footer */
#footer {
    padding: 1.25em;
    margin-top: 0;
    font-size: 0.75em;
    color: var(--wiki-text);
    background-color: var(--wiki-bg);
    border-top: 1px solid var(--wiki-border-secondary);
    font-family: 'Latin Modern Roman', serif;
}

#footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#footer li {
    display: inline-block;
    margin-right: 1em;
    margin-bottom: 0.5em;
}

/* Infobox */
.infobox {
    border: 1px solid var(--wiki-border-secondary);
    background-color: var(--wiki-bg);
    color: var(--wiki-text);
    margin: 0.5em 0 0.5em 1em;
    padding: 0.2em;
    float: right;
    clear: right;
    font-size: 88%;
    line-height: 1.5em;
    width: 22em;
    font-family: 'Latin Modern Roman', serif;
}

.infobox th {
    vertical-align: top;
    text-align: left;
    padding: 0.2em 0.4em;
}

.infobox td {
    vertical-align: top;
    padding: 0.2em 0.4em;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    #mw-panel {
        position: relative;
        top: auto;
        left: auto;
        height: auto;
        overflow-y: visible;
        width: 100%;
        padding: 0;
        border-bottom: 1px solid var(--wiki-border-secondary);
        margin-bottom: 1em;
        /* Simplify panel for mobile */
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
        background: var(--wiki-bg);
        z-index: auto;
    }
    #mw-panel .portal {
        margin: 0.5em;
    }
    #mw-panel .body {
        margin-left: 0;
        display: none; /* Hide menus by default on mobile to save space */
    }
    #mw-panel h3 {
        cursor: pointer;
    }

    .mw-body-wrapper {
        margin-left: 0;
    }

    #p-logo {
        height: 50px;
        width: 100%;
        margin: 0;
    }

    #content {
        margin-left: 0;
        margin-top: 0;
        border: none;
        padding: 1em;
    }
    #left-navigation, #right-navigation {
        position: static;
        margin: 0;
        padding: 0.5em;
        display: inline-block;
    }
    .vector-menu-tabs {
        float: none;
        display: inline-block;
        margin-right: 0;
    }
    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 1em 0;
    }
}

/* ==========================================================================
   THEME SWITCHER
   ========================================================================== */

.theme-switcher-item {
    margin-left: auto; /* Push to right if flex */
    display: flex;
    align-items: center;
}

.theme-switcher {
    display: inline-flex;
    background-color: var(--wiki-bg); /* Track background */
    border: 1px solid var(--wiki-border);
    border-radius: 6px;
    padding: 2px;
    font-size: 0.8rem;
    font-family: 'Latin Modern Roman', serif;
}

.theme-switcher button {
    background: transparent;
    border: none;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--wiki-meta);
    font-size: inherit;
    line-height: 1.5;
}

.theme-switcher button:hover {
    color: var(--wiki-text);
    background: transparent;
}

.theme-switcher button.active {
    background-color: var(--wiki-content-bg); /* Active button background */
    color: var(--wiki-heading);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: normal;
}

/* Adjustments for dark mode switcher visibility */
[data-theme="dark"] .theme-switcher button.active {
    background-color: #4a4a4a;
    color: #fff;
}
