/* ═══════════════════════════════════════════════════════════
   GEDI PRO — Galerie Photo
   Marine #041E50 · Or #C8923A · Beige #F0EBE3
   3 modes : masonry · grille · diaporama
═══════════════════════════════════════════════════════════ */
:root {
  --gp-m:  #041E50; --gp-m2: #0A2B6E;
  --gp-g:  #C8923A; --gp-gl: #F5EEE4;
  --gp-be: #F0EBE3; --gp-w:  #FFFFFF;
  --gp-tx: #2D3748; --gp-mu: #718096;
  --gp-bd: rgba(4,30,80,0.08);
  --gp-r:  12px;
  --gp-dur: 0.28s;
}

/* ── Wrap ──────────────────────────────────────────────── */
.gp-wrap { font-family: 'Inter',-apple-system,sans-serif; }

/* ── Filtres ───────────────────────────────────────────── */
.gp-filtres {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 28px;
}
.gp-filtre {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 18px; border-radius: 100px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  border: 1.5px solid var(--gp-bd);
  background: var(--gp-w); color: var(--gp-mu);
  cursor: pointer; transition: all var(--gp-dur);
}
.gp-filtre:hover  { border-color: var(--gp-g); color: var(--gp-g); }
.gp-filtre.active { background: var(--gp-m); color: var(--gp-w); border-color: var(--gp-m); }
.gp-filtre-count  {
  background: rgba(255,255,255,0.2); color: inherit;
  font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 100px;
}
.gp-filtre:not(.active) .gp-filtre-count {
  background: var(--gp-be); color: var(--gp-mu);
}
.gp-item.gp-hidden { display: none; }

/* ── GRILLE UNIFORME ───────────────────────────────────── */
.gp-grille {
  display: grid; gap: 16px;
}
.gp-cols-2 { grid-template-columns: repeat(2, 1fr); }
.gp-cols-3 { grid-template-columns: repeat(3, 1fr); }
.gp-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── MASONRY ───────────────────────────────────────────── */
.gp-masonry {
  columns: 3; column-gap: 16px;
}
.gp-masonry .gp-item {
  break-inside: avoid; margin-bottom: 16px; display: block;
}
.gp-masonry .gp-img-wrap {
  padding-top: 0 !important; /* masonry = hauteur naturelle de l'image */
}
.gp-masonry .gp-img-wrap img {
  position: static !important;
  width: 100%; height: auto !important;
  object-fit: unset !important; padding: 0 !important;
}

/* ── ITEM COMMUN ───────────────────────────────────────── */
.gp-item {
  position: relative; margin: 0;
  border-radius: var(--gp-r); overflow: hidden;
  background: var(--gp-be);
  cursor: pointer;
  transition: transform var(--gp-dur), box-shadow var(--gp-dur);
}
.gp-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(4,30,80,0.14);
}
.gp-item:focus-visible {
  outline: 2px solid var(--gp-g); outline-offset: 3px;
}

/* Zone image — ratio carré par défaut en grille */
.gp-grille .gp-img-wrap {
  position: relative; padding-top: 72%; overflow: hidden;
}
.gp-grille .gp-img-wrap img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gp-item:hover .gp-img-wrap img { transform: scale(1.06); }

/* Placeholder si pas d'image */
.gp-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 200px; background: var(--gp-be);
}
.gp-grille .gp-placeholder {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* ── OVERLAY LÉGENDE (hover) ───────────────────────────── */
.gp-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(4,30,80,0.92) 0%,
    rgba(4,30,80,0.5)  50%,
    rgba(4,30,80,0.0)  100%
  );
  display: flex; align-items: flex-end;
  opacity: 0; transition: opacity var(--gp-dur);
}
.gp-item:hover .gp-overlay,
.gp-item:focus-visible .gp-overlay { opacity: 1; }

.gp-overlay-inner {
  padding: 18px 16px;
  transform: translateY(8px);
  transition: transform var(--gp-dur);
}
.gp-item:hover .gp-overlay-inner,
.gp-item:focus-visible .gp-overlay-inner { transform: translateY(0); }

.gp-badge {
  display: inline-block;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
  margin-bottom: 7px;
}
.gp-overlay-titre {
  font-family: 'DM Serif Display',serif;
  font-size: 16px; font-weight: 400; color: #fff;
  margin: 0 0 4px; line-height: 1.25;
}
.gp-overlay-sous {
  font-size: 12px; color: rgba(255,255,255,0.65);
  margin: 0 0 8px; line-height: 1.4;
}
.gp-zoom-hint {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--gp-g);
}

/* ── FIGCAPTION (grille uniquement) ────────────────────── */
.gp-figcaption {
  padding: 12px 14px 14px;
  background: var(--gp-w);
  border-top: 1px solid var(--gp-bd);
  display: flex; flex-direction: column; gap: 3px;
}
.gp-fc-titre {
  font-size: 13px; font-weight: 600;
  color: var(--gp-m); line-height: 1.3;
}
.gp-fc-sous {
  font-size: 11px; color: var(--gp-mu); line-height: 1.4;
}

/* ── EMPTY STATE ───────────────────────────────────────── */
.gp-empty {
  grid-column: 1 / -1; text-align: center;
  padding: 56px 20px; color: var(--gp-mu);
}
.gp-empty p { font-size: 14px; margin-top: 12px; }

/* ═══════════════════════════════════════════════════════════
   DIAPORAMA
═══════════════════════════════════════════════════════════ */
.gp-slider {
  position: relative; border-radius: 16px; overflow: hidden;
  background: var(--gp-m);
  min-height: 400px;
  user-select: none;
}
.gp-slides { display: flex; height: 100%; }
.gp-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.5s ease;
  pointer-events: none;
}
.gp-slide.active { opacity: 1; pointer-events: auto; }

.gp-slide img {
  width: 100%; height: 480px;
  object-fit: cover; display: block;
}

.gp-slide-legende {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 28px 36px;
  background: linear-gradient(to top, rgba(4,30,80,0.92) 0%, transparent 100%);
}
.gp-slide-badge {
  display: inline-block;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 4px; margin-bottom: 10px;
}
.gp-slide-legende h3 {
  font-family: 'DM Serif Display',serif;
  font-size: 26px; font-weight: 400; color: #fff;
  margin: 0 0 6px; line-height: 1.2;
}
.gp-slide-legende p {
  font-size: 14px; color: rgba(255,255,255,0.6);
  margin: 0;
}

/* Contrôles slider */
.gp-ctrl {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 10; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--gp-dur);
  backdrop-filter: blur(4px);
}
.gp-ctrl:hover { background: rgba(255,255,255,0.22); }
.gp-prev { left: 16px; }
.gp-next { right: 16px; }

/* Dots */
.gp-dots {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 10;
}
.gp-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none; cursor: pointer; padding: 0;
  transition: all var(--gp-dur);
}
.gp-dot.active { background: var(--gp-g); width: 22px; border-radius: 4px; }

/* Bouton ouvrir lightbox depuis slider */
.gp-lb-open {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--gp-dur);
}
.gp-lb-open:hover { background: rgba(255,255,255,0.22); }

/* ═══════════════════════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════════════════════ */
.gp-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(2,12,46,0.96);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
  animation: gp-lb-in 0.22s ease;
}
.gp-lightbox.open { display: flex; }

@keyframes gp-lb-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.gp-lb-content {
  position: relative; max-width: 92vw; max-height: 90vh;
  display: flex; flex-direction: column; align-items: center;
}
.gp-lb-content img {
  max-width: 100%; max-height: 78vh;
  object-fit: contain; border-radius: 8px;
  display: block;
  animation: gp-lb-img 0.3s ease;
}
@keyframes gp-lb-img {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

.gp-lb-legende {
  margin-top: 16px; text-align: center;
  max-width: 640px;
}
.gp-lb-cat-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: var(--gp-g); color: #fff;
  padding: 3px 10px; border-radius: 4px; margin-bottom: 8px;
}
.gp-lb-legende h3 {
  font-family: 'DM Serif Display',serif;
  font-size: 22px; font-weight: 400; color: #fff;
  margin: 0 0 5px;
}
.gp-lb-legende p {
  font-size: 13px; color: rgba(255,255,255,0.55); margin: 0;
}

/* Nav lightbox */
.gp-lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--gp-dur);
  z-index: 100000;
}
.gp-lb-nav:hover { background: rgba(255,255,255,0.2); }
.gp-lb-prev { left: 16px; }
.gp-lb-next { right: 16px; }
.gp-lb-nav[style*="display:none"],.gp-lb-nav[hidden] { display: none !important; }

/* Bouton fermer */
.gp-lb-close {
  position: fixed; top: 16px; right: 16px; z-index: 100000;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--gp-dur);
}
.gp-lb-close:hover { background: rgba(255,255,255,0.2); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 960px) {
  .gp-cols-4 { grid-template-columns: repeat(3,1fr); }
  .gp-masonry { columns: 2; }
}
@media (max-width: 680px) {
  .gp-cols-3,.gp-cols-4 { grid-template-columns: repeat(2,1fr); }
  .gp-masonry { columns: 2; }
  .gp-slide img { height: 280px; }
  .gp-slide-legende { padding: 18px 20px; }
  .gp-slide-legende h3 { font-size: 20px; }
}
@media (max-width: 480px) {
  .gp-cols-2,.gp-cols-3,.gp-cols-4 { grid-template-columns: 1fr; }
  .gp-masonry { columns: 1; }
  .gp-lb-nav { display: none; }
}
