/* --- VARIABLES / COULEURS --- */
:root {
    --primary-blue: rgba(11, 41, 81, 1);
    --secondary-blue: rgba(22, 81, 156, 1);
    --tertiary-blue: rgba(40, 143, 226, 1);
    --light-blue: rgba(39, 142, 225, 1);
    --orange: #f57c00;
    --gray: #707070;
    --text-gray: #444;
    --background-light: #f5f5f5;
}

/* --- HTML & BODY GLOBAL --- */
html {
    min-height: 100%;
    overflow-y: scroll; /* barre toujours présente */
    overflow-x: hidden; /* pas de scroll horizontal */
}

body {
    margin: 0;
    padding: 0;
    padding-top: 0 !important;
    overflow-y: visible;
    height: 100%;
    box-sizing: border-box;
}

/* --- BOUTON / FLECHE RETOUR EN HAUT --- */
.scroll-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    margin: 20px auto;
    font-weight: 600;
    transition: 0.3s;
}

div.scroll-top p {
    font-family: 'Raleway', sans-serif !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    color: #0B2951 !important;
    text-align: center;
    padding: 0 !important;
    margin: 0 !important;
}

.scroll-top:hover {
    opacity: 0.7;
}

.scroll-top .chevron {
    width: 13px;
    height: 13px;
    border-style: solid;
    border-width: 1px 1px 0 0;
    border-color: #0B2951;
    transform: rotate(-45deg);
    margin-bottom: -4px;
}

.scroll-top .retour-haut {
    align-items: center;
    color: var(--primary-blue);
}

.scroll-top p {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: #0B2951;
    text-align: center;
    padding: 0;
    margin: 0;
}

/* ----- LIGNE DE FLOTTAISON --- */
.scroll-down {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px; /* espace texte ↔ chevron */
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.scroll-down:hover {
    opacity: 0.7;
}

.scroll-down .chevron {
    margin-top: -4px;      /* 👈 remonte légèrement */
}

.scroll-text {
    text-align: center;
    font-size: 12px;
    color: #0B2951;
}
/* Chevron générique */
.chevron {
    width: 13px;
    height: 13px;
    border-style: solid;
    border-width: 1px 1px 0 0;
    border-color: #0B2951;
    transition: transform 0.3s ease;
}

.chevron.down {
    transform: rotate(135deg);
}


/* --- MESSAGES D'ALERTE --- */
.alert-danger {
    text-align: center;
    margin: 20px;
}

/* --- LIENS --- */
a, a:visited {
    text-decoration: none;
    color: #707070;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--tertiary-blue);
}

/* --- Paragraphes --- */
p {
    font-size: 18px;
    line-height: 1.5;
    margin: 0;
    text-align: center;
}

.page-title {
    font-family: 'Raleway', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(40, 143, 226, 1);
    margin: 10px auto 10px 20px;
    max-width: 1800px;
    position: relative;
    padding-top: 15px; /* Espace pour la ligne au-dessus */
    display: block;
    text-align: left;
}

/* La ligne décorative */
.page-title::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 0;
    width: 150px;      /* Longueur limitée de la ligne */
    height: 2px;      /* Épaisseur de la ligne */
    background-color: rgba(40, 143, 226, 1); /* Même couleur que le titre */
}

/* --- LISTES COMMUNES --- */
ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

ul li {
    padding: 0;
    font-size: 0.95rem;
}

/* --- TILES / CARTES DE BASE --- */
.tile {
    width: auto;
    /*border: 1px solid var(--gray);*/
    border-radius: 10px;
    padding: 18px;
    min-height: 220px;
    overflow: auto;
    background: transparent;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(11, 41, 81, 0.1);
}

.bottom-right-rounded {
    border-radius: 0 0 30px 0;
}

/* --- SIDEBAR / CONTENEUR FLEX DE BASE --- */
.layout-flex {
    display: flex;
    align-items: flex-start;
    min-height: 80vh;
    width: min(90%, 1600px);
    padding: 0px;
    box-sizing: border-box;
    margin: 10px auto 100px auto;
    background-color: #fff;
}

.sidebar {
    width: 25%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    box-sizing: border-box;
}

.content {
    width: 100%;
    /*padding: 20px 60px;*/
    box-sizing: border-box;
    text-align: justify;
}

/* --- BLUE BANNERS --- */
.blue-banner {
    background-color: var(--tertiary-blue);
    color: white;
    padding: 10px;
    text-align: left;
    border-radius: 1px;
    margin-bottom: 30px;
}

.blue-banner h2 {
    margin: 0;
    font-size: 22px;
}

/* --- BREADCRUMB COMMUN --- */
.breadcrumb-wrapper {
    position: relative;
    z-index: 10;
    max-width: 1800px;
    margin: 15px auto 0 20px;
    box-sizing: border-box;

}

/* Safari / macOS */
/*.mac-os .breadcrumb-wrapper {*/
/*    margin: 100px auto 0 20px;*/
/*}*/

.breadcrumb {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-gray);
    margin: 15px 0 5px 0;
}

.breadcrumb-link {
    text-decoration: none;
    color: var(--color-primary);
    transition: color 0.2s;
}

.breadcrumb-link:hover { color: var(--color-primary-dark); }

.breadcrumb span::before {
    content: "›";
    margin: 0 8px;
    color: #999;
}

.breadcrumb-current {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 600;
    margin: 15px 0 5px 0;
    color: var(--orange);
}
/* --------------------------*/
/* ------DEPARTEMENTS ----- */
/* ------------------------*/

.departement-layout {
    display: flex;
    flex-direction: column;
    /*max-width: 90%;*/
    width: min(90%, 1600px);
    margin: var(--spacing-md) auto;
    padding: 0px;
    box-sizing: border-box;
    background-color: #fff;
}

/* Conteneur pour la grille d'images */
.departement-images-grid {
    display: grid;
    /* Crée 3 colonnes de largeur égale */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* Espace entre les images */
    gap: var(--spacing-md);
    /* Pour que la grille prenne toute la largeur disponible dans acces-layout */
    width: 100%;
    margin-top: var(--spacing-lg); /* Un peu d'espace avec le titre */
}

/* Styles pour chaque image */
.departement-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: contain;
    display: block;
    /*width: 100%;*/
    /*height: auto;*/
    /*display: block;*/
}

/*.departement-img {*/
/*    width: 100%;*/
/*    aspect-ratio: 16 / 9;*/
/*    height: 100%;*/
/*    object-fit: cover;*/
/*    display: block;*/
/*}*/
/* --- NOUVELLE SECTION DE CONTENU --- */
.departement-content-container {
    display: flex;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    width: 100%;
    box-sizing: border-box;
}

/* --- COLONNE GAUCHE (SIDEBAR) --- */
.departement-sidebar {
    flex: 0 0 320px;
    max-width: 320px;
    min-width: 260px;
}

/* --- COLONNE DROITE (MAIN CONTENT) --- */
.departement-main-content {
    /* Colonne 2 : 70% de la largeur */
    flex: 1; /* Prend l'espace restant */
    box-sizing: border-box;
    min-width: 0;
    padding-left: 40px;
}
.departement-image img {
    max-width: 100%;
    height: auto;
    display: block; /* évite les espaces fantômes */
}
/* --- STYLES DES VIGNETTES LATÉRALES (COMMON) --- */
.sidebar-vignette {
    padding: var(--spacing-md);
}

.sidebar-vignette h2,
.sidebar-vignette h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 700;
    text-transform: uppercase;
}

.sidebar-link-trigger {
    /* Style pour que le titre cliquable dans la sidebar ressemble au texte normal */
    color: inherit; /* Utilise la couleur du titre h3 (#707070) */
    text-decoration: none; /* Supprime le soulignement par défaut des liens */
}

.sidebar-link-trigger:hover {
    /* Soulignement léger au survol */
    text-decoration: underline;
}

.annuaire-table-container {
    /* Encadrement et couleur */
    border: 2px solid #278EE1;
    font-size: 14px;
    border-bottom-right-radius: 30px;
    overflow: hidden;
}

.annuaire-table-container h3 {
    color: #16519C; /* Couleur pour le titre du tableau, par exemple */
    margin-top: 20px;
}

/* --- VIGNETTE PROJETS --- */
.projets-vignette {
    background-color: #16519C; /* Bleu foncé demandé */
    color: white;
    margin-bottom: 20px;
    /* ✅ Coin inférieur droit arrondi */
    border-bottom-right-radius: 30px;
}

.projets-vignette h2 {
    border-bottom: 1px solid white; /* La ligne blanche */
    padding-bottom: 10px;          /* Espace entre le texte et la ligne */
    margin-bottom: 15px;           /* Espace entre la ligne et le contenu suivant */
}

.projets-vignette ul {
    list-style: disc !important; /* Points devant les listes */
    padding-left: var(--spacing-lg);
    margin-bottom: 0;
}
.projets-vignette li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
    font-size: 16px;
}

.projets-vignette ul li {
    list-style-type: disc !important;
}

.projets-vignette .projet-link {
    color: white; /* Pour que le lien soit visible sur le fond bleu */
    text-decoration: none; /* Enlève le soulignement par défaut */
    font-weight: 600;
    font-size: 18px;
}

.projets-vignette .projet-link:hover {
    color: orange; /* Change la couleur au survol (par exemple en orange) */
    text-decoration: underline;
}

/* --- VIGNETTE RESPONSABLES --- */
.responsables-vignette {
    background-color: #F8F6F2; /* Fond clair demandé */
    /*border: 1px solid #ddd; !* Bordure pour définir la vignette *!*/
    /* Assure qu'elle suit le même style d'arrondi */
    border-bottom-right-radius: 30px;
}

.responsable-title {
    color: #278FE2; /* Bleu demandé */
    font-size: var(--font-size-md);
    margin-bottom: var(--spacing-xs);
}

h3.responsable-title {
    border-bottom: 1px solid #278FE2; /* La ligne bleue */
    padding-bottom: 10px;          /* Espace entre le texte et la ligne */
    margin-bottom: 15px;           /* Espace entre la ligne et le contenu suivant */
}

.responsable-name {
    color: #707070; /* Gris demandé */
    font-weight: 500;
    margin: 5px 0;
    font-size: 18px;
    text-align: left;
}

.responsable-name a {
    color: #707070; /* Gris demandé */
    text-decoration: none; /* enlève le soulignement si besoin */
}

.responsable-name a:hover {
    color: #505050; /* un gris plus foncé au survol */
}

/* --- Style pour les nouvelles vignettes (Membres / HAL) --- */
.membre-hal-vignette {
    /* Style de la vignette simple (fond blanc ou transparent) */
    background-color: white;
    padding: var(--spacing-md);
    /*margin-top: var(--spacing-lg); !* Espace avec la vignette précédente *!*/
    border: none; /* Pas de bordure par défaut, si on veut juste les titres */
}

/* --- Style pour le titre (Membres / HAL) --- */
.membre-hal-title {
    /* Couleur de titre demandée */
    color: #707070;
    font-size: 1.1em;
    font-weight: 700;
    text-align: center; /* Centre le titre entre les deux barres */
    margin: 5px 0; /* Petit espacement vertical */
}

.membre-hal-title a {
    display: flex;             /* Active le mode flexbox */
    justify-content: space-between; /* Pousse le texte à gauche et le + à droite */
    align-items: center;       /* Aligne les deux verticalement */
    width: 100%;               /* Prend toute la largeur disponible */
    text-decoration: none;     /* Enlève le soulignement si besoin */
    padding: 5px 0;            /* Un peu d'air */
}

.btn-icon {
    font-size: 1.5em;          /* Rend le "+" un peu plus visible */
    margin-left: 10px;         /* Sécurité si le texte est trop long */
}
/* --- Style pour la barre horizontale (au-dessus du titre) --- */
.section-title-bar-gray {
    /* Couleur et hauteur de la barre */
    background-color: #707070;
    height: 1px; /* Barre très fine */
    width: 100%; /* S'étend sur toute la largeur de la colonne */
    margin: 10px 0; /* Espace autour de la barre */
}

/* --- VIGNETTE DESCRIPTION (COLONNE DROITE) --- */
.description-vignette {
    background-color: #278EE1; /* Bleu principal demandé */
    color: white; /* Texte blanc demandé */
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-lg); /* Espace entre la vignette titre et le contenu */
    /* S'étend sur toute la largeur de la colonne droite et est en haut */
}

.description-vignette h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

/* --- CONTENU TEXTE DROIT --- */
.text-content {
    max-width: 100%;
    overflow-wrap: break-word;
    box-sizing: border-box;
    font-size: 18px;
    line-height: 1.6rem;
    color: gray;
}

.text-content p {
    text-align: justify;
    font-size: 18px;
    line-height: 1.6rem;
    color: gray;
    overflow-wrap: break-word;
}

.text-content h3 {
    color: var(--color-primary); /* Utilisez la couleur de votre thème */
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
    font-size: 1.3em;
}

.text-content h4 {
    color: #707070; /* Utilisez la couleur de votre thème */
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    font-size: 20px;
}

/* --- Style pour le contenu des Mots Clés (encadré) --- */
/* --- VIGNETTE DESCRIPTION (COLONNE DROITE) --- */
.description-mots-cles {
    background-color: #278EE1; /* Bleu principal demandé */
    color: white; /* Texte blanc demandé */
    padding: var(--spacing-sm);
    margin-top: 20px;
}

.description-mots-cles h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}
.mots-cles-content {
    /* Couleur de la bordure : identique à la vignette DESCRIPTION */
    border: 2px solid #278EE1;

    /* Rayon d'arrondi sur les coins bas-droite */
    border-bottom-right-radius: 30px;

    /* Padding pour que le texte ne colle pas aux bords */
    padding: var(--spacing-md);

    /* Espace au-dessus du cadre */
    margin-top: -1px; /* Pour coller au titre, ajuster si nécessaire */
    margin-bottom: 20px;

    /* Style du texte */
    font-size: 1em;
    font-weight: 600;
    color: #278EE1; /* Texte de la même couleur que le cadre */
    line-height: 1.8rem;
}


.description-membres {
    background-color: #278EE1; /* Bleu principal demandé */
    color: white; /* Texte blanc demandé */
    padding: var(--spacing-sm);
}

.description-membres h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.annuaire-table-container div[style*="display:table"] {
    display: table !important;
    width: 100%;
}

.annuaire-row {
    display: table-row;
}

.annuaire-cell {
    display: table-cell;
    padding: 8px 5px;
    vertical-align: middle;
    border-bottom: 0.5px solid #CCCCCC;
}

@media (max-width: 768px) {
    .scroll-down {
        display: none;
    }

    .page-title {
        font-size: 20px;
    }

    .blue-banner h2 {
        margin: 0;
        font-size: 20px;
    }

    nav.sidebar-menu {
        display: block !important; /* On force l'affichage malgré la règle du topbar */
    }

    /* Le cadre qui cache le surplus */
    .departement-layout {
        overflow: hidden;
        max-width: 100%;
        position: relative;
    }

    .breadcrumb-wrapper {
        margin: 70px auto 0 auto;
    }

    .custom-padding {
        /* Le !important permet de passer outre le style="" du PHP */
        padding-top: 0px !important;
    }

    .departement-content-container {
        display: flex;
        flex-direction: column; /* Empile les éléments verticalement */
        gap: 20px; /* Définit l'espace entre chaque événement */
        width: 100%; /* S'assure que le conteneur prend toute la largeur */
        margin-left: 0px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .departement-sidebar {
        /*flex: 0 0 100%;*/
        /*max-width: 100%;*/
        /*display: flex;*/
        /*flex-direction: column;*/
        /*gap: var(--spacing-lg);*/
        flex: none;
        max-width: 100%;
        min-width: 0;
        width: 100%;
    }

    .departement-main-content {
        flex: 1;
        box-sizing: border-box;
        min-width: 0;
        padding-left: 0;
    }

    /* Le "rail" qui contient les images côte à côte */
    .departement-images-grid {
        display: flex; /* Aligne les images horizontalement */
        transition: transform 0.8s ease-in-out; /* Animation fluide */
        width: 100%;
        grid-template-columns: 1fr;
    }

    /* Chaque image (ou enfant) prend 100% de la largeur du cadre */
    .departement-images-grid > * {
        flex: 0 0 100%; /* Ne rétrécit pas, ne s'étire pas, fait 100% */
        width: 100%;
        height: 300px; /* Ou ta hauteur fixe */
        object-fit: cover;
    }

    .departement-images-grid img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .annuaire-table-container {
        border: 1px solid #278FE2;
        border-radius: 0 0 20px 0;
        overflow: hidden;
        background: white;
    }

    .annuaire-row {
        display: block !important; /* On empile */
        padding: 12px !important;
        border-bottom: 1px solid #eef6ff !important;
        background-color: #fff !important;
    }

    .annuaire-cell {
        display: block !important;
        width: 100% !important;
        padding: 2px 0 !important;
        border: none !important;
    }

    /* Nom : 16px, Gras, Bleu foncé */
    .annuaire-cell.col-name {
        padding: 0 0 5px 0 !important;
        font-weight: 800;
        color: #092851;
        font-size: 16px;
    }

    /* Statut et Tel côte à côte avec le tiret */
    .annuaire-cell.col-statut,
    .annuaire-cell.col-tel {
        display: inline-block !important;
        width: auto !important;
        font-size: 13px;
        color: #666;
    }

    .annuaire-cell.col-statut:after {
        content: " — ";
        white-space: pre;
    }

    /* Lieu en dessous */
    .annuaire-cell.col-site {
        padding: 4px 0 0 0 !important;
        font-size: 13px;
        color: #888;
    }

    .search-results-container {
        /* On réduit la marge du haut (50px au lieu de 100px) */
        margin: 50px auto 20px auto !important;

        /* On réduit le padding interne (1rem au lieu de 2rem) */
        padding: 1rem !important;

        /* On s'assure qu'il prend toute la largeur disponible sans déborder */
        width: 95%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .search-results-container h1 {
        font-size: 1.4rem; /* Réduit la taille du titre qui doit être énorme aussi */
        margin-bottom: 1rem;
    }

    .search-results-container p {
        font-size: 1rem;
    }

    .text-content {
        font-size: 14px;
        line-height: 1.5rem;
    }

    .text-content p {
        font-size: 14px;
        line-height: 1.5rem;
        text-align: left; /* mieux en mobile que justify */
    }

    .text-content h3 {
        font-size: 18px;
        line-height: 1.3;
        margin-top: 20px;
        margin-bottom: 10px;
    }

    .projets-vignette,
    .responsables-vignette,
    .membre-hal-vignette {
        padding: 15px !important;
        border-bottom-right-radius: 18px;
    }

    .projets-vignette h2 {
        font-size: 16px !important;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    .projets-vignette li {
        font-size: 13px !important;
        line-height: 1.35;
        margin-bottom: 6px;
    }

    .projets-vignette .projet-link {
        font-size: 13px !important;
    }

    .responsable-title,
    h3.responsable-title {
        font-size: 16px !important;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    .responsable-name,
    .responsable-name a {
        font-size: 13px !important;
        line-height: 1.35;
    }

    .membre-hal-title {
        font-size: 14px !important;
        line-height: 1.3;
    }

    .membre-hal-title a {
        padding: 4px 0;
    }
}