
/* ===========================================================
  Galerie CEPROGEC — styles isolés
   =========================================================== */

.gallery-hero {
  background: var(--color-dark);
  color: var(--color-white);
  padding: 72px 0 56px;
  text-align: center;
}
.gallery-hero .section-label { color: #2253bb; }
.gallery-hero h1 {
  color: var(--color-white);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.gallery-hero p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 560px;
  margin: 0 auto;
}

.gallery-status {
  text-align: center;
  color: var(--color-gray);
  margin-bottom: 24px;
}
.gallery-status[hidden] { display: none; }

.gallery-search {
  display: block;
  max-width: 560px;
  margin: 0 auto 28px;
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.85rem;
}
.gallery-search span { display: block; margin-bottom: 8px; }
.gallery-search input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-dark);
  font: inherit;
  outline: none;
}
.gallery-search input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(19, 76, 197, 0.14); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  box-shadow: var(--shadow);
  background: var(--color-light);
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.08); }
.gallery-item:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

.gallery-item-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 16px;
  background: linear-gradient(0deg, rgba(20,24,31,0.88) 0%, rgba(20,24,31,0) 100%);
  color: var(--color-white);
  text-align: left;
}
.gallery-item-caption span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2253bb;
}
.gallery-item-caption strong {
  display: block;
  font-size: 0.9rem;
  font-family: var(--font-heading);
  margin-top: 2px;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-gray);
  padding: 40px 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.94);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.lightbox[hidden] { display: none; }

.lightbox-figure {
  margin: 0;
  max-width: 90vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lightbox-figure img {
  max-width: 90vw;
  max-height: 74vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-figure figcaption {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.12);
  border: none;
  color: var(--color-white);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: var(--color-white);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

@media (max-width: 640px) {
  .lightbox { padding: 16px; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.4rem; }
  .lightbox-close { top: 12px; right: 12px; width: 38px; height: 38px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}