/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
}

body {
    background: #0d1117;
    color: #e6edf3;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #e5796d;
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    color: #e6edf3;
    line-height: 1.25;
    font-weight: 600;
}

/* ===== HEADER ===== */
.site-header {
    border-bottom: 1px solid #21262d;
    background: #010409;
}

.header-nav {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e6edf3;
}

.site-title:hover {
    color: #e5796d;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.25rem;
}

.nav-links a {
    font-size: 0.9375rem;
    color: #e6edf3;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover {
    background: #21262d;
    text-decoration: none;
}

.nav-links a.active {
    font-weight: 600;
    background: rgba(248, 81, 73, 0.15);
    color: #e5796d;
}

/* ===== FOOTER ===== */
.site-footer {
    margin-top: auto;
    border-top: 1px solid #21262d;
    background: #010409;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: #8b949e;
}

.footer-contact {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.8125rem;
}

/* ===== MAIN ===== */
.site-main {
    flex: 1;
}

/* ===== HOME ===== */
.home-container {
    max-width: 1012px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.hero {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #21262d;
    text-align: left;
}

.hero-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #e6edf3;
    font-weight: 600;
}

.hero-subtitle {
    font-size: 1rem;
    color: #8b949e;
    line-height: 1.7;
}

.hero-subtitle p {
    margin-bottom: 0.75rem;
}

.hero-subtitle p:last-child {
    margin-bottom: 0;
}

/* ===== CARDS DOSSIER ===== */
.dossiers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.dossier-card {
    display: block;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1.25rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    color: #e6edf3;
}

.dossier-card:hover {
    border-color: #e5796d;
    box-shadow: 0 1px 3px rgba(248, 81, 73, 0.15);
    text-decoration: none;
    color: #e6edf3;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.1875rem;
    color: #e5796d;
    font-weight: 600;
}

.card-summary {
    font-size: 0.9375rem;
    color: #8b949e;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.card-meta {
    display: flex;
    gap: 1rem;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.8125rem;
    color: #8b949e;
}

/* ===== AVERTISSEMENT ===== */
.avertissement {
    background: rgba(210, 153, 34, 0.08);
    border: 1px solid rgba(210, 153, 34, 0.4);
    border-radius: 6px;
    padding: 1.25rem;
    font-size: 0.9375rem;
    color: #e6edf3;
    line-height: 1.5;
}

.avertissement p {
    margin-bottom: 0.5rem;
}

.avertissement p:last-child {
    margin-bottom: 0;
}

.avertissement-label {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #d29922;
    margin-bottom: 0.75rem;
}

/* ===== LAYOUT AVEC SIDEBAR ===== */
.layout-with-sidebar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 1.5rem;
}

.sidebar-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #21262d;
}

.sidebar-title a {
    color: #e6edf3;
}

.sidebar-title a:hover {
    color: #e5796d;
}

.sidebar-links {
    list-style: none;
}

.sidebar-links li {
    margin-bottom: 1px;
}

.sidebar-links a {
    display: block;
    padding: 0.375rem 0.75rem;
    font-size: 0.9375rem;
    color: #8b949e;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.sidebar-links a:hover {
    color: #e6edf3;
    background: #21262d;
    text-decoration: none;
}

.sidebar-links a.active {
    color: #e6edf3;
    font-weight: 600;
    background: rgba(248, 81, 73, 0.15);
    border-left-color: #e5796d;
}

.content-main {
    flex: 1;
    min-width: 0;
}

/* ===== LAYOUT SINGLE ===== */
.layout-single {
    max-width: 848px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== CONTENT ===== */
.content-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #21262d;
}

.content-header h1 {
    font-size: 2.25rem;
}

.content-body {
    font-size: 1.0625rem;
    line-height: 1.6;
}

.content-body h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #21262d;
}

.content-body h3 {
    font-size: 1.3125rem;
    margin: 1.25rem 0 0.5rem;
}

.content-body p {
    margin-bottom: 1rem;
}

.content-body ul, .content-body ol {
    margin: 0 0 1rem;
    padding-left: 2em;
}

.content-body li {
    margin-bottom: 0.25rem;
}

.content-body li + li {
    margin-top: 0.25rem;
}

.content-body blockquote {
    border-left: 0.25em solid #30363d;
    padding: 0 1em;
    margin: 1rem 0;
    color: #8b949e;
}

.content-body code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 85%;
    background: rgba(110, 118, 129, 0.4);
    padding: 0.2em 0.4em;
    border-radius: 6px;
}

.content-body em {
    color: #8b949e;
}

.content-body strong {
    font-weight: 600;
    color: #e6edf3;
}

/* ===== DOSSIER PAGE ===== */
.dossier-resume {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: #8b949e;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1rem;
    text-align: center;
}

.metric-value {
    display: block;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 2.25rem;
    color: #e5796d;
    font-weight: 600;
    line-height: 1.2;
}

.metric-label {
    display: block;
    font-size: 0.8125rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 0.25rem;
}

.chapitres-list {
    margin-top: 1.5rem;
    border-top: 1px solid #21262d;
    padding-top: 1.5rem;
}

.chapitres-list h2 {
    font-size: 1.3125rem;
    margin-bottom: 0.75rem;
}

.chapitre-link {
    display: block;
    padding: 0.875rem 1rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    color: #e6edf3;
}

.chapitre-link:hover {
    border-color: #e5796d;
    box-shadow: 0 1px 3px rgba(248, 81, 73, 0.15);
    text-decoration: none;
}

.chapitre-title {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #e5796d;
}

.chapitre-summary {
    display: block;
    font-size: 0.875rem;
    color: #8b949e;
    margin-top: 0.2rem;
}

/* ===== TELECHARGER ===== */
.telecharger-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.telecharger-box p {
    margin-bottom: 0.75rem;
}

.telecharger-box p:last-child {
    margin-bottom: 0;
}

.telecharger-label {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #8b949e;
}

.telecharger-btn {
    display: inline-block;
    padding: 0.625rem 1.25rem;
    border: 1px solid #e5796d;
    border-radius: 6px;
    background: rgba(248, 81, 73, 0.1);
    color: #e5796d;
    font-weight: 600;
    transition: background 0.15s;
}

.telecharger-btn:hover {
    background: rgba(248, 81, 73, 0.2);
    text-decoration: none;
}

.telecharger-absent {
    color: #d29922;
}

.telecharger-box--hors-ligne {
    background: rgba(210, 153, 34, 0.08);
    border-color: rgba(210, 153, 34, 0.4);
}

.telecharger-box--hors-ligne .telecharger-label {
    color: #d29922;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    .header-nav {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .nav-links {
        gap: 0.125rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .layout-with-sidebar {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
        border-bottom: 1px solid #21262d;
        padding-bottom: 0.75rem;
        margin-bottom: 1rem;
    }

    .sidebar-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .sidebar-links a {
        border-left: none;
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }

    .sidebar-links a.active {
        border-left: none;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .home-container {
        padding: 1.5rem 1rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-header h1 {
        font-size: 1.75rem;
    }
}
