/* =====================================================================
   BASE.CSS — remplace Bootstrap (sans framework)
   ---------------------------------------------------------------------
   Ce fichier reprend uniquement ce que le site utilisait de Bootstrap,
   avec les mêmes noms de classes : le HTML n'a presque pas changé.
   Les icônes (Bootstrap Icons / Font Awesome) restent chargées à part.

   Sommaire :
     1. Réglages de base (marges, polices, titres, liens...)
     2. Conteneur et grille (container, row, col-*)
     3. Boutons (btn, btn-primary...)
     4. Cartes (card)
     5. Vidéo au bon format (ratio)
     6. Menu (navbar) — ouverture sur mobile : fichier menu.js
     7. Fenêtre (modal) et carrousel (carousel)
     8. Classes utilitaires (marges, alignements, affichage...)

   Tailles d'écran utilisées :
     sm = 576px et plus   md = 768px et plus   lg = 992px et plus
     xl = 1200px et plus  xxl = 1400px et plus
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. RÉGLAGES DE BASE
   --------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

@media (prefers-reduced-motion: no-preference) {
    :root {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    -webkit-tap-highlight-color: transparent;
}

hr {
    margin: 1rem 0;
    color: inherit;
    border: 0;
    border-top: 1px solid;
    opacity: 0.25;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
}

/* Titres : la taille s'adapte à la largeur de l'écran */
h1 { font-size: calc(1.375rem + 1.5vw); }
h2 { font-size: calc(1.325rem + 0.9vw); }
h3 { font-size: calc(1.3rem + 0.6vw); }
h4 { font-size: calc(1.275rem + 0.3vw); }
h5, .h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

@media (min-width: 1200px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    h4 { font-size: 1.5rem; }
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

ol, ul {
    padding-left: 2rem;
}

ol, ul, dl {
    margin-top: 0;
    margin-bottom: 1rem;
}

ol ol, ul ul, ol ul, ul ol {
    margin-bottom: 0;
}

b, strong {
    font-weight: bolder;
}

small, .small {
    font-size: 0.875em;
}

a {
    color: #0d6efd;
    text-decoration: underline;
}

a:hover {
    color: #0a58ca;
}

img, svg {
    vertical-align: middle;
}

iframe {
    border: 0;
}

label {
    display: inline-block;
}

button {
    border-radius: 0;
}

button, input, select, textarea {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button, select {
    text-transform: none;
}

button, [type="button"], [type="reset"], [type="submit"] {
    -webkit-appearance: button;
}

button:not(:disabled), [type="button"]:not(:disabled) {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

/* Image qui ne dépasse jamais de son conteneur */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Liste sans puces */
.list-unstyled {
    padding-left: 0;
    list-style: none;
}

/* Texte d'introduction un peu plus grand */
.lead {
    font-size: 1.25rem;
    font-weight: 300;
}

/* Très grands titres */
.display-4 {
    font-size: calc(1.475rem + 2.7vw);
    font-weight: 300;
    line-height: 1.2;
}

@media (min-width: 1200px) {
    .display-4 {
        font-size: 3.5rem;
    }
}


/* ---------------------------------------------------------------------
   2. CONTENEUR ET GRILLE
   .container : largeur limitée et centrée
   .row : une ligne de colonnes   .col-6 : demi-largeur (6/12)
   .col-md-4 : un tiers à partir de 768px, pleine largeur en dessous
   .g-3 : espace entre les colonnes
   --------------------------------------------------------------------- */

.container,
.container-fluid {
    --gx: 1.5rem;
    width: 100%;
    padding-right: calc(var(--gx) * 0.5);
    padding-left: calc(var(--gx) * 0.5);
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

.row {
    --gx: 1.5rem;
    --gy: 0;
    display: flex;
    flex-wrap: wrap;
    margin-top: calc(-1 * var(--gy));
    margin-right: calc(-0.5 * var(--gx));
    margin-left: calc(-0.5 * var(--gx));
}

.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: calc(var(--gx) * 0.5);
    padding-left: calc(var(--gx) * 0.5);
    margin-top: var(--gy);
}

/* Espacement entre colonnes : g-0 (aucun) à g-5 (grand) */
.g-0 { --gx: 0; --gy: 0; }
.g-1 { --gx: 0.25rem; --gy: 0.25rem; }
.g-2 { --gx: 0.5rem; --gy: 0.5rem; }
.g-3 { --gx: 1rem; --gy: 1rem; }
.g-4 { --gx: 1.5rem; --gy: 1.5rem; }
.g-5 { --gx: 3rem; --gy: 3rem; }

@media (min-width: 768px) {
    .g-md-3 { --gx: 1rem; --gy: 1rem; }
    .g-md-4 { --gx: 1.5rem; --gy: 1.5rem; }
}


/* ---------------------------------------------------------------------
   3. BOUTONS
   --------------------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: 0.5rem;
}

.btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-dark {
    color: #fff;
    background-color: #212529;
    border-color: #212529;
}

.btn-dark:hover {
    color: #fff;
    background-color: #424649;
    border-color: #373b3e;
}

.btn-light {
    color: #000;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

.btn-light:hover {
    color: #000;
    background-color: #d3d4d5;
    border-color: #c6c7c8;
}

.btn-outline-light {
    color: #f8f9fa;
    border-color: #f8f9fa;
}

.btn-outline-light:hover {
    color: #000;
    background-color: #f8f9fa;
    border-color: #f8f9fa;
}

/* Croix de fermeture */
.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 1em auto no-repeat;
    border: 0;
    border-radius: 0.375rem;
    opacity: 0.5;
}

.btn-close:hover {
    opacity: 0.75;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}


/* ---------------------------------------------------------------------
   4. CARTES
   --------------------------------------------------------------------- */

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: #fff;
    background-clip: border-box;
    border: 1px solid rgba(0, 0, 0, 0.175);
    border-radius: 0.375rem;
}

.card-body {
    flex: 1 1 auto;
    padding: 1rem;
}

.card-title {
    margin-bottom: 0.5rem;
}

.card-subtitle {
    margin-top: -0.25rem;
    margin-bottom: 0;
}

.card-text:last-child {
    margin-bottom: 0;
}

.card-img-top {
    width: 100%;
    border-top-left-radius: calc(0.375rem - 1px);
    border-top-right-radius: calc(0.375rem - 1px);
}


/* ---------------------------------------------------------------------
   5. VIDÉO AU BON FORMAT : <div class="ratio ratio-16x9"><iframe>
   --------------------------------------------------------------------- */

.ratio {
    position: relative;
    width: 100%;
}

.ratio::before {
    display: block;
    padding-top: var(--aspect-ratio);
    content: "";
}

.ratio > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ratio-16x9 { --aspect-ratio: 56.25%; }
.ratio-4x3 { --aspect-ratio: 75%; }
.ratio-1x1 { --aspect-ratio: 100%; }


/* Barre de progression (lecteurs audio)
   Couleurs et animation seulement si la barre est dans un .progress */
.progress {
    --progress-bar-color: #fff;
    --progress-bar-bg: #0d6efd;
    --progress-bar-transition: width 0.6s ease;
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: 0.75rem;
    background-color: #e9ecef;
    border-radius: 0.375rem;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: var(--progress-bar-color);
    text-align: center;
    white-space: nowrap;
    background-color: var(--progress-bar-bg);
    transition: var(--progress-bar-transition);
}


/* ---------------------------------------------------------------------
   6. MENU (navbar)
   Sur mobile, le menu est replié : le bouton (navbar-toggler) l'ouvre
   grâce au fichier menu.js. À partir de 992px (navbar-expand-lg),
   il est toujours déplié, en ligne.
   --------------------------------------------------------------------- */

.navbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.navbar > .container,
.navbar > .container-fluid {
    display: flex;
    flex-wrap: inherit;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
    margin-right: 1rem;
    font-size: 1.25rem;
    color: #000;
    text-decoration: none;
    white-space: nowrap;
}

.navbar-nav {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

/* Lien de menu : espacement et couleurs donnés par des variables,
   définies seulement dans un .navbar-nav (le CSS du site peut les remplacer) */
.nav-link {
    display: block;
    padding: var(--nav-link-padding-y, 0) var(--nav-link-padding-x, 0);
    color: var(--nav-link-color);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--nav-link-hover-color);
}

.navbar-nav {
    --nav-link-padding-x: 0;
    --nav-link-padding-y: 0.5rem;
    --nav-link-color: rgba(0, 0, 0, 0.65);
    --nav-link-hover-color: rgba(0, 0, 0, 0.8);
}

.navbar-nav .nav-link.active {
    color: #000;
}

.navbar-collapse {
    flex-basis: 100%;
    flex-grow: 1;
    align-items: center;
}

/* Bouton du menu mobile */
.navbar-toggler {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    color: rgba(0, 0, 0, 0.65);
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    transition: box-shadow 0.15s ease-in-out;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

/* Bloc replié : caché tant qu'il n'a pas la classe "show" */
.collapse:not(.show) {
    display: none;
}

@media (min-width: 992px) {
    .navbar-expand-lg {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .navbar-expand-lg .navbar-nav {
        flex-direction: row;
    }

    .navbar-expand-lg .navbar-nav .nav-link {
        padding-right: 0.5rem;
        padding-left: 0.5rem;
    }

    .navbar-expand-lg .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
    }

    .navbar-expand-lg .navbar-toggler {
        display: none;
    }
}

/* Menu fixé en haut de l'écran */
.fixed-top {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1030;
}


/* ---------------------------------------------------------------------
   7. FENÊTRE (modal) ET CARROUSEL (carousel)
   Ouverture / fermeture gérées par le JavaScript de la page
   (classe "show" sur .modal).
   --------------------------------------------------------------------- */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: block;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }

    .modal-dialog-centered {
        min-height: calc(100% - 3.5rem);
    }
}

@media (min-width: 992px) {
    .modal-xl {
        max-width: 800px;
    }
}

@media (min-width: 1200px) {
    .modal-xl {
        max-width: 1140px;
    }
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.175);
    border-radius: 0.5rem;
    outline: 0;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.5rem - 1px);
    border-top-right-radius: calc(0.5rem - 1px);
}

.modal-header .btn-close {
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

/* Page derrière la fenêtre : on bloque le défilement */
body.modal-open {
    overflow: hidden;
}

.carousel {
    position: relative;
}

.carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-inner::after {
    display: block;
    clear: both;
    content: "";
}

.carousel-item {
    position: relative;
    display: none;
    float: left;
    width: 100%;
    margin-right: -100%;
    backface-visibility: hidden;
    transition: transform 0.6s ease-in-out;
}

.carousel-item.active {
    display: block;
}

.carousel-control-prev,
.carousel-control-next {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15%;
    padding: 0;
    color: #fff;
    text-align: center;
    background: none;
    border: 0;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
    opacity: 0.9;
}

.carousel-control-prev { left: 0; }
.carousel-control-next { right: 0; }

.carousel-control-prev-icon,
.carousel-control-next-icon {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    background-repeat: no-repeat;
    background-position: 50%;
    background-size: 100% 100%;
}

.carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}

.carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}


/* ---------------------------------------------------------------------
   8. CLASSES UTILITAIRES
   Elles passent avant le style des sites (!important), comme avant.
   Lecture des noms :
     m = marge, p = espace intérieur ; t = haut, b = bas, s = gauche,
     e = droite, x = gauche+droite, y = haut+bas
     0 = aucun, 1 = 0.25rem, 2 = 0.5rem, 3 = 1rem, 4 = 1.5rem, 5 = 3rem
     ex : mb-3 = marge en bas de 1rem ; mt-md-0 = pas de marge en haut
     à partir de 768px.
   --------------------------------------------------------------------- */

/* Couleurs de texte */
.text-white { color: #fff !important; }
.text-light { color: #f8f9fa !important; }
.text-dark { color: #212529 !important; }
.text-muted { color: #6c757d !important; }
.text-primary { color: #0d6efd !important; }
.text-success { color: #198754 !important; }
.text-warning { color: #ffc107 !important; }
.text-danger { color: #dc3545 !important; }

/* Fonds */
.bg-dark { background-color: #212529 !important; }
.bg-light { background-color: #f8f9fa !important; }
.bg-white { background-color: #fff !important; }
.bg-transparent { background-color: transparent !important; }

/* Texte */
.text-decoration-none { text-decoration: none !important; }
.text-decoration-underline { text-decoration: underline !important; }
.fw-light { font-weight: 300 !important; }
.fw-normal { font-weight: 400 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }
.fs-1 { font-size: calc(1.375rem + 1.5vw) !important; }
.fs-2 { font-size: calc(1.325rem + 0.9vw) !important; }
.fs-3 { font-size: calc(1.3rem + 0.6vw) !important; }
.fs-4 { font-size: calc(1.275rem + 0.3vw) !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }

@media (min-width: 1200px) {
    .fs-1 { font-size: 2.5rem !important; }
    .fs-2 { font-size: 2rem !important; }
    .fs-3 { font-size: 1.75rem !important; }
    .fs-4 { font-size: 1.5rem !important; }
}

/* Bordures, coins arrondis, ombre */
.border { border: 1px solid #dee2e6 !important; }
.border-0 { border: 0 !important; }
.border-secondary { border-color: #6c757d !important; }
.border-light { border-color: #f8f9fa !important; }
.rounded { border-radius: 0.375rem !important; }
.rounded-3 { border-radius: 0.5rem !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: 50rem !important; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }

/* Tailles */
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
.h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; }
.vh-100 { height: 100vh !important; }
.min-vh-100 { min-height: 100vh !important; }

/* Position */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }

/* Flexbox (hors tailles d'écran) */
.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.align-self-center { align-self: center !important; }

/* ---------------------------------------------------------------------
   Colonnes et classes utilitaires par taille d ecran (fichier genere)
   --------------------------------------------------------------------- */

.col-12 { flex: 0 0 auto; width: 100%; }
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.justify-content-center { justify-content: center !important; }
.align-items-center { align-items: center !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.ms-0 { margin-left: 0 !important; }
.ms-auto { margin-left: auto !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }
.p-0 { padding: 0 !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.text-start { text-align: left !important; }
.text-center { text-align: center !important; }

@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
}

@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 auto; width: 33.33333333%; }
}

@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .d-lg-block { display: block !important; }
}

