/* ==========================================================================
   STYLES SPÉCIFIQUES - CAS D'ÉTUDE PROJET (project-detail.css)
   ========================================================================== */

body {
    background-color: #000000;
    color: #E0E0E0;
    font-family: 'Newsreader', serif;
    overflow-x: hidden;
}

/* ---- Images en niveaux de gris jusqu'au survol ---- */
.grayscale-hover {
    filter: grayscale(100%);
    transition: filter 0.6s ease;
}

/* Souris : couleur au survol. Écran tactile : pas de survol (il resterait « collé » après un toucher), voir .is-touched. */
@media (hover: hover) {
    .grayscale-hover:hover,
    .slider-container:hover .grayscale-hover {
        filter: grayscale(0%);
    }
}

/* Écran tactile : pas de survol, l'image passe en couleur quand on la touche (classe posée par js/project-detail.js) */
.grayscale-hover.is-touched,
.is-touched .grayscale-hover {
    filter: grayscale(0%);
}

/* ---- Conteneur principal ---- */
.main-content {
    width: 100%;
    min-height: 100vh;
    padding-top: 4rem;
}

@media (min-width: 768px) {
    .main-content { padding-top: 6rem; }
}

/* ---- Bouton retour ---- */
.back-btn-wrap {
    padding: 1rem 1.5rem;
}

@media (min-width: 768px) {
    .back-btn-wrap {
        padding: 2rem 120px;
    }
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #8C8C8C;
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-btn:hover { color: #E0E0E0; }

.back-icon { font-size: 14px; }

.back-label {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---- Hero du projet ---- */
.project-hero {
    width: 100%;
    padding: 1.5rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (min-width: 768px) {
    .project-hero {
        padding: 4rem 120px 3rem;
    }
}

.project-hero-title {
    font-family: 'Instrument Serif', serif;
    color: #E0E0E0;
    font-size: 40px;
    line-height: 1;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    font-weight: 300;
}

@media (min-width: 480px) {
    .project-hero-title { font-size: 52px; }
}

@media (min-width: 768px) {
    .project-hero-title { 
        font-size: 96px;
        margin-bottom: 3rem;
    }
}

@media (min-width: 1024px) {
    .project-hero-title { font-size: 120px; }
}

/* ---- Grille de métadonnées ---- */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 0.75rem;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8C8C8C;
    border-top: 1px solid #222222;
    padding-top: 1.25rem;
    max-width: 56rem;
    width: 100%;
}

@media (min-width: 380px) {
    .meta-grid {
        grid-template-columns: repeat(3, 1fr);
        font-size: 12px;
        letter-spacing: 0.08em;
        padding-top: 1.5rem;
    }
}

@media (min-width: 768px) {
    .meta-grid {
        font-size: 12px;
        letter-spacing: 0.1em;
        gap: 6rem;
        padding-top: 2rem;
    }
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
}

.meta-item--left { align-items: flex-start; }
.meta-item--center { align-items: flex-start; }
.meta-item--right { align-items: flex-start; }

@media (min-width: 768px) {
    .meta-item { gap: 0.5rem; }
    .meta-item--center { align-items: center; text-align: center; }
    .meta-item--right { align-items: flex-end; text-align: right; }
}

.meta-label { color: #7A7A7A; }
.meta-value { color: #E0E0E0; }

/* ---- Description globale du projet ---- */
.project-desc-section {
    width: 100%;
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .project-desc-section { margin-bottom: 4rem; }
}

.project-desc-inner {
    max-width: 65ch;
    width: 100%;
}

.project-desc-text {
    font-family: 'Newsreader', serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.6;
    color: #C0C0C0;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .project-desc-text { font-size: 20px; }
}

/* ---- Image plein format ---- */
.project-cover {
    width: 100%;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .project-cover { margin-bottom: 4rem; }
}

.project-cover-inner {
    width: 100%;
    height: 320px;
    position: relative;
    overflow: hidden;
    background-color: #111111;
}

@media (min-width: 580px) {
    .project-cover-inner { height: 480px; }
}

@media (min-width: 768px) {
    .project-cover-inner { height: 614px; }
}

@media (min-width: 1024px) {
    .project-cover-inner { height: 819px; }
}

.project-cover-img {
    width: 100%;
    height: 130%;
    position: absolute;
    top: -15%;
    left: 0;
    object-fit: cover;
    will-change: transform;
}

/* ---- Section de détails textuels ---- */
.project-detail-section {
    width: 100%;
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .project-detail-section { margin-bottom: 4rem; }
}

.project-detail-title {
    font-family: 'Instrument Serif', serif;
    font-size: 36px;
    color: #E0E0E0;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

/* ---- Section slider ---- */
.slider-section {
    width: 100%;
    padding: 0 1.5rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .slider-section { padding: 0; }
}

.slider-wrap {
    width: 100%;
    position: relative;
}

@media (min-width: 768px) {
    .slider-wrap {
        width: 70vw;
        margin-left: 20vw;
    }
}

.slider-container {
    position: relative;
    height: 280px;
    overflow: hidden;
    background-color: #111111;
    border: 1px solid #222222;
}

@media (min-width: 580px) {
    .slider-container { height: 420px; }
}

@media (min-width: 768px) {
    .slider-container { height: 512px; }
}

@media (min-width: 1024px) {
    .slider-container { height: 716px; }
}

.slider-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-out;
}

.slide {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    position: relative;
}

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

/* ---- Boutons du slider ---- */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.75);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.slider-btn .material-symbols-outlined {
    font-size: 18px;
}

/* Mobile : flèches plus discrètes, dans les coins bas de l'image (le sujet reste dégagé) */
@media (max-width: 767px) {
    .slider-btn {
        top: auto;
        bottom: 0.75rem;
        transform: none;
        width: 44px;
        height: 44px;
    }

    /* Les deux flèches regroupées en bas à droite */
    .slider-btn.slider-btn--prev { left: auto; right: calc(0.75rem + 44px - 1px); }
}

.slider-btn:hover {
    background-color: #ffffff;
    color: #000000;
}

.slider-btn--prev { left: 0.75rem; }
.slider-btn--next { right: 0.75rem; }

@media (min-width: 768px) {
    .slider-btn--prev { left: 1.5rem; }
    .slider-btn--next { right: 1.5rem; }
}

/* ---- Métadonnées du slider ---- */
.slider-meta {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #8C8C8C;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---- Lien vers le projet suivant ---- */
.next-project {
    width: 100%;
    border-top: 1px solid #222222;
    margin-top: 4rem;
    padding: 3rem 1.5rem 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.5s ease;
}

.next-project:hover { background-color: rgba(17, 17, 17, 0.5); }

.next-project-label {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: #8C8C8C;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    display: block;
    transition: color 0.3s ease;
}

.next-project:hover .next-project-label { color: #E0E0E0; }

.next-project-title {
    font-family: 'Instrument Serif', serif;
    color: #8C8C8C;
    font-size: 48px;
    line-height: 1;
    font-weight: 300;
    text-decoration: none;
    transition: color 0.5s ease;
}

@media (min-width: 768px) { .next-project-title { font-size: 72px; } }
@media (min-width: 1024px) { .next-project-title { font-size: 96px; } }

.next-project:hover .next-project-title { color: #E0E0E0; }

/* ---- Bouton Visiter le site live ---- */
.visit-site-btn {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #000000;
    background-color: #ffffff;
    padding: 0.75rem 2.2rem;
    border: 1px solid #ffffff;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    border-radius: 1px;
    font-weight: bold;
}

.visit-site-btn:hover {
    background-color: transparent;
    color: #ffffff;
}

.visit-site-btn span {
    transition: transform 0.3s ease;
}

.visit-site-btn:hover span {
    transform: translate(3px, -3px);
}

/* ==========================================================================
   LECTEUR VIDÉO YOUTUBE (chargé au clic)
   Placé en bas de la fiche, à la place du diaporama, et centré (70vw sur grand écran).
   ========================================================================== */
.video-section {
    width: 100%;
    padding: 0 1.5rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .video-section { padding: 0; }
}

/* Lecteur centré, dans la même largeur que le diaporama (70vw) */
.video-wrap {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .video-wrap { width: 70vw; }
}

.video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000000;
    border: 1px solid #222222;
    overflow: hidden;
}

.video-frame iframe,
.video-play {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-play {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #000000;
    color: #FFFFFF;
    cursor: pointer;
}

/* Image fixe en noir et blanc, qui passe en couleur au survol (comme les autres images du site) */
.video-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.5s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.video-play:hover .video-thumb,
.video-play:focus-visible .video-thumb {
    filter: grayscale(0%);
    transform: scale(1.02);
}

.video-play-btn {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #FFFFFF;
    background-color: rgba(0, 0, 0, 0.55);
    border: 1px solid #FFFFFF;
    padding: 1rem 1.75rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.video-play:hover .video-play-btn,
.video-play:focus-visible .video-play-btn {
    background-color: #FFFFFF;
    color: #000000;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8C8C8C;
}

.video-meta a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

.video-meta a:hover { color: #FFFFFF; }

/* ==========================================================================
   MOBILE : en-tête éditorial aligné à gauche, titre plus présent,
   fiche technique en lignes (libellé à gauche, valeur à droite)
   ========================================================================== */
@media (max-width: 767px) {
    .project-hero {
        align-items: stretch;
        text-align: left;
        padding-top: 1rem;
    }

    .project-hero-title {
        font-size: clamp(48px, 15vw, 72px);
        line-height: 0.95;
        margin-bottom: 1.75rem;
    }

    .meta-grid {
        grid-template-columns: 1fr;
        gap: 0;
        padding-top: 0;
    }

    .meta-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: 1.5rem;
        padding: 0.9rem 0;
        border-bottom: 1px solid #1c1c1c;
    }

    .meta-value {
        text-align: right;
    }
}
