/* Style global */
body {
    font-family: Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #000; /* Fond noir */
    color: #fff; /* Texte blanc */
}

#vertical-name {
    font-size: 48px; /* Taille inchangée pour garder une bonne lisibilité */
    font-weight: bold;
    color: #04eeff;
    text-transform: uppercase;
    position: fixed; /* Fixe l'élément pour qu'il reste au même endroit */
    top: 0; /* Place le texte en haut de l'écran */
    left: 0; /* Collé au bord gauche */
    transform-origin: top left; /* Définit le point de rotation */
    transform: rotate(-90deg) translate(-100%, 0); /* Rotation verticale + translation */
    margin: 0;
    padding: 0;
    overflow: visible; /* Assure que rien ne soit coupé */
    text-decoration: none; /* Pas de soulignement */
    writing-mode: horizontal-tb; /* Forcer l'orientation horizontale avant rotation */
}

#vertical-name:hover {
    color: #ff04f2;
    cursor: pointer;
}

/* Adaptation responsive pour #vertical-name */
@media (max-width: 768px) {
    #vertical-name {
        font-size: 24px;
        top: 20px;
        left: 0;
        transform: rotate(-90deg) translate(-100%, 0);
        transform-origin: top left;
        overflow: visible;
        writing-mode: horizontal-tb;
    }

    main {
        margin-left: 70px; /* Ajuste la marge pour éviter le chevauchement */
    }
}

/* Mise en page principale */
main {
    margin-left: 80px;
}

@media (min-width: 769px) {
    main {
        margin-left: 7%;
    }
}

/* Liens généraux */
a {
    color: #04ff82;
    text-decoration: underline;
}

a:hover {
    color: #ff04f2;
}

/* Liens spécifiques à Selected Work */
nav ul li a {
    color: #fff; /* Couleur blanche par défaut */
    text-decoration: none;
}

nav ul li a:hover {
    color: #ff04f2; /* Couleur rose au survol */
}

/* Titre des œuvres d'art */
.art-title {
    font-size: 48px;
    font-weight: bold;
    color: #ffc404;
    margin-left: 7%;
}

/* Légende des œuvres d'art */
.art-caption {
    font-size: 16px;
    font-family: "Helvetica Thin", Arial, sans-serif;
    color: #fff;
    margin-left: 7%;
}

/* Lien "PRESS" */
.press-link {
    font-size: 16px;
    font-weight: bold;
    color: #ff04f2;
    text-decoration: none;
    margin-left: 7%;
    display: block;
}

.press-link:hover {
    text-decoration: underline;
}

/* Conteneur pour les vidéos */
.video-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

/* Description des œuvres d'art */
.art-description {
    font-family: "Helvetica Thin", Arial, sans-serif;
    margin: 0 auto;
    width: 900px;
    text-align: justify;
    color: #fff;
}

/* Description des œuvres d'art - Responsive */
@media (max-width: 900px) {
    .art-description {
        width: 90%;
        margin: 0 auto;
    }
}

/* Style général des sections */
footer {
    margin: 50px 7%;
    text-align: left;
}

/* Ligne de séparation */
hr {
    margin: 40px 0;
    border: 0;
    height: 1px;
    background-color: #fff;
    width: 100%;
}

/* Thème jour : détecté automatiquement via prefers-color-scheme */
@media (prefers-color-scheme: light) {
    body {
        background-color: #fff; /* Fond blanc */
        color: #000; /* Texte noir */
    }

    .art-caption,
    .art-description {
        color: #000; /* Texte noir dans le thème clair */
    }

    nav ul li a {
        color: #000; /* Titres des œuvres en noir */
    }

    hr {
        background-color: #000; /* Ligne noire */
    }
}

/* Galerie */
.gallery {
    margin: 50px 7%;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.05);
}

/* Overlay pour la fenêtre flottante */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

/* Fenêtre modale */
.modal {
    position: relative;
    width: 90%; /* Largeur ajustée */
    max-width: 800px; /* Taille maximale augmentée */
    max-height: 90%; /* Hauteur maximale augmentée */
    overflow: hidden; /* Cache tout contenu qui dépasse */
    background-color: #000; /* Fond noir */
    border-radius: 10px; /* Coins arrondis */
    padding: 0; /* Supprime le padding pour éviter les marges */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5); /* Ombre */
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal img {
    width: 100%; /* Prend toute la largeur de la modale */
    height: 100%; /* Prend toute la hauteur de la modale */
    max-width: 100%; /* Ne dépasse pas la largeur de la modale */
    max-height: 100%; /* Ne dépasse pas la hauteur de la modale */
    object-fit: cover; /* Remplit la modale sans laisser d'espace vide */
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* Bouton de fermeture */
.close-btn {
    position: absolute;
    top: 15px; /* Position ajustée */
    right: 15px;
    font-size: 24px;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001; /* Assure que la croix reste au-dessus de l'image */
}

.close-btn:hover {
    background-color: #ff04f2;
}

/* Flèches de navigation */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 30px;
    color: #fff;
    cursor: pointer;
    user-select: none;
}

.nav-btn:hover {
    color: #ff04f2;
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* Style pour le canvas Processing */
#processingCanvas {
    margin: 0 auto;
    display: block;
}

.video-container {
    text-align: center;
    margin: 2rem auto;
    max-width: 1920px;
}

@media (max-width: 768px) {
    .video-container {
        margin: 10px 0 !important; /* Réduit la marge verticale */
        width: 100vw; /* Prend toute la largeur de l'écran */
        margin-left: -7% !important; /* Compense la marge du main */
    }

    .video-container iframe {
        width: 100% !important;
        height: auto !important;
        min-height: 200px; /* Hauteur minimale pour les très petits écrans */
    }

    .art-description {
        margin-top: 15px !important; /* Réduit l'espace au-dessus de la description */
        padding: 0 7%; /* Alignement avec le titre */
    }

    .art-caption {
        margin: 10px 7% !important; /* Réduit l'espace autour de la légende */
    }
}

@media (max-width: 480px) {
    .video-container {
        margin-left: -10% !important; /* Ajustement supplémentaire pour très petits écrans */
    }

    .art-title {
        margin-left: 7%;
        margin-bottom: 10px; /* Espacement cohérent sous le titre */
    }
}

/* Ajoutez ces règles à la fin de votre fichier CSS */
.video-container.processing-container {
    max-width: 900px; /* Largeur maximale de l'image */
    width: 90%;
    margin: 2rem auto;
    position: relative;
}

#processingCanvas {
    width: 100% !important;
    height: auto !important;
    max-height: 80vh;
}

@media (max-width: 768px) {
    .video-container.processing-container {
        width: 100%;
        margin: 1rem 0;
    }

    #processingCanvas {
        max-height: 60vh;
    }
}
