/* ========================= AGENDA PAGE ==================================================================================================================================== */

/* Conteneur principal */
body {
    background: #fff;
}

/* Bandeau héro comme sur la page d'accueil */
.agenda-hero {
    width: 100vw;
    height: 256px;
    overflow: hidden;
    background: #efe9e4;
    margin-left: calc(50% - 50vw);
    margin-bottom: 2rem;
}

.agenda-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.14);
}

.agenda-hero--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-family: 'Comic Sans MS', cursive;
    font-size: 1.4rem;
}

/* Décoration en points - fichiers SVG retirés */
.bg-variant-1 {
    /* background-image: url('../../images/background_1.svg'); */
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.bg-variant-2 {
    /* background-image: url('../../images/background_2.svg'); */
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.agenda-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 0.5rem;
    position: relative;
    z-index: 1;
}

/* Titre principal */
.agenda-container h1 {
    font-size: 2.5rem;
    margin: 0 0 1.5rem 0;
    text-align: left;
    color: #000;
    animation: softReveal 500ms ease-out both;
}

.agenda-container h1 i {
    margin-right: 15px;
}

/* Conteneur des sections */
.agenda-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px;
    padding: 0;
    margin-bottom: 20px;
}

/* Section individuelle */
.agenda-section h2 {
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #000;
    margin-bottom: 30px;
    text-align: center;
    font-family: 'More Sugar', cursive;
    animation: softReveal 520ms ease-out both;
}

/* Suppression des fonds colorés */
.agenda-section {
    border-radius: 16px;
    padding: 20px;
    background: transparent;
    animation: softReveal 520ms ease-out both;
}

.agenda-sections .agenda-section:nth-child(1) {
    animation-delay: 200ms;
}

.agenda-sections .agenda-section:nth-child(2) {
    animation-delay: 300ms;
}

/* Grille événements */
.events-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Carte événement skeleton */
.event-skeleton {
    background: #d9d9d9;
    border-radius: 16px;
    aspect-ratio: 1;
    width: 100%;
}
/* Animations */
@keyframes softReveal {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes floaty {
    0%, 100% { transform: translateY(0) rotate(var(--tilt, 0deg)); }
    50% { transform: translateY(var(--float, -10px)) rotate(calc(var(--tilt, 0deg) * -1)); }
}
/* Message vide (même style que l’accueil) */
.agenda-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #000;
    font-size: 1.5rem;
    font-family: 'More Sugar', cursive;
    padding: 1.25rem;
}

/* Carte événement réelle (quand il y aura des événements) */
.event {
    background: #fff;
    border-radius: 16px;
    border: 2px solid #ffffff; /* bordure blanche uniquement sur les cartes remplies */
    aspect-ratio: 1;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: floaty 8s ease-in-out infinite;
    will-change: transform;
}

.event:nth-child(1) { animation-delay: 0s; transform: rotate(-2deg); }
.event:nth-child(2) { animation-delay: 0.8s; transform: rotate(2.5deg); }
.event:nth-child(3) { animation-delay: 1.6s; transform: rotate(-1.5deg); }
.event:nth-child(4) { animation-delay: 2.4s; transform: rotate(3deg); }
.event:nth-child(5) { animation-delay: 0s; transform: rotate(-2deg); }
.event:nth-child(6) { animation-delay: 0.8s; transform: rotate(2.5deg); }
.event:nth-child(7) { animation-delay: 1.6s; transform: rotate(-1.5deg); }
.event:nth-child(8) { animation-delay: 2.4s; transform: rotate(3deg); }

@media (prefers-reduced-motion: reduce) {
    .event {
        animation: none;
        transform: none !important;
    }
}

.event:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.events-grid .event .event-cover {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.events-grid .event .event-cover img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    background: transparent !important;
    border-radius: inherit;
}

/* Filtres */
#tag-filters {
    padding: 0;
    margin-bottom: 60px;
    display: none;
}

.event-container {
    display: none;
}

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    color: #333;
}

.filter-toggle .chevron {
    transition: transform 0.3s ease;
    font-size: 14px;
}

#tag-filters.open .chevron {
    transform: rotate(180deg);
}

.filter-content {
    display: none;
    margin-top: 20px;
}

#tag-filters.open .filter-content {
    display: block;
}

.filter-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.tag-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.tag-section:last-child {
    margin-bottom: 0;
}

.tag-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    opacity: 0.7;
}

.tag-btn:hover,
.tag-btn.active {
    opacity: 1;
    border-color: #333;
    transform: scale(1.05);
}

/* Bouton ajouter événement */
.event-btn-container {
    padding: 0 80px;
    margin-bottom: 40px;
    display: none;
}

.event-btn-add {
    padding: 12px 24px;
    background: #333;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.event-btn-add:hover {
    background: #555;
    transform: scale(1.05);
}

/* Message aucun événement */
.event-container h2 {
    text-align: center;
    font-size: 24px;
    color: #999;
    margin: 60px 0;
}

/* Responsive */
@media (max-width: 1400px) {
    .events-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .agenda-sections {
        padding: 0 10%;
        gap: 60px;
    }
    
    h1 {
        margin-left: 10%;
    }
    
    #tag-filters {
        padding: 0 10%;
    }
}

@media (max-width: 992px) {
    h1 {
        font-size: 32px;
        margin: 30px 0 40px 40px;
    }

    .agenda-sections {
        grid-template-columns: 1fr;
        gap: 50px;
        padding: 0 40px;
    }

    .agenda-section h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .events-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    
    #tag-filters {
        padding: 0 40px;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 28px;
        margin: 20px 0 30px 20px;
    }

    .agenda-sections {
        padding: 0 20px;
        gap: 40px;
    }

    .agenda-section h2 {
        font-size: 18px;
    }

    .events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Sur mobile : carte minimaliste (titre + image si présente + En savoir +). Les détails sont sur la fiche. */
    .events-grid .event {
        aspect-ratio: auto;
        overflow: visible;
        animation: none;
        transform: none !important;
    }

    .events-grid .event .event-cover {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        height: 180px !important;
    }

    .events-grid .event h3 {
        white-space: normal;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* Masquer description, infos et tags sur la carte mobile : tout reste visible sur la fiche */
    .events-grid .event .event-description,
    .events-grid .event .event-info-container {
        display: none;
    }

    #tag-filters {
        padding: 0 20px;
    }
}

/* Carte sans image : afficher uniquement le titre + "En savoir +", partout (mobile + desktop) */
.events-grid .event--titleonly {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    padding: 0.4rem 0.5rem;
}

.events-grid .event--titleonly h3 {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    color: var(--color-red) !important;
    font-family: 'More Sugar', cursive !important;
    font-weight: 400 !important;
    font-size: clamp(0.75rem, 1.3vw, 1rem) !important;
    line-height: 1.15 !important;
    letter-spacing: -0.04em !important;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.events-grid .event--titleonly i {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.85rem;
    display: none !important;
}

@media (max-width: 768px) {
    .events-grid .event--titleonly {
        aspect-ratio: auto;
        min-height: 0;
        padding: 0.75rem 1rem;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .events-grid .event--titleonly h3 {
        font-size: clamp(0.9rem, 3.2vw, 1.1rem) !important;
    }

    .events-grid .event--titleonly i {
        display: inline !important;
    }
}

@media (max-width: 480px) {
    .events-grid {
        grid-template-columns: 1fr;
    }
}
