/* =========================================
   STYLES DE BASE ET STRUCTURE GLOBALE
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

::selection {
    background-color: #e0e0e0;
    color: #111;
}

/* --- En-tête et Navigation --- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    background: linear-gradient(to bottom, #fdf8f5 30%, rgba(253, 248, 245, 0) 100%);
    border-bottom: none; 
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #111;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.logo-icon {
    width: 28px;
    height: 28px;
    stroke: #111;
    transition: transform 0.3s ease;
}

.logo a:hover {
    transform: scale(1.05);
}

.logo a:hover .logo-icon {
    transform: scale(1.1);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    position: relative;
    padding-bottom: 5px;
    display: inline-block;
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), color 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 50%;
    background-color: #111;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.main-nav a:hover, 
.main-nav a.active {
    color: #111 !important;
    text-shadow: 0.9px 0 0 currentColor; 
    transform: scale(1.15); 
}

.main-nav a:hover::after, 
.main-nav a.active::after {
    width: 100%;
}

/* =========================================
   PORTFOLIO ET GALERIE
========================================= */
.portfolio-section {
    padding: 2rem 5% 4rem;
    flex: 1;
}

.page-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Filtres --- */
.portfolio-filters {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.portfolio-filters li {
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    padding-bottom: 5px;
    border-bottom: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-filters li:hover,
.portfolio-filters li.active-filter {
    color: #111;
    font-weight: bold;
    border-bottom: 1px solid #111;
    transform: scale(1.1);
}

/* --- GRILLE PORTFOLIO --- */
.gallery-grid {
    column-count: 1; 
    column-gap: 1.5rem; 
}

@media (min-width: 600px) { .gallery-grid { column-count: 2; } }
@media (min-width: 900px) { .gallery-grid { column-count: 3; } }
@media (min-width: 1200px) { .gallery-grid { column-count: 4; } }

@keyframes apparaitreEnDouceur {
    from { opacity: 0; transform: scale(0.95) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    background-color: transparent;
    animation: apparaitreEnDouceur 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-grid:hover .gallery-item {
    opacity: 0.5; 
}

.gallery-grid .gallery-item:hover {
    opacity: 1; 
    z-index: 1;
}

.gallery-item img {
    width: 100%;
    height: auto; 
    display: block;
    transition: transform 0.4s ease;
    cursor: pointer;
}

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

/* --- Lightbox (Vue agrandie) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out; 
}

.modal.active { opacity: 1; }

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border: none;
    box-shadow: 0 0 40px rgba(0,0,0,0.9);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s ease;
}

.modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close-modal:hover { color: #bbb; }

.modal-caption {
    position: absolute;
    bottom: 25px; 
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.45); 
    font-weight: 300; 
    font-size: 1.05rem; 
    text-shadow: 0 1px 3px rgba(0,0,0,0.4); 
    letter-spacing: 1.5px; 
    text-align: center;
    max-width: 80%;
    z-index: 1005;
    font-style: italic;
    pointer-events: none;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    z-index: 1001;
    padding: 15px 20px;
    user-select: none;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 5px;
}

.nav-btn:hover {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
}

.prev-btn { left: 20px; }
.next-btn { right: 20px; }

@media (max-width: 600px) {
    .nav-btn { font-size: 35px; padding: 10px; }
    .prev-btn { left: 5px; }
    .next-btn { right: 5px; }
}

/* =========================================
   MODALE MOT DE PASSE
========================================= */
.password-container {
    max-width: 400px;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    background: #fff;
}

.password-container h3 {
    margin-bottom: 10px;
    font-weight: 400;
    letter-spacing: 1px;
}

.password-container p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 20px;
}

#gallery-password-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 1.1rem;
    outline: none;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-buttons button {
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-primary { background: #333; color: #fff; }
.btn-secondary { background: #eee; color: #333; }
.modal-buttons button:hover { opacity: 0.8; }

/* =========================================
   BOUTON RETOUR EN HAUT
========================================= */
.back-to-top {
    position: fixed;
    bottom: 40px; 
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(0, 0, 0, 0.4); 
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    visibility: hidden;
    z-index: 990;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: #000;
    transform: translate(-50%, -5px); 
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* =========================================
   ANIMATIONS D'APPARITION
========================================= */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.fade-in-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   FOOTER
========================================= */
.site-footer {
    background-color: #fcfcfc;
    border-top: 1px solid #eaeaea; 
    padding: 2.5rem 0;
    text-align: center;
    margin-top: auto; 
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-content p {
    margin: 0;
    color: #999;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.footer-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.footer-links a {
    color: #555;
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #111; 
}

/* =========================================
   MOBILE
========================================= */
@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        padding: 1.5rem 5%;
        text-align: center;
    }
    
    .logo {
        margin-bottom: 1.5rem;
    }
    
    .main-nav ul {
        flex-wrap: wrap; 
        justify-content: center;
        gap: 1rem 1.5rem; 
    }
    
    .portfolio-section {
        padding: 0.5rem 5% 2.5rem; 
    }

    .portfolio-filters {
        gap: 1rem 1.5rem; 
        margin-bottom: 1.5rem; 
    }

    .page-title {
        margin-bottom: 1.5rem; 
        font-size: 1.6rem;
    }
}