:root {
  --thumb-bg: #111;
  --text-light: #fff;
}

/* ---------- BASE ---------- */
* { 
  box-sizing: border-box; 
}

html, body { 
  height: 100%; 
}

body {
  margin: 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: #fff;
  color: var(--text-light);
}

/* ---------- HEADER ---------- */
.header {
  padding: 20px 60px 30px;							
  background: #fff;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header h1 {
  margin: 0;
  font-size: 2.2rem;
  color: #404040;
}

/* MENU */
.menu {
  display: flex;
  gap: 16px;
}

.menu a {
  color: rgba(0,0,0,0.5); 			/*   color: #bbb; #808080; rgba(0,0,0,0.9); */
  text-decoration: none;
  padding: 6px 8px;
}

.menu a:hover {
  background: rgba(0,0,0,0.1);			/*  conflit couleur avec overlay  / background: rgba(255,255,255,0.1); OU rgba(0,0,0,0.1);   */		
  border-radius: 4px;
}

.subtitle {
  color: #808080;
  margin-top: 10px;
}

/* ---------- BURGER ---------- */
.menu-toggle { 
  display: none; 
}

.burger {
  position: absolute;
  top: 30px;
  right: 40px;
  width: 30px;
  height: 24px;
  display: none; /* hidden by default (desktop) */
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1100;
}
.burger span {
  display: block;
  height: 3px;
  width: 100%;
  background: #707070;   		       /*   background: #404040;    */
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* burger animated into X when active */
.burger.active span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* overlay menu */
.menu {
  display: flex;
  gap: 14px;
  justify-content: flex-end;
  padding: 20px 40px 0;
  transition: all 0.3s ease;
}

/* responsive version (hidden behind overlay) */
@media (max-width: 800px) {
  .burger { display: flex; }

  .menu {
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background: rgba(0,0,0,0.9);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 1000;
  }

  .menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .menu a {
    font-size: 1.6rem;
    color: #fff;
  }
}

/* ---------- GALLERY ---------- */
.main {
  padding: 20px 55px 60px;
}

.gallery {
  margin: 0;
}

/* ---------- PHOTO (THUMBNAILS) ---------- */
.photo {
    /* Largeur minimale qui sera utilisée pour calculer les colonnes */
     width: 180px;								/*     width: 250px;   */
    
    /* Marge entre les vignettes (sera la moitié de la gouttière) */
    margin: 5px; 
    
    position: relative;
    overflow: hidden;
    background: var(--thumb-bg);
    box-shadow: 0 0 0 1px #333;
    cursor: pointer;
}

.photo img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform .25s, opacity .25s;
  display: block;
}


.photo:hover img {
  transform: scale(1.05);
  opacity: 0.9;
}

/* Caption fix : visible et au-dessus de l’image */
.caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 4px 6px;
  background: rgba(0,0,0,0.6);
  text-align: center;
  font-size: 12px;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
  transition: opacity .18s;
}

.photo:hover .caption { 
  opacity: 1; 
}

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.98);
  display: none;
  z-index: 999;
}

.lightbox:not(.hidden) {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
}

.lightbox-content {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  z-index: 20;
}

.lightbox-image {
  flex: 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity .3s, transform .3s;
}

/* Fade transition */
.fade-out {
  opacity: 0 !important;
  transform: scale(.99);
}

/* ---------- ZOOM ---------- */
#lightbox-img.zoomed {
  cursor: grab;
  transform: scale(2);
  transition: transform 0.15s ease;
}

#lightbox-img {
  transition: transform 0.2s ease;
  will-change: transform;
}

/* ---------- LIGHTBOX TEXT ---------- */
.lightbox-text {
  flex: 45%;
  padding: 36px;
  overflow-y: auto;
  color: #fff;
}

.lightbox-text h2 {
  margin-top: 0;
  font-size: 1.6rem;
}

/* ---------- NAVIGATION ---------- */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.4rem;
  color: #fff;
  padding: 6px 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  cursor: pointer;
  z-index: 40;
}

.nav-btn.left { left: 20px; }
.nav-btn.right { right: 20px; }

.close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 40;
}

/* ---------- RESPONSIVE LIGHTBOX ---------- */
@media (max-width: 900px) {
  .lightbox-content {
    flex-direction: column;
  }

  .lightbox-image {
    flex: none;
    height: 60%;
  }

  .lightbox-text {
    flex: none;
    height: 40%;
    padding: 20px;
  }
}


/* ---------- TEXT OVERLAY (MOBILE) ---------- */

.text-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    z-index: 9999;
    
    /* Cacher par défaut */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    
    /* Style du texte */
    color: var(--text-light); /* Blanc */
    text-align: center;
    overflow-y: auto;
}

.text-overlay-content {
    max-width: 600px;
}

.text-overlay.active {
    visibility: visible;
    opacity: 1;
}

/* Texte en italique dans les commentaires */
.text-overlay-content em {
    font-style: italic;
}