/*
Theme Name: Mon Portfolio Coverflow
Author: Moi
Version: 2.0
*/

/* RESET & BASES */
:root {
    --color-accent: #ffffff;
    --color-bg: #050505;
    --color-text: #ffffff;
    --color-text-muted: #cccbcb;
    --color-card-bg: #111111;
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    --font-size-base: 1.1rem;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-main);
    width: 100vw;
    /* On enlève le overflow:hidden global ici */
}

a {
    text-decoration: none;
    color: inherit;
}



/* --------------- HEADER --------------- */

/* 1. Empêche tout débordement horizontal */
* {
    box-sizing: border-box;
}

/* FIXED HEADER */
.site-header {
    position: fixed;
    top: 0px;
    left: 0em;
    right: 0em;
    width: auto;
    border: 1px solid rgba(229, 231, 235, 0.2);
    padding: 20px 40px;
    z-index: 9999;
    /* On augmente le z-index comme demandé */
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    /* Ajout esthétique souvent lié à ce genre de design flottant */
}

.site-header::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
    backdrop-filter: blur(12px);
    background-color: rgba(0, 0, 0, .3);
    border-radius: inherit;
    pointer-events: none;
}


.header-logo img {
    height: 60px;
    width: auto;
    display: block;
    pointer-events: auto;
    /* Rendre le logo cliquable */
}


.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
    pointer-events: auto;
    /* Rendre le menu cliquable */
}


.main-navigation ul li a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.main-navigation ul li a:hover {
    opacity: 1;
}

/* --------------- MENU DEROULANT (SUB-MENU) --------------- */
.submenu-toggle {
    display: none;
    /* Caché sur desktop, géré par survol */
}

.main-navigation ul li {
    position: relative;
}

.main-navigation ul ul.sub-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-width: 200px;
    padding: 10px 0;
    margin-top: 15px;
    /* Espace pour ne pas coller immédiatement */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10000;
}

/* Pont transparent pour éviter de perdre le survol */
.main-navigation ul ul.sub-menu::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
    background: transparent;
}

/* Affichage au survol du parent */
.main-navigation ul li:hover>ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.main-navigation ul ul.sub-menu li {
    width: 100%;
}

.main-navigation ul ul.sub-menu li a {
    display: block;
    padding: 10px 20px;
    font-size: 0.85rem;
    opacity: 1;
    color: var(--color-text-muted);
    text-align: center;
}

.main-navigation ul ul.sub-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

.burger-menu {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    pointer-events: auto;
    z-index: 10001;
    padding: 0;
}

/* --------------- SHARED STYLES --------------- */

/* Shared Section Title (Toile style / Global) */
.section-title,
.portfolio-section-title {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--color-accent, white);
}

.section-title i,
.portfolio-section-title i {
    color: var(--color-accent, white);
    /* Fallback to white */
}



/* --------------- PROFIL (page et section) --------------- */
.profil-pic {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    margin: 60px auto;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: block;
}

.hero-tagline {
    font-size: 1.4rem;
    color: var(--color-text-muted);
    max-width: 700px;
    margin: 0 auto 40px;
    font-weight: 300;
    text-align: center;
}

/* ===== TABLETTE PAYSAGE (≤ 1024px) ===== */
@media (max-width: 1024px) {

    .profil-pic {
        width: 250px;
        height: 250px;
    }

}

/* ===== TABLETTE PORTRAIT (≤ 768px) ===== */
@media (max-width: 768px) {

    .profil-pic {
        width: 200px;
        height: 200px;
        margin: 40px auto;
    }

    .hero-tagline {
        font-size: 1.2rem;
    }
}

/* ===== MOBILE (≤ 576px) ===== */
@media (max-width: 576px) {

    .profil-pic {
        width: 150px;
        height: 150px;
        margin: 30px auto;
    }

    .hero-tagline {
        font-size: 1.1rem;
        margin-bottom: 25px;
    }

}

/* --------------- FOOTER --------------- */
.site-footer {
    position: relative;
    z-index: 100;
    background-color: var(--color-card-bg);
    padding: 60px 40px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-accent, white);
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--color-accent, white);
}

/* Brand Column */
.footer-logo {
    display: inline-block;
    margin-bottom: 20px;
}

.site-icon-footer {
    height: 40px;
    width: auto;
    opacity: 0.9;
}

.footer-copyright {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Social & Back to Top */
.social-links {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1.2rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.custom-social-icon {
    width: 20px;
    height: 20px;
}

.social-links a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.back-to-top-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.back-to-top-btn:hover {
    background-color: white;
    color: black;
}

/* Reponsive Footer */
@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .site-footer {
        padding: 50px 20px 20px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .back-to-top-btn {
        margin: 0 auto;
    }
}

.typewriter-cursor {
    display: inline-block;
    width: 10px;
    height: 1em;
    background-color: white;
    margin-left: 5px;
    vertical-align: bottom;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* TYPEWRITER (Global) */
.typewriter-effect {
    white-space: pre-wrap;
    /* ou pre */
    border-right: 2px solid white;
    /* Le curseur */
    display: inline-block;
    padding-right: 5px;
    box-sizing: border-box;
    margin: 5px 0;
    font-family: 'Roboto Mono', monospace;
    /* Rappel du style tech */
}

/* --- TYPOGRAPHIE GLOBALE --- */
.typewriter-title {
    font-family: 'Roboto Mono', monospace;
    font-size: 3rem;
    color: white;
    /*height: 3rem;  Hauteur fixe parfois gênante si le titre passe sur 2 lignes */
    line-height: 1.2;

    /* Fix pour le curseur : on serre la boîte autour du texte */
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    display: block;
    /* Sécurité */
}

/* --------------- GALERIE PHOTOS --------------- */
.galerie-page {
    padding-top: 150px;
    padding-bottom: 80px;
    min-height: calc(100vh - 200px);
}

.galerie-page .container-width {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.galerie-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text-muted);
    padding: 8px 20px;
    border-radius: 50px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-btn:hover,
.filter-btn.active {
    background: white;
    color: black;
    border-color: white;
}

.galerie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.photo-item {
    display: none; /* Masqué par défaut, le JS s'occupe de l'afficher */
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.photo-item.show {
    opacity: 1;
    transform: scale(1);
}

.photo-inner {
    position: relative;
    width: 100%;
    padding-top: 100%; /* Ratio 1:1 (carré) */
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--color-card-bg);
}

.photo-inner img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-item:hover .photo-inner img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 50%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform: translateY(15px);
    transition: transform 0.4s ease;
}

.photo-item:hover .overlay-content {
    transform: translateY(0);
}

.photo-overlay h3 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
    font-family: var(--font-main);
}

.photo-date {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.no-photos {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--color-text-muted);
    padding: 40px;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .site-header {
        padding: 15px 20px;
    }

    .burger-menu {
        display: block;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(5, 5, 5, 0.4);
        backdrop-filter: blur(20px);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 25vh;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 10000;
        pointer-events: auto;
    }

    .main-navigation.is-active {
        opacity: 1;
        visibility: visible;
    }

    .main-navigation ul {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    /* Style du parent pour permettre le wrap avec le bouton flèche */
    .main-navigation ul li.menu-item-has-children {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        width: 100%;
    }

    .main-navigation ul li.menu-item-has-children>a {
        grid-column: 2;
        text-align: center;
        display: flex;
        align-items: center;
    }

    /* Bouton flèche mobile */
    .submenu-toggle {
        grid-column: 3;
        justify-self: start;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        color: white;
        font-size: 1.5rem;
        margin-left: 10px;
        padding: 0;
        cursor: pointer;
        transition: transform 0.3s ease;
    }

    /* Rotation de la flèche si ouvert */
    .main-navigation ul li.menu-item-has-children.is-open>.submenu-toggle {
        transform: rotate(180deg);
    }

    /* Sous-menu sur mobile */
    .main-navigation ul ul.sub-menu {
        grid-column: 1 / -1;
        position: static;
        transform: none !important;
        background-color: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        min-width: auto;
        width: 100%;
        margin: 0;
        display: flex;
        flex-direction: column;

        /* Accordion transition properties */
        max-height: 0;
        padding: 0;
        gap: 0;
        opacity: 0;
        visibility: hidden;
        overflow: hidden;
        transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease, gap 0.4s ease;
    }

    /* Affiché quand la classe is-open est présente (via JS) */
    .main-navigation ul li.menu-item-has-children.is-open>ul.sub-menu {
        max-height: 400px;
        opacity: 1;
        visibility: visible;
        padding: 10px 0 0 0;
        gap: 15px;
    }

    .main-navigation ul li:hover>ul.sub-menu {
        transform: none !important;
    }

    .main-navigation ul ul.sub-menu::before {
        display: none;
    }

    .main-navigation ul li a {
        font-size: 1.5rem;
    }

    .main-navigation ul ul.sub-menu li a {
        font-size: 1.1rem;
        padding: 5px 0;
    }

    .header-right ul {
        gap: 15px;
    }

    .typewriter-title {
        font-size: 2rem;
    }
}

body.no-scroll {
    overflow: hidden;
}