/* ==========================================================================
   STYLES SPÉCIFIQUES - INDEX DES PROJETS (portfolio.css)
   ========================================================================== */

body {
    background-color: #000000;
    color: #E0E0E0;
    font-family: 'Newsreader', serif;
    /* Pas d'overflow sur le body : il casserait le position: sticky de la colonne de gauche
       (le débordement horizontal est déjà géré par overflow-x: clip dans main.css) */
}

/* ---- Conteneur principal ---- */
.main-content {
    flex-grow: 1;
    width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 80px;
    padding-bottom: 64px;
    position: relative;
}

@media (min-width: 768px) {
    .main-content {
        padding-left: 120px;
        padding-right: 120px;
        padding-top: 120px;
        padding-bottom: 96px;
    }
}

/* ---- Titre de la page ----
   Même famille que « Contact » et « Admin. » : grand titre,
   domaines en petites capitales ; sur ordinateur, sur une ligne au-dessus des deux colonnes. */
.portfolio-head {
    padding: 2.5rem 0 1.75rem;
    border-bottom: 1px solid #222222;
}

@media (min-width: 768px) {
    .portfolio-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 2rem;
        padding: 1rem 0 2rem;
    }
}

.portfolio-title {
    font-family: 'Instrument Serif', serif;
    font-size: clamp(56px, 18vw, 80px);
    line-height: 0.9;
    letter-spacing: -0.02em;
    font-weight: 300;
    color: #E0E0E0;
}

@media (min-width: 768px) {
    .portfolio-title { font-size: clamp(96px, 10vw, 160px); }
}

.portfolio-head-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.25rem;   /* mobile : pas de point orphelin en fin de ligne */
    margin-top: 1.25rem;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    line-height: 1.7;
    color: #8C8C8C;
}

@media (min-width: 768px) {
    .portfolio-head-meta {
        margin-top: 0;
        padding-bottom: 0.6rem;
        font-size: 12px;
        gap: 0;
    }

    .portfolio-head-meta span + span::before {
        content: "·";
        margin: 0 1rem;
    }
}

/* ---- Mise en page principale (deux colonnes) ---- */
.portfolio-layout {
    display: flex;
    flex-direction: column;
    min-height: 600px;
    margin-top: 0;
}

@media (min-width: 768px) {
    .portfolio-layout {
        flex-direction: row;
        margin-top: 3rem;
    }
}

/* ---- Colonne gauche (sidebar) ---- */
.portfolio-sidebar {
    display: none;
}

@media (min-width: 768px) {
    .portfolio-sidebar {
        display: block;
        width: 30%;
        padding-right: 2rem;
        flex-shrink: 0;
        position: sticky;
        top: 8rem;
        height: fit-content;
    }
}

.sidebar-label {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #8C8C8C;
    margin-bottom: 2rem;
}

.sidebar-desc {
    font-family: 'Newsreader', serif;
    font-size: 20px;
    font-style: italic;
    line-height: 1.75;
    font-weight: 300;
    color: #E0E0E0;
    margin-bottom: 2rem;
}

/* Conteneur d'image de prévisualisation dans la colonne gauche */
.hover-image-container {
    opacity: 0;
    transform: scale(0.95);
    filter: grayscale(100%);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
    pointer-events: none;
    width: 100%;
    height: 380px;
    background-color: #111111;
    border: 1px solid #222222;
    background-size: cover;
    background-position: center;
    display: none;
}

@media (min-width: 768px) {
    .hover-image-container {
        display: block;
    }
}

.project-item:hover .hover-image-container {
    opacity: 1;
    transform: scale(1);
}

/* ---- Image de chaque projet sur mobile ----
   Se déplie quand le projet passe au centre de l'écran (js/portfolio.js) et reste ouverte ensuite :
   rien ne se replie au-dessus de la lecture, donc la liste ne saute jamais.
   Seule l'image du projet au centre passe en couleur ; titres et infos gardent leur style habituel. */
.mobile-img {
    display: none;
}

@media (max-width: 767px) {
    #cursor-image { display: none; }

    .mobile-img {
        display: grid;
        grid-template-rows: 0fr;
        transition: grid-template-rows 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--open-delay, 0ms), margin-top 0.8s cubic-bezier(0.16, 1, 0.3, 1) var(--open-delay, 0ms);
    }

    .mobile-img-inner {
        min-height: 0;
        overflow: hidden;
    }

    .mobile-img img {
        display: block;
        width: 100%;
        aspect-ratio: 16 / 10;
        object-fit: cover;
        background-color: #111111;
        filter: grayscale(100%) brightness(0.55);
        transform: scale(1.06);
        transition: filter 0.6s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .project-item.is-open .mobile-img {
        grid-template-rows: 1fr;
        margin-top: 1.25rem;
    }

    .project-item.is-current .mobile-img img {
        filter: grayscale(0%) brightness(1);
        transform: scale(1);
    }
}

/* ---- Colonne droite : liste de projets ---- */
.project-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

@media (min-width: 768px) {
    .project-list {
        width: 70%;
    }
}

/* ---- Item de projet ---- */
.project-item {
    display: block;
    border-bottom: 1px solid #222222;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

@media (min-width: 768px) {
    .project-item {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

.project-item-row {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .project-item-row {
        flex-direction: row;
        align-items: baseline;
    }
}

.project-title {
    font-family: 'Instrument Serif', serif;
    color: #8C8C8C;
    font-size: 36px;
    line-height: 1;
    font-weight: 300;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

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

@media (min-width: 768px) {
    .project-title {
        font-size: 64px;
        margin-bottom: 0;
    }
}

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

.project-item:hover .project-title {
    color: #FFFFFF;
}

.project-category {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #8C8C8C;
    transition: color 0.3s ease;
}

.project-item:hover .project-category {
    color: #E0E0E0;
}

/* ---- Écrans tactiles : pas de survol, donc les titres sont lisibles en permanence ---- */
@media (hover: none), (max-width: 767px) {
    .project-title { color: #B8B8B8; }
    .project-category { color: #8C8C8C; }
}
