/* ===============================
BDA — Styles globaux consolidés
=============================== */
:root {
    --nav-h: 64px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    padding-top: var(--nav-h);
    background: var(--bs-body-bg);
}

.section,
.section :is(h1, h2, h3),
:target {
    scroll-margin-top: calc(var(--nav-h) + 8px);
}

/* Navbar */
.navbar-brand img {
    height: 28px;
    width: auto;
}

/* Fallback pour l’icône burger */
.navbar-toggler-icon {
    background-image: var(--bs-navbar-toggler-icon-bg);
}

.nav-link {
    color: var(--bs-body-color);
    transition: color .2s ease-in-out, text-decoration .2s;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--bs-primary);
}

#tocNavbar .nav-link.active,
#tocNavbar .nav-link:focus-visible {
    color: var(--bs-primary) !important;
    font-weight: 600;
    outline: none;
}

/* Lang switch — version unique */
#lang-switch {
    background-color: var(--bs-body-bg);
    border-radius: .375rem;
    padding: .1rem;
}

#lang-switch .btn {
    padding: .25rem .4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

#lang-switch .flag {
    width: 18px;
    height: 13px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
}

.flag-16 {
    width: 16px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
    vertical-align: baseline;
}

/* Sections */
.section {
    margin-bottom: 2rem;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .5rem;
}

.section-title h2,
.section-title h3,
.section-title h4 {
    margin: 0;
}

.section-rule {
    height: 2px;
    opacity: .35;
    border: 0;
}

.section-body {
    margin-left: clamp(.75rem, 2vw, 2rem);
}

.section-body.with-rail {
    border-left: 2px solid rgba(13, 139, 209, .25);
    padding-left: clamp(.75rem, 1.5vw, 1.25rem);
    margin-left: clamp(.5rem, 1.5vw, 1.25rem);
}

/* Intro */
#intro-title {
    font-size: clamp(1.9rem, 3vw, 2.4rem);
    line-height: 1.15;
    margin: 0 0 .2rem 0;
}

.intro-subtitle {
    color: var(--bs-primary);
    font-weight: 600;
    font-size: clamp(.95rem, 1.4vw, 1.1rem);
    line-height: 1.3;
    margin: 0 0 .6rem 0;
}

section[aria-labelledby="intro-title"] {
    padding-top: 2rem;
}

.ds-logo {
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 0 6px rgba(0, 0, 0, .2);
    max-width: 100%;
    height: auto;
}

/* i18n visibility */
html[lang="en"] .only-fr {
    display: none !important;
}

html[lang="fr"] .only-en {
    display: none !important;
}

/* Thumbnails */
img.doc-thumb {
    display: block;
    width: clamp(72px, 10vw, 96px);
    height: auto;
    object-fit: contain;
    border-radius: clamp(4px, .4vw, 12px);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    margin: 0 auto;
}

/* Tables */
table.table th,
table.table td {
    vertical-align: middle;
}

section[aria-labelledby="eval-title"] .table-responsive {
    width: 880px;
    max-width: 100%;
    margin-left: 0;
    margin-right: auto;
    padding: 0 .5rem;
    overflow-x: auto;
}

/* Responsive */
@media (max-width: 575.98px) {
    .section-body .row {
        flex-direction: column;
        align-items: stretch;
    }

    .section-body .row>[class*="col-"] {
        width: 100%;
        text-align: start !important;
    }

    section[aria-labelledby="intro-title"] .col-md-4 {
        text-align: center;
    }

    section[aria-labelledby="intro-title"] .col-md-8 {
        text-align: start;
    }
}

@media (max-width: 582px) {
    .navbar .container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-brand {
        width: 100%;
        justify-content: center;
        margin-bottom: .25rem;
    }

    .navbar-toggler {
        align-self: center;
        margin-bottom: .25rem;
    }

    #lang-switch {
        display: flex;
        justify-content: center;
        margin-bottom: .25rem;
        width: 100%;
    }
}


.nowrap {
    white-space: nowrap;
}


:root {
    --nav-h: 64px;
}

body {
    padding-top: var(--nav-h);
}

/* Switcher rectangulaire, largeur fixe pour éviter le shift */
#lang-switch {
    background: inherit;
    border: 0;
    padding: 0;
    box-shadow: none;
}

#lang-switch .btn-group {
    display: inline-flex;
    gap: 0;
    width: 92px;
}

/* largeur fixe */
#lang-switch .btn {
    height: 30px;
    flex: 1 0 46px;
    /* chaque bouton = moitié, fixe */
    padding: 0 .4rem;
    border: 1px solid var(--bs-border-color);
    background: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lang-switch .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

#lang-switch .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

#lang-switch .btn[aria-pressed="true"] {
    pointer-events: none;
}

#lang-switch .flag {
    width: 18px;
    height: 13px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
    object-fit: cover;
}

#lang-switch .btn.btn-primary {
    background-color: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}

#lang-switch .btn.btn-outline-primary {
    background: inherit;
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Mobile: ordonner les blocs et garantir visibilité */
@media (max-width: 582px) {
    .navbar .container {
        flex-direction: column;
        align-items: center;
        gap: .25rem;
    }

    .navbar-brand {
        order: 1;
    }

    .navbar-toggler {
        order: 2;
    }

    .collapse.navbar-collapse {
        order: 3;
    }

    /* menu */
    #lang-switch {
        order: 4;
        display: flex !important;
    }

    /* après le menu */
}


/* Accessibilité focus visible pour les liens */
#tocNavbar .nav-link:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}



/* Course cards */
.course-article {
    border-left: 4px solid #0d8bd1;
    border-top: none;
    border-right: none;
    border-bottom: none;
    background: var(--bs-body-bg, #fff);
    border-radius: .75rem;
    padding: 1rem 1rem .75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}


.course-article .course-title {
    margin: 0 0 .25rem 0;
    font-weight: 700;
    line-height: 1.25;
}

.course-article .course-summary {
    margin: 0 0 .75rem 0;
    color: var(--bs-secondary-color, #6c757d);
    font-size: .95rem;
}

.course-article ul.compact-list {
    margin: 0 0 .75rem 1.1rem;
}

.course-article ul.compact-list li {
    margin: .15rem 0;
}

.nowrap { white-space: nowrap; }
