/* =========================================================
   GALERIE — L'INNOVATION, UNE HISTOIRE COLLECTIVE
   Innov'a

   Feuille de style de la galerie et des interviews.
========================================================= */


/* =========================================================
   1. BASE
========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}
main {
    background: #f8fafc !important;
}
body {
    margin: 0;
    padding: 0;
    background: #f8fafc;
    color: #333;
    font-family:
        Arial,
        Helvetica,
        sans-serif;
}


/* =========================================================
   2. CONTENEUR PRINCIPAL
========================================================= */

main {
    width: min(1400px, 92%);
    margin: 0 auto;
    padding: 50px 0 80px;
}


/* =========================================================
   3. GALERIE
========================================================= */

#gallery {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(280px, 1fr)
        );
    gap: 30px;
    transition:
        opacity 0.25s ease;
}


/* =========================================================
   4. CARTE PORTRAIT
========================================================= */

.portrait-card {
    background: #ffffff;
    border-radius: 28px;
    overflow: hidden;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
    
    /* Alignement flex pour forcer le bas de carte uniforme */
    display: flex;
    flex-direction: column;
}

.portrait-card:hover {
    transform:
        translateY(-7px);
    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.14);
}


/* =========================================================
   5. IMAGE DE LA CARTE
========================================================= */

.portrait-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}


/* =========================================================
   6. CONTENU DE LA CARTE
========================================================= */

.portrait-content {
    position: relative;
    /* Marges internes : haut 24px, droite 24px, bas 60px (place pour la flèche), gauche 24px */
    padding: 24px 24px 60px 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.portrait-title {
    margin: 0;
    font-size:
        clamp(23px, 2vw, 30px);
    line-height: 1.1;
    font-weight: 800;
}

.portrait-tagline {
    margin: 12px 0 0;
    font-size: 17px;
    line-height: 1.4;
    font-weight: 700;
    font-style: italic;
    color: #555;
}


/* =========================================================
   FLÈCHE DES PORTRAITS
========================================================= */

.card-arrow {
    position: absolute;
    right: 24px;
    bottom: 24px;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    color: #253081;
    transition:
        transform 0.2s ease;
}

.portrait-card:hover .card-arrow {
    transform:
        translate(4px, -4px);
}


/* =========================================================
   7. PASTILLE / CHAPITRE
========================================================= */

.chapter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-height: 42px;
    padding: 9px 17px;
    margin-bottom: 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    color: #222;
}


/* =========================================================
   8. COULEURS DES CATÉGORIES
========================================================= */

.category-germe {
    background: #FB6F92;
}

.category-grandit {
    background: #FDC500;
}

.category-forme {
    background: #9BC045;
}

.category-solution {
    background: #23C0F1;
}

.category-deploie {
    background: #E8873A;
}


/* =========================================================
   9. CHARGEMENT
========================================================= */

.loading {
    grid-column: 1 / -1;
    padding: 60px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
}


/* =========================================================
   10. ERREUR
========================================================= */

.error {
    grid-column: 1 / -1;
    padding: 30px;
    background: #ffffff;
    border-radius: 20px;
    color: #a33;
    font-weight: 600;
}


/* =========================================================
   11. VUE DÉTAILLÉE — SIDEBAR
========================================================= */

#detail {
    position: fixed;
    top: 0;
    right: 0;
    width: min(680px, 92vw);
    height: 100vh;
    background: #f8fafc;
    z-index: 1000;
    overflow-y: auto;
    padding: 45px 50px 60px;
    box-shadow:
        -12px 0 45px rgba(0, 0, 0, 0.18);
    animation:
        detailSlideIn 0.35s ease;
}

@keyframes detailSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* =========================================================
   12. FOND DERRIÈRE LA SIDEBAR
========================================================= */

body.detail-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 999;
    cursor: pointer;
}


/* =========================================================
   13. BOUTON RETOUR
========================================================= */

.back-button {
    position: sticky;
    top: 0;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    border: none;
    background: #253081;
    padding: 10px 16px;
    margin-bottom: 30px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.back-button:hover {
    background: #1d276b;
    transform: translateX(-4px);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.12);
}


/* =========================================================
   14. EN-TÊTE DE L'INTERVIEW
========================================================= */

.detail-header {
    margin-bottom: 45px;
}


/* =========================================================
   15. PASTILLE DÉTAIL
========================================================= */

.detail-badge {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 0;
}


/* =========================================================
   16. TITRE DE LA STRUCTURE
========================================================= */

.detail-title {
    display: block;
    width: fit-content;
    margin: 10px auto 0;
    padding: 14px 22px;
    border-radius: 18px;
    font-size:
        clamp(32px, 5vw, 47px);
    line-height: 1.05;
    font-weight: 900;
    text-align: center;
    color: #111;
}


/* =========================================================
   17. COULEUR DU TITRE SELON LE CHAPITRE
========================================================= */

.detail-title.category-germe {
    background: #FB6F92;
}

.detail-title.category-grandit {
    background: #FDC500;
}

.detail-title.category-forme {
    background: #9BC045;
}

.detail-title.category-solution {
    background: #23C0F1;
}

.detail-title.category-deploie {
    background: #E8873A;
}


/* =========================================================
   18. TAGLINE DE L'INTERVIEW
========================================================= */

.detail-tagline {
    width: 100%;
    max-width: 800px;
    margin: 30px auto 0;
    font-size:
        clamp(20px, 2vw, 27px);
    line-height: 1.35;
    font-weight: 700;
    font-style: italic;
    color: #555;
    text-align: center;
}


/* =========================================================
   19. GRANDE IMAGE
========================================================= */

.detail-image-wrapper {
    width: 100%;
    margin: 30px 0 45px;
    border-radius: 24px;
    overflow: hidden;
    background: #ffffff;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.10);
}

.detail-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}


/* =========================================================
   20. CONTENU DE L'INTERVIEW
========================================================= */

.interview-content {
    max-width: 950px;
    margin: 0 auto;
}


/* =========================================================
   21. BLOC D'INTERVIEW
========================================================= */

.interview-section {
    margin-bottom: 55px;
}

.interview-section-title {
    margin: 0 0 18px;
    font-size:
        clamp(24px, 3vw, 34px);
    line-height: 1.15;
    font-weight: 800;
}


/* =========================================================
   22. TEXTE DE L'INTERVIEW
========================================================= */

.interview-text {
    margin: 0;
    font-size:
        clamp(17px, 1.6vw, 20px);
    line-height: 1.7;
    text-align: justify;
    color: #444;
}


/* =========================================================
   23. MISE EN FORME DU TEXTE
========================================================= */

/* Gras */
.interview-text strong,
.interview-text b {
    font-weight: 800;
    color: #222;
}

/* Italique */
.interview-text em,
.interview-text i {
    font-style: italic;
}

/* Gras + italique */
.interview-text strong em,
.interview-text em strong,
.interview-text b i,
.interview-text i b {
    font-weight: 800;
    font-style: italic;
    color: #222;
}


/* =========================================================
   24. PERSONNE INTERVIEWÉE
========================================================= */

.interview-person {
    margin-top: 15px;
    font-size: 16px;
    font-style: italic;
    line-height: 1.5;
    color: #666;
}

.interview-person strong,
.interview-person b {
    font-weight: 800;
    color: #222;
}


/* =========================================================
   25. RESSOURCES COMPLÉMENTAIRES
========================================================= */

.detail-resources {
    margin-top: 60px;
    padding: 30px;
    background: #ffffff;
    border-radius: 24px;
}

.detail-resources-title {
    margin: 0 0 15px;
    font-size: 24px;
    font-weight: 800;
}

.detail-resources strong {
    font-weight: 800;
    color: #222;
}


/* =========================================================
   26. CRÉDIT PHOTO
========================================================= */

.photo-credit {
    margin-top: 15px;
    font-size: 13px;
    color: #777;
}


/* =========================================================
   27. MOBILE
========================================================= */

@media (max-width: 700px) {

    main {
        width: 90%;
        padding-top: 30px;
    }

    #gallery {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .portrait-card {
        border-radius: 22px;
    }

    /* SIDEBAR MOBILE */
    #detail {
        width: 100vw;
        padding: 30px 25px 50px;
    }

    /* TITRE MOBILE */
    .detail-title {
        font-size: 38px;
        padding: 12px 18px;
    }

    /* IMAGE MOBILE */
    .detail-image-wrapper {
        margin-top: 25px;
        border-radius: 18px;
    }

    .detail-image {
        max-height: 400px;
    }

    /* INTERVIEW MOBILE */
    .interview-section {
        margin-bottom: 40px;
    }

    .interview-text {
        text-align: left;
        line-height: 1.6;
    }
}

/* =========================================================
   BARRE DE RECHERCHE & FILTRES EN BLOC CARTE
========================================================= */

#filters-section {
    max-width: 900px;
    margin: 0 auto 40px auto;
    padding: 20px 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Zone de la barre de recherche */
.search-box {
    position: relative;
    width: 100%;
}

#searchInput {
    width: 100%;
    padding: 10px 16px 10px 42px; /* Espace à gauche pour l'icône loupe */
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: all 0.2s ease;
}

#searchInput:focus {
    background-color: #ffffff;
    border-color: #1e293b;
    box-shadow: 0 0 0 3px rgba(30, 41, 59, 0.05);
}

/* Icône Loupe à l'intérieur de l'input */
.search-box::before {
    content: "🔍";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
    pointer-events: none;
}

/* Conteneur des filtres */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* Label "Filière :" ou "Étape :" */
.filter-label {
    font-weight: 700;
    color: #1e293b;
    font-size: 14px;
    margin-right: 4px;
}

/* Boutons de filtres */
.filter-btn {
    background: #e2e8f0;
    color: #1e293b;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-btn:hover {
    background: #cbd5e1;
}

/* Bouton actif (bleu marine / sombre) */
.filter-btn.active {
    background: #252a6a;
    color: #ffffff;
}
