/**
 * ZambiaWiki Styles
 * 
 * Custom styles for the Wikipedia-based ZambiaWiki feature
 * Last updated: December 31, 2025
 */

/* ========================================
   Wiki Featured Section (Homepage)
   ======================================== */

.wiki-featured-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    padding: 4rem 0;
    margin: 3rem 0;
}

.wiki-on-this-day-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #4361ee;
}

.wiki-otd-title {
    font-size: 1.3rem;
    color: #4361ee;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.wiki-otd-title i {
    margin-right: 0.5rem;
}

.on-this-day-events {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.on-this-day-event {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #4361ee;
}

.on-this-day-event:last-child {
    margin-bottom: 0;
}

.event-year {
    font-weight: 700;
    color: #4361ee;
    font-size: 1.5rem;
    min-width: 60px;
}

.event-content p {
    margin: 0 0 0.5rem 0;
    color: #333;
    line-height: 1.6;
}

.event-link {
    color: #4361ee;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.event-link:hover {
    text-decoration: underline;
}

.wiki-featured-grid {
    margin-top: 2rem;
}

.result-type.wiki {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* ========================================
   Wiki Hero Section
   ======================================== */

.wiki-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-bottom: 0;
}

.wiki-hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.wiki-hero-title i {
    margin-right: 1rem;
}

.wiki-hero-subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Wiki Container
   ======================================== */

.wiki-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

/* ========================================
   Wiki Search Section
   ======================================== */

.wiki-search-section {
    margin-bottom: 2.5rem;
}

.wiki-search-form {
    display: flex;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.2rem;
}

.wiki-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.wiki-search-input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

/* ========================================
   Wiki Categories Section
   ======================================== */

.wiki-categories-section {
    margin-bottom: 2rem;
    text-align: center;
}

.wiki-section-label {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
    font-weight: 500;
}

.wiki-categories-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.wiki-category-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wiki-category-btn:hover {
    border-color: #4361ee;
    color: #4361ee;
    transform: translateY(-2px);
}

.wiki-category-btn.active {
    background: #4361ee;
    border-color: #4361ee;
    color: white;
}

/* ========================================
   Wiki Results Info
   ======================================== */

.wiki-results-info {
    margin-bottom: 2rem;
    text-align: center;
    color: #666;
}

.wiki-results-info p {
    margin: 0;
    font-size: 1rem;
}

/* ========================================
   Wiki Articles Grid
   ======================================== */

.wiki-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.wiki-article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wiki-article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.wiki-article-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.wiki-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wiki-article-card:hover .wiki-article-image img {
    transform: scale(1.05);
}

.wiki-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 3rem;
}

.wiki-article-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wiki-article-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.wiki-article-excerpt {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.wiki-article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 1rem;
}

.wiki-views {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.wiki-article-footer {
    padding: 0 1.5rem 1.5rem;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* ========================================
   Wiki Empty State
   ======================================== */

.wiki-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.wiki-empty-state i {
    color: #ccc;
    margin-bottom: 1rem;
}

.wiki-empty-state h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.wiki-empty-state p {
    color: #666;
    margin-bottom: 2rem;
}

/* ========================================
   Wiki Pagination
   ======================================== */

.wiki-pagination {
    margin-top: 3rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination li a:hover {
    background: #4361ee;
    color: white;
    border-color: #4361ee;
}

.pagination li.active a {
    background: #4361ee;
    color: white;
    border-color: #4361ee;
}

.pagination li.disabled span {
    color: #ccc;
    cursor: not-allowed;
}

/* ========================================
   Wiki Article Page
   ======================================== */

/* Fallback header height; updated via JS to match real header size */
:root {
    --site-header-height: 70px;
}

.wiki-article-page {
    background: #f8f9fa;
    min-height: 100vh;
    --wiki-header-extra: 5rem;
    padding-top: calc(var(--site-header-height, 70px) + var(--wiki-header-extra));
}

@media (max-width: 768px) {
    .wiki-article-page {
        --wiki-header-extra: 4rem;
    }
}

.wiki-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

body.dark-mode .wiki-breadcrumb a,
body.dark-mode .wiki-breadcrumb span,
body.dark-mode .wiki-breadcrumb i {
    color: #cfd3e6;
}

.wiki-breadcrumb a {
    color: #4361ee;
    text-decoration: none;
}

.wiki-breadcrumb a:hover {
    text-decoration: underline;
}

.wiki-breadcrumb i {
    color: #999;
    font-size: 0.7rem;
}

.wiki-breadcrumb span {
    color: #666;
}

.wiki-article-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    padding: 2rem 0;
    margin-top: 1rem;
}

body.dark-mode .wiki-article-container {
    color: #e1e1e1;
}

/* Main Article Content */

.wiki-article-main {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    max-width: 1120px;
    margin: 0 auto;
}

body.dark-mode .wiki-article-main {
    background: #1f2737;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

body.dark-mode .wiki-article {
    color: #e1e1e1;
}

.wiki-article {
    padding: 2.25rem;
    max-width: 960px;
    margin: 0 auto;
}

.wiki-article-header {
    margin-bottom: 1.4rem;
    padding: 1rem 1.25rem 0.9rem;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    position: relative; /* avoid floating/sticky jump on scroll */
    top: 0;
    background: white;
    z-index: 1;
    border-radius: 12px;
}

body.dark-mode .wiki-article-header {
    background: #1f2737;
    border-color: #3a3f58;
}

.wiki-article-main-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

body.dark-mode .wiki-article-main-title {
    color: #f2f4ff;
}

.wiki-article-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #4b5565;
    align-items: center;
    max-width: 100%;
}

.wiki-meta-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: #f4f6fb;
    border-radius: 999px;
    border: 1px solid #e5e7ef;
}

.wiki-meta-item i {
    color: #4361ee;
}

/* Dark mode meta pills */
body.dark-mode .wiki-meta-item {
    background: #2a2f45;
    border-color: #3a3f58;
    color: #a0a0a0;
}

body.dark-mode .wiki-article-meta-info {
    color: #a0a0a0;
}

.wiki-article-primary-image {
    margin-bottom: 2rem;
    border-radius: 8px;
    overflow: hidden;
}

.wiki-article-primary-image img {
    width: 100%;
    height: auto;
    display: block;
}

.wiki-article-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f7fa;
    color: #4361ee;
    min-height: 280px;
    font-size: 3rem;
}

body.dark-mode .wiki-article-placeholder {
    background: #252942;
    color: #e1e1e1;
}

.wiki-image-caption {
    padding: 1rem;
    background: #f8f9fa;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    margin: 0;
}

body.dark-mode .wiki-image-caption {
    background: #252f45;
    color: #e1e1e1;
}

.wiki-article-summary {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #e8f4f8;
    border-left: 4px solid #4361ee;
    border-radius: 8px;
    margin-bottom: 2rem;
}

body.dark-mode .wiki-article-summary {
    background: rgba(67, 97, 238, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
    color: #e1e1e1;
}

.wiki-summary-icon {
    color: #4361ee;
    font-size: 1.5rem;
}

body.dark-mode .wiki-summary-icon {
    color: #f2f4ff;
}

.wiki-summary-text {
    flex: 1;
    color: #333;
    line-height: 1.7;
    font-size: 1.05rem;
}

body.dark-mode .wiki-summary-text {
    color: #e1e1e1;
}

.wiki-article-body {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

body.dark-mode .wiki-article-body {
    color: #e1e1e1;
}

body.dark-mode .wiki-article-body p,
body.dark-mode .wiki-article-body li,
body.dark-mode .wiki-article-body ol,
body.dark-mode .wiki-article-body ul {
    color: #e1e1e1;
}

/* Hide only noisy infobox/metadata blocks while keeping main content visible */
.wiki-article-body table.infobox,
.wiki-article-body .infobox,
.wiki-article-body .infobox_v2,
.wiki-article-body .infobox-subbox,
.wiki-article-body .navbox,
.wiki-article-body .vertical-navbox,
.wiki-article-body .metadata,
.wiki-article-body .hatnote,
.wiki-article-body .toc,
.wiki-article-body .shortdescription,
.wiki-article-body .mw-empty-elt {
    display: none !important;
}

.wiki-article-body h2 {
    font-size: 1.6rem;
    color: #4361ee;
    margin-top: 2rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
}

.wiki-article-body h3 {
    font-size: 1.25rem;
    color: #333;
    margin-top: 1.6rem;
    margin-bottom: 0.7rem;
    font-weight: 600;
}

body.dark-mode .wiki-article-body h3,
body.dark-mode .wiki-article-body h4 {
    color: #f2f4ff;
}

.wiki-article-body h4 {
    font-size: 1.1rem;
    color: #333;
    margin-top: 1.4rem;
    margin-bottom: 0.55rem;
    font-weight: 600;
}

.wiki-article-body p {
    margin-bottom: 1rem;
    text-align: justify;
}

.wiki-article-body ul,
.wiki-article-body ol {
    margin: 1rem 0 1.5rem 2rem;
    padding-left: 1rem;
}

.wiki-article-body li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.wiki-article-body a {
    color: #4361ee;
    text-decoration: none;
    border-bottom: 1px solid rgba(67, 97, 238, 0.3);
    transition: all 0.2s ease;
}

body.dark-mode .wiki-article-body a {
    color: #9fb5ff;
    border-bottom-color: rgba(159, 181, 255, 0.4);
}

.wiki-article-body a:hover {
    color: #2a3f9f;
    border-bottom-color: #2a3f9f;
}

.wiki-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

body.dark-mode .wiki-article-body table {
    background: #1f2737;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

.wiki-article-body table th,
.wiki-article-body table td {
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.wiki-article-body table th {
    background: #4361ee;
    color: white;
    font-weight: 600;
}

.wiki-article-body table tr:nth-child(even) {
    background: #f8f9fa;
}

body.dark-mode .wiki-article-body table tr:nth-child(even) {
    background: #252f45;
}

.wiki-article-body blockquote {
    border-left: 4px solid #4361ee;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
}

body.dark-mode .wiki-article-body blockquote {
    background: #252f45;
    color: #e1e1e1;
}

.wiki-article-body code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.wiki-article-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.wiki-article-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.wiki-article-body img {
    max-width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
    border-radius: 12px;
    margin: 1.25rem auto;
    display: block;
    background: #f8f9fa;
    padding: 0.5rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

body.dark-mode .wiki-article-body img {
    background: #252f45;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

.wiki-article-gallery {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #f0f0f0;
}

body.dark-mode .wiki-article-gallery {
    border-top-color: #3a3f58;
}

.wiki-article-gallery h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1.5rem;
}

body.dark-mode .wiki-article-gallery h3 {
    color: #f2f4ff;
}

.wiki-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.wiki-gallery-item {
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

body.dark-mode .wiki-gallery-item {
    background: #252f45;
}

.wiki-gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.wiki-gallery-caption {
    padding: 0.75rem;
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

body.dark-mode .wiki-gallery-caption {
    color: #e1e1e1;
}

.wiki-source-attribution {
    margin-top: 3rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    align-items: start;
}

body.dark-mode .wiki-source-attribution {
    background: #252f45;
    color: #e1e1e1;
}

.wiki-source-attribution i {
    color: #4361ee;
    margin-top: 0.2rem;
}

.wiki-source-attribution p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.wiki-source-attribution a {
    color: #4361ee;
    text-decoration: underline;
}

/* Sidebar */

.wiki-article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.wiki-sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

body.dark-mode .wiki-sidebar-section {
    background: #1f2737;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.wiki-sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wiki-sidebar-title i {
    color: #4361ee;
}

.wiki-related-articles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wiki-related-card {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

body.dark-mode .wiki-related-card {
    border-color: #3a3f58;
    color: #e1e1e1;
}

.wiki-related-card:hover {
    border-color: #4361ee;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.1);
}

.wiki-related-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.wiki-related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wiki-related-content h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #333;
}

body.dark-mode .wiki-related-content h4 {
    color: #f2f4ff;
}

.wiki-related-content p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

body.dark-mode .wiki-related-content p {
    color: #cfd3e6;
}

.wiki-quick-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wiki-stat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

body.dark-mode .wiki-stat-item {
    background: #252f45;
}

.wiki-stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4361ee;
    color: white;
    border-radius: 8px;
    font-size: 1.2rem;
}

.wiki-stat-info {
    flex: 1;
}

.wiki-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

body.dark-mode .wiki-stat-value {
    color: #f2f4ff;
}

.wiki-stat-label {
    font-size: 0.85rem;
    color: #666;
}

body.dark-mode .wiki-stat-label {
    color: #cfd3e6;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
    .wiki-article-container {
        grid-template-columns: 1fr;
    }
    
    .wiki-article-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .wiki-hero-title {
        font-size: 2rem;
    }
    
    .wiki-hero-subtitle {
        font-size: 1.1rem;
    }
    
    .wiki-search-form {
        flex-direction: column;
    }
    
    .wiki-articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .wiki-article {
        padding: 1.5rem;
    }
    
    .wiki-article-main-title {
        font-size: 1.8rem;
    }
    
    .wiki-article-body {
        font-size: 1rem;
    }
    
    .wiki-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .wiki-categories-filters {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .wiki-container {
        padding: 2rem 1rem;
    }
    
    .wiki-hero {
        padding: 2.5rem 0;
    }
    
    .on-this-day-event {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .event-year {
        min-width: auto;
    }
}

/* ========================================
   Dark Mode Support
   ======================================== */

/* Article Page Background */
body.dark-mode .wiki-article-page {
    background: #121212;
}

body.dark-mode .wiki-article-container {
    background: #0f172a;
}

/* Article Cards and Containers */
.dark-mode .wiki-article-card,
.dark-mode .wiki-article,
.dark-mode .wiki-article-main,
.dark-mode .wiki-sidebar-section {
    background: #1f2737;
    color: #e1e1e1;
    border-color: #3a3f58;
}

/* Ensure article body surface matches dark background */
body.dark-mode .wiki-article {
    color: #e1e1e1;
}

/* Breadcrumb */
body.dark-mode .wiki-breadcrumb {
    color: #a0a0a0;
}

body.dark-mode .wiki-breadcrumb a {
    color: #7a7f98;
}

body.dark-mode .wiki-breadcrumb a:hover {
    color: var(--primary);
}

body.dark-mode .wiki-breadcrumb span {
    color: #e1e1e1;
}

/* Article Headers and Titles */
.dark-mode .wiki-article-title,
.dark-mode .wiki-article-main-title,
.dark-mode .wiki-sidebar-title,
.dark-mode .wiki-sidebar-title h4,
.dark-mode .wiki-related-content h4 {
    color: #e1e1e1;
}

/* Article Body and Text */
.dark-mode .wiki-article-excerpt,
.dark-mode .wiki-article-body,
.dark-mode .wiki-article-body p,
.dark-mode .wiki-summary-text {
    color: #c8cad6;
}

.dark-mode .wiki-article-body h2 {
    color: var(--primary);
    border-bottom-color: #3a3f58;
}

.dark-mode .wiki-article-body h3,
.dark-mode .wiki-article-body h4 {
    color: #e1e1e1;
}

.dark-mode .wiki-article-body ul,
.dark-mode .wiki-article-body ol {
    color: #c8cad6;
}

.dark-mode .wiki-article-body li {
    color: #c8cad6;
}

.dark-mode .wiki-article-body table {
    background: #1f2737;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-mode .wiki-article-body table th {
    background: var(--primary);
    color: white;
    border-color: rgba(67, 97, 238, 0.5);
}

.dark-mode .wiki-article-body table td {
    border-color: #3a3f58;
    color: #c8cad6;
}

.dark-mode .wiki-article-body table tr:nth-child(even) {
    background: #2a2f45;
}

.dark-mode .wiki-article-body blockquote {
    background: #2a2f45;
    border-left-color: var(--primary);
    color: #c8cad6;
}

.dark-mode .wiki-article-body code {
    background: #2a2f45;
    color: #e8b339;
    border: 1px solid #3a3f58;
}

.dark-mode .wiki-article-body pre {
    background: #1a1f2e;
    border: 1px solid #3a3f58;
    color: #f8f8f2;
}

/* Dark mode images */
body.dark-mode .wiki-article-body img {
    background: #1f2737;
    border: 1px solid #3a3f58;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

/* Article Body Links */
body.dark-mode .wiki-article-body a {
    color: #6b8afd;
    border-bottom-color: rgba(107, 138, 253, 0.3);
}

body.dark-mode .wiki-article-body a:hover {
    color: #5578e8;
}

/* Article Meta Info */
body.dark-mode .wiki-article-meta-info {
    color: #7a7f98;
    border-bottom-color: #3a3f58;
}

body.dark-mode .wiki-meta-item {
    color: #7a7f98;
}

/* Article Summary Box */
body.dark-mode .wiki-article-summary {
    background: #2a2f45;
    border-left-color: var(--primary);
}

body.dark-mode .wiki-summary-icon {
    color: var(--primary);
}

/* Image Captions */
body.dark-mode .wiki-image-caption,
body.dark-mode .wiki-gallery-caption {
    background: rgba(42, 47, 69, 0.9);
    color: #e1e1e1;
}

/* Gallery Grid */
body.dark-mode .wiki-article-gallery h3 {
    color: #e1e1e1;
}

body.dark-mode .wiki-gallery-item {
    background: #2a2f45;
}

/* Source Attribution */
body.dark-mode .wiki-source-attribution {
    background: #2a2f45;
    border-color: #3a3f58;
    color: #a0a0a0;
}

body.dark-mode .wiki-source-attribution a {
    color: var(--primary);
}

/* Related Articles */
body.dark-mode .wiki-related-card {
    background: #2a2f45;
    border-color: #3a3f58;
}

body.dark-mode .wiki-related-card:hover {
    background: #323754;
    border-color: var(--primary);
}

body.dark-mode .wiki-related-content p {
    color: #7a7f98;
}

/* Quick Stats */
body.dark-mode .wiki-quick-stats {
    background: #2a2f45;
}

body.dark-mode .wiki-stat-item {
    border-bottom-color: #3a3f58;
}

body.dark-mode .wiki-stat-icon {
    color: var(--primary);
}

body.dark-mode .wiki-stat-value {
    color: #e1e1e1;
}

body.dark-mode .wiki-stat-label {
    color: #7a7f98;
}

/* Category Buttons */
.dark-mode .wiki-category-btn {
    background: #2a2f45;
    border-color: #3a3f58;
    color: #a0a0a0;
}

.dark-mode .wiki-category-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.dark-mode .wiki-category-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ========================================
   Responsive Design for Wiki Articles
   ======================================== */

@media (max-width: 992px) {
    .wiki-article-container {
        grid-template-columns: 1fr;
    }
    
    .wiki-article-sidebar {
        order: -1;
    }
    
    .wiki-article-main-title {
        font-size: 2rem;
    }
    
    .wiki-article {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .wiki-hero-title {
        font-size: 2rem;
    }
    
    .wiki-hero-subtitle {
        font-size: 1.1rem;
    }
    
    .wiki-article-main-title {
        font-size: 1.75rem;
    }
    
    .wiki-article-body {
        font-size: 1rem;
    }
    
    .wiki-article-body h2 {
        font-size: 1.5rem;
    }
    
    .wiki-article-body h3 {
        font-size: 1.25rem;
    }
    
    .wiki-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .wiki-article {
        padding: 1.5rem 1rem;
    }
    
    .wiki-breadcrumb {
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 576px) {
    .wiki-search-form {
        flex-direction: column;
    }
    
    .wiki-btn-primary {
        width: 100%;
    }
    
    .wiki-article-meta-info {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .wiki-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Fix for long words breaking layout */
.wiki-article-body * {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Improve table responsiveness */
@media (max-width: 768px) {
    .wiki-article-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Better spacing for article sections */
.wiki-article-body > *:first-child {
    margin-top: 0;
}

.wiki-article-body > *:last-child {
    margin-bottom: 0;
}
/* Search Input */
.dark-mode .wiki-search-input {
    background: #252942;
    border-color: #3a3f58;
    color: #e1e1e1;
}

.dark-mode .wiki-search-input::placeholder {
    color: #7a7f98;
}

/* Tables in Article Body */
body.dark-mode .wiki-article-body table {
    border-color: #3a3f58;
}

body.dark-mode .wiki-article-body th {
    background: #2a2f45;
    color: #e1e1e1;
    border-color: #3a3f58;
}

body.dark-mode .wiki-article-body td {
    border-color: #3a3f58;
}

body.dark-mode .wiki-article-body tr:hover {
    background: #252942;
}

/* Code Blocks */
body.dark-mode .wiki-article-body code {
    background: #2a2f45;
    color: #6b8afd;
}

body.dark-mode .wiki-article-body pre {
    background: #2a2f45;
    border-color: #3a3f58;
}

/* Blockquotes */
body.dark-mode .wiki-article-body blockquote {
    background: #2a2f45;
    border-left-color: var(--primary);
    color: #c0c0c0;
}

/* Featured Section (Homepage) */
body.dark-mode .wiki-featured-section {
    background: #1f2737;
}

body.dark-mode .wiki-on-this-day-card {
    background: #2a2f45;
    border-left-color: var(--primary);
}

body.dark-mode .on-this-day-event {
    background: #1f2737;
    border-left-color: var(--primary);
}

body.dark-mode .event-year {
    color: var(--primary);
}

body.dark-mode .event-content p {
    color: #c0c0c0;
}

body.dark-mode .event-link {
    color: var(--primary);
