h1 { display: none; }

body {
    background-image: url('../images/allover-plain.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-color: #FFEFE6;
}

.projets-page {
    margin: 0 auto;
    padding: 4rem 2rem 2rem;
}

.projets-grid {
    min-height: 300px;
}

/* ── Titre principal ───────────────────────────────────────────────────── */
.projets-main-title-wrap {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.projets-main-title {
    font-family: 'GillSans-UltraBold', sans-serif;
    text-transform: uppercase;
    font-size: 2.2rem;
    color: #FF1D0F;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 0;
    width: 100%; /* ← AJOUT */
}
.projets-main-title::before,
.projets-main-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background-color: #FF1D0F;
}

/* ── Bouton filtre ─────────────────────────────────────────────────────── */
.filter-btn {
    background: none;
    border: none;
    border-radius: 8px;
    padding: 5px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.filter-btn:hover { transform: translateY(-3px); }
.filter-btn img { width: 30px; height: 30px; display: block; }

/* ── Dropdown filtre ───────────────────────────────────────────────────── */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    z-index: 999;
    background-color: #FFEFE6;
    background-image: url('../images/allover-plain.jpg');
    background-size: cover;
    background-position: center;
    border: 0.5px solid #E0E0E0;
    border-radius: 1rem;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 260px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.filter-dropdown.open {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}
.filter-dropdown label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: 'Americane-Regular', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #2A5842;
}
.filter-dropdown select {
    font-size: 14px;
    padding: 8px 10px;
    width: 100%;
    border: 0.5px solid #CCC;
    border-radius: 8px;
    background: #FFFFFF;
    color: #999;
    outline: none;
}
.filter-dropdown select:focus {
    border-color: #999;
    box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}

/* ── Grille ────────────────────────────────────────────────────────────── */
.projets-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}
@media (max-width: 900px) { .projets-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .projets-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Carte ─────────────────────────────────────────────────────────────── */
.projet-card {
    position: relative;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    overflow: visible;
    transition: transform 0.2s ease;
}
.projet-card:hover {
    transform: translateY(-4px);
}

.projet-card__inner {
    position: absolute;
    inset: 0;
    border-radius: 1.2rem;
    overflow: hidden;
    background-color: #FFA3C8;
    transition: background-color 0.3s ease, box-shadow 0.2s ease;
}
.projet-card:hover .projet-card__inner {
    background-color: #FFEFE6;
}

.projet-card__logo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease;
}
.projet-card:hover .projet-card__logo {
    opacity: 0.2;
}

.projet-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.2rem 1.4rem;
    text-align: center;
}

.projet-card__title {
    font-family: 'Blisstwin', sans-serif;
    font-size: 1.6rem;
    font-weight: bold;
    text-align: center;
    color: #FF1D0F;
    margin: 0;
    transition: color 0.3s ease;
}
.projet-card:hover .projet-card__title {
    color: #2A5842;
}

.projet-card__cats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    opacity: 0;
    max-height: 0;           /* ← AJOUT */
    overflow: hidden;        /* ← AJOUT */
    transition: opacity 0.3s ease, max-height 0.3s ease; /* ← MODIFIÉ */
}
.projet-card:hover .projet-card__cats {
    opacity: 1;
    max-height: 200px;       /* ← AJOUT */
}
.projet-card__cats li {
    font-family: 'Americane-Regular', sans-serif;
    font-size: 1rem;
    color: #2A5842;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.projet-card__cats li::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url('../icones/star-darkgreen.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.projet-card__star {
    position: absolute;
    bottom: -25px;
    right: -25px;
    width: 70px;
    height: 70px;
    object-fit: contain;
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.projet-card:hover .projet-card__star {
    opacity: 1;
}

.projets-empty {
    font-family: 'Americane-Regular', sans-serif;
    color: #2A5842;
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
}

.projet-detail__flag img {
    width: 30px;
    height: auto;
    border-radius: 3px;
    vertical-align: middle;
}

/* ── Flèche ────────────────────────────────────────────────────────────── */
.projet-arrow {
    text-align: center;
    margin: 1rem 0 0;
}
.projet-arrow img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    transform: rotate(90deg);
    animation: bounce 1s infinite;
}
@keyframes bounce {
    0%, 100% { transform: rotate(90deg) translateX(0); }
    50%       { transform: rotate(90deg) translateX(6px); }
}

/* ── Panneau détail ────────────────────────────────────────────────────── */
.projet-detail {
    position: relative;
    margin-top: 1rem;
    background: #FFEFE6;
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.projet-detail__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #FFA3C8;
    transition: color 0.2s ease;
}
.projet-detail__close:hover { color: #FF1D0F; }

.projet-detail__header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 1rem;
}

.projet-detail__header-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.projet-detail__logo img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 1rem;
}
.projet-detail__logo-initials {
    width: 100px;
    height: 100px;
    background: #FFA3C8;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'GillSans-UltraBold', sans-serif;
    font-size: 2rem;
    color: #FFEFE6;
}

.projet-detail__title {
    font-family: 'GillSans-UltraBold', sans-serif;
    font-size: 1.6rem;
    color: #FFA3C8;
    text-transform: uppercase;
    margin: 0 0 0.5rem;
}

.projet-detail__cats {
    list-style: none;
    padding: 0;
    margin: 0 0 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.projet-detail__cats li {
    font-family: 'Americane-Regular', sans-serif;
    font-size: 0.8rem;
    color: #2A5842;
    background: rgba(42, 88, 66, 0.1);
    padding: 3px 10px;
    border-radius: 999px;
    transition: transform 0.2s ease;
}
.projet-detail__cats li:hover { transform: translateY(-3px); }

.projet-detail__url {
    font-family: 'GillSans-UltraBold', sans-serif;
    text-transform: uppercase;
    font-size: 1.1rem;
    font-weight: bold;
    color: #6EA14F;
    text-decoration: none;
    transition: color 0.2s ease;
}
.projet-detail__url:hover { color: #FFA3C8; }

.projet-detail__description {
    font-family: 'Americane-Regular', sans-serif;
    font-size: 1rem;
    color: #444;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.projet-detail__section { margin-bottom: 2.5rem; }

.projet-detail__section-title {
    font-family: 'GillSans-UltraBold', sans-serif;
    text-transform: uppercase;
    font-size: 1.1rem;
    color: #2A5842;
    margin-bottom: 0.8rem;
}

.projet-detail__section-text {
    font-family: 'Americane-Regular', sans-serif;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.7;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}
.projet-detail__section-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.projet-detail__section-inner--side {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}
.projet-detail__section-inner .projet-detail__gallery {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.75rem;
    overflow-x: auto;
}

.projet-detail__section-inner .projet-detail__gallery img {
    width: auto;
    height: 160px;
    max-width: 220px;
    object-fit: cover;
    border-radius: 0.8rem;
    flex-shrink: 0;
}
.projet-detail__section-inner--side .projet-detail__gallery {
    display: flex;
    flex-direction: column;
}

.projet-detail__gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.projet-detail__gallery img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    border-radius: 0.8rem;
    padding: 0.5rem;
}

.hidden { display: none !important; }

.projet-detail__footer {
    text-align: center;
    margin-top: 2.5rem;
}
.projet-detail__back {
    font-family: 'GillSans-UltraBold', sans-serif;
    text-transform: uppercase;
    font-size: 1rem;
    color: #6EA14F;
    background-color: #FFD3EA;
    border: none;
    border-radius: 999px;
    padding: 0.7rem 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.projet-detail__back:hover {
    background: #6EA14F;
    color: #FFD3EA;
    transform: translateY(-3px);
}

/* MEDIA QUERY */
/* ───────────────────────────── */
/* TABLETTE (≤ 1023px) */
/* ───────────────────────────── */
@media (max-width: 1023px) {

    .projets-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        overflow-x: hidden;
    }

    .projet-card {
        overflow: hidden;
    }

    .projet-card__star {
        display: none;
    }

    .projets-main-title {
        font-size: 1.8rem;
    }

    .projet-card__title {
        font-size: 1.2rem;
        padding: 0 0.5rem;
    }

    .projet-card__cats li {
        font-size: 0.85rem;
        gap: 4px;
    }

    .projet-card__cats li::before {
        width: 10px;
        height: 10px;
    }

    .projet-detail__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .projet-detail__logo img {
        width: 160px;
        height: 160px;
    }
}

/* ───────────────────────────── */
/* MOBILE (≤ 767px) */
/* ───────────────────────────── */
@media (max-width: 767px) {

    .projets-page {
        padding: 2rem 1rem;
        overflow-x: hidden;
    }

    .projets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        overflow-x: hidden;
    }

    .projets-main-title {
        font-size: 1.4rem;
        gap: 0.8rem;
    }

    .filter-dropdown {
        width: 90%;
    }

    .projet-card {
        overflow: hidden;
    }

    .projet-card__title {
        font-size: 1rem;
    }

    .projet-card__overlay {
        padding: 0.8rem;
    }

    .projet-card__cats {
        gap: 0.1rem;
    }

    .projet-card__cats li {
        font-size: 0.75rem;
        text-align: center;
    }

    .projet-detail {
        padding: 1.5rem 1rem;
    }

    .projet-detail__logo img {
        width: 120px;
        height: 120px;
    }

    .projet-detail__title {
        font-size: 1.2rem;
    }

    .projet-detail__description {
        font-size: 0.95rem;
    }
}