/* ========== RESET & VARIABLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-page: #f8f9fa;
    --bg-white: #ffffff;
    --border-light: #e0e2e5;
    --text-dark: #202122;
    --text-muted: #54595d;
    --link-blue: #0645ad;
    --link-hover: #0b0080;
    --red-accent: #c3262e;
    --gold: #c6a43c;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-page);
    color: var(--text-dark);
    line-height: 1.6;
}

.wikipedia-container {
    max-width: 1440px;
    margin: 0 auto;
    background: var(--bg-page);
}

/* ========== SCROLL ANIMATION ========== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== HEADER ========== */
.wiki-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: var(--font-heading);
}

.logo-icon {
    color: var(--red-accent);
    font-size: 1.8rem;
}

.logo-text {
    letter-spacing: -0.5px;
}

.beta-tag {
    background: #e0e2e5;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 400;
}

.search-area {
    display: flex;
    flex: 1;
    max-width: 400px;
}

.search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: 24px 0 0 24px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--link-blue);
}

.search-btn {
    background: #e0e2e5;
    border: 1px solid var(--border-light);
    border-left: none;
    border-radius: 0 24px 24px 0;
    padding: 0 16px;
    cursor: pointer;
    color: var(--text-dark);
    transition: background 0.2s;
}

.search-btn:hover {
    background: #d0d2d5;
}

.user-actions a {
    margin-left: 16px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.user-actions .create-account {
    background: var(--link-blue);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
}

.user-actions .create-account:hover {
    background: var(--link-hover);
}

.wiki-nav ul {
    display: flex;
    list-style: none;
    padding: 0 24px;
    border-top: 1px solid var(--border-light);
}

.wiki-nav li a {
    display: inline-block;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.85rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.wiki-nav li a.active {
    border-bottom-color: var(--red-accent);
    font-weight: 600;
}

.wiki-nav li a:hover {
    border-bottom-color: var(--link-blue);
}

/* ========== LAYOUT PRINCIPAL ========== */
.wiki-content {
    display: flex;
    gap: 30px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.main-article {
    flex: 3;
    background: var(--bg-white);
    padding: 30px 35px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.sidebar-right {
    flex: 1;
    min-width: 280px;
}

/* ========== INFOBOX ========== */
.infobox {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 0 0 15px 0;
    box-shadow: var(--shadow-sm);
}

.infobox h3 {
    background: #f0f2f5;
    padding: 12px;
    text-align: center;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-light);
}

.infobox-img {
    text-align: center;
    padding: 15px;
}

.infobox-img img {
    width: 100%;
    max-width: 220px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.img-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.infobox-table {
    width: 100%;
    font-size: 0.85rem;
    border-collapse: collapse;
}

.infobox-table th,
.infobox-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.infobox-table th {
    width: 40%;
    font-weight: 600;
    color: var(--text-muted);
}

/* ========== TITRES ========== */
.article-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 500;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.article-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.article-section {
    margin: 40px 0;
}

.article-section h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    color: var(--red-accent);
    font-size: 1.3rem;
}

.sub-section {
    margin: 25px 0 30px 20px;
}

.sub-section h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========== QUOTE ========== */
.quote-card {
    background: linear-gradient(135deg, #f7f9fc 0%, #edf2f7 100%);
    border-left: 4px solid var(--gold);
    padding: 20px 28px;
    border-radius: 12px;
    margin: 25px 0;
    position: relative;
}

.quote-icon {
    font-size: 2rem;
    color: var(--gold);
    opacity: 0.4;
    margin-bottom: -10px;
}

.quote-card p {
    font-size: 1rem;
    font-style: italic;
    color: #2c3e50;
}

.quote-author {
    display: block;
    margin-top: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

/* ========== SOMMAIRE ========== */
.toc {
    background: #f8f9fc;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 12px 20px;
    margin: 25px 0;
    max-width: 380px;
}

.toc-title {
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 6px;
    margin-bottom: 8px;
}

.toc-list {
    list-style: none;
    padding-left: 12px;
}

.toc-list li {
    margin: 6px 0;
}

.toc-list a {
    text-decoration: none;
    color: var(--link-blue);
    font-size: 0.9rem;
}

.toc-list a:hover {
    text-decoration: underline;
}

.toc-list ul {
    list-style: none;
    padding-left: 20px;
}

/* ========== GRILLE PROJETS ========== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.project-img {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.project-info {
    padding: 15px;
}

.project-info h4 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.project-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.project-location {
    font-size: 0.75rem;
    color: var(--link-blue);
}

/* ========== STATS VISION ========== */
.vision-stats {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0;
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--red-accent);
    display: block;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========== LISTE DISTINCTIONS ========== */
.distinctions-list {
    list-style: none;
}

.distinctions-list li {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.distinctions-list i {
    color: var(--gold);
    width: 24px;
}

/* ========== GALERIE ========== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 10px;
    transition: transform 0.3s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    font-size: 0.7rem;
    text-align: center;
    padding: 6px;
    background: #f8f9fa;
    color: var(--text-muted);
}

/* ========== EDIT FOOTER ========== */
.edit-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.edit-btn {
    background: none;
    border: 1px solid var(--border-light);
    padding: 8px 20px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.edit-btn:hover {
    background: var(--bg-page);
    border-color: var(--link-blue);
}

.last-edit {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========== FOOTER ========== */
.wiki-footer {
    background: #eef2f5;
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-light);
    margin-top: 20px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.footer-links a {
    text-decoration: none;
    color: var(--link-blue);
    font-size: 0.8rem;
}

.footer-copyright {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .wiki-content {
        flex-direction: column;
    }
    
    .sidebar-right {
        order: 2;
    }
    
    .main-article {
        order: 1;
    }
    
    .toc {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-area {
        max-width: 100%;
    }
    
    .main-article {
        padding: 20px;
    }
    
    .article-title {
        font-size: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .user-actions {
        display: flex;
        justify-content: center;
        gap: 15px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .vision-stats {
        flex-direction: column;
        gap: 15px;
    }
}


/* ========== BARRE DE SUGGESTIONS ========== */
.suggestions-bar {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.suggestions-bar.visible {
    opacity: 1;
    transform: translateY(0);
}

.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
    color: #856404;
}

.suggestions-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #856404;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.suggestion-link {
    background: white;
    padding: 6px 14px;
    border-radius: 25px;
    text-decoration: none;
    color: #0645ad;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.suggestion-link:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}