/*
  Reconstructed CSS based on HTML structure analysis
  Attempts to mimic a MediaWiki Vector-like skin appearance
*/

/* Global Resets & Defaults */
html {
    font-size: 100%;
}

body {
    font-family: sans-serif;
    font-size: 0.875em; /* Common base size for wikis */
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f6f6f6; /* Light grey background */
    color: #202122; /* Standard text color */
}

a {
    color: #3366cc; /* Standard link blue */
    text-decoration: none;
    background-color: transparent;
}

a:hover {
    text-decoration: underline;
}

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

/* Headings */
h1, h2, h3, h4, h5, h6 {
    margin: 1em 0 0.5em 0;
    padding: 0;
    font-weight: normal;
    border-bottom: none;
    color: #000000;
}

h1 {
    font-size: 1.8em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #a2a9b1; /* Separator line */
    margin-bottom: 0.6em;
}

h2 {
    font-size: 1.5em;
    margin-top: 1.5em;
    padding-bottom: 0.2em;
    border-bottom: 1px solid #a2a9b1; /* Separator line */
}

h3 {
    font-size: 1.2em;
    font-weight: bold; /* Often bold in wikis */
    margin-top: 1.5em;
    border-bottom: none;
}

/* Paragraphs and Lists */
p {
    margin: 0.5em 0 1em 0;
}

ul {
    margin: 0.3em 0 1em 1.6em; /* Indentation */
    padding: 0;
    list-style: disc;
}

li {
    margin-bottom: 0.2em;
}

/* Basic Layout Structure (Vector Skin Style - Absolute Positioning) */
#page-container {
    position: relative; /* Context for absolute positioning */
    min-width: 720px; /* Prevent extreme squishing */
}

/* Left Panel / Sidebar */
#panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 10em; /* Approximately 160px at default font size */
    padding-top: 160px; /* Space for logo */
    z-index: 1;
}

#p-logo {
    position: absolute;
    top: 0;
    left: 0;
    width: 10em; /* Match panel width */
    height: 160px; /* Height of logo area */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#p-logo a {
    display: block;
    width: 155px; /* Common Vector logo size */
    height: 155px;
    background-size: contain; /* Scale logo image */
    background-repeat: no-repeat;
    background-position: center;
    text-indent: -9999px; /* Hide text if using background image */
}

/* Tools section in Panel */
#p-tb {
    margin: 1em 0.6em 0 0.8em;
}

#p-tb h5 {
    font-size: 0.75em;
    color: #404040;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1em 0 0.5em 0;
    padding: 0 0.6em;
    border-bottom: none;
}

#p-tb .body {
    /* Wrapper div for tool list */
}

#p-tb .body ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#p-tb .body li {
    margin: 0;
    padding: 0.25em 0.7em; /* Padding for tool links */
    font-size: 0.85em; /* Slightly smaller */
}

/* Top Tabs Area */
#head {
    position: absolute;
    top: 0;
    left: 10em; /* Start after panel */
    right: 0;
    height: 2.8em; /* Approximate height */
    margin-left: 0.5em; /* Small gap from panel */
    z-index: 3; /* Above content */
}

#left-navigation {
    position: absolute;
    bottom: 0; /* Align tabs to the bottom */
    left: 0;
    line-height: 1; /* Prevent extra space */
}

#p-namespaces {
    /* Container for the tabs */
}

.vectorTabs {
    /* Styling for the tab system */
}

.vectorTabs ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* Arrange tabs horizontally */
}

.vectorTabs li {
    margin: 0 0.2em 0 0;
    padding: 0;
    background-color: #f8f9fa; /* Default tab background */
    border: 1px solid #a2a9b1;
    border-bottom: none; /* Remove bottom border */
    border-radius: 0.25em 0.25em 0 0; /* Rounded top corners */
    white-space: nowrap;
}

.vectorTabs li a {
    display: block;
    padding: 0.8em 1em;
    color: #3366cc;
}

.vectorTabs li a span {
    /* The text within the tab link */
    display: inline-block;
}

.vectorTabs li.selected {
    background-color: #ffffff; /* Selected tab matches content background */
    border-color: #a2a9b1;
    border-bottom: 1px solid #ffffff; /* Hide bottom border by matching bg */
    position: relative;
    bottom: -1px; /* Nudge down to overlap content border */
    z-index: 4; /* Above non-selected tabs */
    padding-bottom: 1px; /* Ensure border visually connects */
}

.vectorTabs li.selected a {
    color: #202122; /* Darker text for selected tab */
    font-weight: bold;
}

/* Main Content Area */
#content {
    margin-left: 10.5em; /* Space for panel + gap */
    padding: 1.5em 2em;
    background-color: #ffffff; /* White background */
    border: 1px solid #a2a9b1; /* Border around content */
    border-right-width: 0; /* Vector often has border visually on left only */
    border-bottom-width: 0;
    position: relative; /* Needed for positioning context */
    z-index: 2;
    min-height: 50vh; /* Ensure it has some height */
}

#bodyContent {
    /* Specific styles for the main content wrapper if needed */
}

/* Footer */
#footer {
    margin-left: 10.5em; /* Align with content */
    padding: 1em 2em;
    border-top: 1px solid #a2a9b1;
    font-size: 0.8em;
    color: #555;
    background-color: #ffffff; /* Match content background */
    position: relative;
    z-index: 1;
    clear: both; /* Clear floats from content if any */
}

#footer ul#footer-info {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center; /* Center footer items */
}

#footer ul#footer-info li {
    display: inline-block; /* Arrange items horizontally */
    margin: 0 10px;
}

#footer .license, #footer .dokuwiki {
    display: inline-block;
}

/* Content Elements */

/* Breadcrumbs */
.catlinks {
    font-size: 0.85em;
    color: #555;
    border: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    padding: 0.5em 1em;
    margin-bottom: 1.5em;
    clear: both; /* Clear floats like TOC */
}

.catlinks .bchead {
    font-weight: bold;
}

.catlinks a {
    color: #3366cc;
}

/* Table of Contents */
#dw__toc {
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa; /* Light grey background */
    padding: 1em;
    margin: 0 0 1.5em 1em; /* Top/Bottom/Left margin */
    max-width: 300px;
    float: right; /* Float to the right */
    font-size: 0.9em; /* Slightly smaller text */
}

#dw__toc h3.toggle {
    font-size: 1em; /* Relative to TOC font-size */
    margin: 0 0 0.5em 0;
    padding: 0;
    border: none;
    font-weight: bold;
    cursor: pointer; /* Indicate interactivity */
}

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

#dw__toc ul.toc ul {
    margin-left: 1.5em; /* Indent nested levels */
}

#dw__toc li {
    margin-bottom: 0.3em;
    line-height: 1.4;
}

#dw__toc .li {
    /* Wrapper div, can be used for more specific styling */
}

#dw__toc a {
    /* Specific TOC link styles if needed */
}

/* Section Edit Links (often hidden or icons in wikis) */
.sectionedit1, .sectionedit2 {
    /* Usually contains an edit link, maybe floated right or an icon */
    /* display: none; */ /* Uncomment to hide if not needed */
}

/* Specific List Styles from ciyu.html & index.html */
.level2 li.items,
.level2 li.popular-item,
.level2 > p > li /* Targeting list items directly in <p> tags within .level2 */
{
    display: inline-block; /* Horizontal flow */
    margin-right: 15px;
    margin-bottom: 10px;
    list-style: none; /* Remove bullets */
    vertical-align: top; /* Align items nicely if wrapping */
}

.level2 li.items a,
.level2 li.popular-item a,
.level2 > p > li > a
{
    border: 1px solid #eee;
    padding: 3px 8px;
    border-radius: 3px;
    background-color: #f8f9fa;
    display: inline-block; /* Ensure padding applies correctly */
    font-size: 0.95em;
}

.level2 li.items a:hover,
.level2 li.popular-item a:hover,
.level2 > p > li > a:hover
{
    background-color: #eee;
    border-color: #ddd;
    text-decoration: none;
}

/* Image styling (from ciyu.html) */
.level2 > p > img {
    max-width: 200px; /* Limit image size */
    height: auto;
    float: right; /* Example: float image */
    margin-left: 1em;
    margin-bottom: 1em;
    border: 1px solid #ccc;
    padding: 3px;
    background-color: #fff;
}

/* Horizontal Rule (from ciyu.html) */
.hr {
    border: 0;
    height: 1px;
    background-color: #a2a9b1;
    margin: 2em 0;
}

/* Utility Classes */
.clearer {
    clear: both;
    height: 0;
    line-height: 0;
    font-size: 0;
    overflow: hidden;
}

.noprint {
    /* Defined in @media print */
}

/* Header from HTML (might be redundant with Vector model) */
#site-header {
     /* display: none; */ /* Uncomment if truly unused in Vector model */
     padding: 10px 20px;
     background-color: #fff;
     border-bottom: 1px solid #a2a9b1;
}
#site-header .logo {
    font-size: 1.5em;
    font-weight: bold;
    color: #000;
}


/* Print Styles */
@media print {
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        font-size: 10pt !important;
        margin: 1cm !important; /* Add margins for printing */
        padding: 0 !important;
    }

    #panel, #head, #footer, #site-header, .noprint, #dw__toc h3.toggle, .sectionedit1, .sectionedit2, #p-logo, #p-tb {
        display: none !important; /* Hide non-content elements */
    }

    #content, #footer, #page-container, body {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        width: auto !important;
        position: static !important; /* Override absolute positioning */
        float: none !important;
    }

    #content {
        margin-left: 0 !important; /* Remove left margin */
    }

    a {
        color: #000 !important; /* Black links */
        text-decoration: underline !important;
    }

    /* Show URLs for links in print */
    a[href^="/"]:not([href*="#"]):after,
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
        font-weight: normal;
        color: #555; /* Lighter color for URL */
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid !important;
        font-weight: bold !important; /* Make headings stand out */
        border-bottom: 1pt solid #ccc !important;
    }
    h1 { font-size: 16pt !important; }
    h2 { font-size: 14pt !important; }
    h3 { font-size: 12pt !important; }


    ul { list-style: disc !important; margin-left: 2em !important; }
    img { max-width: 100% !important; page-break-inside: avoid !important; float: none !important; margin: 1em 0 !important; }

    #dw__toc {
        float: none !important;
        max-width: none !important;
        border: 1px solid #ccc !important;
        margin: 1em 0 !important;
        padding: 0.5em !important;
        page-break-inside: avoid !important;
    }
    #dw__toc ul.toc ul { margin-left: 1em !important; }

    .catlinks { border: 1px solid #ccc !important; background: none !important; }
}

/* Basic Responsive Adjustments */
@media (max-width: 768px) {
    body {
        font-size: 0.95em; /* Slightly larger base font on mobile */
    }

    #panel {
        display: none; /* Hide sidebar on smaller screens */
    }

    #head {
        left: 0; /* Head starts from left edge */
        margin-left: 0.5em;
        height: auto; /* Allow tabs to wrap if needed */
    }

    #left-navigation {
        position: static; /* Let tabs flow normally */
        margin-bottom: 0.5em;
    }
    .vectorTabs ul {
        flex-wrap: wrap; /* Allow tabs to wrap */
    }
    .vectorTabs li {
        margin-bottom: 2px;
    }

    #content {
        margin-left: 0; /* Full width content */
        padding: 1em;
        border-left-width: 1px; /* Add border back */
    }

    #footer {
        margin-left: 0; /* Full width footer */
        padding: 1em;
        text-align: left;
    }
    #footer ul#footer-info li {
        display: block; /* Stack footer links */
        margin: 5px 0;
    }


    #dw__toc {
        float: none; /* Don't float TOC */
        max-width: none; /* Full width */
        margin: 1em 0;
    }

    .level2 > p > img {
        float: none;
        display: block;
        margin: 1em auto; /* Center image */
        max-width: 90%;
    }
}