body.gallery-modal-open {
  overflow: hidden;
}

.gallery-page {
  padding-top: 4rem;
}

.gallery-grid {
  column-count: 3;
  column-gap: 10px;
  padding: 0;
  margin: 0;
}

.gallery-item {
  list-style: none;
  break-inside: avoid;
  margin-bottom: 10px;
}

.gallery-card {
  display: block;
  width: 100%;
  position: relative;
  padding: 0;
  border: 1px solid rgba(0, 255, 245, 0.15);
  background: rgba(8, 14, 40, 0.85);
  color: var(--light);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(0, 255, 245, 0.5);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.gallery-card:focus-visible {
  outline: 2px solid rgba(0, 255, 245, 0.45);
  outline-offset: 3px;
}

.gallery-card-media {
  display: block;
}

.gallery-card-image-tag {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s ease;
}

.gallery-card:hover .gallery-card-image-tag,
.gallery-card:focus-visible .gallery-card-image-tag {
  transform: scale(1.04);
}

.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(5, 12, 42, 0.95), rgba(5, 12, 42, 0.15) 55%, rgba(5, 12, 42, 0.1)),
    linear-gradient(135deg, rgba(0, 255, 245, 0.14), transparent 45%, rgba(255, 46, 209, 0.18));
}

.gallery-card-meta {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  padding: 1.25rem;
}

.gallery-card-index {
  color: rgba(0, 255, 245, 0.9);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
}

.gallery-card-text {
  display: grid;
  gap: 0.2rem;
}

.gallery-card-text strong {
  font-size: 1.05rem;
  line-height: 1.3;
}

.gallery-card-text small {
  color: var(--sub);
  font-size: 0.85rem;
  line-height: 1.5;
}

.gallery-empty-state {
  max-width: 52rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  border: 1px solid rgba(0, 255, 245, 0.18);
  background:
    linear-gradient(135deg, rgba(0, 255, 245, 0.08), rgba(111, 0, 255, 0.08)),
    rgba(7, 13, 37, 0.86);
  text-align: center;
}

.gallery-empty-kicker {
  margin-bottom: 0.5rem;
  color: var(--cyan);
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.gallery-empty-state h3 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

.gallery-empty-state p {
  max-width: 38rem;
  margin: 0 auto;
  color: var(--sub);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 24, 0.86);
  backdrop-filter: blur(10px);
}

.gallery-lightbox-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  width: min(1200px, 100%);
}

.gallery-lightbox-figure {
  overflow: hidden;
  border: 1px solid rgba(0, 255, 245, 0.22);
  background: rgba(5, 12, 42, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.gallery-lightbox-image {
  display: block;
  width: 100%;
  max-height: min(70vh, 820px);
  object-fit: contain;
  background: #030616;
}

.gallery-lightbox-caption {
  display: grid;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.gallery-lightbox-counter {
  color: var(--cyan);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-lightbox-caption strong {
  font-size: 1.1rem;
}

.gallery-lightbox-caption p {
  color: var(--sub);
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(0, 255, 245, 0.28);
  background: rgba(7, 13, 37, 0.9);
  color: var(--light);
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:hover,
.gallery-lightbox-nav:focus-visible {
  border-color: rgba(0, 255, 245, 0.6);
  background: rgba(13, 23, 66, 0.98);
  transform: translateY(-2px);
}

.gallery-lightbox-close {
  position: absolute;
  top: -1rem;
  right: 0;
  z-index: 2;
  font-size: 1.8rem;
}

.gallery-lightbox-nav span {
  font-size: 2rem;
  line-height: 1;
}

@media (max-width: 767px) {
  .gallery-item {
    flex: 1 1 100%;
  }

  .gallery-lightbox {
    padding: 1rem 0.75rem;
  }

  .gallery-lightbox-dialog {
    grid-template-columns: 1fr;
  }

  .gallery-lightbox-close {
    top: 0.75rem;
    right: 0.75rem;
  }

  .gallery-lightbox-nav {
    position: absolute;
    bottom: 1rem;
    z-index: 2;
    width: 48px;
    height: 48px;
  }

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

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