/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
}

/* scroll-behavior piloté par JS (assets/smooth-scroll.js) */
html { overflow-x: hidden; }

/* ============ SCROLLBAR NATIVE : masquée ============ */
html { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }

/* ============ SCROLLBAR CUSTOM ============ */
.c-scrollbar {
  position: fixed;
  right: 18px;
  top: 12vh;
  height: 76vh;
  width: 1px;
  background: rgba(10,10,10,0.1);
  z-index: 50;
  cursor: pointer;
}

.c-scrollbar__thumb {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  background: var(--black);
  cursor: grab;
  transition: width 0.2s ease, background 0.2s ease;
}

.c-scrollbar__thumb:hover,
.c-scrollbar__thumb.dragging { width: 5px; cursor: grabbing; }

.c-scrollbar:hover .c-scrollbar__thumb { background: #333; }

body.flow-mode .c-scrollbar { opacity: 0; pointer-events: none; }

body {
  font-family: var(--font-sans);
  color: var(--black);
  background: var(--white);
  padding-bottom: 40vh;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; color: transparent; font-size: 0; }

/* Texte visible uniquement par les lecteurs d'écran */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============ PAGE CONTENT ============ */
.page-content {
  position: relative;
  z-index: 1;
  background: var(--white);
}

/* ============ NAVIGATION ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 48px;
  background: transparent;
  transition: background 0.3s;
}

.nav__logo { text-decoration: none; display: flex; align-items: center; }
.nav__logo-img { height: 44px; width: auto; display: block; object-fit: contain; }

.nav__links { display: flex; gap: 40px; list-style: none; }

.nav__link {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--black);
  text-transform: capitalize;
  position: relative;
  padding-bottom: 2px;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--black);
  transition: width 0.3s ease;
}

.nav__link:hover::after { width: 100%; }

/* ============ VIEW TOGGLE ============ */
.view-toggle {
  position: fixed;
  top: 78px;
  right: 48px;
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 2px;
  background: #f0f0f0;
  border-radius: 8px;
  padding: 4px;
}

.view-toggle__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: #6f6f6f;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.view-toggle__btn.active {
  background: var(--white);
  color: var(--black);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ============ RETOUR GALERIES ============ */
/* Même verre dépoli que le bouton Flow/Grid, sur la même ligne, à gauche */
.gallery-back {
  position: fixed;
  top: 78px;
  left: 48px;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 40px;
  color: var(--black);
  text-decoration: none;
  background: rgba(255,255,255,0.6);
  -webkit-backdrop-filter: blur(6px) saturate(1.15);
  backdrop-filter: blur(6px) saturate(1.15);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 8px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.10);
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.gallery-back__arrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 22px;
  line-height: 1;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.gallery-back:hover .gallery-back__arrow { transform: translateX(-4px); }
/* S'efface avec le header pendant le scroll, comme le bouton Flow/Grid */
.gallery-back.nav--hidden {
  transform: translateY(-24px);
  opacity: 0;
  pointer-events: none;
}

/* ============ GALLERY ============ */
.gallery {
  padding-top: 138px;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 20px;
  row-gap: 50px;
  padding: 0 30px 30px;
}

.gallery__item {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #f4f4f4;
}

/* Perf : le navigateur ne calcule/peint que les vignettes proches du viewport.
   contain-intrinsic-size réserve la place des autres → scroll stable, pas de
   saccade. Désactivé en mode Flow (toutes les vignettes doivent être rendues). */
.gallery__grid:not(.flow) .gallery__item {
  content-visibility: auto;
  contain-intrinsic-size: auto 620px;
}

.gallery__item img {
  transition: transform 0.6s ease;
}

.gallery__item:hover img { transform: scale(1.04); }

/* Flow mode : scroll horizontal */
.gallery__grid.flow {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 16px;
  padding: 40px 30px;
  height: calc(100vh - 164px);
  scrollbar-width: none;
}

.gallery__grid.flow::-webkit-scrollbar { display: none; }

.gallery__grid.flow .gallery__item {
  flex: 0 0 auto;
  height: 72%;
  aspect-ratio: 2 / 3;
  width: auto;
  transform-origin: center center;
  will-change: transform;
}

.gallery__grid.flow .gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-width: none;
}

/* ============ FLOW MODE ============ */
html.flow-mode,
body.flow-mode {
  overflow: hidden;
  height: 100vh;
  overscroll-behavior: none;
  scroll-behavior: auto !important;
}
body.flow-mode { padding-bottom: 0; }
body.flow-mode .footer { display: none; }

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden; /* empêche le focus clavier quand fermée */
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition: opacity 0.3s ease; /* visibilité immédiate à l'ouverture */
}

.lightbox__img-wrap {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* La photo s'affiche entière, sans recadrage, quelle que soit son orientation */
.lightbox__img {
  max-height: 85vh;
  max-width: 90vw;
  width: auto;
  height: auto;
  display: block;
  background: #d0d0d0;
}

.lightbox__close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
  padding: 8px;
}

.lightbox__close:hover { opacity: 1; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 56px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  padding: 0 24px;
  line-height: 1;
  user-select: none;
}

.lightbox__nav:hover { opacity: 1; }
.lightbox__nav--prev { left: 0; }
.lightbox__nav--next { right: 0; }

.lightbox__counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.5);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.15em;
}

/* ============ FOOTER ============ */
.footer {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%; z-index: 0;
  background: #0f0f0f;
  overflow: hidden;
  color: var(--black);
  padding: 0 0 60px;
  display: flex;
  flex-direction: column;
  height: 40vh;
}

.footer__main {
  display: inline-block;
  align-self: flex-start;
  margin-right: -3.5vw;
}

.footer__logo {
  font-family: var(--font-serif);
  font-size: 11.5vw;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 0.82;
  margin: 0; padding: 0;
  color: var(--black);
  display: block;
  -webkit-font-smoothing: antialiased;
}

.footer__phone {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 300;
  letter-spacing: 0.28em;
  color: var(--black);
  text-align: right;
  margin-top: 4px;
  display: block;
  text-decoration: none;
}

.footer__bottom {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 48px 0;
}

.footer__socials { display: flex; gap: 36px; align-items: center; }

.footer__social-link {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: #888;
  text-transform: capitalize;
}

.footer__nav { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }

.footer__nav-link {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: var(--black);
  text-decoration: none;
  text-transform: uppercase;
  transition: opacity 0.2s;
}

/* --- Footer : fond photo noir & blanc --- */
.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url(../../assets/cat-mariages.jpg) center 30% / cover no-repeat;
  filter: grayscale(1) contrast(1.06) brightness(0.82);
  z-index: 0;
}
.footer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0.34) 0%, rgba(10,10,10,0.66) 55%, rgba(10,10,10,0.8) 100%);
  z-index: 0;
}
.footer__main,
.footer__bottom { position: relative; z-index: 1; }
.footer__logo { color: #fff; }
.footer__phone { color: rgba(255,255,255,0.9); }
.footer__nav-link { color: #fff; font-weight: 400; text-transform: capitalize; }
.footer__social-link { color: rgba(255,255,255,0.6); }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .nav { padding: 16px 24px; }
  .nav__links { gap: 20px; }
  .nav__link { font-size: 12px; }
  .view-toggle { top: 70px; right: 16px; }
  .gallery-back { top: 70px; left: 16px; width: 44px; height: 38px; }
  .gallery-back__arrow { font-size: 20px; }
  .gallery { padding-top: 116px; }
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 12px;
    row-gap: 24px;
    padding: 0 16px 24px;
  }
  .gallery__grid.flow { height: calc(100dvh - 116px); }
  .lightbox__img { max-height: 80vh; max-width: 92vw; }
  .lightbox__nav { padding: 0 8px; font-size: 40px; }
  .footer__main { padding-top: 24px; }
  .footer__bottom { flex-direction: column; align-items: center; text-align: center; gap: 20px; padding: 24px 24px 0; }
  .footer__phone { text-align: left; }
}


/* Nav compacte sur petit écran : logo au-dessus, liens en dessous */
@media (max-width: 480px) {
  .nav { flex-direction: column; gap: 10px; padding: 12px 16px; }
  .nav__logo-img { height: 36px; }
  .nav__links { gap: 14px; }
  .nav__link { font-size: 11px; letter-spacing: 0.04em; }
  .view-toggle { top: 70px; right: 16px; }
  .gallery-back { top: 70px; left: 16px; width: 44px; height: 38px; }
  .gallery { padding-top: 116px; }
  .gallery__grid.flow { height: calc(100dvh - 116px); }
}

/* ============ NAV LISIBLE PARTOUT — bandeau blanc, sans ombre ============ */
.nav,
.nav.scrolled {
  background: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: transparent;
  box-shadow: none;
}

.view-toggle {
  background: rgba(255,255,255,0.6);
  -webkit-backdrop-filter: blur(6px) saturate(1.15);
  backdrop-filter: blur(6px) saturate(1.15);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 2px 14px rgba(0,0,0,0.10);
}

/* ============ HEADER ESCAMOTABLE — caché pendant le scroll, revient à l'arrêt ============ */
.nav {
  transition: transform 0.35s ease, opacity 0.35s ease, background 0.3s;
}
.nav--hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Le bouton Flow/Grid s'efface avec le header pendant le scroll */
.view-toggle {
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.view-toggle.nav--hidden {
  transform: translateY(-24px);
  opacity: 0;
  pointer-events: none;
}

/* ============ CTA CONTACT + REMONTER EN HAUT ============ */
/* Même verre dépoli que le bouton Flow/Grid ; ils suivent le header :
   cachés pendant le scroll, ils réapparaissent à l'arrêt. */
.gallery-cta,
.gallery-top {
  position: fixed;
  bottom: 28px;
  z-index: 99;
  background: rgba(255,255,255,0.6);
  -webkit-backdrop-filter: blur(6px) saturate(1.15);
  backdrop-filter: blur(6px) saturate(1.15);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 2px 14px rgba(0,0,0,0.10);
  color: var(--black);
  transition: transform 0.35s ease, opacity 0.35s ease, background 0.2s;
}
/* CTA : même bouton noir plein que « Envoyer » (Contact) et les CTA de À propos */
.gallery-cta {
  right: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}
.gallery-cta:hover { opacity: 0.75; }
.gallery-cta span { transition: transform 0.2s; }
.gallery-cta:hover span { transform: translateX(4px); }
.gallery-top {
  left: 50%;
  margin-left: -20px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
}
.gallery-top:hover { background: #fff; }
.gallery-cta.nav--hidden,
.gallery-top.nav--hidden {
  transform: translateY(24px);
  opacity: 0;
  pointer-events: none;
}
.gallery-top.is-off { display: none; }
@media (max-width: 768px) {
  .gallery-cta { right: 16px; bottom: 16px; padding: 12px 20px; font-size: 12px; }
  .gallery-top { bottom: 16px; }
}
