/**
 * Styles pour la galerie publique d'albums
 * CEP-TchadElec - Bibliothèques
 */

/* ============================================
   GALLERY CARDS
   ============================================ */

.gallery-card {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-radius: 0.75rem;
  overflow: hidden;
}

.gallery-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* ============================================
   CARD MEDIA
   ============================================ */

.card-media {
  position: relative;
  overflow: hidden;
  height: 300px;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ============================================
   GRADIENTS & OVERLAYS
   ============================================ */

.bg-gradient-to-top {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
  pointer-events: none;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.gallery-card:hover .card-overlay {
  opacity: 1;
}

.card-overlay .btn {
  pointer-events: auto;
}

.card-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  text-decoration: none;
}

.card-link-overlay:focus {
  outline: 2px solid var(--bs-primary);
  outline-offset: -2px;
}

/* ============================================
   UTILITIES
   ============================================ */

.object-fit-cover {
  object-fit: cover;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.hover-effect-scale {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-effect-scale:hover {
  transform: scale(1.02);
}

.transition-opacity {
  transition: opacity 0.3s ease;
}

/* ============================================
   MEDIA GRID
   ============================================ */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.media-grid-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .card-media {
    height: 220px;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }

  .gallery-card:hover {
    transform: translateY(-4px);
  }
}

@media (max-width: 576px) {
  .card-media {
    height: 200px;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   MEDIA CARDS (Page détails album)
   ============================================ */

.media-card {
  transition: all 0.3s ease;
}

.media-link {
  display: block;
  position: relative;
  border-radius: 0.5rem;
  overflow: hidden;
}

.media-img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-link:hover .media-img {
  transform: scale(1.1);
}

.media-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.media-link:hover .media-overlay {
  opacity: 1;
}

.media-overlay .btn {
  pointer-events: auto;
}

.media-info {
  padding: 0.5rem;
  background-color: rgba(248, 249, 250, 0.95);
  border-top: 1px solid #dee2e6;
}

/* ============================================
   HOVER INTERACTIONS
   ============================================ */

.hover-text-primary:hover {
  color: var(--bs-primary) !important;
  transition: color 0.2s ease;
}

.stretched-link::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border-width: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .card-media img,
  .card-overlay,
  .hover-effect-scale {
    transition: none !important;
  }
}
