:root {
    --max-width: 1340px;
    --min-margin: 3rem;
    --dynamic-width: min(var(--max-width), calc(100% -(2* var(--min-margin))));
    --dynamic-margin: max(calc(50% - 0.5* var(--max-width)), var(--min-margin));
} 

/*
 *
 * INITIALISATION 
 *
 */

html, body{
    width : 100%;
    overflow: hidden;
    overflow-y: auto;
}

header .elementor-widget-image a img[src$=".svg"]{
    width: auto;
}

footer .elementor-widget-image a img[src$=".svg"]{
    width: auto;
}

/* DISPLAY NONE */
.d-none{
    display: none!important;
}

@media screen and (min-width:768px){
    .d-sm-only{
        display: none!important;
    }
}

@media screen and (max-width:767px){
    .d-sm-none{
        display: none!important;
    }
}

@media screen and (min-width:1024px){
    .d-md-only{
        display: none!important;
    }
}

@media screen and (max-width:1023px){
    .d-md-none{
        display: none!important;
    }
}

@media screen and (min-width:1200px){
    .d-lg-only{
        display: none!important;
    }
}

@media screen and (max-width:1199px){
    .d-lg-none{
        display: none!important;
    }
}

/* RECAPTCHA */
.grecaptcha-badge{
	display : none!important;
	opacity : 0;
	z-index : -99999;
}

/*
 *
 * GENERAL 
 *
 */


/* Full height */
.full-height{
    height: 100%!important;
}

/* Offset left wrapper */
@media screen and (min-width:768px){
    .offset-left-wrapper{
        position: relative;
        padding-left: var(--dynamic-margin);
    }
}

/* Offset left wrapper */
@media screen and (min-width:768px){
    .offset-right-wrapper{
        position: relative;
        padding-right: var(--dynamic-margin);
    }
}

/* Background image & squared background image */
.background-img, .squared-img{
    position: relative;
}

.background-img:before, .squared-img:before{
    z-index: 2;
}

.squared-img{
    aspect-ratio: 1 / 1;
}

.squared-img > div, .background-img > div{
    position: static;
}

.squared-img img, .background-img img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    font-family: 'object-fit: cover;';
    object-position: center;
    min-height: 100%;
}

.squared-img .elementor-widget-image, .background-img .elementor-widget-image{
    height: 100%;
}

.squared-img.top img, .background-img.top img{
    object-position: center top;
}

.squared-img.bottom img, .background-img.bottom img{
    object-position: center bottom;
}

@media screen and (max-width:767px){
    .background-img.full-height, .squared-img.full-height{
        height: auto!important;
    }
}

/* Not clickable */
.not-clickable{
    pointer-events: none;
}

/*
 *
 * HEADER 
 *
 */

#nav-toggler{
    position: relative;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
}

#nav-toggler:before{
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 211.2 177.6"><path d="M12,133.5C-11.9,92.2,1.1,39.9,40.8,17c5.7-3.2,11.7-5.8,18-7.6C83.2,1,134.2-9.3,203.7,15.9l7.6,2.7-1.6,7.9c-14.8,74.4-48.4,112.7-67.2,129-4.6,4.4-9.7,8.2-15.1,11.4-39.8,23-91.5,8-115.4-33.3" fill="%23cf1b24"/></svg>');
    position: absolute;
    width: 11rem;
    left: -2.5rem;
    bottom: -2rem;
}

#nav-toggler.active:before{
    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 211.2 177.6"><path d="M12,133.5C-11.9,92.2,1.1,39.9,40.8,17c5.7-3.2,11.7-5.8,18-7.6C83.2,1,134.2-9.3,203.7,15.9l7.6,2.7-1.6,7.9c-14.8,74.4-48.4,112.7-67.2,129-4.6,4.4-9.7,8.2-15.1,11.4-39.8,23-91.5,8-115.4-33.3" fill="%23ffffff"/></svg>');
}

#nav-toggler .nav-icon {
    width: 30px;
    height: 16px;
    margin: 10px 10px;
    position: relative;
    cursor: pointer;
    display: inline-block;
}

#nav-toggler .nav-icon span {
    background-color: #fff;
    position: absolute;
    transition: .3s cubic-bezier(.8, .5, .2, 1.4);
    width: 100%;
    height: 4px;
    transition-duration: 500ms;
}

#nav-toggler.active .nav-icon span{
    background-color: var(--rouge);
}

#nav-toggler .nav-icon span:nth-child(1) {
    top: 0px;
    left: 0px;
}

#nav-toggler .nav-icon span:nth-child(2) {
    bottom: 0px;
    left: 0px;
}

#nav-toggler .nav-icon.open span:nth-child(1) {
    transform: rotate(45deg);
    top: 13px;
}

#nav-toggler .nav-icon.open span:nth-child(2) {
    transform: rotate(-45deg);
    top: 13px;
}

#nav-toggler #nav-status span{
    color: #fff;
    z-index: 1; 
    text-transform: uppercase;
    font-size: .9rem;
    font-weight: 700;
}

#nav-toggler.active #nav-status span{
    color: var(--rouge);
}

#nav-toggler .nav-icon + #nav-status .close{
    display: none;
}

#nav-toggler .nav-icon.open + #nav-status .close{
    display: inline-block;
}

#nav-toggler .nav-icon.open + #nav-status .open{
    display: none;
}

#nav-toggler  #nav-status{
    display: flex;
    justify-content: center;
}

#menu-content{
    display: none;
}

#menu-content.active{
    display: flex;
}


/*
 *
 * PAGES 
 *
 */

/* HERO */
#main-hero .mask-img{
    mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 668.7 713.3"><path d="M9.4,316.8C3.3,341.2.1,366.3,0,391.5c0,177.5,150,321.9,334.4,321.9h0c184.4,0,334.4-144.4,334.4-321.9,0-24.4-3-48.8-8.8-72.5-13.2-68.6-50.2-185.7-154.1-318.9H160C59.8,128.8,22.9,246.6,9.4,316.8Z"/></svg>');
    mask-size: cover;
    mask-repeat: no-repeat;
    mask-position: center bottom;
    bottom: -5rem;
    top: auto;
}

/* WRAPPER ICON */
.wrapper-icon:not(:last-child):after{
    content : "+";
    position: absolute;
    right: -1.5rem;
    top: 1rem;
    color : var(--bleu-cyan);
    font-family: "futura-100";
    font-weight: 600;
}

@media (max-width: 1366px) and (min-width: 1200px) {
    #main-hero .mask-img{
        bottom: -4rem;
    }
}

@media  (max-width: 1199px) and (min-width: 1024px) {
    #main-hero .mask-img{
        bottom: -3rem;
    }
}

@media  (max-width: 1023px) and (min-width: 576px) {
    #main-hero .mask-img{
        bottom: -2rem;
    }
}

@media  (max-width: 575px) {
    #main-hero .mask-img{
        top: 0;
        bottom: auto;
    }
}


/*
 *
 * MARQUEE
 *
 */

.marquee-wrapper{
    --marquee-duration: 20s;
    --marquee-gap: 4rem;
    position: relative;
    overflow: hidden;
    width: 100%;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.marquee-wrapper .marquee-track{
    display: flex;
    flex-wrap: nowrap;
    flex-shrink: 0;
    align-items: center;
    width: max-content;
    animation: marquee-scroll var(--marquee-duration) linear infinite;
    will-change: transform;
}

.marquee-wrapper .marquee-item{
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding-right: var(--marquee-gap);
    white-space: nowrap;
}

/* Original Elementor text is kept for SEO/accessibility but visually hidden once the marquee is built */
.marquee-wrapper[data-marquee-ready] [data-marquee-source]{
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reverse direction: add class "marquee-reverse" on the section */
.marquee-wrapper.marquee-reverse .marquee-track{
    animation-direction: reverse;
}

/* Pause on hover: add class "marquee-pause-hover" on the section */
.marquee-wrapper.marquee-pause-hover:hover .marquee-track{
    animation-play-state: paused;
}

@keyframes marquee-scroll{
    from{
        transform: translateX(0);
    }
    to{
        transform: translateX(calc(-1 * var(--marquee-distance, 50%)));
    }
}

@media (prefers-reduced-motion: reduce){
    .marquee-wrapper .marquee-track{
        animation: none;
    }
}


/*
 *
 * SINGLE ACTIONS
 *
 */

#single-term-header .elementor-post-info__terms-list-item{
    padding: .5rem 1rem;
    border-radius: 5rem;
    border: 1px solid var(--blanc);
    font-size: .9rem;
}


/*
 *
 * SINGLE EVENEMENTS
 *
 */

#book-an-event .wpa-events__tickets-scroll{
    min-height: auto!important;
}

#book-an-event .wpa-events__book-button{
    padding: 0;
    box-shadow: 0 0 0 transparent;
}

#book-an-event .wpa-events__footer-mount{
    padding-top: 1rem;
}


/*
 *
 * WIDGET ETAPE DU PROJET
 *
 */

.teds-etapes{
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.teds-etapes__item{
    position: relative;
    margin: 0;
    padding-left: 1.75rem;
    font-size: 1rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #000;
}

.teds-etapes__item.is-past{
    color: #bbb;
}

.teds-etapes__item.is-current::before{
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    background-color: var(--rouge, #c0342b);
    -webkit-mask: url("../images/check-icon.svg") no-repeat center / contain;
    mask: url("../images/check-icon.svg") no-repeat center / contain;
}


/*
 *
 * SEARCH & FILTER PRO — FILTRES EN PILLS
 *
 */

/* Titres des filtres */
.search-filter-base.search-filter-field .search-filter-label{
    display: block;
    margin: 0 0 1.5rem;
    padding: 0;
    font-family: "futura-100", sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--noir);
}

/* Groupe de pills */
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-group{
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-start;
    gap: .5rem;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox{
    --pill-color: var(--noir);
    --pill-text-selected: var(--blanc);
    position: relative;
    display: inline-flex !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 100%;
    margin: 0 !important;
    padding: 0;
}

/* Couleurs par thématique */
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox[data-option-value="sobriete-de-leau"]{
    --pill-color: var(--bleu-clair);
}
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox[data-option-value="milieux-aquatiques"]{
    --pill-color: var(--vert-eau);
}
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox[data-option-value="biodiversite"]{
    --pill-color: var(--vert);
    --pill-text-selected: var(--noir);
}
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox[data-option-value="assainissement"]{
    --pill-color: var(--orange);
}

/* Checkbox native masquée (reste accessible au clavier) */
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox__input{
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox__control{
    display: none;
}

/* La pill */
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox__container{
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: .7rem 1.2rem;
    border: 1px solid var(--pill-color);
    border-radius: 5rem;
    background-color: transparent;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox__label{
    padding: 0;
    font-family: "avenir-lt-pro", sans-serif;
    font-size: .9rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: .05rem;
    text-transform: uppercase;
    color: var(--noir);
    transition: color .2s ease;
}

/* Survol */
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox__container:hover{
    background-color: color-mix(in srgb, var(--pill-color) 12%, transparent);
}

/* Sélectionné */
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox__input:checked + .search-filter-input-checkbox__container{
    background-color: var(--pill-color);
}
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox__input:checked + .search-filter-input-checkbox__container .search-filter-input-checkbox__label{
    color: var(--pill-text-selected);
}

/* Focus clavier */
.search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox__input:focus-visible + .search-filter-input-checkbox__container{
    outline: 2px solid var(--noir);
    outline-offset: 3px;
}

/* Bouton Valider */
.search-filter-base.search-filter-field--control-type-submit .search-filter-input-button{
    margin: 0;
    padding: 1.6rem 4rem;
    border: 0;
    border-radius: 5rem;
    background-color: var(--bleu-cyan);
    font-family: "futura-100", sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    line-height: 1;
    text-transform: uppercase;
    color: var(--noir);
    cursor: pointer;
    transition: background-color .2s ease;
}
.search-filter-base.search-filter-field--control-type-submit .search-filter-input-button:hover,
.search-filter-base.search-filter-field--control-type-submit .search-filter-input-button:focus-visible{
    background-color: color-mix(in srgb, var(--bleu-cyan) 80%, var(--noir));
}

/* Bouton Reset → picto reload */
.search-filter-base.search-filter-field--control-type-reset .search-filter-input-button{
    position: relative;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 0;
    color: transparent;
    overflow: hidden;
    cursor: pointer;
}
.search-filter-base.search-filter-field--control-type-reset .search-filter-input-button::before{
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 1.6rem;
    height: 1.6rem;
    background-color: var(--noir);
    -webkit-mask: url("../images/reload-icon.svg") no-repeat center / contain;
    mask: url("../images/reload-icon.svg") no-repeat center / contain;
    transition: transform .4s ease;
}
.search-filter-base.search-filter-field--control-type-reset .search-filter-input-button:hover::before{
    transform: rotate(180deg);
}
.search-filter-base.search-filter-field--control-type-reset .search-filter-input-button:focus-visible{
    outline: 2px solid var(--noir);
    outline-offset: 2px;
}

@media (max-width: 767px){
    .search-filter-base.search-filter-field .search-filter-label{
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    .search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-group{
        gap: .6rem;
    }
    .search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox__container{
        padding: .7rem 1.2rem;
    }
    .search-filter-base.search-filter-field--input-type-checkbox .search-filter-input-checkbox__label{
        font-size: .85rem;
    }
    .search-filter-base.search-filter-field--control-type-submit .search-filter-input-button{
        padding: 1.2rem 3rem;
        font-size: 1.2rem;
    }
}


/*
 *
 * BOUCLE ÉVÉNEMENTS — [teds_evenement_date]
 *
 */

.teds-event-date{
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    text-align: center;
    font-family: "futura-100", Sans-serif!important;
}

.teds-event-date__day{
    font-size: 4rem;
}

.teds-event-date__month {
    margin-top: 0.25rem;
    font-size: 1.75rem;
    text-transform: uppercase;
}

@media screen and (max-width: 767px) {
    .teds-event-date__day {
        font-size: 2.75rem;
    }

    .teds-event-date__month{
        font-size: 1.25rem;
    }
}

/*
 *
 * PARTENAIRES (CPT "partenaires") — templates Elementor "Single partenaire" / "Archive partenaires"
 *
 */

/* Contenu WYSIWYG issu des champs ACF */
.partner-field p{
    margin: 0 0 1em;
}
.partner-field p:last-child,
.partner-field ul:last-child{
    margin-bottom: 0;
}
.partner-field ul{
    white-space: normal; /* le champ est en pre-line pour conserver les retours à la ligne des paragraphes */
    margin: 0 0 1em;
    padding: 0;
    list-style: none;
}
.partner-field li{
    position: relative;
    margin-bottom: 0.6em;
    padding-left: 1.5em;
}
.partner-field li::before{
    content: "";
    position: absolute;
    top: 0.6em;
    left: 0;
    width: 0.6em;
    height: 0.6em;
    border-radius: 50%;
    background-color: var(--vert-eau);
}

/* Chiffres clés : un chiffre par ligne, séparés par un filet rouge (comme les objectifs des actions) */
.partner-figures li{
    margin: 0;
    padding: 1.25em 0;
    border-top: 2px solid var(--rouge);
}
.partner-figures li::before{
    display: none;
}
.partner-figures strong{
    display: block;
    font-family: "futura-100", sans-serif;
    font-weight: 900;
    font-size: 2.5rem;
    line-height: 1.1;
}

/* Blocs facultatifs : masqués quand le champ ACF est vide */
.partner-block:not(:has(.partner-socials)):not(:has(.partner-field:not(:empty))),
.partner-block-optional:not(:has(.partner-field:not(:empty))),
.partner-impacts:not(:has(.partner-block-optional .partner-field:not(:empty))){
    display: none;
}

/* Réseaux sociaux : liens sans URL masqués, section masquée si aucun lien */
/* (Elementor rend un bouton sans URL en <button> au lieu de <a>) */
button.partner-social,
.partner-social:not([href]),
.partner-social[href=""],
.partner-socials-section:not(:has(a.partner-social[href]:not([href=""]))){
    display: none;
}

/* Widget Image V4 sans source (ex. événement sans image mise en avant) : on masque le cadre vide
   pour laisser apparaître le fond de repli du conteneur */
img.e-image-base:not([src]),
img.e-image-base[src=""]{
    display: none;
}

/* Liens dans les textes longs (fiches partenaires, mentions légales) */
.partner-field a{
    color: var(--vert-eau);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}
.partner-field a:hover,
.partner-field a:focus-visible{
    color: var(--noir);
}
