/* =====================================================
   SLIDER ÉVÉNEMENTS (custom, prefixé evs-)
   ===================================================== */
.evs-wrapper {
    position: relative;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 60px;
    box-sizing: border-box;
    overflow: visible;
}

.evs-wrapper * { box-sizing: border-box; }

.evs-slider {
    position: relative;
    overflow-x: hidden;
    overflow-y: visible;
    width: 100%;
    padding-bottom: 5vh;
}

.evs-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.evs-slide {
    flex: 0 0 calc(100% - 120px);
    max-width: calc(100% - 120px);
    margin-right: 24px;
    box-sizing: border-box;
}

.evs-card {
    display: flex;
    flex-direction: row;
    background: #fff;
    border-radius: 100px 0 0 0;
    border: 1px solid #4d74b5;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    min-height: 320px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.evs-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.evs-image {
    flex: 0 0 40%;
    min-height: 50vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    border-right: 1px solid #4d74b5;
}

.evs-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(77, 116, 181, 0.1) 0%, transparent 50%);
}

.evs-content {
    flex: 1;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.event-content-header {
    display: flex;
    align-items: center;
    gap: 3vw;
    width: 100%;
    background-color: #ececec;
}

.evs-date {
    display: flex;
    align-items: center;
    gap: 1vw;
    background: #4d74b5;
    color: white;
    padding: 10px 16px;
    border-radius: 10px 0 0 0;
    width: fit-content;
    line-height: 1.2;
}

.evs-day {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Nexa Light', sans-serif;
}

.evs-month {
    font-size: 19px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.evs-title {
    font-size: 22px;
    font-weight: 700;
    color: #1d2327;
    text-align: left;
    margin: 0;
    padding: 0 !important;
    line-height: 1.3;
    font-family: 'Nexa Light', sans-serif;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.evs-excerpt {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
}

.evs-infos {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #666;
}

.evs-venue,
.evs-time {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #4d74b5;
    padding: 1% 2%;
    color: white;
    border-radius: 10px 0 0 0;
    width: fit-content;
}

.evs-venue::before,
.evs-time::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    flex-shrink: 0;
}

.evs-venue::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.evs-time::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E") no-repeat center;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.btn-event-container {
    display: flex;
    width: 100%;
    justify-content: flex-end;
}

.evs-button {
    display: inline-block;
    background: #00a09a;
    color: white !important;
    padding: 12px 24px;
    border-radius: 10px 0 0 0;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 14px;
    font-family: 'Nexa Light', sans-serif;
    transition: background 0.3s ease, transform 0.2s ease;
    width: fit-content;
    text-align: center;
    float: inline-end;
}

.evs-button:hover {
    background: #008f8a;
    transform: scale(1.02);
}

/* Navigation */
.evs-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: #4d74b5;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto !important;
}

.evs-nav:hover:not(:disabled) {
    background: #3d5a8a;
    transform: translateY(-50%) scale(1.1);
}

.evs-nav:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: auto !important;
}

.evs-nav-prev { left: 5px; }
.evs-nav-next { right: 5px; }

.evs-nav svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Dots */
.evs-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.evs-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.evs-dot:hover { background: #999; }

.evs-dot.active {
    background: #4d74b5;
    width: 28px;
    border-radius: 5px;
}

/* No events */
.evs-no-events {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.evs-no-events-icon { font-size: 48px; margin-bottom: 15px; opacity: 0.8; }
.evs-no-events-title { font-size: 22px; color: #1d2327; margin: 0 0 10px 0; font-family: 'Nexa Light', sans-serif; font-weight: 600; }
.evs-no-events-text { color: #666; font-size: 15px; margin: 0; line-height: 1.5; }

/* =====================================================
   SLIDER ÉVÉNEMENTS (ancien Swiper — compatibilité)
   ===================================================== */

.swiper-container {
    width: 100%;
    padding: 40px 0;
    overflow-x: hidden;
}

.swiper-slide {
    transition: transform 0.3s ease;
}

.event-slide {
    display: flex;
    background: #fff;
    border-radius: 90px 0 0 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    max-width: 100%;
    margin: auto;
    border: 1px solid #4D74B5;
}

.home .event-image {
    width: 30%;
    min-height: 50vh;
    background-size: cover;
    background-position: center;
}

.event-meta-date {
    position: absolute;
    top: 10px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: #fff;
    font-family: 'Nexa Light';
    z-index: 2;
}

.event-meta-date .day {
    font-size: 2rem;
    background-color: #295B9C;
    padding: 5px 15px;
    position: relative;
    z-index: 1;
}

.event-meta-date .month {
    text-transform: capitalize;
    background-color: #8EA5D4;
    text-align: left;
    padding: 7px 3vw 7px 10px;
    margin-top: -7px;
    font-size: 1.8rem;
}

.home .event-content {
    position: relative;
    width: 70%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.event-title {
    font-size: 1.6rem;
    color: #295B9C;
    margin-bottom: 10px;
    font-weight: bold;
}

.event-excerpt {
    font-size: 1.1rem !important;
    color: #333;
    text-align: left;
    margin-bottom: 15px;
    line-height: 1.5 !important;
}

.event-infos {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.home .event-button {
    align-self: flex-start;
    background: #DDAF6D;
    color: white !important;
    padding: 10px 2vw 10px 3vw;
    border-radius: 40px 0 0px 0;
    text-decoration: none;
    font-weight: bold;
    position: absolute;
    bottom: 0;
    font-size: 1.2rem !important;
    right: 0;
}

.event-venue,
.event-time {
    background-color: #8EA5D4;
    color: white;
    padding: 5px 10px;
    border-radius: 15px 0 0 0;
}

.liste-events-container h3.event-title {
    font-size: 19px !important;
}

/* Swiper arrows */
.swiper-button-next,
.swiper-button-prev {
    color: #295B9C;
}

.swiper-button-next {
    height: 60vh;
    transform: translateY(-46%);
    padding: 0px 30px;
    min-width: 5vw;
    box-sizing: border-box;
    backdrop-filter: blur(5px) brightness(1);
    right: 0;
    border-left: 1px solid #ececec;
    transition: backdrop-filter 0.2s linear;
}

.swiper-button-next:hover {
    backdrop-filter: blur(10px) brightness(0.9);
}

.swiper-backface-hidden .swiper-slide {
    width: 80vw !important;
}

/* No events (ancien) */
.no-events-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    min-height: 400px;
}

.no-events-visual {
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.no-events-title {
    font-family: 'Quicksand Medium', sans-serif;
    font-weight: 600;
    font-size: 28px;
    color: #4D74B5;
    margin: 0 0 15px 0;
}

.no-events-text {
    font-family: 'Quicksand Medium', sans-serif;
    font-weight: 300;
    font-size: 18px;
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
    max-width: 500px;
}

/* =====================================================
   PROJET CARDS (homepage & grille)
   ===================================================== */
.projets-container {
    display: flex;
    justify-content: center;
    gap: 4vw;
    max-width: 97%;
    margin: 5px auto;
}

.projet-card {
    width: 95vw;
    max-width: 450px;
    position: relative;
    transition: transform 0.3s;
}

.page-id-85 .projet-card {
    max-width: 350px;
}

.page-id-82 .projet-card {
    max-width: 100%;
}

.projet-card:hover {
    transform: translateY(-5px);
}

.projet-image {
    height: 500px;
    background-size: cover;
    background-position: center;
    border-radius: 60px 0 0 0;
    background-color: white;
    border: 1px solid #ececec;
}

.projet-content {
    background-color: #295b9cde;
    color: #fff;
    position: absolute;
    display: flex;
    bottom: -9%;
    right: -10%;
    left: 10%;
    border-left: 2px solid #D0AD75;
    flex-direction: column;
    align-items: flex-end;
}

.projet-title {
    color: #295B9C !important;
    width: 100%;
    font-family: 'Nexa Light';
    font-size: 1.2rem;
    margin: 0 0 10px;
    font-weight: bold;
}

.home .projet-title,
.grille-projets .projet-title {
    color: white !important;
    padding-top: 10px;
}

.grille-projets .projet-title {
    padding: 4%;
}

.projet-excerpt {
    font-size: 0.9rem !important;
    line-height: 1.4;
    color: #fff !important;
    margin-bottom: 20px;
    padding: 2% 4%;
    text-align: justify;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.projet-button {
    display: inline-block;
    background-color: #DDAF6D;
    color: #fff !important;
    font-weight: bold;
    padding: 10px 15px 10px 2vw;
    border-radius: 20px 0 0 0;
    text-decoration: none;
    font-size: 0.85rem;
}

.projets-container.grille-projets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 10vh 3vw;
    align-items: stretch;
}

/* =====================================================
   COMPTEURS
   ===================================================== */
.mcs-counter {
    font-family: "Nexa Light";
}

.mcs-counters {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-end;
    text-align: center;
    flex-wrap: wrap;
}

.mcs-counter img {
    width: auto;
    height: auto;
    margin-bottom: 10px;
}

.mcs-counter-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: #0b6faf;
    margin-bottom: 4px;
}

.mcs-counter-label {
    font-size: 1.3rem;
    font-weight: 600;
    color: #0b6faf;
}

/* =====================================================
   TERRITOIRE / COMMUNES TOGGLE
   ===================================================== */
.cpts-territoire-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    margin: 40px 0;
    align-items: flex-start;
}

.cpts-phrase {
    flex: 1 1 300px;
    font-size: 1rem;
    color: #295B9C;
    line-height: 1.6;
}

.cpts-bascule {
    flex: 1 1 400px;
}

.cpts-toggle-button {
    background-color: #295B9C;
    color: #fff;
    padding: 12px 18px;
    font-size: 1.1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.cpts-toggle-button .arrow {
    float: right;
}

.cpts-communes-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background-color: #f4f8fa;
    margin-top: 10px;
    border-radius: 8px;
    padding: 0 15px;
}

.cpts-communes-content.open {
    max-height: 1000px;
    padding: 15px;
}

.cpts-communes-list {
    column-count: 3;
    column-gap: 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.cpts-communes-list li {
    margin-bottom: 6px;
    font-size: 0.95rem;
    color: #333;
}

/* =====================================================
   POPUP ÉVÉNEMENT (coin bas-droit)
   ===================================================== */
.popup-event-cpts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 35vw;
    max-width: 700px;
    background: #fff;
    border-radius: 70px 0 0px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    overflow: hidden;
    font-family: inherit;
    transform: translateX(100%);
    opacity: 0;
    animation: slideInRight 0.8s ease forwards 1.2s;
}

.popup-event-cpts.closed {
    animation: slideOutRight 0.6s ease forwards;
}

@keyframes slideInRight {
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    to { transform: translateX(120%); opacity: 0; }
}

.popup-header {
    background: #f1f1f1;
    padding: 10px 15px 10px 35px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.popup-title {
    font-family: 'Nexa Light';
    font-weight: bold;
    color: #295B9C;
    font-size: 1.3rem;
}

.popup-close {
    background: none;
    border: none;
    position: absolute;
    right: 10px;
    font-size: 2.2rem;
    cursor: pointer;
    color: #888;
}

.popup-body {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    align-items: flex-start;
}

.popup-date {
    background: #295B9C;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    text-align: center;
    font-size: 0.8rem;
    position: absolute;
}

.popup-day {
    font-size: 1.4rem;
    font-weight: bold;
}

.popup-month {
    text-transform: capitalize;
}

.popup-info {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex: 1;
}

.popup-thumb {
    width: 120px;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
}

.popup-text h4 {
    font-family: 'Quicksand Medium';
    margin: 0 0 5px;
    font-size: 1rem;
    color: #295B9C;
}

.popup-text p {
    margin: 0 0 10px;
    font-size: 0.8rem;
    color: #444;
}

div.popup-text a.popup-button,
div.popup-text a.popup-button:hover {
    color: white !important;
}

.popup-button {
    display: inline-block;
    background: #295B9C;
    color: white;
    padding: 6px 10px;
    font-size: 0.8rem;
    border-radius: 10px 0 10px 0;
    text-decoration: none;
    font-weight: bold;
}

/* =====================================================
   RESPONSIVE SLIDER
   ===================================================== */
@media (max-width: 991px) {
    .evs-wrapper { padding: 20px 50px; }
    .evs-slide { flex: 0 0 100%; max-width: 100%; margin-right: 20px; }
    .evs-card { min-height: 280px; }
    .evs-image { flex: 0 0 38%; min-height: 250px; }
    .evs-content { padding: 20px 25px; }
    .evs-title { font-size: 20px; }
    .evs-excerpt { font-size: 14px; -webkit-line-clamp: 2; }
    .evs-day { font-size: 24px; }
    .evs-month { font-size: 12px; }
}

@media (max-width: 768px) {
    .cpts-communes-list { column-count: 2; }
}

@media (max-width: 500px) {
    .cpts-territoire-container { flex-direction: column; }
    .cpts-communes-list { column-count: 1; }
}

/* =====================================================
   RESPONSIVE HOME (1024px)
   ===================================================== */
@media screen and (max-width: 1024px) {
    .popup-event-cpts .popup-info p { display: none; }
    .popup-event-cpts {
        width: 80vw;
        border-radius: 40px 0 0px 0;
    }
    .popup-thumb {
        width: 82px;
        height: 90px;
    }
    .popup-title { display: none; }
    .popup-close { position: initial; }

    .home div.et_block_row.et_pb_column.column-intro-home {
        margin-bottom: 0 !important;
    }

    .projets-container {
        gap: 16vw;
        flex-wrap: wrap;
    }
    .projet-content {
        right: 0%;
        left: 0%;
    }

    .popup-info { align-items: center; }
    .popup-date { position: relative; top: 20px; }

    .home .event-image { min-height: initial; }

    .swiper-button-next {
        height: 30vh;
        padding: 0px 10px;
        transform: translateY(-44%);
    }

    .event-meta-date {
        position: initial;
        margin-bottom: 2vh;
    }

    .popup-header {
        background: #ffffff;
        padding: 6px 15px 0px 35px;
        position: absolute;
        z-index: 1;
        justify-content: flex-end;
        right: 0;
    }

    .event-image { height: 350px !important; }
    .swiper-backface-hidden .swiper-slide { width: 88vw !important; }
}

/* =====================================================
   RESPONSIVE HOME (767px)
   ===================================================== */
@media screen and (max-width: 767px) {
    .evs-wrapper { padding: 15px 15px 70px; }
    .evs-slide { flex: 0 0 100%; max-width: 100%; margin-right: 16px; }
    .evs-card { flex-direction: column; min-height: auto; }
    .evs-image { flex: none; width: 100%; height: 200px; min-height: 40vh; }
    .evs-content { padding: 20px; gap: 10px; }
    .evs-title { font-size: 18px; }
    .evs-excerpt { -webkit-line-clamp: 3; }
    .evs-infos { flex-direction: column; gap: 8px; }
    .evs-button { width: 100%; text-align: center; }
    .evs-nav { top: auto; bottom: 15px; transform: none; width: 44px; height: 44px; }
    .evs-nav:hover:not(:disabled) { transform: scale(1.1); }
    .evs-nav-prev { left: calc(50% - 55px); }
    .evs-nav-next { right: calc(50% - 55px); }
    .evs-dots { margin-top: 15px; }

    .no-events-container { padding: 40px 20px; min-height: 300px; }
    .no-events-title { font-size: 24px; }
    .no-events-text { font-size: 16px; }

    .projets-container.grille-projets { gap: 18vw; }
    .mcs-counters { flex-direction: column; align-items: center; gap: 50px; }
    .page-id-85 .projet-card { max-width: 100%; }
}

/* =====================================================
   RESPONSIVE HOME (480px)
   ===================================================== */
@media (max-width: 480px) {
    .evs-image { height: 180px; }
    .evs-content { padding: 15px; }
    .evs-title { font-size: 16px; }
    .evs-excerpt { font-size: 13px; -webkit-line-clamp: 2; }
    .evs-date { padding: 8px 12px; }
    .evs-day { font-size: 22px; }
    .evs-month { font-size: 11px; }
    .evs-button { padding: 10px 20px; font-size: 13px; }

    .popup-event-cpts {
        width: 96%;
        right: 5%;
        bottom: 10px;
    }
}
