/* === CONTENEUR PRINCIPAL === */
.gallery-section {
  padding: 5rem 1rem;
  background-color: var(--color-bg);
  transition: background-color 0.3s ease;
}

.gallery-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* === EN-TÊTE === */
.gallery-header {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeInUp 0.6s ease-out;
}

.gallery-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(1, 112, 168, 0.1), rgba(25, 184, 216, 0.1));
  border: 1px solid rgba(1, 112, 168, 0.2);
  border-radius: 9999px;
  margin-bottom: 1.5rem;
}

[data-theme='dark'] .gallery-badge {
  background: linear-gradient(135deg, rgba(1, 112, 168, 0.2), rgba(25, 184, 216, 0.2));
}

.badge-icon {
  width: 1rem;
  height: 1rem;
  color: #0170a8;
}

[data-theme='dark'] .badge-icon {
  color: #19b8d8;
}

.badge-text {
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 600;
  color: #0170a8;
}

[data-theme='dark'] .badge-text {
  color: #19b8d8;
}

.gallery-title {
  font-family: var(--font-primary);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.gallery-title-gradient {
  background: linear-gradient(135deg, #0170a8, #19b8d8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gallery-subtitle {
  font-family: var(--font-secondary);
  font-size: 1.125rem;
  color: #6b7280;
  max-width: 42rem;
  margin: 0 auto;
}

[data-theme='dark'] .gallery-subtitle {
  color: #9ca3af;
}

/* === TOGGLE AVANT/APRÈS === */
.gallery-toggle-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.6s ease-out 0.2s backwards;
}

.gallery-toggle {
  display: inline-flex;
  align-items: center;
  background-color: #ffffff;
  border-radius: 9999px;
  padding: 0.375rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  position: relative;
}

[data-theme='dark'] .gallery-toggle {
  background-color: #1f2937;
  border-color: #374151;
}

.gallery-toggle-btn {
  position: relative;
  padding: 0.75rem 2rem;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 9999px;
  transition: all 0.3s ease;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 0.9375rem;
  color: #374151;
  z-index: 2;
}

[data-theme='dark'] .gallery-toggle-btn {
  color: #9ca3af;
}

.gallery-toggle-btn:hover {
  color: #111827;
}

[data-theme='dark'] .gallery-toggle-btn:hover {
  color: #ffffff;
}

.gallery-toggle-btn.active {
  color: #ffffff;
}

.toggle-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0170a8, #19b8d8);
  border-radius: 9999px;
  opacity: 0;
  transition: opacity 0.3s ease;
  box-shadow: 0 4px 15px rgba(1, 112, 168, 0.4);
}

.gallery-toggle-btn.active .toggle-bg {
  opacity: 1;
}

.toggle-text {
  position: relative;
  z-index: 1;
}

/* === SLIDER D'IMAGES === */
.gallery-slider-card {
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  padding: 0.5rem;
  animation: fadeInUp 0.6s ease-out 0.4s backwards;
}

[data-theme='dark'] .gallery-slider-card {
  background: linear-gradient(135deg, #1f2937, #111827);
}

.gallery-slider {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background-color: #000;
  aspect-ratio: 16 / 10;
}

@media (min-width: 1024px) {
  .gallery-slider {
    aspect-ratio: 16 / 9;
  }
}

.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.gallery-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-image.active {
  opacity: 1;
}

.gallery-slide.active .gallery-image.active {
  animation: imageZoom 0.4s ease-out;
}

@keyframes imageZoom {
  from {
    transform: scale(1.05);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* === OVERLAY INFORMATIF === */
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 50%, transparent 100%);
  padding: 2rem;
  z-index: 10;
}

.overlay-content {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.overlay-left {
  flex: 1;
}

.overlay-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.badge-dot {
  width: 0.5rem;
  height: 0.5rem;
  background-color: #ffffff;
  border-radius: 50%;
}

.badge-state {
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
}

.overlay-title {
  font-family: var(--font-primary);
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.overlay-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-family: var(--font-secondary);
}

.meta-icon {
  width: 1rem;
  height: 1rem;
}

.overlay-counter {
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-family: var(--font-primary);
}

.counter-current {
  font-weight: 700;
  color: #ffffff;
}

/* === NAVIGATION === */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5rem;
  height: 3.5rem;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 20;
  color: #ffffff;
}

.gallery-nav:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.gallery-nav svg {
  width: 1.75rem;
  height: 1.75rem;
  transition: transform 0.3s ease;
}

.gallery-nav:hover svg {
  transform: scale(1.1);
}

.gallery-nav-prev {
  left: 1rem;
}

.gallery-nav-next {
  right: 1rem;
}

/* === MINIATURES === */
.gallery-thumbnails {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.gallery-thumb {
  position: relative;
  width: 5rem;
  height: 5rem;
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid #d1d5db;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.6;
  transform: scale(1);
}

[data-theme='dark'] .gallery-thumb {
  border-color: #4b5563;
}

.gallery-thumb:hover {
  opacity: 1;
}

.gallery-thumb.active {
  border-color: #0170a8;
  opacity: 1;
  transform: scale(1.1);
box-shadow: 0 8px 20px rgba(1, 112, 168, 0.3);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-thumb:hover img {
  transform: scale(1.1);
}

.thumb-indicator {
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 0.25rem;
  background: linear-gradient(135deg, #0170a8, #19b8d8);
  border-radius: 9999px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-thumb.active .thumb-indicator {
  opacity: 1;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .gallery-section {
    padding: 3rem 1rem;
  }

  .gallery-header {
    margin-bottom: 2.5rem;
  }

  .gallery-title {
    font-size: 2rem;
  }

  .gallery-subtitle {
    font-size: 1rem;
  }

  .gallery-toggle-btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
  }

  .gallery-slider {
    aspect-ratio: 4 / 3;
  }

  .overlay-title {
    font-size: 1.25rem;
  }

  .overlay-meta {
    font-size: 0.75rem;
  }

  .gallery-nav {
    width: 2.75rem;
    height: 2.75rem;
  }

  .gallery-nav svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .gallery-thumbnails {
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  .gallery-thumb {
    width: 4rem;
    height: 4rem;
    flex-shrink: 0;
  }

  .overlay-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .overlay-counter {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .gallery-overlay {
    padding: 1.5rem;
  }

  .overlay-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
  }

  .gallery-nav-prev {
    left: 0.5rem;
  }

  .gallery-nav-next {
    right: 0.5rem;
  }
}