/**
 * Module:Sidebar/styles.css
 * TemplateStyles for sidebars and portal boxes.
 *
 * INSTALLATION:
 * 1. Create page: Module:Sidebar/styles.css
 * 2. Paste this entire file
 * 3. Mark as sanitized CSS (Content model: Sanitized CSS)
 *
 * DARK MODE:
 * Uses [data-theme="dark"] selector to match wiki's dark mode toggle.
 */

/* ==========================================================================
   BASE SIDEBAR
   ========================================================================== */

.sidebar {
    float: right;
    clear: right;
    width: 22em;
    max-width: 40%;
    margin: 0 0 1em 1em;
    padding: 0.5em;
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    font-size: 0.9em;
    line-height: 1.5;
}

.sidebar-left {
    float: left;
    clear: left;
    margin: 0 1em 1em 0;
}

/* ==========================================================================
   SIDEBAR ELEMENTS
   ========================================================================== */

.sidebar-title {
    font-size: 1.15em;
    font-weight: bold;
    text-align: center;
    padding-bottom: 0.5em;
    margin-bottom: 0.5em;
    border-bottom: 1px solid #a2a9b1;
}

.sidebar-above {
    text-align: center;
    font-size: 0.95em;
    margin-bottom: 0.5em;
}

.sidebar-image {
    text-align: center;
    margin-bottom: 0.5em;
}

.sidebar-caption {
    font-size: 0.9em;
    color: #54595d;
    margin-top: 0.3em;
}

.sidebar-heading {
    font-weight: bold;
    padding: 0.3em 0;
    margin-top: 0.3em;
    border-top: 1px solid #c8ccd1;
}

.sidebar-heading:first-child {
    border-top: none;
    margin-top: 0;
}

.sidebar-content {
    padding: 0.2em 0;
}

/* Lists in sidebar */
.sidebar-content ul {
    margin: 0.3em 0;
    padding-left: 1.5em;
}

.sidebar-content li {
    margin: 0.2em 0;
}

.sidebar-below {
    margin-top: 0.5em;
    padding-top: 0.5em;
    border-top: 1px solid #a2a9b1;
    font-size: 0.9em;
    text-align: center;
}

/* ==========================================================================
   COLLAPSIBLE SIDEBAR
   ========================================================================== */

.sidebar-collapsible .sidebar-title {
    cursor: pointer;
}

.sidebar-collapsible .sidebar-title::after {
    content: ' [hide]';
    font-weight: normal;
    font-size: 0.8em;
}

.sidebar-collapsible.mw-collapsed .sidebar-title::after {
    content: ' [show]';
}

/* ==========================================================================
   PORTAL SIDEBAR
   ========================================================================== */

.sidebar-portal {
    width: auto;
    max-width: none;
    float: none;
    clear: none;
    display: inline-block;
    margin: 0.5em;
    padding: 0.3em 0.6em;
}

.portal-content {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media screen and (max-width: 720px) {
    .sidebar {
        float: none;
        clear: both;
        width: 100%;
        max-width: 100%;
        margin: 1em 0;
    }

    .sidebar-left {
        float: none;
        margin: 1em 0;
    }
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */

[data-theme="dark"] .sidebar {
    border-color: #72777d;
    background-color: #27292d;
    color: #c8ccd1;
}

[data-theme="dark"] .sidebar-title {
    border-bottom-color: #72777d;
}

[data-theme="dark"] .sidebar-caption {
    color: #a2a9b1;
}

[data-theme="dark"] .sidebar-heading {
    border-top-color: #54595d;
}

[data-theme="dark"] .sidebar-below {
    border-top-color: #72777d;
}

[data-theme="dark"] .sidebar a {
    color: #6b9eff;
}

[data-theme="dark"] .sidebar a:visited {
    color: #b695e0;
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .sidebar {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 1em 0;
        border-color: #000;
        background-color: #fff;
    }

    .sidebar-title {
        border-bottom-color: #000;
    }

    .sidebar-heading {
        border-top-color: #000;
    }

    .sidebar-below {
        border-top-color: #000;
    }

    .sidebar-collapsible .sidebar-title::after {
        content: none;
    }

    .sidebar-collapsible.mw-collapsed .mw-collapsible-content {
        display: block;
    }
}