/* ========================================= */
/* PAGE WORK : STRUCTURE & PROJETS           */
/* ========================================= */

/* HEADER EFFET */
.fixed-header,
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: auto !important;
  padding-top: 12px !important;
  padding-bottom: 7px !important;
  padding-left: var(--side) !important;
  padding-right: var(--side) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

/* COMPENSATION DU HEADER */
.page-work {
  padding-top: 70px;
  display: block !important; 
}

/* CONTENEUR PRINCIPAL */
.work-container {
  display: flex;
  flex-direction: column;
  gap: 40px; 
  padding: 20px var(--side);
  width: 100%;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* INTÉRIEUR D'UN PROJET */
.project-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.project-title {
  font-size: 15px;
  font-weight: 300;
  margin: 0;
}

.project-title strong {
  font-weight: 700;
  letter-spacing: -0.5px;
}

.project-more {
  font-size: 16px;
  color: #000;
  text-decoration: none;
  line-height: 1;
}

.project-more::after {
  display: none !important;
}

/* ========================================= */
/* GRILLE D'IMAGES PARFAITEMENT ALIGNÉE     */
/* ========================================= */

.project-gallery {
  display: grid;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* Colonnes à largeur égale (1fr) */
.project-gallery.cols-3 { grid-template-columns: repeat(3, 1fr); }
.project-gallery.cols-4 { grid-template-columns: repeat(4, 1fr); }
.project-gallery.cols-5 { grid-template-columns: repeat(5, 1fr); }

/* Remplissage strict sans restriction de hauteur */
.project-gallery img,
.project-gallery video {
  width: 100%;
  height: 100%;
  max-height: none !important;
  object-fit: cover;
  display: block;
}

/* HAUTEUR UNIFORME SUR TOUTES LES LIGNES */
.project-gallery img,
.project-gallery video {
  width: 100%;
  height: 280px; /* Même hauteur exacte pour Hibiki, Lipault, Sam Quealy, etc. */
  object-fit: cover; /* Cadrage parfait sans déformer */
  display: block;
}

/* ========================================= */
/* LAYOUT FORMATS LIBRES (FLEX)             */
/* ========================================= */

.project-gallery-fluid {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  width: 100%;
  min-width: 0; 
}

.project-gallery-fluid img,
.project-gallery-fluid video {
  height: 250px;
  flex: 1 1 auto;
  max-width: 100%;
  min-width: 0;
  object-fit: cover;
  display: block;
}

/* ========================================= */
/* LIGHTBOX                                  */
/* ========================================= */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: 85vw;
  max-height: 85vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 85vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: #fff;
  font-size: 36px;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  user-select: none;
  z-index: 1002;
  transition: opacity 0.2s ease;
}

.lightbox-close:hover { opacity: 0.6; }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 36px;
  padding: 20px;
  cursor: pointer;
  z-index: 1001;
  user-select: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  outline: none;
}

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

.lightbox-prev:hover {
  opacity: 0.6;
  transform: translateY(-50%) translateX(-3px);
}

.lightbox-next:hover {
  opacity: 0.6;
  transform: translateY(-50%) translateX(3px);
}

@media (max-width: 768px) {
  .lightbox-prev, .lightbox-next {
    font-size: 28px;
    padding: 10px;
  }
  .lightbox-prev { left: 5px; }
  .lightbox-next { right: 5px; }
}

/* ========================================= */
/* NAVIGATION                                */
/* ========================================= */

.main-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  position: relative;
  color: #000;
  text-decoration: none !important;
  line-height: 1;
}

.main-nav a::after,
.main-nav a.active::after,
a.nav-link::after {
  content: none !important;
  display: none !important;
}

.nav-indicator {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 1px;
  background-color: #000;
  width: 0;
  transform: translateX(0);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), 
              width 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease;
  pointer-events: none;
}

/* ========================================= */
/* RESPONSIVE MOBILE                         */
/* ========================================= */

@media (max-width: 900px) {
  .project-gallery,
  .project-gallery-fluid {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 12px;
  }

  .project-gallery img,
  .project-gallery video,
  .project-gallery-fluid img,
  .project-gallery-fluid video {
    flex: 0 0 85%;
    width: 85%;
    max-height: 60vh;
    object-fit: cover;
    scroll-snap-align: start;
    border-radius: 4px;
  }

  .project-gallery::-webkit-scrollbar,
  .project-gallery-fluid::-webkit-scrollbar {
    display: none;
  }
  .project-gallery,
  .project-gallery-fluid {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

/* ========================================= */
/* FOOTER & PROTECTION                       */
/* ========================================= */

footer { padding: 40px 0 60px 0; }

.footer-grid {
  display: grid;
  width: 100%;
  padding: 0 var(--side);
  gap: clamp(24px, 4vw, 64px);
  grid-template-columns: repeat(5, 1fr);
  justify-content: start;
}

@media (max-width: 1200px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }

.col h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: none;
}
.col p {
  margin: 4px 0;
  font-size: 14px;
}

header, .fixed-header, .site-header {
  border-bottom: none !important;
  box-shadow: none !important;
}

header::after, .fixed-header::after, .site-header::after {
  display: none !important;
}

.project-row, .project-header, .work-container {
  border-top: none !important;
}

img, video {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* OVERLAY CALÉ EXACTEMENT SOUS LE HEADER */
.legal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  color: #000000;
  z-index: 99; /* Se place sous le header (qui a un z-index supérieur) */
  display: flex;
  flex-direction: column;
  padding-top: 72px; /* Hauteur de ton header pour laisser dépasser logo et menu */
  box-sizing: border-box;
  
  /* Animation slide de bas en haut */
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.legal-overlay.active {
  transform: translateY(0);
}

.legal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px var(--side);
  border-bottom: 1px solid #eee;
}

.legal-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.legal-close {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #000;
}

.legal-container {
  flex: 1;
  overflow-y: auto;
  padding: 48px var(--side);
}

.legal-content {
  max-width: 800px;
}

.legal-content section {
  margin-bottom: 32px;
}

.legal-content h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.legal-content p, .legal-intro {
  font-size: 14px;
  line-height: 1.5;
  color: #222;
}