/* =========================================
   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; background-color: #fdf8f5; }
::selection { background-color: #e0e0e0; color: #111; }

.site-header { display: flex; justify-content: space-between; align-items: center; padding: 2rem 5%; background: transparent; }
.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 ease; }
.logo-icon { width: 28px; height: 28px; stroke: #111; transition: transform 0.3s ease; }
.logo a:hover { transform: scale(1.03); }
.logo a:hover .logo-icon { transform: scale(1.1); }

/* Navigation Principale */
.main-nav ul { list-style: none; display: flex; gap: 2.5rem; align-items: center; }
.main-nav a { text-decoration: none; color: #999; font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; transition: color 0.3s; padding-bottom: 4px; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: #555; }
.main-nav a.active { color: #111; border-bottom-color: #111; }

/* =========================================
   PORTFOLIO (FILTRES ET GRILLES)
========================================= */
.portfolio-section { padding: 0.5rem 5% 4rem; flex: 1; }

.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 Photos */
.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; } }

.gallery-item { break-inside: avoid; margin-bottom: 1.5rem; background-color: transparent; transition: opacity 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; border-radius: 8px; transition: transform 0.4s ease; cursor: pointer; }
.gallery-item:hover img { transform: scale(1.03); }

/* Grille Vidéos */
.video-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; max-width: 1200px; margin: 0 auto; }
@media(min-width: 850px) { .video-grid { grid-template-columns: 1fr 1fr; } }
.video-item { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.05); transition: transform 0.4s ease; }
.video-item:hover { transform: translateY(-5px); }
.video-item video { width: 100%; display: block; background: #000; }
.video-title { padding: 15px; text-align: center; font-weight: 600; color: #333; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; }

/* L'Animation fluide parfaite */
.fade-in-on-scroll { opacity: 0; transform: translateY(30px); 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); }

/* =========================================
   LIGHTBOX ET MODALES
========================================= */
.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; }

.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 Authentification */
.password-container { max-width: 400px; padding: 30px; text-align: center; border-radius: 16px; background: #fff; }
.password-container h3 { margin-bottom: 10px; font-weight: 600; letter-spacing: 1px; color: #111; font-size: 1.2rem; }
.password-container p { font-size: 0.9rem; color: #666; margin-bottom: 25px; line-height: 1.5; }

.auth-modal input { 
    width: 100%; padding: 14px 15px; margin-bottom: 25px; border: 1px solid #d1d5db; 
    border-radius: 8px; text-align: center; font-size: 1rem; outline: none; 
    box-sizing: border-box; -webkit-appearance: none; appearance: none;
    background-color: #f9fafb; color: #111; font-family: inherit; transition: all 0.3s ease;
}
.auth-modal input:focus { border-color: #111; background-color: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,0.05); }

.modal-buttons { display: flex; gap: 12px; justify-content: center; }
.modal-buttons button { padding: 14px 0; flex: 1; border: none; border-radius: 8px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: background 0.3s; }
.btn-primary { background: #111; color: #fff; }
.btn-primary:hover { background: #000; }
.btn-secondary { background: #eee; color: #333; }
.btn-secondary:hover { background: #e5e7eb; }

/* =========================================
   BOUTON RETOUR EN HAUT & FOOTER
========================================= */
.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; 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); }

.site-footer { background-color: transparent; padding: 2.5rem 0; text-align: center; margin-top: auto; }
.footer-content { max-width: 1200px; margin: 0 auto; }
.footer-content p { margin: 0; color: #999; font-size: 0.85rem; letter-spacing: 0.5px; }

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