/* =============================================================
   VARIABLES PRINCIPALES
============================================================= */
:root {
    /* Couleurs mode clair */
    --bg-color: #f4f7f9;
    --content-bg: #ffffff;
    --text-color: #333333;
    --primary-color: #0379ee;
    --secondary-color: #1b4f72;
    --accent-color: #d5d80a;
    --important-color: #ff9800;
    --success-color: #4caf50;
    --code-bg: #282c34;
    --code-color: #abb2bf;
}

/* =============================================================
   MODE SOMBRE
============================================================= */
.dark-mode {
    --bg-color: #1e1e1e;
    --content-bg: #2c2c2c;
    --text-color: #e0e0e0;
    --primary-color: #4aa1ff;
    --secondary-color: #82cfff;
    --accent-color: #ffd700;
    --important-color: #ffb86c;
    --success-color: #50fa7b;
    --code-bg: #121212;
    --code-color: #f8f8f2;
}

/* =============================================================
   IMPORT POLICES GOOGLE
============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Fira+Code&display=swap');

/* =============================================================
   LAYOUT PRINCIPAL
============================================================= */
body {
    font-family: 'Merriweather', serif;
    background: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    text-align: justify;
    transition: all 0.3s ease;
}

.wy-nav-content-wrap {
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.wy-nav-content {
    width: 100%;
    max-width: 950px;
    padding: 40px 60px;
    background: var(--content-bg);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.wy-body-for-nav {
    background: var(--bg-color);
}

/* =============================================================
   TYPOGRAPHIE ET ESPACEMENT
============================================================= */
.rst-content p,
.rst-content li {
    margin-bottom: 16px;
}

.rst-content ul,
.rst-content ol {
    padding-left: 20px;
    margin-bottom: 18px;
}

.rst-content li {
    margin-bottom: 6px;
}

/* =============================================================
   TITRES ET SECTIONS
============================================================= */
.rst-content h2 {
    margin-top: 60px;
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
    text-transform: uppercase;
    font-weight: bold;
    scroll-margin-top: 80px;
}

.rst-content h3 {
    margin-top: 40px;
    color: var(--secondary-color);
    border-left: 6px solid var(--accent-color);
    padding-left: 15px;
    scroll-margin-top: 80px;
}

/* =============================================================
   BLOCS DE CODE
============================================================= */
.rst-content pre {
    margin: 30px 0;
    padding: 20px;
    background: var(--code-bg);
    color: var(--code-color);
    border-radius: 6px;
    border-left: 5px solid var(--primary-color);
    font-family: 'Fira Code', monospace;
    overflow-x: auto;
    tab-size: 2;
    transition: all 0.3s ease;
}

code {
    background: #f1f1f1;
    padding: 3px 6px;
    border-radius: 4px;
}

pre code {
    background: none;
}

/* =============================================================
   IMAGES
============================================================= */
.rst-content img {
    display: block;
    margin: 25px auto;
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.rst-content img:hover {
    transform: scale(1.02);
}

.logo-gallery {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* =============================================================
   BOITES D’INFO
============================================================= */
.box {
    padding: 18px;
    margin: 25px 0;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.box-concept {
    background: #e8f4fd;
    border-left: 6px solid var(--primary-color);
}

.box-important {
    background: #fff4e5;
    border-left: 6px solid var(--important-color);
}

.box-astuce {
    background: #e8f5e9;
    border-left: 6px solid var(--success-color);
}

/* =============================================================
   TABLEAUX
============================================================= */
.rst-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    display: block;
    overflow-x: auto;
}

.rst-content table th {
    background: var(--primary-color);
    color: white;
    padding: 10px;
    text-align: left;
}

.rst-content table td {
    border: 1px solid #ddd;
    padding: 10px;
}

.rst-content table tr:nth-child(even) {
    background: var(--bg-color);
}

/* =============================================================
   RESPONSIVE
============================================================= */
@media screen and (max-width: 768px) {
    .wy-nav-content-wrap {
        justify-content: flex-start;
    }

    .wy-nav-content {
        margin: 10px;
        padding: 20px;
        width: auto;
    }

    .rst-content {
        padding: 15px;
    }

    .rst-content pre {
        padding: 10px;
    }
}