/* ── Gallery Hero ── */

.gallery-hero {
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 120px 24px 60px;
  text-align: center;
  overflow: hidden;
}

.gallery-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(79,70,229,.18) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(129,140,248,.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(99,102,241,.06) 0%, transparent 40%);
  pointer-events: none;
}

.gallery-hero-content {
  position: relative;
  max-width: 680px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color .2s;
}

.back-link:hover {
  color: var(--accent-light);
}

.gallery-hero-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--badge-text);
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  padding: 5px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.gallery-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -.03em;
}

.gallery-hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ── Filter ── */

.gallery-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.gallery-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 40px;
  position: sticky;
  top: 76px;
  z-index: 10;
  padding: 8px 0;
}

.filter-btn {
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 100px;
  border: 1px solid var(--border-light);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .25s;
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Grid ── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.gallery-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: var(--mock-bg);
  border: 1px solid var(--border-mock);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  transition: transform .4s ease, box-shadow .4s ease, border .3s;
  aspect-ratio: 16 / 10;
  opacity: 0;
  transform: translateY(20px);
  animation: cardIn .6s ease forwards;
}

.gallery-card:nth-child(1) { animation-delay: .05s; }
.gallery-card:nth-child(2) { animation-delay: .1s; }
.gallery-card:nth-child(3) { animation-delay: .15s; }
.gallery-card:nth-child(4) { animation-delay: .2s; }
.gallery-card:nth-child(5) { animation-delay: .25s; }
.gallery-card:nth-child(6) { animation-delay: .3s; }
.gallery-card:nth-child(7) { animation-delay: .35s; }
.gallery-card:nth-child(8) { animation-delay: .4s; }
.gallery-card:nth-child(9) { animation-delay: .45s; }
.gallery-card:nth-child(10) { animation-delay: .5s; }
.gallery-card:nth-child(11) { animation-delay: .55s; }
.gallery-card:nth-child(12) { animation-delay: .6s; }
.gallery-card:nth-child(13) { animation-delay: .65s; }
.gallery-card:nth-child(14) { animation-delay: .7s; }
.gallery-card:nth-child(15) { animation-delay: .75s; }
.gallery-card:nth-child(16) { animation-delay: .8s; }
.gallery-card:nth-child(17) { animation-delay: .85s; }
.gallery-card:nth-child(18) { animation-delay: .9s; }

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

.gallery-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  border-color: rgba(79,70,229,.3);
}

.gallery-card-img {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

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

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

.gallery-card-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,.1) 50%, transparent 100%);
  opacity: 0;
  transition: opacity .35s ease;
}

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

.gallery-card-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(79,70,229,.35);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.1);
  color: #e0e7ff;
  margin-bottom: 8px;
}

.gallery-card-info h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
}

/* ── Lightbox ── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  padding: 40px;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,.08);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255,255,255,.15);
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0,0,0,.6);
  object-fit: contain;
}

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  font-weight: 500;
  text-align: center;
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gallery-filter {
    gap: 6px;
    top: 68px;
  }

  .filter-btn {
    font-size: .75rem;
    padding: 5px 14px;
  }

  .lightbox {
    padding: 16px;
  }

  .lightbox-img {
    max-height: 70vh;
  }
}
