/* RESET ET BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: none;
    text-decoration: none;
}

html { scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; background-color: white; }

/* HEADER COMMUN */
header {
    width: 100%;
    min-height: 80px;
    max-height: 200px;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}
.lien-logo { display: inline-flex; align-items: center; flex-shrink: 0; }
#header-logo {
    display: block;
    width: 150px;
    height: auto;
    max-width: 55vw;
    max-height: none;
    object-fit: contain;
    opacity: 1;
    visibility: visible;
}
#buttons-header { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.header-button {
    background-color: #493cff;
    color: white;
    border-radius: 10px;
    padding: 8px 15px;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.header-button:hover { background-color: #9B94FF; color: white; }

/* NAVIGATION CATÉGORIES */
.catégories {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0;
    padding: 120px 30px 30px;
    background-color: white;
}
.catégories button {
    background-color: #493CFF;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    padding: 12px 18px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, padding 0.3s ease, font-size 0.3s ease;
}
.catégories button:hover { background-color: #9B94FF; }
.catégories button.actif {
    background-color: #9B94FF;
    color: white;
    padding-top: 22px;
    padding-bottom: 22px;
    font-size: 25px;
}

/* CONTENU PRINCIPAL */
main { padding: 40px 5%; background-color: white; }

/* GRILLE DES PROJETS */
.categorie-projets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    column-gap: 50px;
    row-gap: 80px;
    margin-bottom: 100px;
}
.categorie-projets:last-child { margin-bottom: 0; }

   /* CARTES PROJETS */
.projet {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 25px;
    width: 100%;
    min-width: 0;
    margin-bottom: 0;
    border: 1px solid #8f8f8f;
    border-radius: 12px;
    padding: 25px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.projet:hover { border-color: #493CFF; box-shadow: 0 6px 20px rgba(73, 60, 255, 0.12); cursor: pointer; }
.projet img {
    display: block;
    width: 45%;
    height: auto;
    max-height: 550px;
    object-fit: contain;
    flex-shrink: 0;
}
.projet-texte { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.projet-texte h2 {
    font-size: clamp(20px, 2vw, 32px);
    font-weight: 600;
    line-height: 1.2;
    color: #493CFF;
    margin-bottom: 15px;
    overflow-wrap: anywhere;
}
.projet-texte p { font-size: clamp(13px, 1vw, 16px); line-height: 1.6; color: #333333; }
.projet:nth-child(even) { flex-direction: row-reverse; }
.projet:nth-child(even) .projet-texte { text-align: right; }

/* TABLETTE : 2 COLONNES, IMAGES AU-DESSUS */
@media screen and (max-width: 900px) {
    .header-button { font-size: smaller; }
    .catégories button { font-size: 15px; padding: 10px 12px; }
    .catégories button.actif { font-size: 18px; padding: 10px 12px; }
    .categorie-projets {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 30px;
        row-gap: 60px;
        margin-bottom: 80px;
    }
    .projet, .projet:nth-child(even) { flex-direction: column; align-items: stretch; gap: 20px; }
    .projet img { width: 100%; height: 220px; max-height: none; object-fit: contain; }
    .projet-texte { width: 100%; min-width: 0; }
    .projet-texte h2 { font-size: 22px; line-height: 1.3; margin-bottom: 12px; }
    .projet-texte p { font-size: 14px; line-height: 1.6; }
}

/* TÉLÉPHONE : 1 COLONNE */
@media screen and (max-width: 600px) {
    header { padding: 15px 20px; }
    #header-logo { width: 120px; max-width: 55vw; }
    main { padding: 30px 5%; }
    .categorie-projets { grid-template-columns: minmax(0, 1fr); row-gap: 50px; margin-bottom: 60px; }
    .projet, .projet:nth-child(even) { flex-direction: column; align-items: stretch; gap: 20px; }
    .projet { padding: 15px; border-radius: 8px; }
    .projet:nth-child(even) .projet-texte { text-align: left; }
    .projet img {
        width: 100%;
        height: 280px;
        max-height: none;
        object-fit: contain;
        object-position: left center;
        align-self: flex-start;
    }
    .projet-texte { width: 100%; }
    .projet-texte h2 { font-size: 24px; line-height: 1.3; margin-bottom: 12px; }
    .projet-texte p { font-size: 15px; line-height: 1.6; }
}

/* FOOTER COMMUN : MÊMES TAILLES SUR LES DEUX PAGES */
footer {
    background-color: #9B94FF;
    display: flex;
    flex-direction: column;
    padding: 50px;
    font-size: 16px;
}
.footer-content {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 25px;
    font-size: 16px;
}
.case { padding-left: 30px; }
.footer-category { font-size: 1rem; color: white; padding-bottom: 15px; }
.categorie { color: white; font-size: 1rem; }
.categorie:hover { color: #483CFF; }
.social-media { display: flex; flex-direction: row; align-items: flex-start; gap: 5px; }
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}
.social-icon:hover { color: #483CFF; }
.social-icon svg { display: block; width: 30px; height: 30px; fill: currentColor; }
.email, .telephone { color: white; font-size: 1rem; transition: color 0.3s ease; }
.email:hover, .telephone:hover { color: #483CFF; }
.footer-credits { text-align: center; padding-top: 100px; font-size: 0.75rem; color: white; }
#contact:target { animation: footer-bleu 2s ease-in-out; }
@keyframes footer-bleu {
    1%, 49% { background-color: #9B94FF; }
    50%, 99% { background-color: #483CFF; }
    100% { background-color: #9B94FF; }
}

/* FOOTER TABLETTE */
@media (max-width: 800px) {
    .footer-content, .footer-content a, .footer-content p, .footer-content h5,
    .footer-category, .categorie, .email, .telephone { font-size: 0.8rem; }
    .footer-credits { font-size: 0.6rem; }
}
/* FOOTER TÉLÉPHONE */
@media (max-width: 600px) {
    footer { padding: 30px 20px; }
    .footer-content { flex-direction: column; flex-wrap: wrap; gap: 30px; }
    .case { padding-left: 0; }
    .footer-credits { padding-top: 60px; }
}

/* =========================================
   RESPONSIVE TÉLÉPHONE — HEADER ET FOOTER
   ========================================= */

@media screen and (max-width: 600px) {

    /* BASE */

    html, body {
        width: 100%;
        max-width: 100%;
    }

    body {
        overflow-x: hidden;
    }

    /* HEADER */

    header {
        width: 100%;
        min-height: 75px;
        max-height: none;
        padding: 12px 15px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
    }

    /* LOGO */

    .lien-logo {
        display: flex;
        align-items: center;
        flex-shrink: 1;
        min-width: 0;
    }

    #header-logo {
        display: block;
        width: 105px;
        max-width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
    }

    /* BOUTONS DU HEADER */

    #buttons-header {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 6px;
        flex-shrink: 0;
    }

    .header-button {
        display: inline-block;
        padding: 6px 10px;
        font-size: 11px;
        line-height: 1.3;
        border-radius: 8px;
        text-align: center;
        white-space: nowrap;
    }

    /* FOOTER */

    footer {
        width: 100%;
        padding: 35px 20px 25px;
        display: flex;
        flex-direction: column;
    }

    .footer-content {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        flex-wrap: nowrap;
        gap: 30px;
        width: 100%;
    }

    /* BLOCS DU FOOTER */

    .case {
        padding-left: 0;
        width: 100%;
        min-width: 0;
    }

    .footer-category {
        font-size: 14px;
        line-height: 1.5;
        padding-bottom: 10px;
    }

    .categorie,
    .email,
    .telephone {
        font-size: 13px;
        line-height: 1.7;
        overflow-wrap: anywhere;
    }

    /* RÉSEAUX SOCIAUX */

    .social-media {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 20px;
    }

    .social-icon svg {
        display: block;
        width: 28px;
        height: 28px;
    }

    /* CRÉDITS */

    .footer-credits {
        width: 100%;
        padding-top: 45px;
        text-align: center;
        font-size: 11px;
        line-height: 1.6;
    }

    .footer-credits p {
        font-size: inherit;
    }
}

/* TÉLÉPHONES TRÈS ÉTROITS */

@media screen and (max-width: 360px) {

    header {
        padding: 10px;
        gap: 6px;
    }

    #header-logo {
        width: 85px;
    }

    .header-button {
        padding: 5px 8px;
        font-size: 10px;
    }

    footer {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* =====================================
   PAGE PROJETS — FORMAT TÉLÉPHONE
   ===================================== */

@media screen and (max-width: 600px) {

    /* GRILLE : UNE SEULE COLONNE */

    .categorie-projets {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        gap: 20px;
    }

    /* LIEN QUI ENTOURE CHAQUE CARTE */

    .lien-projet {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        align-self: start;
    }

    /* RECTANGLE DU PROJET */

    .projet,
    .lien-projet .projet {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
        overflow: hidden;
    }

    /* IMAGE */

    .projet img {
        display: block;
        width: 100%;
        height: auto;
        max-height: none;
        aspect-ratio: auto;
        object-fit: contain;
        object-position: left center;
        flex-shrink: 0;
    }

    /* TEXTE */

    .projet-texte {
        position: static;
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 15px;
        text-align: left;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    /* MÊME DISPOSITION POUR LES CARTES PAIRES */

    .lien-projet:nth-child(even) .projet,
    .projet:nth-child(even) {
        flex-direction: column;
    }

    .lien-projet:nth-child(even) .projet-texte {
        text-align: left;
    }
}

/* =====================================
   NAVIGATION CATÉGORIES — TÉLÉPHONE
   ===================================== */

@media screen and (max-width: 600px) {

    /* CONTENEUR DES CATÉGORIES */

    .catégories {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;

        width: 100%;
        height: auto;
        min-height: 0;

        padding: 15px;
    }

    /* BOUTONS DES CATÉGORIES */

    .catégories button {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 44px;

        padding: 10px 15px;

        font-family: 'Poppins', sans-serif;
        font-size: 13px;
        line-height: 1.4;
        text-align: center;

        white-space: normal;
        overflow-wrap: break-word;

        border-radius: 10px;
        cursor: pointer;
    }
}

/* NAVIGATION CATÉGORIES — ESPACE SOUS LE HEADER */

@media screen and (max-width: 600px) {

    .catégories {
        margin-top: 100px;
        scroll-margin-top: 100px;
    }}

    /* TITRES DES PROJETS — TRÈS PETITS TÉLÉPHONES */

@media screen and (max-width: 360px) {

    .projet-texte h2 {
        font-size: 20px;
        line-height: 1.3;
    }

}