
/* --- BASE --- */

:root { --couleur-txt: #000000; }

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    width: 100%;
    height: 100%;
    font-family: 'Geist', sans-serif;
    background-color: #fafafa
}

section {
    width: 100%;
    height: 100vh;
}

p {
    font-size: 20px;
}

/* --- HERO --- */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    row-gap: 24px;
    position: relative;
}

#hero-titre {
    font-size: clamp(2rem, 1rem + 4vw, 5rem);
    font-weight: 400;
    line-height: 1.1;
    color: #212121;
    text-align: center;
    position: relative;
    padding-bottom: 24px;
    width: 75%;
    margin-left: auto;
    margin-right: auto;
}

#hero-scroll {
    font-size: clamp(1rem, 0.9019rem + 0.4984vw, 1.5rem);
    color: #212121;
    text-align: center;
    position: relative;
}

/* --- CARDS SCROLL GSAP --- */

.card.scroll {
    position: relative;
}

.img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(32rem, 13.9965rem + 54.2113vw, 56.25rem);
    aspect-ratio: 16 / 10;
    height: auto;
}

.img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- FILTRES --- */

#filtres {
    display: flex;
    flex-direction: row;
    column-gap: 12px;
    margin-bottom: 24px;
}

.filtre {
    font-family: 'Geist', sans-serif;
    font-size: 32px;
    font-weight: 400;
    width: fit-content;
    height: fit-content;
    border: 0;
    background-color: transparent;
    color: #00000080;
    line-height: 110%;
    transition: 0.3s ease;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.filtre:hover {
    color: #000000BF;
}

.filtre.actif {
    color: #212121;
    font-weight: 600;
}

/* --- LISTE PROJETS --- */

#projets {
    height: fit-content;
    padding: 30px;
    padding-top: 60px;
    margin-bottom: 100px;
    position: relative;
    z-index: 10;
    background-color: snow;
}

#projects {
    display: flex;
    flex-direction: row;
    gap: 32px;
    align-items: flex-start;
    overflow: hidden;
    height: fit-content;
}

#listing-projets {
    flex: 2;
    width: 100%;
    border-collapse: collapse;
    align-self: flex-start;
}

#listing-projets th,
#listing-projets td {
    text-align: left;
    padding: 16px 0;
    border-bottom: 1px solid var(--couleur-txt);
    position: relative;
    z-index: 1;
    transition: color 0.3s ease-in-out;
}

#listing-projets th:last-child,
#listing-projets td:last-child {
    text-align: right;
}

#listing-projets td:nth-child(2) {
    padding-left: 12px;
    width: 50%;
}

#listing-projets td:nth-child(3) {
    width: 30%;
}

#listing-projets td:nth-child(4) {
    width: 20%;
    padding-right: 12px;
}

#listing-projets tr {
    cursor: pointer;
}

#listing-projets td::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: var(--couleur-projet, var(--couleur-txt));
    transition: height 0.3s ease-in-out;
    z-index: -1;
}

#listing-projets tr:hover td::after,
#listing-projets tr.actif-ligne td::after {
    height: 100%;
}

#listing-projets tr:hover td,
#listing-projets tr.actif-ligne td {
    color: #fafafa;
}

.proj-tt {
    font-weight: 600;
    text-transform: uppercase;
}

/* --- MINIATURE PROJET --- */

#infos-img {
    flex: 1;
    position: relative;
    height: fit-content;
    align-self: flex-start;
    will-change: transform;
    transition: transform 0.15s ease-out;
}

.miniature-projet {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.miniature-projet.visible {
    opacity: 1;
}

/* --- LOADER --- */

#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
}

#loader-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #fafafa;
}

#loader-compteur {
    position: fixed;
    bottom: 24px;
    right: 24px;
    font-size: 100px;
    font-family: 'Geist', sans-serif;
    mix-blend-mode: difference;
    color: #fafafa;
    z-index: 100000;
    line-height: 1;
}

.td-img-mobile {
    display: none;
}

/* --- RESPONSIVE --- */

@media (max-width: 900px) {

    body {
        width: 100%;
        height: fit-content;
    }

    #filtres{
        display: block;
        width: 100%;
        height: fit-content;
    }

    .filtre{
        margin-bottom: 16px;
        margin-right: 9px;
    }

    .hero {
        height: 100vh;
        width: 100%;
    }

    section {
        width: 100%;
        height: 100vh;
    }

    .img {
        max-width: 80vw;
    }

    .img img {
        max-width: 100%;
        height: 100%;
    }
}

@media (max-width: 900px) {

    body {
        width: 100%;
        height: fit-content;
    }

    .hero {
        height: 100vh;
        width: 100%;
    }

    section {
        width: 100%;
        height: 100vh;
    }

    .img {
        max-width: 80vw;
    }

    .img img {
        max-width: 100%;
        height: 100%;
    }

    /* --- TABLEAU → CARTES --- */

    #projects {
        flex-direction: column;
    }

    #infos-img {
        display: none;
    }

    #listing-projets,
    #listing-projets thead,
    #listing-projets tbody,
    #listing-projets tr,
    #listing-projets td {
        display: block;
        width: 100%;
    }

    #listing-projets thead {
        display: none;
    }

    #listing-projets tr {
        margin-bottom: 16px;
        border: 1px solid var(--couleur-txt);
        padding: 16px;
        position: relative;
        overflow: hidden;
        background-color: transparent;
    }

    #listing-projets td {
        border: none;
        padding: 4px 0;
        text-align: left;
        background-color: transparent;
    }

    #listing-projets td:hover {
        background-color: transparent;
    }

    #listing-projets td:nth-child(1),
    #listing-projets td:nth-child(2),
    #listing-projets td:nth-child(3) {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
        text-align: left;
    }

    p{
        text-align: left;
    }

    #listing-projets td:nth-child(3) {
        text-align: left;
        color: #00000080;
        font-size: 14px;
    }


     .td-img-mobile {
        display: block;
        width: 100%;
        margin-bottom: 12px;
    }

    .td-img-mobile img {
        width: 100%;
        object-fit: cover;
        display: block;
    }


}