body {
    padding: 0;
    margin: 0 auto;
    position: relative;
    font-family: "Montserrat", sans-serif;
    max-width: 1600px;
    min-width: 320px;

}

:root {
    /* 1% de la largeur de page, bloqué à 16px (page max 1600px) */
    --u: min(1vw, 16px);
    /* marge gauche/droite de main */
    --gap: clamp(1.5rem, 4vw, 5rem);
}

main {
    margin: var(--gap);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Transitions ciblées pour les éléments interactifs (sans conflit avec GSAP) */
a,
button,
input,
textarea,
.categorie-badge {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

nav {
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

nav ul li {
    transition: font-size 0.3s ease, color 0.3s ease, padding-top 0.3s ease;
}

.button a,
.button input {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.filtre a {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Font */

.montserrat {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
}


.montserrat-alternates-light {
    font-family: "Montserrat Alternates", sans-serif;
    font-weight: 300;
    font-style: normal;
}

.montserrat-alternates-extrabold {
    font-family: "Montserrat Alternates", sans-serif;
    font-weight: 800;
    font-style: normal;
}


/* Couleur*/

:root {
    --creme: #DCAF95;
    --brun-clair: #B0744F;
    --brun: #7D431F;
    --brun-fonce: #422A14;
}

/* Menu */
header {
    display: flex;
    justify-content: space-between;
    padding-top: 2rem;
}

.logo {
    font-size: 2rem;
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    padding-left: 4rem;
    color: var(--brun-fonce);
    z-index: 1;
}

header div {
    position: relative;
}

.logo::after {
    content: "•";
    z-index: -1;
    font-size: 12rem;
    position: absolute;
    color: var(--creme);
    top: -290%;
    left: 18%;
    opacity: 50%;
}

.Accueil .logo::after {
    color: rgb(255, 255, 255);
}

nav {
    position: sticky;
    padding: 1.1rem 0;
    /* Un halo immense pour masquer le texte derrière de façon très diffuse */
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

nav ul {
    display: flex;
    gap: 1.875rem;
    padding-right: 6rem;

    li {
        text-decoration: none;
        list-style: none;
        font-family: "Montserrat", sans-serif;
        font-weight: 800;
        font-size: 1rem;
        color: var(--brun-clair);
        padding-top: 0.4rem;
        white-space: nowrap;
    }

    li:hover {
        font-size: 1.4rem;
        color: var(--creme);
        padding-top: 0;
    }
}

/* menu plus serré entre 769px et 1000px pour rester sur une ligne */
@media (max-width: 1000px) {
    nav ul {
        gap: 1.1rem;
        padding-right: 2rem;
    }
}

a {
    text-decoration-line: none;
}

/* footer */
footer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: var(--brun-clair);
    color: white;
    padding: 2rem 0;
    font-weight: 200;
    font-family: "Montserrat Alternates", sans-serif;

}

/* ==========================================================================
   ACCUEIL - SECTION 1 (PRÉSENTATION)
   Tout est mesuré en --u (1% de la largeur, bloqué à 16px au-delà de 1600px)
   pour que la tache coupe toujours "Maëli" entre le "ë" et le "l".
   Ordi (> 1100px)      : photo à gauche, "Maëli Dong" au milieu, texte sous "Dong"
   Tablette (769-1100px): idem, mais "Dong" passe sous "Maëli", décalé à droite
   GSM (≤ 768px)        : nom, photo, texte et boutons empilés
   ========================================================================== */
.tache {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(60 * var(--u));
    max-width: none;
    z-index: -3;
    height: auto;
    pointer-events: none;
    transform-origin: top left;
}

.presentation {
    display: grid;
    /* colonne 1 = photo (jusqu'à 33% de la largeur), colonne 2 = nom + texte */
    grid-template-columns: calc(33 * var(--u)) 1fr;
    grid-template-rows: auto 1fr;
    align-items: start;
    align-content: start;
    /* la section prend toute la largeur de la page (annule la marge de main) */
    margin-inline: calc(-1 * var(--gap));
    margin-top: calc(max(17.8 * var(--u) - 94px, 2rem) - var(--gap));
    /* la section suivante commence sous la tache */
    min-height: calc(40 * var(--u));
    margin-bottom: calc(6 * var(--u));
}

.nom {
    grid-column: 2;
    grid-row: 1;
    font-family: "Montserrat Alternates", sans-serif;
    font-weight: 800;
    font-size: calc(6.9 * var(--u));
    line-height: 1.1;
    position: relative;
    z-index: 1;

    > div {
        display: flex;
        flex-wrap: wrap;
        column-gap: 0.25em;
    }

    .prenom {
        color: var(--brun);
    }

    .famille {
        color: var(--creme);
    }
}

.photo {
    grid-column: 1;
    grid-row: 1 / 3;
    position: relative;
    margin-left: calc(13.5 * var(--u));
}

.photo .moi {
    display: block;
    width: calc(18.5 * var(--u));
    border-radius: 50%;
    aspect-ratio: 1/1;
    object-fit: cover;
    margin-top: calc(1 * var(--u));
    border: solid calc(0.6 * var(--u)) var(--creme);
}

.photo .designer {
    width: calc(14 * var(--u));
    position: absolute;
    left: calc(-5.5 * var(--u));
    top: calc(-3 * var(--u));
    z-index: -1;
    transform-origin: center center;
}

/* texte d'intro sous "Dong" */
.intro {
    grid-column: 2;
    grid-row: 2;
    margin-top: calc(2 * var(--u));
    margin-left: calc(22 * var(--u));
    width: max(22 * var(--u), 23rem);

    p {
        padding-bottom: 1rem;
        font-size: 1.1rem;
        text-align: justify;
        word-spacing: -0.05em;
        hyphens: auto;
        -webkit-hyphens: auto;
    }
}

/* ---------- Tablette : "Dong" sous "Maëli", décalé vers la droite ---------- */
@media (max-width: 1100px) {

    .presentation {
        grid-template-columns: calc(27 * var(--u)) 1fr;
        margin-top: calc(max(15.5 * var(--u) - 95px, 1rem) - var(--gap));
    }

    .nom {
        font-size: calc(9.5 * var(--u));
        line-height: 0.95;

        > div {
            flex-direction: column;
            align-items: flex-start;
        }

        /* "Dong" commence juste après le bord de la tache */
        .famille {
            margin-left: calc(25 * var(--u));
        }
    }

    .photo {
        margin-left: calc(5 * var(--u));
    }

    .photo .moi {
        width: calc(20 * var(--u));
    }

    .photo .designer {
        width: calc(15 * var(--u));
        left: calc(-4 * var(--u));
    }

    .intro {
        margin-top: calc(3 * var(--u));
        margin-left: calc(25 * var(--u));
        width: auto;
        padding-right: calc(5 * var(--u));
    }
}

/* ---------- GSM : tout empilé ---------- */
@media (max-width: 768px) {

    .tache {
        left: calc(-35 * var(--u));
        width: calc(90 * var(--u));
    }

    .presentation {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2rem;
        margin-top: calc(max(21.5 * var(--u) - 61px, 1rem) - 2rem);
        min-height: 0;
        margin-bottom: 5rem;
    }

    .nom {
        font-size: calc(16 * var(--u));
        padding-left: calc(6 * var(--u));

        .famille {
            margin-left: calc(38 * var(--u));
        }
    }

    .photo {
        margin: 0 auto;
    }

    .photo .moi {
        width: min(60 * var(--u), 260px);
        margin: calc(3 * var(--u)) 0 0;
        border-width: 0.4rem;
    }

    .photo .designer {
        width: 55%;
        left: -18%;
        top: -4%;
    }

    .intro {
        margin: 0;
        width: auto;
        padding-inline: var(--gap);

        p {
            font-size: 1rem;
        }

        .button {
            flex-direction: column;
            align-items: center;
            gap: 0.8rem;

            a {
                width: 100%;
                max-width: 18rem;
            }
        }
    }
}

p,
li {
    font-family: "Montserrat Alternates", sans-serif;
    font-weight: 300;
    font-size: 0.9rem;
}

.button {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;

    a,
    input {
        padding: 0.5rem 0;
        width: 10rem;
        text-align: center;
        color: white;
        border-radius: 50px;
        font-weight: 500;
        font-size: 1rem;

    }

    .creme {
        background-color: var(--creme);
        border: solid 2px var(--creme);
    }

    .brun-clair {
        background-color: var(--brun-clair);
        border: solid 2px var(--brun-clair);
    }

    .brun {
        background-color: var(--brun);
        border: solid 2px var(--brun);
    }

    .creme:hover {
        background-color: white;
        color: var(--creme);
    }

    .brun-clair:hover {
        background-color: white;
        color: var(--brun-clair);
    }

    .brun:hover {
        background-color: white;
        color: var(--brun);
    }
}

/* Accueil - Section 2*/

h1 {
    font-family: "Montserrat Alternates", sans-serif;
    font-weight: 800;
    color: var(--creme);
}

h1::before {
    content: "•";
    color: var(--brun);
    padding-right: 0.5rem;
}

h1::after {
    content: "•";
    color: var(--brun);
    padding-left: 0.5rem;
}

.projet {

    width: 100%;
    aspect-ratio: 14/9;
    border: solid 3px var(--brun);
    position: relative;
    border-radius: 50px;
    align-items: center;
    transition: box-shadow 0.4s ease, border-color 0.4s ease;

    .image-projet {
        display: block;
        object-fit: cover;
        height: 100%;
        width: 100%;
        border-radius: 50px;
        opacity: 1;
        visibility: visible;
        transition: filter 0.4s ease, transform 0.4s ease;
    }

    .info {
        position: absolute;
        left: 50%;
        top: 100%;
        width: auto;
        transform: translate(-50%, -50%);
        text-align: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, top 0.4s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.4s ease;
    }

    a {
        color: white;
        font-weight: 700;
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.4);
    }

    .rectangle {
        position: absolute;
        width: 100%;
        height: 100%;
        left: 50%;
        top: 50%;
        transform: translate(-53%, -53%);
        border-radius: 50px;
        border: solid 3px var(--creme);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
    }
}

.projet:hover .image-projet {
    filter: brightness(0.5);
}

.projet:hover .info {
    opacity: 1;
    visibility: visible;
    top: 50%;
}

.projet:hover .rectangle {
    opacity: 1;
    visibility: visible;
}

.tout-projet {
    display: grid;
    grid-template-columns: 22% 22% 22% 22%;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    height: auto;
    margin: 4rem 0;
}

.end {
    display: flex;
    justify-content: flex-end;
}

/* Mes projets - Section 1 */
.filtre {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;

    a {
        padding: 0.5rem 0;
        width: 10rem;
        text-align: center;
        color: var(--brun);
        border-radius: 50px;
        font-weight: 400;
        background-color: white;
        border: solid 2px var(--brun);
        cursor: pointer;
    }

    a:hover,
    a.active {
        background-color: var(--brun);
        color: white;
    }
}

/* Formulaire - Contact */

.contact-form {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 4rem;
}

.left,
.right {

    width: 30%;
}

.nom-complet {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.input {
    margin: 0.8rem 0;

    label {
        color: var(--brun-clair);
        font-size: 1.2rem;
        font-weight: 500;
    }

    input,
    textarea {
        border: none;
        border-radius: 20px;
        border: solid 2px var(--brun-clair);
        padding: 0.3rem;
        margin: 0.2rem 0;
        width: 100%;
    }

    .message {
        height: 100%;
    }
}

/* Formulaire - Connexion */
.connect {
    width: 100%;
    display: flex;
    justify-content: center;
    align-content: center;

}

.connexion {
    width: 30%;
    border-radius: 50px;
    border: solid 2px var(--brun-clair);
    padding: 2rem 0;

    .input {
        margin-bottom: 2rem;
        text-align: center;

        input {
            width: 60%;
        }
    }

    .button {
        display: flex;
        justify-content: center;
    }
}

/* A propos - Section 1 */

h3 {
    font-weight: 500;
}

.cv {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    margin: 4rem;
}

@media (max-width:1400px) {
    .cv {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width:900px) {
    .cv {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   INTERMEDIATE - PROJETS border-radius (1000px → 769px)
   Les cartes doivent rester carrées, pas en pillule
   ========================================================================== */
@media (max-width: 1000px) {
    .projet {
        border-radius: 20px;
    }

    .projet .image-projet {
        border-radius: 20px;
    }

    .projet .rectangle {
        border-radius: 20px;
    }
}


.mes-infos {
    display: flex;

    flex-direction: column;
    padding: 3rem;
    border-radius: 50px;
    border: solid 3px var(--brun);
    height: auto;

    h2 {
        text-align: center;
    }

    h2,
    h3,
    i,
    p,
    li {
        color: var(--brun-fonce);
    }
}

.group {
    padding: 0.5rem 0;

    h3 {
        margin-bottom: 0;
        text-transform: uppercase;
    }
}

.date {
    display: flex;
    justify-content: space-between;

    i {
        font-size: 0.8rem;
    }
}

.competence {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;

}

.group {
    ul {
        padding: 0;
    }

    li {
        list-style: none;
        margin-bottom: 1rem;
    }
}

.qualite {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;

    li {
        padding: 0.5rem 0;
        width: 7rem;
        text-align: center;
        border: solid 2px var(--creme);
        border-radius: 50px;
        font-weight: 400;
        font-size: 1rem;
    }

}


/* ==========================================================================
   A PROPOS - ANIMATIONS DE SURVOL
   (on utilise "translate"/"scale" et pas "transform" pour ne pas entrer
   en conflit avec les animations GSAP d'apparition)
   ========================================================================== */
.mes-infos {
    transition: translate 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease, background-color 0.4s ease;
}

.mes-infos:hover {
    translate: 0 -8px;
    border-color: var(--brun-clair);
    background-color: rgba(220, 175, 149, 0.08);
    box-shadow: 0 18px 40px rgba(125, 67, 31, 0.15);
}

/* Titre de colonne : petit soulignement qui s'étire */
.mes-infos h2 {
    position: relative;
    padding-bottom: 0.4rem;
}

.mes-infos h2::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 3px;
    border-radius: 3px;
    background: var(--creme);
    translate: -50% 0;
    transition: width 0.4s ease;
}

.mes-infos:hover h2::after {
    width: 4rem;
}

/* Chaque bloc (parcours, compétences, langues...) */
.group {
    border-radius: 20px;
    transition: translate 0.3s ease, background-color 0.3s ease;
}

.group h3 {
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}

.group:hover h3 {
    color: var(--brun-clair);
    letter-spacing: 0.06em;
}

.group:hover {
    translate: 6px 0;
}

/* Compétences : petit point qui apparaît + glissement */
.competence li {
    position: relative;
    cursor: default;
    transition: translate 0.25s ease, color 0.25s ease;
}

.competence li::before {
    content: "";
    position: absolute;
    left: -0.9rem;
    top: 50%;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--brun-clair);
    translate: 0 -50%;
    scale: 0;
    transition: scale 0.25s ease;
}

.competence li:hover {
    translate: 0.6rem 0;
    color: var(--brun-clair);
}

.competence li:hover::before {
    scale: 1;
}

/* Qualités : la pastille se remplit */
.qualite li {
    cursor: default;
    transition: background-color 0.3s ease, color 0.3s ease, scale 0.3s ease, border-color 0.3s ease;
}

.qualite li:hover {
    background-color: var(--creme);
    border-color: var(--creme);
    color: white;
    scale: 1.08;
}

/* Langues / infos / parcours : le texte se réchauffe */
.group p,
.date i {
    transition: color 0.3s ease;
}

.group:hover p,
.group:hover .date i {
    color: var(--brun);
}

@media (prefers-reduced-motion: reduce) {
    .mes-infos:hover,
    .group:hover,
    .competence li:hover {
        translate: none;
    }

    .qualite li:hover {
        scale: none;
    }
}

/* Projet - Section 1 */
.mon-projet {
    display: flex;
    justify-content: space-evenly;
    margin: 0 4rem;

    .projet {
        margin: 1rem;
    }

    p {
        padding-right: 5rem;
        text-align: justify;
        text-justify: inter-word;
    }

    .gauche {
        margin-bottom: 5rem;
    }

    .droite {
        margin-top: 5rem;
    }

    .projet {
        aspect-ratio: 4/3;
        overflow: hidden;
    }

    .projet:hover img {
        transform: scale(1.1);
        opacity: 1;
        visibility: visible;
        filter: none;
    }
}

/* Projet avec une seule image */
.mon-projet.single-image {
    flex-wrap: wrap;
}

.mon-projet.single-image .text {
    flex: 1 1 40%;
}

.mon-projet.single-image .projet.gauche {
    flex: 1 1 50%;
    margin-bottom: 0;
}

.categorie-badge {
    display: inline-block;
    padding: 0.4rem 1.5rem;
    border: solid 2px var(--brun-clair);
    border-radius: 50px;
    color: var(--brun-clair);
    font-family: "Montserrat Alternates", sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: capitalize;
    margin-top: 1rem;
}

/* Projet - Vidéo */
.projet-video {
    display: flex;
    justify-content: center;
    margin: 3rem 4rem;
}

.projet-video video {
    max-width: 60%;
    border-radius: 30px;
    border: solid 3px var(--brun);
}

/* Dashboard */
.back-end {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;

    .ajouter {
        align-self: flex-end;
        margin-right: 5%;
    }
}

.ligne {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    padding: 1rem;
    border-radius: 50px;
    border: solid 2px var(--brun-clair);

    .titre-projet {
        font-family: "Montserrat Alternates", sans-serif;
        font-size: 1.2rem;
        padding-left: 1rem;
        font-weight: 500;
    }

    .titre-projet,
    .button {
        flex: 1;
    }

    .button {
        width: 16rem;
        justify-content: flex-end;

        .brun-clair {
            color: var(--brun-clair);
            background-color: white;
            border-color: white;
        }

        .creme {
            color: var(--creme);
            background-color: white;
            border-color: white;
        }

        .brun-clair:hover {
            border-color: var(--brun-clair);
        }

        .creme:hover {
            border-color: var(--creme);
        }
    }
}

.pu,
.mis {
    display: block;
    width: 10rem;
}

.pu {
    color: var(--brun-clair);
    padding-right: 1rem;
}

.non {
    color: var(--brun-fonce);
}

.mis {
    color: var(--creme);
}

/* Ajouter - formulaire */

.image-file {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    overflow: hidden;

    input {
        border: none;
    }
}

.check {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;

    input {
        width: 2rem;
    }
}

.left {
    .button {
        margin-top: 3rem;
    }
}

/* Edition - Formulaire */

.edition-form {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-top: 4rem;

}

/* Lightbox */
.remove-scroll {
    overflow: hidden;
}

.remove-scroll nav {
    display: none !important;
}

.lightbox-hide {
    top: 0;
    left: 0;
    position: absolute;
    visibility: hidden;
}

.lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* personnalisation de la couleur de fond possible et de son opacité */
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

.lightbox-wrapper {
    position: relative;
}

.lightbox-image {
    /* personnalisation des dimensions possible ainsi qu’ajout de border, border-radius, padding… */
    max-height: 80vmin;
    max-width: 80vmin;
    object-fit: contain;
    border-radius: 0.5rem;
    border: #fff 0.1rem solid;
}

.lightbox-btn-close {
    cursor: zoom-out;
    top: -0.8rem;
    right: -0.8rem;
    background-size: 40%;
    background-image: url('icons/icon-lightbox-close.svg');
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes createBox {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

@keyframes deleteBox {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(0);
    }
}

/* Contact */
.error {
    border: 2px solid #ff4d4d;
    background-color: #fff2f2;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
    display: inline-block;
    width: 60%;
}

.password-wrapper input {
    width: 100% !important;
}

.eye-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--brun-clair);
    display: flex;
    align-items: center;
}

.eye-icon:hover {
    color: var(--brun-fonce);
}

/* Admin Forms - Select */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: solid 2px var(--brun-clair);
    border-radius: 20px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    font-family: "Montserrat Alternates", sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--brun-fonce);
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23B0744F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    cursor: pointer;
    width: 100%;
}

select:focus {
    outline: none;
    border-color: var(--brun);
}

/* Admin Forms - Checkboxes */
.check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.3rem !important;
    height: 1.3rem;
    border: solid 2px var(--brun-clair);
    border-radius: 5px;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    background-color: white;
}

.check input[type="checkbox"]:checked {
    background-color: var(--brun-clair);
    border-color: var(--brun-clair);
}

.check input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
}

.check label {
    font-family: "Montserrat Alternates", sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--brun-fonce);
    vertical-align: middle;
    cursor: pointer;
}

/* Admin Forms - File Inputs */
.image-file input[type="file"] {
    border: none !important;
    font-size: 0;
    color: transparent;
    width: 100%;
    padding: 0;
}

.image-file input[type="file"]::file-selector-button {
    background-color: var(--creme);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: "Montserrat", sans-serif;
    font-size: 0.8rem;
    margin-right: 0.8rem;
}

.image-file input[type="file"]::file-selector-button:hover {
    background-color: var(--brun-clair);
}

/* Admin Forms - Image Previews */
.preview-container {
    width: 100%;
    height: 120px;
    border: 2px dashed var(--creme);
    border-radius: 15px;
    margin: 0.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: rgba(220, 175, 149, 0.05);
}

.img-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 13px;
}

.img-name {
    font-family: "Montserrat Alternates", sans-serif;
    font-size: 0.75rem;
    color: var(--brun-clair);
    font-style: italic;
    margin-top: 0.3rem;
}

.img-name span {
    font-weight: 500;
}

.petal-particle {
    position: fixed;
    top: -50px;
    left: 0;
    pointer-events: none;
    z-index: 9999;
}

/* ==========================================================================
   UTILITAIRES
   ========================================================================== */
.d-none {
    display: none !important;
}

.text-error {
    color: red;
}

/* ==========================================================================
   RESPONSIVE - HAMBURGER MENU
   ========================================================================== */

/* Prevent scroll when menu open */
body.no-scroll {
    overflow: hidden;
}

/* Hamburger button - hidden on desktop */
.hamburger {
    display: none !important;   /* caché sur desktop, réactivé par @media */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
    margin-right: 1.5rem;
    position: relative;
    box-shadow: none;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 2.5px;
    background-color: var(--brun-fonce);
    border-radius: 3px;
    transition: transform 0.35s ease, opacity 0.35s ease, width 0.35s ease;
    transform-origin: center;
}

/* Hamburger → X animation */
.hamburger.open span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
    width: 0;
}
.hamburger.open span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Overlay (dark background behind menu) */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(66, 42, 20, 0.55);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.nav-overlay.visible {
    opacity: 1;
}

/* ==========================================================================
   RESPONSIVE - TABLET (≤ 768px)
   ========================================================================== */
@media (max-width: 768px) {

    body {
        max-width: 100%;
    }

    :root {
        --gap: 1.2rem;
    }

    main {
        margin: 2rem var(--gap);
    }

    /* ---------- Header / Nav ---------- */
    header {
        padding-top: 1rem;
        position: sticky;
        top: 0;
        background: white;
        z-index: 1000;
        box-shadow: 0 2px 12px rgba(66,42,20,0.08);
    }

    .hamburger {
        display: flex !important;   /* réactive le hamburger sur mobile */
    }

    /* Nav becomes a drawer */
    #main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75vw;
        max-width: 320px;
        height: 100dvh;
        background: #fff;
        z-index: 1000;
        box-shadow: -4px 0 30px rgba(66,42,20,0.15);
        transition: right 0.38s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #main-nav.open {
        right: 0;
    }

    .nav-overlay {
        display: block;
        pointer-events: none;
    }

    .nav-overlay.visible {
        pointer-events: auto;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0;
        width: 100%;
        align-items: flex-start;
        padding: 2rem;
    }

    nav ul a {
        display: block;
        width: 100%;
        border-bottom: 1px solid rgba(176,116,79,0.15);
    }

    nav ul li {
        font-size: 1.2rem !important;
        padding: 1rem 0 !important;
        color: var(--brun-fonce) !important;
    }

    nav ul li:hover {
        font-size: 1.4rem !important;
        color: var(--brun-clair) !important;
        padding-top: 0.8rem !important;
    }

    /* ---------- Logo ---------- */
    .logo {
        font-size: 1.4rem;
        padding-left: 1.2rem;
    }

    .logo::after {
        font-size: 6rem;
        top: -160%;
        left: 10%;
    }

    .button {
        flex-wrap: wrap;
        justify-content: flex-start;
    }


    /* ---------- Grille projets ---------- */
    .tout-projet {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin: 2rem 0;
    }

    /* ---------- Filtre projets ---------- */
    .filtre {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .filtre a {
        width: auto;
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }

    /* ---------- Contact ---------- */
    .contact-form {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .left,
    .right {
        width: 100%;
    }

    /* ---------- A propos - CV ---------- */
    .cv {
        grid-template-columns: 1fr;
        margin: 1.5rem 0;
        gap: 1.5rem;
    }

    .mes-infos {
        padding: 2rem 1.5rem;
        border-radius: 30px;
    }

    /* ---------- Page projet ---------- */
    .mon-projet {
        flex-direction: column;
        margin: 0 0.5rem;
        gap: 2rem;
    }

    .mon-projet .gauche,
    .mon-projet .droite {
        margin: 0;
    }

    .mon-projet p {
        padding-right: 0;
    }

    .projet-video {
        margin: 2rem 0;
    }

    .projet-video video {
        max-width: 100%;
    }

    /* ---------- Dashboard / Admin ---------- */
    .ligne {
        flex-direction: column;
        align-items: flex-start;
        border-radius: 20px;
        padding: 1rem;
        gap: 0.5rem;
    }

    .ligne .button {
        justify-content: flex-start;
        width: 100%;
    }

    .pu,
    .mis {
        width: auto;
    }

    /* ---------- Connexion ---------- */
    .connexion {
        width: 90%;
        padding: 2rem 1rem;
    }

    /* ---------- Footer ---------- */
    footer {
        padding: 1.5rem 1rem;
        text-align: center;
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   RESPONSIVE - SMALL MOBILE (≤ 480px)
   ========================================================================== */
@media (max-width: 480px) {

    :root {
        --gap: 1rem;
    }

    main {
        margin: 1.5rem var(--gap);
    }

    .button {
        justify-content: center;
    }


    .tout-projet {
        grid-template-columns: 1fr;
    }

    .projet {
        border-radius: 25px;
    }

    .projet .image-projet {
        border-radius: 25px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .button a,
    .button input {
        width: 9rem;
        font-size: 0.9rem;
    }

    .qualite {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .qualite li {
        width: 6rem;
        font-size: 0.85rem;
    }

    .competence {
        gap: 1rem;
    }
}


/* ==========================================================================
   ANIMATIONS DE SURVOL - TOUT LE SITE
   On utilise les propriétés "translate", "scale" et "rotate" (et pas
   "transform") pour ne pas casser les animations GSAP d'apparition.
   ========================================================================== */

/* ---------- Menu (ordi) : soulignement qui s'étire, sans faire bouger le menu ---------- */
@media (min-width: 769px) {
    nav ul a {
        position: relative;
    }

    nav ul li,
    nav ul li:hover {
        font-size: 1rem;
        padding-top: 0.4rem;
    }

    nav ul li {
        transition: color 0.3s ease, translate 0.3s ease;
    }

    nav ul a::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: -0.35rem;
        width: 0;
        height: 3px;
        border-radius: 3px;
        background: var(--creme);
        translate: -50% 0;
        transition: width 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    }

    nav ul a:hover li {
        color: var(--creme);
        translate: 0 -3px;
    }

    nav ul a:hover::after {
        width: 100%;
    }
}

/* ---------- Logo : le point grossit ---------- */
.logo::after {
    transition: scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

header > div:hover .logo::after {
    scale: 1.25;
    opacity: 80%;
}

/* ---------- Titres h1 : les points s'écartent ---------- */
h1::before,
h1::after {
    display: inline-block;
    transition: translate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

h1:hover::before {
    translate: -0.5rem 0;
    color: var(--creme);
}

h1:hover::after {
    translate: 0.5rem 0;
    color: var(--creme);
}

/* ---------- Boutons : se soulèvent, ombre douce, effet "appui" au clic ---------- */
.button a,
.button input,
.filtre a {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease,
        box-shadow 0.3s ease, translate 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), scale 0.15s ease;
}

.button a:hover,
.button input:hover,
.filtre a:hover {
    translate: 0 -4px;
    box-shadow: 0 10px 22px rgba(125, 67, 31, 0.22);
}

.button a:active,
.button input:active,
.filtre a:active {
    translate: 0 0;
    scale: 0.96;
    box-shadow: 0 4px 10px rgba(125, 67, 31, 0.18);
}

/* ---------- Accueil : nom, photo et sticker ---------- */
.nom .prenom,
.nom .famille {
    display: inline-block;
    transition: color 0.35s ease, translate 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nom .prenom:hover {
    color: var(--brun-fonce);
    translate: 0 -6px;
}

.nom .famille:hover {
    color: var(--brun-clair);
    translate: 0 -6px;
}

.photo .moi {
    transition: scale 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.photo:hover .moi {
    scale: 1.05;
    border-color: var(--brun-clair);
    box-shadow: 0 18px 40px rgba(66, 42, 20, 0.25);
}

.photo .designer {
    transition: rotate 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.photo:hover .designer {
    rotate: -25deg;
}

/* ---------- Cartes projets (accueil + mes projets) ---------- */
.tout-projet .projet {
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.tout-projet .projet:hover {
    border-color: var(--brun-clair);
    box-shadow: 0 20px 40px rgba(66, 42, 20, 0.22);
}

.tout-projet .projet .rectangle {
    transition: opacity 0.4s ease, visibility 0.4s ease, rotate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tout-projet .projet:hover .rectangle {
    rotate: -2deg;
}

.tout-projet .projet .info p::after {
    content: " →";
    display: inline-block;
    margin-left: 0.3rem;
    transition: translate 0.35s ease;
}

.tout-projet .projet:hover .info p::after {
    translate: 0.4rem 0;
}

/* ---------- Formulaires (contact, connexion, admin) ---------- */
.input label {
    transition: color 0.3s ease, letter-spacing 0.3s ease;
}

.input:focus-within label {
    color: var(--brun);
    letter-spacing: 0.05em;
}

.input input:hover,
.input textarea:hover,
.input select:hover {
    border-color: var(--brun);
}

.input input:focus,
.input textarea:focus,
.input select:focus {
    outline: none;
    border-color: var(--brun);
    box-shadow: 0 0 0 4px rgba(220, 175, 149, 0.35);
}

/* ---------- Dashboard : la ligne survolée ressort ---------- */
.ligne {
    transition: background-color 0.3s ease, translate 0.3s ease;
}

.ligne:hover {
    background-color: rgba(220, 175, 149, 0.12);
    translate: 4px 0;
}

/* ---------- Footer ---------- */
footer div {
    transition: letter-spacing 0.4s ease;
}

footer:hover div {
    letter-spacing: 0.05em;
}


/* ==========================================================================
   PAGE PROJET (projet.php) - SURVOL
   ========================================================================== */

/* Images : se soulèvent, s'inclinent légèrement et affichent une loupe */
.mon-projet .projet {
    transition: translate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), rotate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.4s ease, border-color 0.4s ease;
}

.mon-projet .projet .image-projet {
    transition: scale 0.6s ease, filter 0.4s ease;
}

.mon-projet .projet:hover {
    translate: 0 -8px;
    border-color: var(--brun-clair);
    box-shadow: 0 24px 45px rgba(66, 42, 20, 0.25);
}

.mon-projet .projet.gauche:hover {
    rotate: -1.5deg;
}

.mon-projet .projet.droite:hover {
    rotate: 1.5deg;
}

.mon-projet .projet:hover .image-projet {
    transform: none;
    scale: 1.08;
    filter: brightness(0.85);
}

.mon-projet .projet a {
    display: block;
    height: 100%;
    position: relative;
    cursor: zoom-in;
}

/* loupe "+" au centre de l'image */
.mon-projet .projet a::after {
    content: "+";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--brun);
    font-family: "Montserrat", sans-serif;
    font-size: 2rem;
    font-weight: 500;
    text-shadow: none;
    translate: -50% -50%;
    scale: 0.4;
    opacity: 0;
    transition: scale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    pointer-events: none;
}

.mon-projet .projet:hover a::after {
    scale: 1;
    opacity: 1;
}

/* Sous-titre : soulignement qui s'étire au survol du texte */
.mon-projet .text h3 {
    position: relative;
    display: inline-block;
    padding-bottom: 0.3rem;
}

.mon-projet .text h3::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 3px;
    border-radius: 3px;
    background: var(--creme);
    transition: width 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.mon-projet .text:hover h3::after {
    width: 100%;
}

.mon-projet .text p {
    transition: color 0.3s ease;
}

.mon-projet .text:hover p {
    color: var(--brun-fonce);
}

/* Badge de catégorie : se remplit */
.categorie-badge {
    transition: background-color 0.3s ease, color 0.3s ease, translate 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.categorie-badge:hover {
    background-color: var(--brun-clair);
    color: white;
    translate: 0 -3px;
}

/* Vidéo */
.projet-video video {
    transition: scale 0.5s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.projet-video video:hover {
    scale: 1.02;
    border-color: var(--brun-clair);
    box-shadow: 0 24px 45px rgba(66, 42, 20, 0.25);
}

/* Bouton fermer de la lightbox : tourne */
.lightbox-btn-close {
    transition: rotate 0.4s ease;
}

.lightbox-btn-close:hover {
    rotate: 90deg;
}

/* ---------- Mouvement réduit : on garde les couleurs, pas les déplacements ---------- */
@media (prefers-reduced-motion: reduce) {
    nav ul a:hover li,
    h1:hover::before,
    h1:hover::after,
    .button a:hover,
    .button input:hover,
    .filtre a:hover,
    .button a:active,
    .button input:active,
    .filtre a:active,
    .nom .prenom:hover,
    .nom .famille:hover,
    .tout-projet .projet:hover .info p::after,
    .ligne:hover,
    .mon-projet .projet:hover,
    .categorie-badge:hover {
        translate: none;
    }

    .photo:hover .designer,
    .tout-projet .projet:hover .rectangle,
    .mon-projet .projet.gauche:hover,
    .mon-projet .projet.droite:hover,
    .lightbox-btn-close:hover {
        rotate: none;
    }

    .photo:hover .moi,
    .mon-projet .projet:hover .image-projet,
    .projet-video video:hover,
    .button a:active,
    .button input:active,
    .filtre a:active {
        scale: none;
    }
}


/* ==========================================================================
   ADMIN - CORRECTIFS FORMULAIRES (ajouter / editer)
   ========================================================================== */

/* Les 2 champs image prennent chacun la moitié de la largeur.
   Sans ça, l'aperçu de l'image 1 écrasait le champ "Image 2" (caché). */
.image-file > .input {
    flex: 1 1 0;
    min-width: 0;
}

/* Tous les champs fichier (images ET vidéo) ont le même bouton */
.input input[type="file"] {
    border: none !important;
    box-shadow: none !important;
    font-size: 0;
    color: transparent;
    width: 100%;
    padding: 0;
}

.input input[type="file"]::file-selector-button {
    background-color: var(--creme);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: "Montserrat", sans-serif;
    font-size: 0.8rem;
    margin-right: 0.8rem;
    transition: background-color 0.3s ease;
}

.input input[type="file"]::file-selector-button:hover {
    background-color: var(--brun-clair);
}

/* Champ "nouvelle catégorie" sous le menu déroulant */
.nouvelle-categorie {
    margin-top: 0.6rem;
}

/* Le filtre passe à la ligne s'il y a beaucoup de catégories */
.filtre {
    flex-wrap: wrap;
}

.filtre a {
    text-transform: lowercase;
}


/* ==========================================================================
   DASHBOARD - catégorie + lien vers la page du projet
   ========================================================================== */
.ligne a.titre-projet {
    color: var(--brun-fonce);
    text-decoration: none;
    transition: color 0.3s ease;
}

.ligne a.titre-projet .fleche {
    display: inline-block;
    opacity: 0;
    translate: -0.4rem 0;
    transition: opacity 0.3s ease, translate 0.3s ease;
}

.ligne a.titre-projet:hover {
    color: var(--brun-clair);
}

.ligne a.titre-projet:hover .fleche {
    opacity: 1;
    translate: 0 0;
}

.ligne .cat {
    display: inline-block;
    margin-bottom: 0.3rem;
    padding: 0.15rem 0.9rem;
    border: solid 2px var(--creme);
    border-radius: 50px;
    color: var(--brun-clair);
    font-family: "Montserrat Alternates", sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

/* Barre d'aperçu sur projet.php quand on est connectée */
.apercu-admin {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-family: "Montserrat Alternates", sans-serif;
    font-size: 0.85rem;

    span {
        margin-right: auto;
        padding: 0.3rem 1rem;
        border-radius: 50px;
        background-color: rgba(220, 175, 149, 0.25);
        color: var(--brun);
        font-weight: 500;
    }

    a {
        padding: 0.3rem 1rem;
        border: solid 2px var(--brun-clair);
        border-radius: 50px;
        color: var(--brun-clair);
        font-weight: 500;
    }

    a:hover {
        background-color: var(--brun-clair);
        color: white;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ligne a.titre-projet .fleche {
        translate: none;
    }
}


/* ==========================================================================
   A PROPOS - description du parcours en liste (une ligne de la BD = un tiret)
   ========================================================================== */
.group .parcours-liste {
    margin: 0.8rem 0;
    padding: 0;
}

.group .parcours-liste li {
    position: relative;
    margin-bottom: 0.4rem;
    padding-left: 1.1rem;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.group .parcours-liste li::before {
    content: "";
    position: absolute;
    left: 0.15rem;
    /* centré sur la 1re ligne de texte (line-height 1.5) */
    top: calc(0.75em - 0.2rem);
    width: 0.2rem;
    height: 0.2rem;
    border-radius: 50%;
    background-color: var(--creme);
    transition: background-color 0.3s ease, scale 0.3s ease;
}

.group:hover .parcours-liste li {
    color: var(--brun);
}

.group:hover .parcours-liste li::before {
    background-color: var(--brun-clair);
    scale: 1.2;
}


/* Mots en gras dans les descriptions (**mot** dans la base de données) */
p strong,
li strong {
    font-weight: 600;
}


/* ==========================================================================
   LIGHTBOX - photo plus grande + boutons fermer / précédent / suivant
   ========================================================================== */
.lightbox-container {
    /* au-dessus de la barre du haut (sticky sur GSM) */
    z-index: 3000;
    padding: 1rem;
}

.lightbox-image {
    display: block;
    max-width: min(92vw, 1500px);
    max-height: 88vh;
    max-height: 88dvh;
    width: auto;
    height: auto;
    border-radius: 0.8rem;
    border: solid 0.15rem white;
}

/* Boutons ronds blancs */
.lightbox-btn {
    position: absolute;
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: white;
    background-image: none !important;
    color: var(--brun);
    font-family: "Montserrat", sans-serif;
    font-size: 1.6rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease, rotate 0.4s ease, scale 0.2s ease;
    z-index: 1;
}

.lightbox-btn:hover {
    background-color: var(--creme);
    color: white;
}

.lightbox-btn:active {
    scale: 0.92;
}

.lightbox-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* le clic doit toucher le bouton lui-même, pas le symbole */
.lightbox-btn::before {
    pointer-events: none;
}

.lightbox-btn-close {
    top: -1.2rem;
    right: -1.2rem;
    cursor: pointer;
}

.lightbox-btn-close::before {
    content: "×";
    font-size: 2rem;
    margin-top: -0.15rem;
}

.lightbox-btn-previous,
.lightbox-btn-next {
    top: 50%;
    translate: 0 -50%;
}

.lightbox-btn-previous {
    left: -4rem;
}

.lightbox-btn-next {
    right: -4rem;
}

.lightbox-btn-previous::before {
    content: "‹";
    margin-top: -0.2rem;
}

.lightbox-btn-next::before {
    content: "›";
    margin-top: -0.2rem;
}

/* GSM / tablette : photo presque plein écran, flèches sous la photo */
@media (max-width: 900px) {
    .lightbox-container {
        padding: 0.5rem;
    }

    .lightbox-image {
        max-width: 96vw;
        /* place pour le bouton fermer au-dessus et les flèches en dessous */
        max-height: calc(100vh - 9rem);
        max-height: calc(100dvh - 9rem);
        border-radius: 0.6rem;
    }

    .lightbox-btn-close {
        top: -3.4rem;
        right: 0;
    }

    .lightbox-btn-previous,
    .lightbox-btn-next {
        top: calc(100% + 0.8rem);
        translate: none;
    }

    .lightbox-btn-previous {
        left: calc(50% - 3.4rem);
    }

    .lightbox-btn-next {
        right: calc(50% - 3.4rem);
    }
}


/* Contact : bouton Envoyer à la fin, sous le message */
.contact-form .envoyer-bouton {
    justify-content: flex-end;
    margin-top: 1rem;
}


/* ==========================================================================
   PAGE PROJET - description (retours à la ligne gardés) + galerie
   ========================================================================== */

/* Les retours à la ligne / lignes vides tapés dans la description s'affichent */
.mon-projet .text p.description {
    white-space: pre-line;
}

.projet-galerie {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 1.5rem;
    margin: 3rem 4rem;
}

.galerie-item {
    margin: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: solid 3px var(--brun);
    border-radius: 25px;
    transition: translate 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease, border-color 0.4s ease;

    a {
        display: block;
        height: 100%;
        position: relative;
        cursor: zoom-in;
    }

    img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: scale 0.6s ease, filter 0.4s ease;
    }

    /* loupe "+" au survol, comme les grandes images */
    a::after {
        content: "+";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 3rem;
        height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.9);
        color: var(--brun);
        font-family: "Montserrat", sans-serif;
        font-size: 1.8rem;
        font-weight: 500;
        translate: -50% -50%;
        scale: 0.4;
        opacity: 0;
        transition: scale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
        pointer-events: none;
    }
}

.galerie-item:hover {
    translate: 0 -6px;
    border-color: var(--brun-clair);
    box-shadow: 0 18px 35px rgba(66, 42, 20, 0.22);

    img {
        scale: 1.08;
        filter: brightness(0.85);
    }

    a::after {
        scale: 1;
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .projet-galerie {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        margin: 2rem 0;
    }

    .galerie-item {
        border-radius: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .galerie-item:hover {
        translate: none;

        img {
            scale: none;
        }
    }
}

/* ---------- Admin : galerie dans ajouter / editer ---------- */
.galerie-admin-grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
    gap: 0.6rem;
    margin: 0.5rem 0;
}

.galerie-admin-grille:empty {
    display: none;
}

.galerie-admin-item {
    position: relative;
    display: block;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--creme);
    cursor: pointer;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: filter 0.3s ease, opacity 0.3s ease;
    }

    input[type="checkbox"] {
        position: absolute;
        top: 0.3rem;
        right: 0.3rem;
        width: 1.1rem !important;
        height: 1.1rem;
        margin: 0;
        accent-color: var(--brun);
        cursor: pointer;
    }

    span {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 0.15rem;
        text-align: center;
        font-family: "Montserrat", sans-serif;
        font-size: 0.7rem;
        color: white;
        background: rgba(125, 67, 31, 0.75);
        opacity: 0;
        transition: opacity 0.3s ease;
    }
}

.galerie-admin-item:hover span {
    opacity: 1;
}

/* image cochée = sera retirée */
.galerie-admin-item:has(input:checked) {
    border-color: var(--brun);

    img {
        filter: grayscale(1);
        opacity: 0.45;
    }

    span {
        opacity: 1;
    }
}

/* aperçu des nouvelles images (pas encore enregistrées) */
.galerie-admin-item.nouvelle {
    border-style: dashed;
    cursor: default;
}


/* ==========================================================================
   PAGE PROJET - mise en page 50 / 50 : texte à gauche, photos à droite
   ========================================================================== */
.mon-projet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 4rem;
    align-items: start;
    margin: 0 2rem;
}

.mon-projet .text {
    min-width: 0;
}

/* texte aligné à gauche (plus de justifié) */
.mon-projet p,
.mon-projet .text p.description {
    text-align: left;
    padding-right: 0;
}

/* les 2 photos se partagent la moitié droite, légèrement décalées */
.projet-images {
    display: flex;
    gap: 1.5rem;
    min-width: 0;
}

.projet-images .projet {
    flex: 1 1 0;
    min-width: 0;
    margin: 0;
}

.mon-projet .projet-images .gauche {
    margin-bottom: 4rem;
}

.mon-projet .projet-images .droite {
    margin-top: 4rem;
}

/* une seule photo : elle prend toute la moitié droite */
.mon-projet.single-image .projet-images .gauche {
    margin: 0;
}

/* tablette : les photos l'une sous l'autre, toujours à droite du texte */
@media (max-width: 1100px) {
    .mon-projet {
        column-gap: 2.5rem;
        margin: 0;
    }

    .projet-images {
        flex-direction: column;
    }

    /* en colonne, la photo garde toute la largeur et sa hauteur (ratio 4/3) */
    .projet-images .projet {
        flex: none;
        width: 100%;
    }

    .mon-projet .projet-images .gauche,
    .mon-projet .projet-images .droite {
        margin: 0;
    }
}

/* GSM : texte puis photos, sur une seule colonne */
@media (max-width: 768px) {
    .mon-projet {
        grid-template-columns: 1fr;
        row-gap: 2rem;
    }
}


/* ==========================================================================
   PAGE PROJET - CARROUSEL DE LA GALERIE
   ========================================================================== */
.carousel {
    position: relative;
    margin: 3rem 2rem;
    padding: 0 3.5rem;
}

.carousel-piste {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    /* place pour l'effet de survol (la carte monte) et l'ombre */
    padding: 0.8rem 0.3rem 1.8rem;
    scrollbar-width: none;
    outline: none;
}

.carousel-piste::-webkit-scrollbar {
    display: none;
}

.carousel-piste:focus-visible {
    outline: 3px solid var(--creme);
    outline-offset: 4px;
    border-radius: 25px;
}

/* 3 images visibles sur ordi */
.carousel-slide {
    flex: 0 0 calc((100% - 2 * 1.5rem) / 3);
    scroll-snap-align: start;
}

.carousel-btn {
    position: absolute;
    top: calc(50% - 0.5rem);
    translate: 0 -50%;
    width: 2.8rem;
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 0.2rem;
    border: solid 2px var(--brun);
    border-radius: 50%;
    background: white;
    color: var(--brun);
    font-family: "Montserrat", sans-serif;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease, scale 0.2s ease;
}

.carousel-btn:hover:not(:disabled) {
    background-color: var(--brun);
    color: white;
}

.carousel-btn:active:not(:disabled) {
    scale: 0.92;
}

.carousel-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.carousel-prec {
    left: 0;
}

.carousel-suiv {
    right: 0;
}

.carousel-points {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.carousel-point {
    width: 0.6rem;
    height: 0.6rem;
    padding: 0;
    border: none;
    border-radius: 50px;
    background-color: var(--creme);
    opacity: 0.5;
    cursor: pointer;
    transition: width 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
}

.carousel-point.actif {
    width: 1.6rem;
    opacity: 1;
    background-color: var(--brun-clair);
}

/* pas assez d'images pour défiler : pas de flèches ni de points */
.carousel-statique .carousel-btn,
.carousel-statique .carousel-points {
    display: none;
}

/* tablette : 2 images visibles */
@media (max-width: 1100px) {
    .carousel {
        margin: 2.5rem 0;
    }

    .carousel-slide {
        flex-basis: calc((100% - 1.5rem) / 2);
    }
}

/* GSM : 1 image + un bout de la suivante, flèches par-dessus */
@media (max-width: 768px) {
    .carousel {
        margin: 2rem 0;
        padding: 0;
    }

    .carousel-piste {
        gap: 0.8rem;
    }

    .carousel-slide {
        flex-basis: 85%;
    }

    .carousel-btn {
        width: 2.3rem;
        height: 2.3rem;
        font-size: 1.5rem;
        background: rgba(255, 255, 255, 0.9);
    }

    .carousel-prec {
        left: 0.4rem;
    }

    .carousel-suiv {
        right: 0.4rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .carousel-piste {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   ADMIN - galerie : glisser-déposer + bouton supprimer
   ========================================================================== */
#galerie-existantes .galerie-admin-item {
    cursor: grab;
    transition: opacity 0.2s ease, scale 0.2s ease, border-color 0.3s ease;
}

#galerie-existantes .galerie-admin-item:active {
    cursor: grabbing;
}

.galerie-admin-item.en-deplacement {
    opacity: 0.35;
    scale: 0.95;
    border-style: dashed;
}

.galerie-admin-suppr {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 0.1rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--brun);
    font-family: "Montserrat", sans-serif;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.galerie-admin-suppr:hover {
    background: var(--brun);
    color: white;
}

/* "Sera supprimée" visible seulement quand l'image est marquée */
.galerie-admin-item .galerie-admin-etat {
    opacity: 0;
}

.galerie-admin-item:hover .galerie-admin-etat {
    opacity: 0;
}

.galerie-admin-item.a-supprimer .galerie-admin-etat {
    opacity: 1;
}


/* Liens dans les descriptions ([texte](https://...) ou adresse écrite) */
a.lien-texte {
    color: var(--brun-clair);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--creme);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    transition: color 0.3s ease, text-decoration-color 0.3s ease;
}

a.lien-texte:hover {
    color: var(--brun);
    text-decoration-color: var(--brun);
}


/* Admin galerie : petite étiquette sur les images pas encore enregistrées */
.galerie-admin-item .galerie-admin-badge {
    position: absolute;
    left: 0.25rem;
    top: 0.25rem;
    right: auto;
    bottom: auto;
    padding: 0.1rem 0.45rem;
    border-radius: 50px;
    background: var(--brun-clair);
    color: white;
    font-family: "Montserrat", sans-serif;
    font-size: 0.65rem;
    opacity: 1;
}

.galerie-admin-item.nouvelle {
    cursor: grab;
}
