
/* ============================================================
   TECHNO PORTAIL — ACTIVITÉS
   ============================================================ */

/* ============================================================
   PAGE
   ============================================================ */

body.activities-page {
    display: block;
    width: 100%;
    min-height: 100vh;
    height: auto;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    font-family: "Poppins", sans-serif;

    /* Prevent background image from resizing */
    background-size: auto, 100% auto;
    background-position: top left, center top;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

.activities-content {
    width: 100%;
    max-width: 1250px;
    margin: 0 auto;
    padding: 45px 24px 70px;
}

/* ============================================================
   EN-TÊTE
   ============================================================ */

.activities-header {
    max-width: 700px;
    margin: 0 auto 30px;
}

.activities-header h1 {
    margin: 0 0 12px;
    color: #444;
    font-size: 2rem;
    font-weight: 600;
}

.activities-header p {
    margin: 0;
    color: #666;
    font-size: .95rem;
    font-weight: 300;
    line-height: 1.6;
}

/* ============================================================
   RECHERCHE
   ============================================================ */

.activities-search {
    max-width: 750px;
    margin: 0 auto 20px;
}

.activities-search input {
    width: 100%;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    padding: 13px 42px 13px 16px;
}

.activities-search input:focus {
    background: #fff;
    border-color: #ffc107;
    outline: none;
}

/* ============================================================
   FILTRES PAR CLASSE
   ============================================================ */

.activities-class-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}

.activities-class-btn {
    padding: 8px 19px;
    border: 1px solid #ddd;
    border-radius: 25px;
    background: #fff;
    color: #666;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
    transition:
        background .2s,
        border-color .2s;
}

.activities-class-btn:hover {
    background: #f5f5f5;
}

.activities-class-btn.active,
.activities-class-btn.active:hover {
    background: #ffc107;
    border-color: #ffc107;
    color: #333;
    font-weight: 600;
}

/* ============================================================
   GRILLE PRINCIPALE
   ============================================================ */

.activities-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* ============================================================
   PC / TABLETTE — SIDEBAR
   ============================================================ */

.activities-sidebar-inner {
    position: sticky;
    top: 20px;
    padding: 20px 12px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(0,0,0,.07);
    border-radius: 16px;
    box-shadow: 0 3px 12px rgba(0,0,0,.05);
}

.activities-sidebar h2 {
    margin: 0 12px 15px;
    color: #444;
    font-size: 1.1rem;
    font-weight: 600;
}

.activities-chapter-btn {
    display: block;
    width: 100%;
    margin-bottom: 4px;
    padding: 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #666;
    text-align: left;
    font: inherit;
    font-size: .85rem;
    cursor: pointer;
    transition: background .2s;
}

.activities-chapter-btn:hover {
    background: #f0f1f3;
}

.activities-chapter-btn.active {
    background: rgba(255,193,7,.18);
    color: #745500;
    font-weight: 600;
}

/* ============================================================
   PC / TABLETTE — DOCUMENTS
   ============================================================ */

.activities-results-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin: 0 0 18px;
}

.activities-results-heading h2 {
    margin: 0;
    color: #444;
    font-size: 1.2rem;
    font-weight: 600;
}

#resultsCount {
    color: #888;
    font-size: .8rem;
    white-space: nowrap;
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 20px;
}

/* ============================================================
   CARTES D'ACTIVITÉS
   ============================================================ */

.activities-page .activity-card {
    position: relative;
    width: 100%;
    margin: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 15px;
    box-shadow: 0 3px 12px rgba(0,0,0,.08);
    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.activities-page .card-link {
    display: block;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

/* ============================================================
   IMAGE — CONTENEUR DE RÉFÉRENCE
   ============================================================ */

.activities-page .activity-card .card-image {
    position: relative;
    display: block;
    width: 100%;
    height: 185px;
    overflow: hidden;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* ============================================================
   BANDEAU NOIR — TITRE SUR L'IMAGE
   ============================================================ */

.activities-page .activity-card .card-overlay {
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    width: 100%;
    margin: 0;
    padding: 35px 15px 15px;
    border-radius: 0 0 14px 14px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0,0,0,.45) 35%,
        rgba(0,0,0,.85) 100%
    );
}

/* TITRE ET ICÔNE */

.activities-page .card-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
    color: #fff;
}

.activities-page .card-title {
    flex: 1;
    min-width: 0;
    color: #fff;
    font-size: .95rem;
    font-weight: 500;
    line-height: 1.35;
}

.activities-page .card-text i {
    flex-shrink: 0;
    margin-left: 8px;
    color: #fff;
    font-size: 1rem;
}

/* CLASSE ET CHAPITRE */

.activities-page .activity-meta {
    display: block;
    margin-top: 5px;
    color: rgba(255,255,255,.85);
    font-size: .72rem;
    line-height: 1.4;
}

/* EFFET SOURIS */

@media (hover: hover) {

    .activities-page .activity-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 9px 24px rgba(0,0,0,.13);
    }

}

/* MESSAGE AUCUN RÉSULTAT */

.activities-empty {
    padding: 30px 10px;
    color: #888;
    text-align: center;
}

.activities-empty[hidden] {
    display: none;
}

/* ============================================================
   TÉLÉPHONE — 600px ET MOINS
   ============================================================ */

@media (max-width: 600px) {

    /* PAGE */

    .activities-content {
        padding: 25px 8px 105px;
    }

    /* EN-TÊTE */

    .activities-header {
        margin-bottom: 25px;
    }

    .activities-header h1 {
        font-size: 1.65rem;
    }

    .activities-header p {
        font-size: .82rem;
        line-height: 1.5;
    }

    /* RECHERCHE */

    .activities-search {
        margin-bottom: 20px;
    }

    /* FILTRES */

    .activities-class-filters {
        gap: 8px;
        margin-bottom: 25px;
    }

    .activities-class-btn {
        padding: 7px 16px;
        font-size: .8rem;
    }

    /* ========================================================
       ACCORDÉONS
       ======================================================== */

    .activities-chapter-group {
        margin-bottom: 16px;
    }

    .activities-page .accordion {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin: 0;
        padding: 16px 18px;
        border: 0;
        border-radius: 16px;
        background: #fff;
        box-shadow:
            5px 5px 12px rgba(0,0,0,.09),
            -5px -5px 14px rgba(255,255,255,.75);
        color: #555;
        font: inherit;
        font-size: .9rem;
        font-weight: 500;
        text-align: left;
        cursor: pointer;
        transition: background .2s ease;
    }

    .activities-page .accordion:hover {
        background: #e3e8ec;
    }

    .activities-page .accordion.active {
        background: #e3e8ec;
    }

    .activities-page .accordion i {
        margin-left: 12px;
        color: #888;
        font-size: .8rem;
        transition: transform .25s ease;
    }

    .activities-page .accordion.active i {
        transform: rotate(90deg);
    }

    /* PANNEAU DE L'ACCORDÉON */

    .activities-page .panel {
        display: block;
        max-height: none;
        overflow: visible;
        padding: 0;
        background: transparent;
        transition: none;
    }

    .activities-page .panel[hidden] {
        display: none;
    }

    /* CARTES À L'INTÉRIEUR DES ACCORDÉONS */

    .activities-mobile-cards {
        display: grid;
        grid-template-columns: minmax(0,1fr);
        gap: 14px;
        padding: 18px 3px 5px;
    }

    .activities-page .activity-card {
        border-radius: 16px;
    }

    .activities-page .activity-card .card-image {
        height: 190px;
    }

    .activities-page .card-title {
        font-size: .9rem;
    }

    /* ========================================================
       NAVIGATION MOBILE — IDENTIQUE À INDEX
       ======================================================== */

    .activities-page .home-bottom-nav {
        z-index: 1000;
        display: flex;
        width: 100%;
        height: calc(72px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid #d8dadd;
        box-shadow: 0 -3px 14px rgba(0,0,0,.06);
    }

    /* 4 ZONES IDENTIQUES */

    .activities-page .home-nav-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 25%;
        height: 72px;
        padding: 8px 2px !important;
        color: #777;
        text-decoration: none;
    }

    /* SÉPARATEURS VERTICAUX */

    .activities-page .home-nav-item:not(:last-child) {
        border-right: 1px solid #e2e3e5;
    }

    /* ICÔNES */

    .activities-page .home-nav-item i {
        display: block;
        margin-bottom: 6px;
        font-size: 1.3rem;
        line-height: 1;
    }

    /* TEXTES */

    .activities-page .home-nav-item span {
        display: block;
        font-size: .7rem;
        font-weight: 400;
        line-height: 1;
    }

    /* ÉLÉMENT ACTIF */

    .activities-page .home-nav-active {
        color: #333 !important;
        font-weight: 600;
    }

    /* TRAIT SUPÉRIEUR ACTIF */

    .activities-page .home-nav-active::before {
        content: "";
        position: absolute;
        top: 0;
        left: 25%;
        width: 50%;
        height: 3px;
        background: #ffc107;
        border-radius: 0 0 3px 3px;
    }

}

/* ============================================================
   TRÈS PETITS ÉCRANS
   ============================================================ */

@media (max-width: 380px) {

    .activities-page .activity-card .card-image {
        height: 165px;
    }

    .activities-page .accordion {
        font-size: .83rem;
    }

    .activities-page .card-title {
        font-size: .85rem;
    }

}

/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */

.activities-page button:focus-visible,
.activities-page a:focus-visible {
    outline: 2px solid #d99b00;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    .activities-page .activity-card,
    .activities-page .accordion,
    .activities-page .accordion i {
        transition: none;
    }

}

