/* --- 1. VARIABLES & RESET --- */
:root {
    /* Palette de couleurs "Notion-like" moderne */
    --bg-body: #ffffff;
    --bg-sidebar: #f7f7f5;
    --bg-sidebar-hover: #eef0f2;
    --bg-code: #f4f4f4;
    
    --text-main: #37352f;
    --text-muted: #787774;
    --text-link: #0066cc;
    
    --border-color: #e0e0e0;
    --primary-color: #2eaadc; /* Bleu moderne */
    
    /* Espacements */
    --sidebar-width: 280px;
    --spacing-md: 24px;
    
    /* Callouts colors */
    --info-bg: #e8f3ff;
    --info-text: #0c5460;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.6;
    font-size: 16px;
}

/* --- 2. LAYOUT GÉNÉRAL --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- 3. SIDEBAR (GAUCHE) --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--text-main);
}

.nav-group h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    margin-top: 20px;
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-item:hover {
    background-color: var(--bg-sidebar-hover);
}

.nav-item.active {
    background-color: #e6f3fa;
    color: var(--primary-color);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
}

/* --- 4. CONTENU PRINCIPAL (DROITE) --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width); /* Laisse la place à la sidebar */
    padding: 0;
}

.content-wrapper {
    max-width: 850px; /* Largeur de lecture idéale */
    margin: 0 auto;
    padding: 40px;
}

/* --- 5. TYPOGRAPHIE & ÉLÉMENTS DU CONTENU --- */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

h2 {
    font-size: 1.75rem;
    margin-top: 40px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

p.lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

p {
    margin-bottom: 1.5rem;
}

/* Callout Box (Boite d'info) */
.callout {
    padding: 16px;
    border-radius: 8px;
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.callout.info {
    background-color: var(--info-bg);
    color: var(--info-text);
}

.callout .icon {
    font-size: 1.4rem;
}

/* Tableaux modernes */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: #fafafa;
}

code {
    background-color: rgba(135, 131, 120, 0.15);
    color: #eb5757;
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Bloc de code complet */
.code-block {
    background: #2d2d2d;
    color: #fff;
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
}

.code-header {
    background: #1e1e1e;
    padding: 8px 16px;
    font-size: 0.8rem;
    color: #aaa;
    border-bottom: 1px solid #333;
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
}

.code-block code {
    background: none;
    color: inherit;
    padding: 0;
}

.content-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
}

.top-bar {
    display: none; /* Caché sur desktop */
}

/* --- 6. RESPONSIVE (MOBILE) --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%); /* Cache la sidebar */
        z-index: 1000;
    }
    
    .main-content {
        margin-left: 0;
    }

    .top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        border-bottom: 1px solid var(--border-color);
        background: white;
        position: sticky;
        top: 0;
    }

    .content-wrapper {
        padding: 20px;
    }
    
    h1 { font-size: 2rem; }
}