/* Basic Setup */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    font-size: 0.875em;
    line-height: 1.6;
    color: #202122;
    background-color: #f8f9fa;
}

a {
    text-decoration: none;
    color: #3366cc;
    background: none;
}

a:visited {
    color: #5a3696; /* Visited link color */
}

a:active {
    color: #faa700;
}

a:hover {
    text-decoration: underline;
}

/* Layout Grid */
.mw-page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

@media (min-width: 1000px) {
    .mw-page-container {
        flex-direction: row;
        max-width: 100%;
    }
}

/* Header (Simplified for demo) */
.mw-header {
    background-color: #fff;
    border-bottom: 1px solid #a7d7f9;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Sidebar */
.mw-sidebar {
    width: 11em; /* 176px approx */
    padding: 1.5em 0.75em;
    background-color: #f8f9fa;
    display: none; /* Hidden on small screens normally, but we simplify */
}

@media (min-width: 1000px) {
    .mw-sidebar {
        display: block;
    }
}

.mw-sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mw-sidebar-nav li {
    margin-bottom: 0.5em;
    font-size: 0.85em;
}

/* Main Content */
.mw-content-container {
    flex: 1;
    background-color: #ffffff;
    padding: 1.5em 2em;
    border: 1px solid #a7d7f9;
    border-top: none; /* Header handles top */
    min-width: 0; /* Flexbox trick for overflow */
}

/* Headings */
h1#firstHeading {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    line-height: 1.3;
    margin-bottom: 0.25em;
    padding-bottom: 0;
    font-size: 1.8em;
    border-bottom: 1px solid #a2a9b1;
    font-weight: 400;
}

h2 {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-weight: 400;
    margin: 1em 0 0.25em 0;
    padding: 0;
    padding-bottom: 0.25em;
    border-bottom: 1px solid #a2a9b1;
    font-size: 1.5em;
}

h3 {
    font-weight: bold;
    font-size: 1.2em;
    margin-top: 1em;
    margin-bottom: 0.3em;
}

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

ul {
    margin: 0.3em 0 0 1.6em;
    padding: 0;
}

li {
    margin-bottom: 0.1em;
}

/* Content Text */
.mw-parser-output {
    position: relative;
    z-index: 0;
}

/* Infobox */
.infobox {
    border: 1px solid #a2a9b1;
    border-spacing: 3px;
    background-color: #f8f9fa;
    color: black;
    margin: 0.5em 0 0.5em 1em;
    padding: 0.2em;
    float: right;
    clear: right;
    font-size: 88%;
    line-height: 1.5em;
    width: 22em;
}

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

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

.infobox caption {
    font-size: 125%;
    font-weight: bold;
    padding: 0.2em;
    text-align: center;
}

.infobox-image img {
    max-width: 100%;
    height: auto;
}

/* TOC (Table of Contents) */
.toc {
    display: table;
    zoom: 1;
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    padding: 7px;
    font-size: 95%;
    margin-bottom: 1em;
}

.toctitle {
    text-align: center;
    font-weight: bold;
}

.toc ul {
    list-style: none;
    margin-left: 0;
    padding-left: 2em;
}

.toc ul ul {
    margin: 0 0 0 2em;
}

/* Footerish links */
.catlinks {
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    padding: 5px;
    margin-top: 1em;
    clear: both;
}

/* References */
.references {
    font-size: 90%;
}
