/**
 * WikiBase - Wikipedia-Style Page Styles (Enhanced)
 * 
 * @package WikiBase
 */

/* ============================================
   BASE LAYOUT
   ============================================ */

.wiki-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Lato', 'Helvetica', 'Arial', sans-serif;
    font-size: 16px; /* Increased Size */
    line-height: 1.6;
    color: #202122;
    background-color: #ffffff;
    scroll-behavior: smooth;
}

.wiki-container {
    max-width: 960px;
    margin: 30px auto 0;
    padding: 0 1.5rem;
    background: #ffffff;
}

/* ============================================
   INFOBOX (Wikipedia Style)
   ============================================ */

.wiki-infobox {
    border: 1px solid #a2a9b1;
    background-color: #f8f9fa;
    color: #202122;
    margin: 0.5em 0 1em 1em;
    padding: 0.4em;
    float: right;
    clear: right;
    width: 22em;
    font-size: 0.9em;
    line-height: 1.5em;
    text-align: center; /* Centered Content */
}

.wiki-infobox-title {
    background-color: #cedff2;
    padding: 0.4em;
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 0.5em;
}

.wiki-infobox-image img, 
.wiki-infobox-logo img {
    max-width: 100%;
    height: auto;
    margin-bottom: 0.5em;
}

.wiki-infobox table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5em;
}

.wiki-infobox th {
    text-align: left;
    vertical-align: top;
    padding: 0.4em 0.6em 0.4em 0;
    width: 35%;
}

.wiki-infobox td {
    text-align: left;
    vertical-align: top;
    padding: 0.4em 0;
}

/* ============================================
   SECTIONS & CONTENT
   ============================================ */

.wiki-header {
    border-bottom: 1px solid #a2a9b1;
    margin-bottom: 1em;
}

.wiki-title {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-size: 2em;
    font-weight: normal;
    margin-bottom: 0.2em;
}

.wiki-intro {
    margin-bottom: 1.5em;
}

.wiki-section {
    margin-bottom: 1.5em;
    clear: left; /* Ensure it doesn't wrap weirdly */
}

.wiki-section h2 {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-size: 1.5em;
    font-weight: normal;
    border-bottom: 1px solid #a2a9b1;
    padding-bottom: 0.2em;
    margin-bottom: 0.5em;
    cursor: pointer;
    position: relative;
    user-select: none;
}

/* Collapsible Indicator */
.wiki-section h2::after {
    content: '▼';
    position: absolute;
    right: 0;
    font-size: 12px;
    color: #72777d;
}

.wiki-section.collapsed h2::after {
    content: '▲';
}

.wiki-section.collapsed .wiki-section-content {
    display: none;
}

/* ============================================
   GALLERY SECTION
   ============================================ */

.wiki-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.wiki-gallery img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border: 1px solid #ccc;
    padding: 4px;
    background: #f8f9fa;
    transition: transform 0.2s;
}

.wiki-gallery img:hover {
    transform: scale(1.02);
    border-color: #999;
}

/* ============================================
   SOCIAL PROFILES (Sidebar Style)
   ============================================ */

.wiki-socials-sidebar {
    background: #fff;
    border: 1px solid #a2a9b1;
    padding: 10px;
    margin-top: 15px;
    clear: right;
    float: right;
    width: 22em;
    margin-left: 1em;
}

.wiki-socials-sidebar h3 {
    font-size: 1em;
    margin: 0 0 10px 0;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.wiki-socials-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.wiki-socials-sidebar li a {
    font-size: 0.9em;
    color: #3366cc;
    text-decoration: none;
}

.wiki-socials-sidebar li a:hover {
    text-decoration: underline;
}

/* ============================================
   TOC
   ============================================ */

.wiki-toc {
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    padding: 10px;
    display: table;
    margin-bottom: 1em;
    min-width: 200px;
}

.wiki-toc-title {
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.wiki-toc ul {
    list-style-type: decimal;
    margin-left: 1.5em;
    padding: 0;
}

.wiki-toc.collapsed ul {
    display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .wiki-infobox, .wiki-socials-sidebar {
        float: none;
        width: 100%;
        margin: 0 0 1em 0;
    }
    
    .wiki-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}