/* ===== Image-only Gallery (uses your :root variables) ===== */

.gallery {
  padding: 64px 0;
  background: linear-gradient(180deg, rgba(7, 158, 229, 0.06), rgba(255, 212, 3, 0.06));
}

.gallery__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.gallery__header {
  text-align: center;
  margin-bottom: 28px;
}

.gallery__label {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-yellow);
  background: var(--hover-bg-yellow);
  padding: 6px 10px;
  border-radius: var(--border-radius-sm);
}

.gallery__title {
  margin: 10px 0 6px;
  color: var(--text-black, #111);
  font-size: 28px;
  line-height: 1.2;
}

.gallery__title-accent {
  color: var(--text-cyan);
}

.gallery__subtitle {
  color: var(--text-gray);
  font-size: 14px;
}

/* Responsive grid */
.gallery__grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Tile */
.gallery__item {
  position: relative;
  display: block;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background: var(--color-black);
  box-shadow: 0 8px 24px var(--shadow-footer);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  outline: none;
}

.gallery__item:focus-visible {
  box-shadow: 0 0 0 3px var(--hover-bg-cyan), 0 8px 24px var(--shadow-footer);
}

/* Decorative hover overlay using cyan/yellow blend */
.gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--hover-bg-cyan), var(--hover-bg-yellow));
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.gallery__item:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px var(--shadow-footer);
}

.gallery__item:hover::after {
  opacity: 1;
}

.gallery__img {
  width: 100%;
  height: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.35s ease, filter 0.35s ease;
  will-change: transform;
  filter: saturate(1);
}

.gallery__item:hover .gallery__img {
  transform: scale(1.04);
  filter: saturate(1.1);
}

/* ===== Lightbox ===== */
.gallery__lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9990;
  padding: 20px;
}

.gallery__lightbox--open {
  display: flex;
}

.gallery__lightbox-img {
  max-width: min(96vw, 1200px);
  max-height: 86vh;
  border-radius: var(--border-radius-md);
  box-shadow: 0 20px 40px var(--shadow-footer);
  outline: 6px solid rgba(7, 158, 229, 0.25);
  background: #000;
}

/* Close button */
.gallery__lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--btn-cta-bg);
  color: var(--text-white);
  font-size: 24px;
  line-height: 40px;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--shadow-button);
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallery__lightbox-close:hover {
  background: var(--btn-cta-hover);
  transform: scale(1.04);
}

/* Nav buttons */
.gallery__lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--hover-bg-yellow);
  color: var(--text-black, #111);
  font-size: 24px;
  line-height: 46px;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--shadow-navbar);
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallery__lightbox-prev { left: 16px; }
.gallery__lightbox-next { right: 16px; }

.gallery__lightbox-nav:hover {
  background: var(--hover-bg-cyan);
  transform: translateY(-50%) scale(1.06);
}

/* Small screens */
@media (max-width: 640px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .gallery__lightbox-img {
    max-height: 76vh;
  }
}
