/* =============================================
   CALENDRIER D'ACTIVITÉS - Full Responsive
   ============================================= */

#cal-wrap {
    font-family: sans-serif;
    padding: 1rem 0;
}

/* --- Header --- */
.cal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 16px;
}

.cal-title {
    font-size: clamp(28px, 5vw, 64px);
    font-weight: 400;
    text-align: center;
    color: #1B2A4A;
    font-family: "Tiltwarp", sans-serif;
    text-transform: uppercase;
}

/* --- Body (grille + boutons nav) --- */
.cal-body {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 24px);
}

.nav-btn {
    width: clamp(38px, 5vw, 80px);
    height: clamp(36px, 4vw, 50px);
    border-radius: 35px;
    border: 5px solid #1B2A4A;
    cursor: pointer;
    text-align: center;
    color: #1B2A4A;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.nav-btn i {
    font-size: clamp(14px, 1.8vw, 25px);
    color: currentColor;
}

/* --- Grille --- */
.cal-grid {
    flex: 1;
    min-width: 0; /* critique : empêche le débordement flex */
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: clamp(4px, 0.9vw, 20px);
    border: 5px solid #1B2A4A;
    border-radius: clamp(20px, 3vw, 50px);
    padding: clamp(12px, 2.5vw, 45px) clamp(8px, 2vw, 40px);
}

.day-header {
    text-align: center;
    font-size: clamp(9px, 1.1vw, 20px);
    font-weight: 400;
    color: #fff;
    background: #1B2A4A;
    border-radius: clamp(10px, 1.8vw, 30px);
    padding: clamp(5px, 0.8vw, 15px) clamp(2px, 0.3vw, 35px);
    margin-bottom: 4px;
    font-family: "Tiltwarp", sans-serif;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-cell {
    background: #dddfe4;
    border-radius: clamp(10px, 1.8vw, 30px);
    padding: clamp(3px, 0.4vw, 6px) clamp(3px, 0.5vw, 8px);
    border: 3px solid #e8e8e8;
    cursor: pointer;
    transition: border-color 0.15s;
    aspect-ratio: 1 / 1;
}

.day-cell:hover {
    border-color: #1B2A4A;
}

.day-cell.other-month {
    opacity: 0.35;
}

/* .day-cell.today {
    border: 1.5px solid #378ADD;
} */

.day-num {
    font-size: clamp(10px, 1.2vw, 20px);
    font-weight: 500;
    margin-bottom: 4px;
    font-family: "Tiltwarp", sans-serif;
    padding-left: clamp(2px, 0.5vw, 10px);
}

/* --- Event labels --- */
.event-label {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-top: 2px;
}

.events-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
}

.dot {
    width: 30px;
    height: 30px;
    border-radius: 15px;
}

/* --- Event dot wrappers --- */
.event-dot-wrapper {
    position: relative;
    margin-top: clamp(3px, 0.5vw, 8px);
    height: clamp(16px, 2vw, 30px);
}

.event-dot {
    width: clamp(16px, 2vw, 30px);
    height: clamp(16px, 2vw, 30px);
    border-radius: 50%;
    transition: all 0.35s ease;
    cursor: pointer;
}

.event-hover-label {
    position: absolute;
    left: 0;
    top: 0;
    height: clamp(16px, 2vw, 30px);
    width: max-content;
    max-width: 140px;
    display: block;
    line-height: clamp(16px, 2vw, 30px);
    padding: 0 12px;
    border-radius: 15px;
    font-size: clamp(12px, 1.4vw, 20px);
    font-weight: 400;
    color: black;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: scaleX(0.2);
    transform-origin: left;
    transition: all 0.35s ease;
    pointer-events: none;
}

.event-dot-wrapper:hover .event-hover-label {
    opacity: 1;
    transform: scaleX(1);
}

.event-dot-wrapper:hover .event-dot {
    opacity: 0;
    transform: scale(0);
}

/* --- Légende --- */
.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    text-transform: uppercase;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #1B2A4A;
    font-size: clamp(14px, 1.5vw, 21px);
    font-family: "Tiltwarp", sans-serif;
}

.legend-dot {
    width: 30px;
    height: 30px;
    border-radius: 15px;
    flex-shrink: 0;
}

/* --- Tooltip --- */
.cal-tooltip {
    position: fixed;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    pointer-events: none;
    z-index: 999;
    max-width: 200px;
    display: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* --- Barre de contrôles (4 boutons) --- */
.cal-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1fr;
    gap: 10px;
    width: calc(100% - 208px);
    margin-left: 104px;
    margin-bottom: 40px;
    align-items: stretch;
}

.ctrl-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    border-radius: 35px;
    border: 5px solid #1B2A4A;
    background: transparent;
    color: #1B2A4A;
    font-size: 21px;
    font-family: "Tiltwarp", sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
}

.ctrl-btn:hover {
    background: #1B2A4A;
    color: #fff;
}

.cal-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 5px solid #1B2A4A;
    border-radius: 35px;
    padding: 5px 20px;
    flex: 1;
    min-width: 0;
    background: #fff;
}

.cal-search-wrap i {
    color: #1B2A4A;
    font-size: 21px;
    flex-shrink: 0;
}

#cal-search {
    border: none;
    outline: none;
    background: transparent;
    font-size: 18px;
    color: #1B2A4A;
    width: 100%;
    min-width: 0;
    font-weight: 400;
    font-family: "Outfit";
}

#cal-search::placeholder {
    color: #1B2A4A;
    font-size: 18px;
}

.btn-rechercher {
    padding: 15px 60px;
    border-radius: 35px;
    border: none;
    background: #E54528;
    color: #fff;
    font-size: 16px;
    font-family: "Tiltwarp", sans-serif;
    text-transform: uppercase;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s;
    text-align: center;
}

/* --- Dropdown filtres --- */
.cal-dropdown {
    position: relative;
    display: flex;
}

.cal-dropdown .ctrl-btn {
    width: 100%;
    justify-content: center;
}

.cal-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 3px solid #1B2A4A;
    border-radius: 20px;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 200;
    min-width: 230px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
}

.cal-dropdown-menu.open {
    display: flex;
}

.cat-btn,
.view-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-family: "Tiltwarp", sans-serif;
    font-weight: 300;
    color: #1B2A4A;
    text-transform: uppercase;
    transition: background .15s;
    text-align: left;
}

.cat-btn:hover,
.view-btn:hover {
    background: #f0f1f4;
}

.cat-btn.active,
.view-btn.active {
    background: #1B2A4A;
    color: #fff;
}

.cat-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Vue liste --- */
.cal-list {
    padding: 0 10px;
}

.list-day-row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 2px solid #dddfe4;
}

.list-date {
    min-width: 120px;
    font-size: 20px;
    font-family: "Tiltwarp", sans-serif;
    font-weight: 300;
    color: #1B2A4A;
    text-transform: uppercase;
    padding-top: 4px;
}

.list-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.list-event-item {
    padding: 10px 16px;
    border-radius: 12px;
    background: #dddfe4;
    font-size: 16px;
    font-family: "Tiltwarp", sans-serif;
    color: #1B2A4A;
    transition: background .15s;
}

.list-event-item:hover {
    background: #cdd0d8;
}

.list-empty {
    text-align: center;
    color: #8a90a0;
    font-size: 18px;
    font-family: "Tiltwarp", sans-serif;
    padding: 40px 0;
}

/* --- Navigation post (boutons retour / suivant) --- */
#brxe-tegauo .next-post {
    display: flex;
    align-items: center;
    padding: 0px 20px;
    border: 5px solid var(--color-primary);
    border-radius: 35px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

#brxe-tegauo .next-post::before {
    content: "";
    position: absolute;
    inset: 0;
    width: 0%;
    background: var(--color-secondary);
    z-index: -1;
    transition: width 0.3s ease;
}

#brxe-tegauo .next-post:hover::before {
    width: 100%;
}

#brxe-tegauo .next-post:hover {
    border-color: var(--color-secondary);
    color: white;
}

#brxe-tegauo .next-post:hover .title,
#brxe-tegauo .next-post:hover .label {
    color: white;
}

#brxe-tegauo .prev-post {
    display: none !important;
}

#brxe-tegauo {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

#brxe-uyulqn .bricks-swiper-button-next i {
    display: none;
}

#brxe-uyidgg:empty {
    display: none;
}

/* --- Nav mobile (caché par défaut) --- */
.mobile-month-nav {
    display: none;
}

/* =============================================
   MEDIA QUERIES
   ============================================= */

/* Tablette large */
@media (max-width: 991px) {
    .brxe-post-navigation .next-post {
        justify-content: center;
    }

    .cal-controls {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-left: 0;
        gap: 12px;
    }

    .ctrl-btn,
    .btn-rechercher {
        width: 100%;
        justify-content: center;
    }

    .cal-search-wrap {
        width: 100%;
    }

    .cal-header {
        gap: 20px;
    }

    .cal-legend {
        justify-content: center;
        gap: 10px;
    }

    .list-day-row {
        flex-direction: column;
        gap: 10px;
    }

    .list-date {
        min-width: auto;
        font-size: 16px;
    }
}

/* Mobile */
@media (max-width: 478px) {
    .cal-header {
        align-items: center;
        text-align: center;
        gap: 15px;
    }

    .cal-title {
        display: none;
    }

    .cal-legend {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .legend-item {
        justify-content: center;
    }

    .legend-dot {
        width: 20px;
        height: 20px;
    }

    #dd-view {
        display: none;
    }

    #cal-body {
        display: none !important;
    }

    #cal-list {
        display: block !important;
    }

    .list-day-row {
        flex-direction: column;
        gap: 8px;
        padding: 15px 0;
    }

    .list-date {
        font-size: 18px;
    }

    .list-event-item {
        font-size: 14px;
    }

    .ctrl-btn,
    .btn-rechercher {
        width: 100%;
    }

    .cal-dropdown {
        width: 100%;
    }

    .mobile-month-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        margin-bottom: 20px;
    }

    #mobile-month-title {
        flex: 1;
        text-align: center;
        font-family: "Tiltwarp", sans-serif;
        color: #1B2A4A;
        font-size: 20px;
        text-transform: uppercase;
    }

    .mobile-month-nav .nav-btn {
        width: 50px;
        height: 42px;
        flex-shrink: 0;
    }
}