/* CONCEPTION, CRÉATION, RÉALISATION : MATHIAS GRUNENWALD
    Code écrit manuellement ligne par ligne sous VS Code.
    © 2026 - contact@mathias-grunenwald.fr
    "Esthétique du Silence"
*/

/* ============================================================
   0. CONFIGURATION DE BASE & POLICES
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@200;400;700&display=swap');

html {
    scroll-behavior: smooth;
}

body {
    background-color: #000000;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* On change ces lignes : */
    justify-content: flex-start;
    /* Aligne en haut plutôt qu'au centre parfait */
    min-height: 100vh;
    /* Minimum la hauteur de l'écran, mais peut grandir */
    overflow-y: auto;
    /* Autorise le scroll vertical si besoin */
    overflow-x: hidden;
    /* Empêche le scroll horizontal parasite */
}

/* CORRECTIF : SUPPRESSION DES CARRÉS AU CLIC (CHROME & MOBILE) */
a,
button,
.grid-item,
.btn,
*:focus,
*:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   1. ANIMATIONS (TRANSITIONS CINÉMA)
   ============================================================ */
@keyframes apparitionCinema {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeInTexte {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes apparitionDouce {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInImage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   2. HEADER & NAVIGATION
   ============================================================ */
/* TIROIR 1 : RÉGLAGES POUR ORDINATEUR (PC) */
@media screen and (min-width: 769px) {
    header {
        text-align: center;
        width: 100%;
        margin-bottom: 20px !important;
        display: block !important;
        padding-top: 40px !important;
    }

    header::after {
        content: "";
        display: block;
        width: 60px;
        height: 1px;
        background-color: #333;
        margin: 20px auto 30px;
        /* C'est cette valeur (30px) qui doit faire tout le travail */
    }

    /* On neutralise tous les conteneurs pour qu'ils collent au header */
    .page-serie,
    .page-galerie,
    .atelier-hub,
    .journal-container,
    .about-container {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
}

h1 {
    font-weight: 200;
    font-size: 2.8em;
    letter-spacing: 15px;
    text-transform: uppercase;
    margin: 0;
    background: linear-gradient(to bottom, #ffffff 10%, #888888 50%, #333333 95%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1;
    filter: contrast(1.1);
}

h1 span {
    font-weight: 700;
    letter-spacing: 12px;
}

.menu {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 0;
}

.menu-burger {
    display: none;
    width: 30px;
    flex-direction: column;
    gap: 6px;
}

.btn {
    text-decoration: none;
    color: #666;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 10px 15px;
    transition: all 0.4s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn svg,
.btn i {
    width: 16px;
    height: 16px;
}

.btn:hover {
    color: #ffffff;
    transform: translateY(-2px);
}

/* ============================================================
   3. ACCUEIL (GALLERY & INTRO)
   ============================================================ */
.gallery {
    width: 90%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0 !important;
    /* On supprime la marge qui pousse vers le bas */
    padding-top: 0 !important;
    /* On supprime le rembourrage interne */
    margin-bottom: 40px;
}

.photo-star {
    width: auto;
    /* Laisse l'image garder ses proportions */
    max-height: 65vh;
    /* Elle prendra au max 65% de la hauteur de l'écran */
    max-width: 90%;
    /* Elle ne touchera pas les bords latéraux */
    margin: 0 auto;
    margin-top: 0 !important;
    display: block;
    border: 1px solid #222;
    border-radius: 15px;
    object-fit: contain;
    /* Important pour ne pas déformer */
    animation: apparitionCinema 2.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.intro-text p {
    margin-top: 25px;
    letter-spacing: 8px;
    text-transform: uppercase;
    font-size: 0.7em;
    animation: fadeInTexte 2s ease forwards;
    text-align: center;
    color: #888888;
    background: none;
    -webkit-text-fill-color: initial;
    opacity: 1;
}

/* ============================================================
   4. PAGE PHOTOGRAPHIE (GRILLE)
   ============================================================ */
.page-galerie {
    height: auto !important;
    overflow-y: auto !important;
    display: block !important;
    padding: 0 0 100px 0;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 90%;
    max-width: 1200px;
    /* On met 0 explicitement en haut : */
    margin: 0 auto 40px auto !important;
}

.grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #222;
    aspect-ratio: 3 / 2;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: #ffffff;
    outline: none !important;
}

.grid-item:first-child {
    margin-top: 0 !important;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0%) brightness(1);
    transition: all 0.6s ease;
}

@media (hover: hover) {
    .grid-item img {
        filter: grayscale(20%) brightness(0.9);
    }

    .grid-item:hover img {
        filter: grayscale(0%) brightness(1.1);
        transform: scale(1.05);
    }
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    box-sizing: border-box;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease-out;
}

.photo-caption h3 {
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 5px;
    color: #fff !important;
}

.photo-caption p {
    font-size: 0.7em;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #aaa;
    margin: 0;
}

.grid-item:hover {
    transform: translateY(-5px);
    border-color: #555;
}

.grid-item:hover .photo-caption {
    transform: translateY(0);
    opacity: 1;
}

/* ============================================================
   5. PAGE SÉRIE & VISIONNEUSE
   ============================================================ */
.page-serie {
    height: auto !important;
    overflow-y: auto !important;
    display: block !important;
    /* CORRECTION : On met 0 en haut pour coller au header */
    padding: 0 0 100px 0 !important;
}

.serie-viewer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    /* CORRECTION : On met 0 en haut pour que seul le trait gère l'espace */
    padding: 0 0 60px 0 !important;
    margin-top: 0 !important;
}

.photo-large {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    /* On s'assure qu'aucune marge parasite ne pousse l'image */
    padding-top: 0 !important;
    animation: apparitionDouce 1.2s forwards ease-out;
}

.photo-large img {
    width: auto;
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.9);
    animation: fadeInImage 1.2s ease-out;
}

.end-navigation {
    text-align: center;
    margin-top: 40px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.btn-large {
    text-decoration: none;
    color: #ffffff;
    border: 1px solid #333;
    padding: 15px 40px;
    text-transform: uppercase;
    letter-spacing: 5px;
    font-size: 0.8em;
    border-radius: 50px;
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.05);
}

.btn-large:hover {
    background: #fff;
    color: #000;
}

.back-to-top-text {
    text-decoration: none;
    color: #555;
    text-transform: uppercase;
    font-size: 0.6em;
    letter-spacing: 3px;
}

/* ============================================================
    6. JOURNAL & À PROPOS
   ============================================================ */

/* LE JOURNAL : STRUCTURE CÔTE À CÔTE (SIDE-BY-SIDE) */
.journal-container {
    max-width: 1200px;
    /* Plus large pour accueillir le sommaire */
    margin: 60px auto;
    padding: 0 40px;
    display: flex;
    /* Active le mode colonnes */
    gap: 60px;
    /* Espace entre sommaire et articles */
    align-items: flex-start;
}

.journal-nav {
    flex: 0 0 250px;
    position: sticky;
    top: 40px;
    /* On le remonte un peu (au lieu de 120px) pour gagner de la place */
    padding-right: 20px;
    border-right: 1px solid #1a1a1a;

    /* LIGNES CRUCIALES POUR LAPTOP : */
    max-height: calc(100vh - 60px);
    /* Il ne dépasse jamais l'écran */
    overflow-y: auto;
    /* Permet de scroller dans le menu si besoin */
    z-index: 100;
    /* Passe devant le contenu si collision */
}

/* LA COLONNE DES ARTICLES */
.journal-content {
    flex: 1;
    /* Prend le reste de la place */
    max-width: 800px;
}

/* LES ARTICLES INDIVIDUELS */
.journal-post {
    scroll-margin-top: 130px;
    /* Empêche le titre d'être caché par le header au clic */
    margin-bottom: 120px;
    /* Grand espace entre articles pour la respiration */
    border-left: 1px solid #222;
    padding-left: 30px;
}

.post-date {
    margin-top: 10px;
    font-size: 0.7em;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 15px;
}

.journal-post h2 {
    font-weight: 400;
    font-size: 1.8em;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: #fff;
}

.journal-post p,
.about-text p {
    line-height: 1.8;
    color: #ccc;
    font-size: 0.95em;
    font-weight: 200;
    margin-bottom: 25px;
}

.journal-post img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin-bottom: 40px;
    animation: fadeInImage 1.2s ease-out;
}

/* LA PAGE À PROPOS (Garde sa structure centrée classique) */
.about-container {
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
}

.about-content {
    display: flex;
    gap: 60px;
    align-items: center;
    animation: apparitionDouce 1.5s ease-out;
}

.about-image {
    flex: 1;
}

.about-image img {
    width: 100%;
    border-radius: 4px;
    filter: grayscale(100%);
    border: 1px solid #222;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.about-text {
    flex: 1;
}

.about-text h2 {
    font-weight: 200;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

/* ============================================================
    6.5 NAVIGATION INTERNE (SOMMAIRE)
   ============================================================ */
.journal-nav {
    margin-bottom: 80px;
    padding-bottom: 40px;
    border-bottom: 1px solid #1a1a1a;
    text-align: left;
}

.journal-nav h3 {
    font-size: 0.7em;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #444;
    margin-bottom: 25px;
}

.nav-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.nav-links a {
    text-decoration: none;
    color: #888;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.4s ease;
    display: block;
    padding: 5px 0;
}

.nav-links a:hover {
    color: #ffffff;
    padding-left: 8px;
}

/* LE SEUL BLOC NÉCESSAIRE POUR LE SCROLL DÉSORMAIS */
.journal-post {
    scroll-margin-top: 180px;
    /* Ajuste cette valeur si tu veux que le titre descende encore un peu */
    margin-bottom: 120px;
    border-left: 1px solid #222;
    padding-left: 30px;
}

/* ============================================================
   7. FORMULAIRE DE CONTACT
   ============================================================ */
.contact-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #222;
}

.contact-section h3 {
    font-size: 0.8em;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #666;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #222;
    border-radius: 4px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9em;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #555;
    background: rgba(255, 255, 255, 0.08);
}

.form-group textarea {
    resize: none;
}

/* ============================================================
   8. DÉCOR & FOOTER
   ============================================================ */
.glow-1 {
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    filter: blur(130px);
    opacity: 0.25;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 75%);
    width: 900px;
    height: 900px;
    top: -350px;
    left: -350px;
}

.side-decor {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    /* Centrage vertical parfait */

    /* LA MAGIE : On écrit verticalement au lieu de pivoter */
    writing-mode: vertical-rl;
    text-orientation: mixed;

    color: #555;
    font-size: 0.65em;
    letter-spacing: 6px;
    text-transform: uppercase;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
}

.site-footer {
    width: 100%;
    padding: 60px 0 40px 0;
    margin-top: 50px;
    background-color: #000;
    text-align: center;
    z-index: 5;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-content p {
    font-size: 0.6em;
    letter-spacing: 4px;
    color: #444;
    text-transform: uppercase;
    margin: 0;
    transition: color 0.3s ease;
}

.footer-content p:hover {
    color: #fff;
}

.footer-line {
    width: 30px;
    height: 1px;
    background-color: #222;
}

.footer-tagline {
    font-weight: 200 !important;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #888888 !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    opacity: 1 !important;
}

.footer-tagline:hover {
    color: #ffffff !important;
}

/* ============================================================
    8.5 BOUTON REMONTER (PASTILLE BLANCHE)
   ============================================================ */
.floating-up {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 42px;
    height: 42px;
    background-color: #ffffff;
    color: #000000 !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 22px;
    font-weight: bold;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.floating-up:hover {
    transform: translateY(-5px);
    background-color: #dddddd;
}

/* ============================================================
   9. ADAPTATION MOBILE (PORTRAIT)
   ============================================================ */
@media screen and (max-width: 768px) {

    /* On force TOUS les conteneurs de page à ne pas avoir de padding propre */
    .page-serie,
    .page-galerie,
    .about-container,
    .journal-container {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .side-decor {
        display: none !important;
    }

    .gallery {
        display: block !important;
        width: 95% !important;
        margin: 0 auto !important;
    }

    .photo-star {
        width: 100% !important;
        height: auto !important;
        object-fit: cover;
    }

    body {
        height: auto !important;
        min-height: 100vh !important;
        overflow-y: auto !important;
        display: block !important;
        padding-top: 120px !important;
    }

    header {
        text-align: center;
        width: 100%;
        margin-bottom: 20px !important;
        display: block !important;
        /* Ajoute cette ligne pour forcer l'air au-dessus du titre sur TOUTES les pages */
        padding-top: 70px !important;
    }

    h1 {
        /* ON GARDE LA TAILLE D'ORIGINE POUR LA COHÉRENCE */
        font-size: 1.5em !important;
        letter-spacing: 7px !important;
        margin: 0 auto !important;
        padding: 0 50px !important;
        /* ON AJOUTE 50px DE VIDE À GAUCHE ET À DROITE */
        line-height: 1.2;
        text-align: center !important;

        /* ON FORCE LE TITRE À RESTER AU CENTRE */
        width: 100% !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    header::after {
        content: "";
        /* N'oublie pas le content, sinon elle n'apparaît pas ! */
        display: block !important;
        width: 40px !important;
        height: 1px !important;
        background-color: #333 !important;

        /* RÉGLAGE FINAL : */
        /* 15px (haut) | auto (centrage) | 40px (bas pour repousser la date) */
        margin: 15px auto 50px !important;
    }

    .menu-burger {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        position: fixed !important;
        top: 15px !important;
        right: 15px !important;
        width: 45px !important;
        height: 45px !important;
        z-index: 4000 !important;
        background: rgba(0, 0, 0, 0.8) !important;
        border: 1px solid #333;
        border-radius: 5px;
    }

    .menu-burger span {
        display: block !important;
        width: 25px !important;
        height: 2px !important;
        background-color: #ffffff !important;
        margin: 3px 0 !important;
        transition: all 0.3s ease;
    }

    .menu {
        display: none !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: #000000 !important;

        /* INTERDIRE LE SCROLL DANS LE MENU */
        overflow: hidden !important;

        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;

        /* ON RÉDUIT L'ESPACE POUR QUE ÇA TIENNE SANS SCROLLER */
        gap: 20px !important;

        z-index: 5000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* On s'assure que les liens sont compacts */
    .menu .btn {
        margin: 0 !important;
        padding: 10px 0 !important;
        font-size: 0.9em !important;
        /* Un poil plus petit pour la sécurité */
    }

    .menu.active {
        display: flex !important;
    }
}

/* ============================================================
   10. MOBILE PAYSAGE (LANDSCAPE) - VERSION FINALE SANS CASSE
   ============================================================ */
@media screen and (max-height: 500px) and (orientation: landscape),
screen and (max-width: 932px) and (orientation: landscape) {

    /* --- 1. STRUCTURE GLOBALE --- */
    body {
        display: flex !important;
        /* On garde le flex pour le centrage Index */
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }

    /* --- 2. HAUTEURS DIFFÉRENCIÉES --- */
    /* Accueil : On reste très haut */
    body.page-accueil {
        padding-top: 45px !important;
    }

    body.page-accueil header {
        padding-top: 15px !important;
    }

    /* Autres pages : On descend sous le burger */
    body:not(.page-accueil) {
        padding-top: 40px !important;
    }

    body:not(.page-accueil) header {
        padding-top: 15px !important;
    }

    /* --- 3. FIX PHOTO INDEX (ARRONDI & CENTRAGE) --- */
    body.page-accueil .photo-star {
        border-radius: 15px !important;
        /* Ton arrondi est revenu */
        max-height: 65vh !important;
        width: auto !important;
        margin: 0 auto !important;
        /* Centrage parfait */
        display: block !important;
        object-fit: contain !important;
    }

    /* --- 4. HEADER & BARRE --- */
    header {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 10px !important;
    }

    header::after {
        content: "" !important;
        display: block !important;
        width: 40px !important;
        height: 1px !important;
        background-color: #444 !important;
        margin: 10px auto 15px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    h1 {
        font-size: 1.1em !important;
        letter-spacing: 5px !important;
    }

    /* --- 5. BURGER & MENU --- */
    .menu {
        display: none !important;
    }

    .menu-burger {
        display: flex !important;
        position: fixed !important;
        top: 15px !important;
        right: 15px !important;
        width: 45px !important;
        height: 45px !important;
        z-index: 9999 !important;
        background: rgba(0, 0, 0, 0.8) !important;
        border: 1px solid #333 !important;
        border-radius: 5px !important;
    }

    /* --- RÉAFFICHAGE DES TRAITS DU BURGER --- */
    .menu-burger span {
        display: block !important;
        width: 25px !important;
        height: 2px !important;
        background-color: #ffffff !important;
        margin: 3px auto !important;
        transition: all 0.3s ease;
    }

    .menu.active {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: #000 !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 9998 !important;
    }

    .side-decor {
        display: none !important;
    }
}

/* ============================================================
   11. CORRECTIF ANTI-DÉFORMATION (VITAL)
   ============================================================ */
img {
    height: auto !important;
    max-width: 100%;
}

.photo-star {
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
}

.grid-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.photo-large img {
    width: auto !important;
    height: auto !important;
    max-height: 85vh !important;
    object-fit: contain;
}

/* .photo-star {
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
}
*/

/* ============================================================
   12. NETTOYAGE JOURNAL SUR MOBILE
   ============================================================ */
@media screen and (max-width: 768px) {

    /* On cache complètement le sommaire */
    .journal-nav {
        display: none !important;
    }

    /* On annule le mode "côte à côte" pour que les articles respirent */
    .journal-container {
        display: block !important;
        padding: 0 20px !important;
        margin-top: 20px;
    }

    /* L'article prend toute la largeur disponible */
    .journal-post {
        border-left: none !important;
        padding-left: 0 !important;
        margin-bottom: 60px !important;
    }
}