*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #000000ff;
243ba3ff  font-family: sans-serif;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  color: #fff;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

header p {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  opacity: 0.8;
}

#gallery {
  columns: 5 200px;   /* max 5 colonnes */
  column-gap: 14px;
  padding: 1.5rem 2rem 3rem;
  max-width: 1400px;
  margin: 0 auto;
}


.gallery-item {
  break-inside: avoid;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transition: box-shadow 0.25s ease;
}

.gallery-item:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.gallery-item:hover img {
  transform: scale(1.05) rotate(0.8deg);
}

.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(192, 57, 43, 0.0);
  transition: background 0.25s ease;
  pointer-events: none;
}

.gallery-item:hover .overlay {
  background: rgba(192, 57, 43, 0.15);
}

#loader {
  text-align: center;
  padding: 2rem;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

#loader .spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 0.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Lightbox ─────────────────────────────────── */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
}

#lightbox.active {
  display: flex;
}

#lightbox-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 2rem 5rem;
}

#lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.7);
  object-fit: contain;
  transition: opacity 0.2s ease;
}

#lightbox img.fading {
  opacity: 0;
}

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(192, 57, 43, 0.75);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
  z-index: 10;
  user-select: none;
}

.lb-arrow:hover {
  background: rgba(192, 57, 43, 1);
  transform: translateY(-50%) scale(1.1);
}

#lb-prev { left: 1rem; }
#lb-next { right: 1rem; }

#lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10;
}

#lb-close:hover {
  background: rgba(192, 57, 43, 0.9);
}

#lb-counter {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  pointer-events: none;
}

/* ── Responsive ───────────────────────────────── */

@media (max-width: 600px) {
  #gallery {
    columns: 2 100px;
    padding: 1rem 1rem 2rem;
  }
  #lightbox-inner {
    padding: 1rem 3.5rem;
  }
  .lb-arrow {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  #lb-prev { left: 0.3rem; }
  #lb-next { right: 0.3rem; }
}
