/* ═══ Galerie Communautaire — Styles ═══ */

.gallery-header {
  text-align: center;
  padding: 3rem 2rem 1.5rem;
}

.gallery-header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.gallery-header .section-sub {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.gallery-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1rem;
}

.gallery-stat {
  text-align: center;
}

.gallery-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gallery-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Contrôles ── */
.gallery-controls {
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  padding: 0 1.5rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.gallery-search {
  flex: 1;
  min-width: 180px;
  padding: 0.65rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.gallery-search:focus {
  border-color: var(--accent);
}

.gallery-filter-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.gallery-chip {
  padding: 0.4rem 0.8rem;
  border-radius: 2rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.gallery-chip:hover,
.gallery-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.gallery-sort {
  padding: 0.55rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
}

/* ── Grille Masonry ── */
.gallery-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.gallery-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 0.85rem;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow);
}

.gallery-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: rgba(255, 255, 255, 0.03);
}

.gallery-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.gallery-card:hover .gallery-card-overlay {
  opacity: 1;
}

.gallery-card-overlay-text {
  color: #fff;
  font-size: 0.8rem;
}

.gallery-featured-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gallery-card-body {
  padding: 0.85rem;
}

.gallery-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.gallery-card-artist {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.gallery-card-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.gallery-type-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  font-weight: 600;
  text-transform: uppercase;
}

.gallery-type-badge.illustration { color: #f59e0b; background: rgba(245, 158, 11, 0.15); }
.gallery-type-badge.music { color: #6366f1; background: rgba(99, 102, 241, 0.15); }
.gallery-type-badge.writing { color: #22c55e; background: rgba(34, 197, 94, 0.15); }
.gallery-type-badge.video { color: #ef4444; background: rgba(239, 68, 68, 0.15); }
.gallery-type-badge.photo { color: #3b82f6; background: rgba(59, 130, 246, 0.15); }
.gallery-type-badge.three-d { color: #8b5cf6; background: rgba(139, 92, 246, 0.15); }

.gallery-tag {
  font-size: 0.6rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

/* ── Lightbox ── */

.gallery-lightbox-content {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

.gallery-lightbox-image {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 0.75rem;
  object-fit: contain;
}

.gallery-lightbox-info {
  margin-top: 1rem;
  color: #fff;
}

.gallery-lightbox-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.gallery-lightbox-artist {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.5rem;
}

.gallery-lightbox-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
}

.gallery-lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.2s;
}

.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}

.gallery-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-lightbox-nav.prev { left: 1.5rem; }
.gallery-lightbox-nav.next { right: 1.5rem; }

/* ── CTA ── */
.gallery-cta {
  max-width: 1100px;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem 3rem;
  text-align: center;
}

.gallery-cta-card {
  padding: 2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 1rem;
}

.gallery-cta-card h2 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.gallery-cta-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ── No results ── */
.gallery-no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  grid-column: 1 / -1;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
  }

  .gallery-controls {
    flex-direction: column;
  }

  .gallery-lightbox {
    padding: 0.5rem;
  }

  .gallery-lightbox-nav {
    width: 36px;
    height: 36px;
  }
}
