.ressource-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ressource-badge {
    font-family: var(--e-global-typography-accent-font-family), Sans-serif;
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow:
        0 1px 3px rgba(97, 127, 153, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    color: var(--e-global-color-primary);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

/* Badge alerte : ressource obsolète — palette Elementor du site
   (primary #617F99, fonds #E8ECEF / #f3f5f7 comme les autres badges). */
.ressource-obsolete-notice {
    display: block;
    margin: 0 0 1rem;
}

.ressource-obsolete-notice__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    background: color-mix(in srgb, var(--e-global-color-primary) 14%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--e-global-color-primary) 30%, transparent);
    color: var(--e-global-color-primary);
    font-family: var(--e-global-typography-accent-font-family), Sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: 0 1px 3px color-mix(in srgb, var(--e-global-color-primary) 14%, transparent);
}

@supports not (background: color-mix(in srgb, red 50%, white)) {
    .ressource-obsolete-notice__badge {
        background: #e8ecef;
        border-color: rgba(97, 127, 153, 0.35);
        box-shadow: 0 1px 3px rgba(97, 127, 153, 0.12);
    }
}

.ressource-obsolete-notice__icon {
    flex-shrink: 0;
    color: var(--e-global-color-primary);
}

.ressource-obsolete-notice__label {
    white-space: normal;
}

span.ressource-type,
span.ressource-time-to-read {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50px;
    background: rgba(97, 127, 153, 0.50);
    backdrop-filter: blur(5px);
    padding: 5px 20px;
    color: white;
}

.ressource-card-title h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mallette {
    background: #d6e0e9!important;
}

/* .mallette .ressource-card-title h3,
.mallette .ressource-card-description,
.mallette .ressource-card-date span {
    color: white!important;
} */


.e-loop-item.type-de-ressource-mallette {
    position: relative;
   }
   
   .e-loop-item.type-ressource {
    transition: transform 0.3s ease;
   }


   .e-loop-item.type-ressource:hover {
     transform: scale(1.010);
   }
   
   
   .e-loop-item.type-de-ressource-mallette::before {
       content: '';
       position: absolute;
       left: 0;
       top: -12px;
       width: 150px;
       height: 50px;
       background: #617f99 !important;
        opacity: 0.5;
       z-index: -1;
       border-top-left-radius: 34px;
        border-top-right-radius: 34px;
       border-bottom-left-radius: 0px;
   }


ul.ressource-objectifs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 30px;
}

ul.ressource-activites-pedagogiques {
        display: flex;
    flex-direction: column;
    gap: 0.5rem;
     padding-left: 30px;
}

.ressource-fichiers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ressource-fichiers__header,
.ressource-fichier-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 28px;
    border-radius: 20px;
    background: #fff;
}

.ressource-fichiers__header {
    justify-content: space-between;
}

.ressource-fichiers__title {
    margin: 0;
    font-family: "Ubuntu titling", Sans-serif!important;
    font-size: 32px;
    font-weight: 700;
    color: var(--e-global-color-primary);
}

.ressource-fichiers__download-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    border-radius: 999px;
    background: var(--e-global-color-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.ressource-fichiers__download-all:hover {
    opacity: 0.9;
    color: #fff;
}

.ressource-fichiers__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ressource-fichier-item {
    justify-content: space-between;
}

.ressource-fichier-item__icon {
    flex: 0 0 72px;
}

.ressource-fichier-item__icon img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.ressource-fichier-item__content {
    flex: 1 1 auto;
    min-width: 0;
}

.ressource-fichier-item__name {
    margin: 0 0 8px;
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--e-global-color-primary);
}

.ressource-fichier-item__size {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(97, 127, 153, 0.12);
    color: var(--e-global-color-primary);
    font-size: 13px;
    font-weight: 500;
}

.ressource-fichier-item__button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 18px;
    border-radius: 999px;
    background: var(--e-global-color-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.ressource-fichier-item__button:hover {
    opacity: 0.9;
    color: #fff;
}

@media (max-width: 767px) {
    .ressource-fichiers__header,
    .ressource-fichier-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .ressource-fichiers__header {
        gap: 16px;
    }

    .ressource-fichier-item__button,
    .ressource-fichiers__download-all {
        width: 100%;
        justify-content: center;
    }
}

.ressource-auteurs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ressource-auteurs__header {
    padding: 24px 28px;
    border-radius: 20px;
    background: #fff;
}

.ressource-auteurs__table-wrap {
    padding: 24px 28px;
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
}

.ressource-auteurs__title {
    margin: 0;
    font-family: "Ubuntu titling", Sans-serif!important;
    font-size: 32px;
    font-weight: 700;
    color: var(--e-global-color-primary);
}

.ressource-auteurs__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    table-layout: fixed;
    position: relative;
}

.ressource-auteurs__table::before,
.ressource-auteurs__table::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: rgba(97, 127, 153, 0.2);
    pointer-events: none;
    z-index: 1;
}

.ressource-auteurs__table::before {
    left: 33.333%;
}

.ressource-auteurs__table::after {
    left: 66.666%;
}

.ressource-auteurs__table thead,
.ressource-auteurs__table tbody,
.ressource-auteurs__table tr,
.ressource-auteurs__table th,
.ressource-auteurs__table td {
    border: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
}

.ressource-auteurs__table thead th {
    padding: 0 8px 8px;
    font-weight: 600;
    text-align: center;
    background: transparent;
}

.ressource-auteurs__table thead th span {
    display: block;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(97, 127, 153, 0.12);
    color: var(--e-global-color-primary);
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
    font-size: 14px;
    font-weight: 600;
}

.ressource-auteurs__table tbody td {
    padding: 14px 16px;
    text-align: center;
    color: var(--e-global-color-primary);
    font-family: var(--e-global-typography-primary-font-family), Sans-serif;
    font-size: 15px;
    font-weight: 500;
    background: #fff;
    transition: background-color 0.2s ease;
}

.ressource-auteurs__table tbody tr td:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.ressource-auteurs__table tbody tr td:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

.ressource-auteurs__table tbody tr:nth-child(even) td,
.ressource-auteurs__table tbody tr:nth-child(odd) td {
    background: #fff;
}

.ressource-auteurs__table tbody tr:hover td {
    background: rgba(97, 127, 153, 0.08);
}

@media (max-width: 767px) {
    .ressource-auteurs__header,
    .ressource-auteurs__table-wrap {
        padding: 20px 16px;
    }

    .ressource-auteurs__table thead th span,
    .ressource-auteurs__table tbody td {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 13px;
    }
}

.ressource-accordions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ressource-accordion {
    padding: 24px 28px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow:
        0 2px 8px rgba(97, 127, 153, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ressource-accordion__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    list-style: none;
    cursor: pointer;
}

.ressource-accordion__summary::-webkit-details-marker {
    display: none;
}

.ressource-accordion__title {
    font-family: "Ubuntu titling", Sans-serif!important;
    font-size: 20px;
    font-weight: 700;
    color: var(--e-global-color-primary);
}

.ressource-accordion__toggle {
    position: relative;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--e-global-color-primary);
    border-radius: 50%;
}

.ressource-accordion__toggle::before,
.ressource-accordion__toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--e-global-color-primary);
    transform: translate(-50%, -50%);
}

.ressource-accordion__toggle::before {
    width: 12px;
    height: 1.5px;
}

.ressource-accordion__toggle::after {
    width: 1.5px;
    height: 12px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ressource-accordion[open] .ressource-accordion__toggle::after {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0);
}

.ressource-accordion__content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.ressource-accordion__tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow:
        0 1px 3px rgba(97, 127, 153, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    color: var(--e-global-color-primary);
    font-family: var(--e-global-typography-accent-font-family), Sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .ressource-badge,
    .ressource-accordion,
    .ressource-accordion__tag {
        background: rgba(255, 255, 255, 0.72);
    }
}

@media (max-width: 767px) {
    .ressource-accordion {
        padding: 20px 16px;
    }

    .ressource-accordion__title {
        font-size: 18px;
    }
}

body.cmq-section-objectifs-empty .section-objectifs {
    display: none;
}

body.cmq-section-activites-empty .section-activites {
    display: none;
}

body.cmq-section-competence-sequence-empty .section-competence-sequence {
    display: none;
}

body.cmq-section-ressources-empty .section-ressources {
    display: none;
}

body.cmq-section-auteurs-empty .section-auteurs {
    display: none;
}

body.cmq-section-contenu-libre-empty .section-contenu-libre {
    display: none;
}


/*
Source - https://stackoverflow.com/a/79142029
Posted by Roko C. Buljan, modified by community. See post 'Timeline' for change history
Retrieved 2026-05-27, License - CC BY-SA 4.0
*/

details {
    interpolate-size: allow-keywords;
    
    &::details-content {
      transition:
        block-size 0.3s,
        content-visibility 1s allow-discrete;
      overflow: hidden;
      block-size: 0;     /* Or also:  height:0; */
    }
    
    &[open]::details-content {
      block-size: auto;  /* Or also:  height:auto; */
    }
  }


  .msw-facet__title {
    font-family: var(--e-global-typography-accent-font-family), Sans-serif;
    font-size: 14px;
    text-transform: none!important;
    font-weight: var(--e-global-typography-accent-font-weight);
    line-height: var(--e-global-typography-accent-line-height);
    color: var(--e-global-color-primary);
}


select.msw-facet__select {
    background-color: #f3f5f7 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    border: none !important;
}


.msw-active-badges .msw-active-badge {
    background: var(--e-global-color-primary)!important;
    border: none!important;
    border-radius: 20px;
}

.msw-active-badges .msw-active-badge:hover {
    background: var(--e-global-color-primary)!important;
    opacity: 0.8!important;
}

button.msw-active-badges__reset {
    border: 1px solid var(--e-global-color-primary)!important;
      border-radius: 20px;
    line-height: 1.2em!important;
}

button.msw-active-badges__reset:hover {
        background: var(--e-global-color-primary)!important;
}

/* ===================================================================
   Réduction du panneau filtres : pilotage des colonnes via :has()
   -------------------------------------------------------------------
   - .left-col contient la grille de cards
   - .right-col contient le widget MSW Filtres

   IMPORTANT pour la transition dans les deux sens :
   CSS ne peut PAS transitionner depuis `width: auto` (la valeur
   naturelle qu'Elementor met sur les containers flex) vers une valeur
   en %. Résultat : à la fermeture, la width "auto" → "5%" snap d'un
   coup. À l'ouverture, "5%" → "auto" snap aussi mais l'œil ne le
   remarque pas car la valeur cible reste "auto" (la transition CSS
   est ignorée mais l'animation visuelle vient des autres propriétés).

   Solution : on force une width % explicite sur l'état déployé (75/25
   par défaut, ajuste si ton layout est différent), pour que les deux
   bornes de la transition soient des valeurs numériques.
   =================================================================== */

.left-col,
.right-col {
    transition:
        width 0.3s ease 0s,
        max-width 0.3s ease 0s,
        flex-basis 0.3s ease 0s !important;
    will-change: width, flex-basis;
}

/* État déployé (par défaut) : widths explicites pour que la transition
   ait des bornes numériques des deux côtés. Ajuste 75/25 selon ton
   layout réel si besoin (mais évite `auto`). */
.left-col {
    width: 75% !important;
    max-width: 75% !important;
    flex-basis: 75% !important;
}

.right-col {
    width: 25% !important;
    max-width: 25% !important;
    flex-basis: 25% !important;
}

/* État replié — la colonne des filtres disparaît complètement (0%).
   C'est OK parce que le wrap MSW collapsed sort du flow normal via
   position: fixed (cf. msw-filters.css). Le bouton continue donc d'être
   visible et cliquable, mais la colonne ne consomme plus de place et
   la grille de cards à gauche peut prendre 100% de la largeur. */
.right-col:has(.msw-filters-wrap--collapsed) {
    width: 0% !important;
    max-width: 0% !important;
    flex-basis: 0% !important;
    transition-delay: 0.2s !important;
}

/* État replié — la colonne des cards prend toute la largeur (même
   delay coordonné avec la right-col).
   - Cas 1 : la left-col est APRÈS la right-col (combinateur ~).
   - Cas 2 : la left-col est AVANT la right-col (:has(~ ...)). */
.right-col:has(.msw-filters-wrap--collapsed) ~ .left-col,
.left-col:has(~ .right-col .msw-filters-wrap--collapsed) {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: 100% !important;
    transition-delay: 0.2s !important;
}

/* Couleur primary Elementor pour le bouton de collapse (icône + hover) */
.msw-filters-collapse {
    color: var(--e-global-color-primary) !important;
}

.msw-filters-collapse:hover {
    color: var(--e-global-color-primary) !important;
    opacity: 0.7;
}

/* Bouton d'expand (apparaît dans la sort bar quand le panneau est replié)
   — fond primary Elementor + icône blanche pour bien le faire ressortir. */
.msw-loop-header .msw-filters-expand {
    background: var(--e-global-color-primary) !important;
    color: #ffffff !important;
}

.msw-loop-header .msw-filters-expand:hover {
    background: var(--e-global-color-primary) !important;
    color: #ffffff !important;
    opacity: 0.8;
}

body:has(button.msw-filters-collapse[aria-expanded="false"]) #ressource-loop .elementor-grid {
    grid-template-columns: repeat(3, 1fr)!important;
}



/* Bouton "Charger plus" des filtres — même style que le bouton voir plus
   de la home (.msw-load-more-standalone). Cohérence visuelle des CTAs. */
.msw-pagination-wrap .msw-load-more {
    background: var(--e-global-color-primary) !important;
    border: 1px solid var(--e-global-color-primary) !important;
    color: #ffffff !important;
    border-radius: 30px !important;
    padding: 12px 32px !important;
    font-family: var(--e-global-typography-accent-font-family), Sans-serif;
    font-weight: 500 !important;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--e-global-color-primary) 20%, transparent);
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        opacity 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease !important;
}

.msw-pagination-wrap .msw-load-more:hover:not(:disabled) {
    background: transparent !important;
    color: var(--e-global-color-primary) !important;
    border-color: var(--e-global-color-primary) !important;
    transform: scale(1.02);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--e-global-color-primary) 28%, transparent);
}

.msw-pagination-wrap .msw-load-more--loading {
    opacity: 0.75 !important;
}

@media all and (max-width: 767px) {
    .left-col {
        width: 100%!important;
        max-width: 100%!important;
        flex-basis: 100%!important;
    }

    .right-col {
        width: 0%!important;
        max-width: 0%!important;
        flex-basis: 0%!important;
    }
}