/* ========================================
   Blasphemy 2026 – Gallery Page Styles
   ======================================== */

/* ── Gallery Hero ─────────────────────── */
.gallery-hero {
  position: relative;
  padding: 180px 0 80px;
  text-align: center;
  overflow: hidden;
  background: var(--bg-color);
}

.gallery-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 50% at 50% 40%,
    rgba(255, 77, 0, 0.1) 0%,
    rgba(255, 170, 0, 0.04) 40%,
    transparent 70%
  );
  pointer-events: none;
}

.gallery-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-secondary),
    transparent
  );
}

.gallery-hero-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.013) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.013) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.gallery-hero .container {
  position: relative;
  z-index: 2;
}

.back-link-gallery {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding: 10px 22px 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(6px);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.back-link-gallery svg {
  transition: transform var(--transition-fast);
}

.back-link-gallery:hover {
  color: var(--accent-secondary);
  border-color: var(--accent-primary);
  background: rgba(255, 77, 0, 0.1);
  transform: translateX(-4px);
}

.back-link-gallery:hover svg {
  transform: translateX(-3px);
}

.gallery-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 6px;
  color: var(--text-color);
  margin-bottom: 16px;
  text-shadow:
    3px 3px 0px var(--accent-primary),
    -3px -3px 0px var(--accent-secondary);
}

.gallery-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: var(--text-muted);
  letter-spacing: 3px;
  font-weight: 400;
}

/* ── Active nav link ──────────────────── */
.active-link {
  color: var(--accent-secondary) !important;
}

.active-link::after {
  width: 100% !important;
}

/* ── Gallery Section ──────────────────── */
.gallery-section {
  padding: 80px 0 120px;
  background: var(--bg-color);
}

/* ── Gallery Empty State ──────────────── */
.gallery-empty {
  text-align: center;
  padding: 100px 20px;
  color: var(--text-muted);
}

.gallery-empty svg {
  color: rgba(255, 170, 0, 0.2);
  margin-bottom: 24px;
}

.gallery-empty h3 {
  font-size: 1.4rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-color);
  margin-bottom: 12px;
}

.gallery-empty p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ── Gallery Grid (Masonry-like) ──────── */
.gallery-grid {
  columns: 3;
  column-gap: 20px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition:
    transform var(--transition-smooth),
    box-shadow var(--transition-smooth);
  border: 1px solid var(--card-border);
  background: var(--dark-card);
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 50px rgba(255, 77, 0, 0.1),
    0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 170, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-smooth);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* ── Gallery Item Overlay ─────────────── */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.2) 40%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  transition: opacity var(--transition-smooth);
  color: #fff;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-overlay svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.gallery-item-title {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ── Lightbox ─────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: lightboxImgIn 0.3s ease;
}

@keyframes lightboxImgIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-caption {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
}

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.lightbox-close:hover {
  background: rgba(255, 77, 0, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.lightbox-nav:hover {
  background: rgba(255, 77, 0, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* ── Reveal Animation for gallery ─────── */
.gallery-item.reveal-hidden {
  opacity: 0;
  transform: translateY(30px);
}

.gallery-item.reveal-active {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger */
.gallery-item.reveal-active:nth-child(3n + 1) {
  transition-delay: 0s;
}
.gallery-item.reveal-active:nth-child(3n + 2) {
  transition-delay: 0.1s;
}
.gallery-item.reveal-active:nth-child(3n + 3) {
  transition-delay: 0.2s;
}

/* ── Responsive ───────────────────────── */
@media (max-width: 1024px) {
  .gallery-grid {
    columns: 2;
  }
}

@media (max-width: 768px) {
  .gallery-hero {
    padding: 120px 0 50px;
  }

  .gallery-title {
    letter-spacing: 3px;
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .gallery-subtitle {
    font-size: 0.8rem;
    letter-spacing: 2px;
  }

  .gallery-grid {
    columns: 2;
    column-gap: 10px;
  }

  .gallery-item {
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
  }

  .gallery-section {
    padding: 40px 0 60px;
  }

  .back-link-gallery {
    font-size: 0.65rem;
    padding: 8px 16px 8px 12px;
    margin-bottom: 20px;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
  }

  .lightbox-prev {
    left: 8px;
  }
  .lightbox-next {
    right: 8px;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }

  .lightbox-content img {
    max-width: 95vw;
    max-height: 75vh;
  }

  .lightbox-counter {
    bottom: 16px;
    font-size: 0.7rem;
  }

  .gallery-item-title {
    font-size: 0.7rem;
    bottom: 10px;
    left: 10px;
    right: 10px;
  }

  .gallery-empty {
    padding: 60px 16px;
  }

  .gallery-empty h3 {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .gallery-hero {
    padding: 100px 0 40px;
  }

  .gallery-grid {
    columns: 2;
    column-gap: 8px;
  }

  .gallery-item {
    margin-bottom: 8px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    columns: 1;
  }
}
