/* ============================================================
   VARIABLES GLOBALES
   Modifiez ces valeurs pour personnaliser l'apparence du site
   ============================================================ */
:root {
    /* Couleurs principales */
    --couleur-titres: black;                        /* Titres de la page et du projet choisi */
    --couleur-titres-cartes: white;                 /* Titre affiché sur les vignettes */
    --couleur-texte-principal: white;               /* Textes principaux */
    --couleur-texte-secondaire: white;              /* Textes secondaires */
    --couleur-ombre: rgba(197, 0, 0, 0.6);

    /* Fonds */
    --fond-page: white;                             /* Fond général de la page */
    --fond-footer: lightgray;                       /* Fond du bas de page */
    --fond-icones-et-dates: lightgray;              /* Fond des badges de date et icônes */

    /* Bordures */
    --couleur-bordures: black;                      /* Couleur de tous les contours */

    /* Ligne de séparation décorative */
    --couleur-separateurs: #c50000;
}


/* ============================================================
   RESET & BASE
   Normalisation des marges, paddings et box-model
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}


/* ============================================================
   MISE EN PAGE GÉNÉRALE (html, body)
   Structure en grille verticale : header / main / footer
   ============================================================ */
html {
    height: 100%;
}

body {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    font-family: sans-serif;
    font-size: clamp(14px, 1.2vw, 22px);
    letter-spacing: 1px;
    overflow-x: hidden;
    background-color: var(--fond-page);
}


/* ============================================================
   HEADER
   En-tête centré avec séparateur décoratif
   ============================================================ */
header {
    grid-row: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

header hr {
    display: block;
    width: 25%;
    height: 1px;
    border: 2px solid var(--couleur-separateurs);
    border-radius: 55px;
    background-color: var(--couleur-separateurs);
    margin: 0 auto 30px;
}

#page-title {
    font-size: clamp(60px, 5vw, 70px);
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    padding: 25px;
    color: var(--couleur-titres);
}


/* ============================================================
   MAIN
   Conteneur principal (grille ligne 2)
   ============================================================ */
main {
    grid-row: 2;
    width: 100%;
    height: 100%;
    overflow: hidden;
}


/* ============================================================
   GRILLE DE PROJETS (#my-projects)
   Affichage flex en grille de cartes
   ============================================================ */
#my-projects {
    width: 90%;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 30px;
}


/* ============================================================
   CARTES DE PROJET (.project__article)
   Tuiles cliquables avec image, titre et icône
   ============================================================ */
.project__article {
    flex-shrink: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 350px;
    height: 350px;
    text-align: center;
    overflow: hidden;
    border: 2px solid var(--couleur-bordures);
    border-radius: 5px;
    box-shadow: 2px 2px 2px 2px var(--couleur-ombre);
    transition: all 0.3s ease-in-out;
}

.project__article:hover {
    transform: scale(1.05) rotate(2deg);
    cursor: pointer;
    box-shadow:
        0 0 10px 5px var(--couleur-ombre),
        0 0 10px 10px var(--couleur-ombre);
}

.project__article:hover .project__title {
    transform: rotate(-5deg);
}

.project__article:hover .project__icon {
    transform: rotate(15deg);
}

/* Titre affiché par-dessus l'image de la carte */
.project__title {
    position: absolute;
    z-index: 2;
    font-size: 1.5em;
    color: var(--couleur-titres-cartes);
    text-shadow:
        2px 0 black, -2px 0 black,
        0 2px black, 0 -2px black,
        1px 1px black, -1px -1px black,
        1px -1px black, -1px 1px black;
    transition: all 0.5s ease-in-out;
}

/* Vignette de la carte */
.project__thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(60%);
}

.youtube-thumbnail {
    transform: scale(1.55);
    object-position: center;
}

.youtube-short-thumbnail {
    width: 330%;
    height: 330%;
    object-fit: cover;
    object-position: center top;
}

/* Icône en bas à droite de la carte */
.project__icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: clamp(30px, 3vw, 50px);
    height: clamp(30px, 3vw, 50px);
    border: 2px solid var(--couleur-bordures);
    border-radius: 50%;
    padding: 20px;
    background-color: var(--fond-icones-et-dates);
    transition: all 0.5s ease-in-out;
}

/* Badge de date (partagé entre carte et projet choisi) */
.project__date,
#specificProject__date {
    position: absolute;
    z-index: 999;
    background-color: var(--fond-icones-et-dates);
    border-radius: 7px;
    border: 2px solid var(--couleur-bordures);
    font-family: 'Courier New', Courier, monospace;
    font-weight: 600;
}

.project__date {
    padding: 3px;
    left: 15px;
    bottom: 15px;
}


/* ============================================================
   PROJET CHOISI (#specificProject)
   Fenêtre centrée affichant le détail d'un projet
   ============================================================ */
#overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

#overlay.active {
    display: block;
}

#specificProject {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    width: 80vw;
    height: 85vh;
    padding: 20px;
    background-color: var(--fond-page);
    border: 2px solid var(--couleur-bordures);
    border-radius: 15px;
    box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.5);
    display: none;
    animation: fade-out 0.5s forwards;
}

#specificProject.active {
    display: grid;
    grid-template-columns: 50% 50%;
    grid-template-rows: auto 1fr;
    gap: 10px;
    animation: fade-in 0.5s forwards;
}

/* Titre du projet choisi avec décoration */
#specificProject__title {
    position: relative;
    grid-column: 1 / -1;
    width: fit-content;
    margin: 20px auto 0;
    font-size: clamp(30px, 5vw, 50px);
    font-family: "Playfair Display";
    color: var(--couleur-titres);
    text-align: center;
}

#specificProject__title::before {
    content: '';
    display: block;
    height: 4px;
    width: 75px;
    background-color: var(--couleur-separateurs);
    margin-bottom: 8px;
}

#specificProject__title::after {
    content: '';
    display: block;
    height: 4px;
    width: 75px;
    background-color: var(--couleur-separateurs);
    margin-top: 8px;
    margin-left: auto;
}

/* Colonne gauche : média */
#specificProject__media-container {
    grid-column: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 10px;
    width: 100%;
}

#specificProject__media-container.youtube {
    border-radius: 10px;
    overflow: hidden;
}

.project__media {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Miniature carrée dans le projet choisi */
#specificProject__thumbnail {
    width: clamp(250px, 26vw, 700px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 2px solid var(--couleur-bordures);
    border-radius: 15px;
    padding: 5px;
    margin: auto;
}

/* Image pleine largeur dans le projet choisi */
#specificProject__image {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    border: 1px solid var(--couleur-bordures);
}

/* Iframes et vidéo (format paysage) */
#specificProject__iframe,
#specificProject__video {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 50vh;
    border: 1px solid var(--couleur-bordures);
    border-radius: 10px;
    transition: box-shadow 0.5s ease;
}

#specificProject__video.video-vertical {
    height: 60vh;
    width: auto;
    aspect-ratio: 9 / 16;
    max-height: unset;
}

/* Iframe format portrait (Shorts) */
#specificProject__iframe-short {
    height: 60vh;
    width: auto;
    aspect-ratio: 9 / 16;
    border: 1px solid var(--couleur-bordures);
    border-radius: 10px;
    transition: box-shadow 0.5s ease;
}

#specificProject__iframe:hover,
#specificProject__iframe-short:hover,
#specificProject__video:hover {
    box-shadow:
        0 0 10px 5px var(--couleur-ombre),
        0 0 10px 5px var(--couleur-ombre);
}

/* Lecteur audio */
#specificProject__audio {
    margin: 10px 0;
}

/* Colonne droite : informations textuelles */
#specificProject__info-container {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    padding: 30px;
    overflow-y: auto;
    max-height: 100%;
    align-self: start;
}

#specificProject__description {
    font-size: clamp(15px, 1.2vw, 40px);
}

#specificProject__credits {
    font-size: clamp(15px, 1.6vw, 80px);
    font-style: italic;
    padding: 10px;
}

#specificProject__credits a {
    outline: none;
    text-decoration: none;
    padding: 2px 1px 0;
}

/* Badge de date dans le projet choisi */
#specificProject__date {
    padding: 6px;
    right: 20px;
    bottom: 20px;
    cursor: default;
    transition: all 0.5s ease-in-out;
}

#specificProject__date:hover {
    transform: translateY(-5px);
}

/* Bouton de fermeture */
#specificProject__close-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    right: 10px;
    width: clamp(30px, 3vw, 50px);
    height: clamp(30px, 3vw, 50px);
    font-size: clamp(15px, 1.5vw, 40px);
    color: white;
    border: 2px solid var(--couleur-bordures);
    border-radius: 50%;
    background-color: red;
    transition: all 0.5s ease-in-out;
}

#specificProject__close-button:hover {
    transform: scale(1.1);
    cursor: pointer;
}


/* ============================================================
   LIEN LINKTREE (#linktree-link)
   Bouton flottant en bas de page
   ============================================================ */
#linktree-link {
    position: sticky;
    display: flex;
    align-items: center;
    bottom: 20px;
    left: 85%;
    gap: 8px;
    width: fit-content;
    padding: 12px 20px;
    background-color: var(--fond-page);
    border: 2px solid var(--couleur-bordures);
    border-radius: 25px;
    color: var(--couleur-titres);
    font-family: "Comic Sans MS", sans-serif;
    font-size: 1vw;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.4s, box-shadow 0.2s;
    z-index: 999;
    margin-top: 40px;
}

#linktree-link i {
    font-size: 1.8vw;
}

#linktree-link:hover {
    transform: scale(1.1);
    box-shadow: 5px 5px 12px rgba(0, 0, 0, 0.5);
    background-color: var(--fond-icones-et-dates);
}


/* ============================================================
   FOOTER
   Barre de pied de page centrée
   ============================================================ */
footer {
    grid-row: 3;
    display: flex;
    justify-content: center;
    padding: 15px;
    background-color: var(--fond-footer);
    border: 2px solid var(--couleur-bordures);
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}


/* ============================================================
   ANIMATIONS
   Effets d'entrée/sortie du projet choisi
   ============================================================ */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.7);
    }
}

@keyframes shimmer {
    0%   { box-shadow: 0 0 6px 2px rgba(197, 0, 0, 0.3); }
    50%  { box-shadow: 0 0 18px 6px rgba(197, 0, 0, 0.7); }
    100% { box-shadow: 0 0 6px 2px rgba(197, 0, 0, 0.3); }
}


/* ============================================================
   RESPONSIVE — MOBILE (≤ 728px)
   Passage en colonne unique, tailles réduites
   ============================================================ */
@media (max-width: 728px) {

    #my-projects {
        width: 100%;
        padding: 20px 10px 50px;
    }

    .project__article {
        width: 200px;
        height: 200px;
    }

    #specificProject {
        width: 95vw;
        min-height: 95%;
    }

    #specificProject.active {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto 1fr;
        gap: 15px;
        overflow-y: auto;
    }

    #specificProject__title {
        grid-column: 1;
        grid-row: 2;
        margin-top: 0;
    }

    #specificProject__title::before,
    #specificProject__title::after {
        width: 50%;
    }

    #specificProject__media-container {
        grid-column: 1;
        flex-direction: column;
        width: 95%;
        margin: 0 auto;
    }

    #specificProject__thumbnail {
        width: 100%;
    }

    #specificProject__iframe {
        width: 100%;
    }

    #specificProject__iframe-short {
        height: 75vh;
    }

    #specificProject__video.video-vertical {
        height: 75vh;
    }

    #specificProject__image {
        max-height: 80vh;
    }

    #specificProject__audio {
        width: 60vw;
        margin-bottom: 20px;
    }

    #specificProject__date {
        position: static;
        margin-top: auto;
        align-self: flex-end;
    }

    #specificProject__info-container {
        grid-column: 1;
        grid-row: 3;
        padding: 10px;
        gap: 5px;
        min-height: 150px;
        overflow: unset;
    }

    #linktree-link {
        position: sticky;
        left: 50%;
        transform: translateX(-50%);
        font-size: 4vw;
    }

    #linktree-link i {
        font-size: 4vw;
    }
}


/* ============================================================
   RESPONSIVE — GRAND ÉCRAN (≥ 1800px)
   Agrandissement des cartes, titres et boutons
   ============================================================ */
@media (min-width: 1800px) {

    .project__article {
        width: 450px;
        height: 450px;
    }

    #specificProject__title {
        font-size: 100px;
    }

    #specificProject__title::before,
    #specificProject__title::after {
        height: 8px;
        width: 150px;
    }

    #specificProject__info-container {
        font-size: 60px;
    }

    #specificProject__close-button {
        width: 100px;
        height: 100px;
        font-size: 50px;
    }
}