/* --- Variables et Reset --- */
:root {
    --primary-color: #ff0000;
    --background-color: #000;
    --text-color: #fff;
    --text-muted: #888;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Empêche le défilement horizontal causé par la 3D */
}

/* --- Header --- */
.site-header {
    text-align: center;
    padding: 20px;
    position: relative;
    border-bottom: 1px solid #222;
}

.site-title {
    color: var(--primary-color);
    font-size: clamp(2rem, 5vw, 3rem);
    cursor: pointer;
    transition: color 0.3s;
}

.site-title:hover {
    color: #ff4444;
}

/* --- Navigation --- */
.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px 0;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* --- Menu Hamburger (Mobile) --- */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.8rem;
    cursor: pointer;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
}

/* --- NOUVEAU: Carrousel 3D --- */
.carousel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    perspective: 1200px; /* La perspective est cruciale pour l'effet 3D */
    position: relative;
    padding: 40px 0;
}

.carousel {
    position: relative;
    width: 40vw; /* Largeur de la "scène" */
    height: 25vw; /* Hauteur de la "scène" */
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
    transform: translateZ(-30vw); /* On recule le carrousel pour le voir en entier */
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    display: flex;
    align-items: flex-end; /* Aligne le titre en bas */
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #333;
    transition: transform 0.5s, border-color 0.5s;
}

.carousel-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    z-index: 1;
}

.carousel-item h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    z-index: 2;
    padding: 20px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
    color: var(--text-color);
    transition: color 0.3s;
}

.carousel-item:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.carousel-item:hover h2 {
    color: var(--primary-color);
}

/* Positionnement de chaque item dans l'espace 3D */
/* 4 items = 360 / 4 = 90 degrés par item */
/* La valeur de translateZ détermine le rayon du carrousel */
.carousel-item:nth-child(1) { transform: rotateY(0deg) translateZ(30vw); }
.carousel-item:nth-child(2) { transform: rotateY(90deg) translateZ(30vw); }
.carousel-item:nth-child(3) { transform: rotateY(180deg) translateZ(30vw); }
.carousel-item:nth-child(4) { transform: rotateY(270deg) translateZ(30vw); }

/* Navigation du Carrousel */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.5);
    border: 1px solid #444;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.3s;
}

.carousel-nav:hover {
    background-color: var(--primary-color);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 20px;
}

.carousel-nav.next {
    right: 20px;
}


/* --- Galerie --- */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
    min-height: 50vh;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    background-color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img, .gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-icon {
    position: absolute;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    transition: opacity 0.3s;
}

.gallery-item:hover .play-icon {
    opacity: 0;
}

.audio-thumbnail {
    text-align: center;
    font-size: 1rem;
    padding: 10px;
    word-break: break-all;
}
.audio-thumbnail i {
    font-size: 3rem;
    margin-bottom: 10px;
}
.gallery-info {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
}

/* --- Indicateur de chargement --- */
.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #333;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 50px auto;
    grid-column: 1 / -1;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid #222;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: var(--primary-color);
}

/* --- Modales --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content-wrapper {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-content-wrapper img, .modal-content-wrapper video, .modal-content-wrapper audio {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    margin: auto;
}
#about-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    color: #ccc;
    background: #1a1a1a;
    padding: 20px;
    border-radius: 5px;
}

.modal-close {
    position: absolute;
    top: -25px;
    right: -10px;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}
.modal-close:hover {
    color: var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hamburger-btn {
        display: block;
    }

    .main-nav {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 250px;
        height: 100vh;
        background-color: #111;
        transform: translateX(-100%);
        transition: transform 0.4s ease-in-out;
        z-index: 1000;
        padding-top: 80px;
    }

    .main-nav.is-active {
        transform: translateX(0);
    }

    .main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }
    
    .main-nav a {
        display: block;
        width: 100%;
        padding: 15px 30px;
        border-bottom: none;
    }
    
    /* Responsive pour le carrousel */
    .carousel {
        width: 60vw;
        height: 40vw;
        transform: translateZ(-45vw);
    }
    .carousel-item:nth-child(1) { transform: rotateY(0deg) translateZ(45vw); }
    .carousel-item:nth-child(2) { transform: rotateY(90deg) translateZ(45vw); }
    .carousel-item:nth-child(3) { transform: rotateY(180deg) translateZ(45vw); }
    .carousel-item:nth-child(4) { transform: rotateY(270deg) translateZ(45vw); }

    .carousel-nav.prev { left: 5px; }
    .carousel-nav.next { right: 5px; }
}