.gallery-main .gallery-grid-wrap {
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 56px 24px 56px;
}

.gallery-main .gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 24px;
}

.gallery-main .gallery-item {
  display: block;
  border-radius: 12px;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 125, 220, 0.9);
  background: rgba(0, 0, 0, 0.45);
  box-shadow:
    0 0 6px rgba(255, 120, 220, 0.65),
    0 0 14px rgba(255, 80, 200, 0.45);
  transition: box-shadow 0.28s ease, border-color 0.28s ease, transform 0.28s ease;
}


.gallery-main .gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid #fff;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}

.gallery-main .gallery-item img {
  width: 100%;
  border-radius: inherit;
  position: relative;
  z-index: 1;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-main .gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-main .gallery-item:hover,
.gallery-main .gallery-item:focus-visible {
  border-color: rgba(120, 255, 170, 0.95);
  box-shadow:
    0 0 7px rgba(120, 255, 170, 0.8),
    0 0 18px rgba(70, 255, 145, 0.6);
}


.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  z-index: 9999;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, background-color 0.3s ease, visibility 0s linear 0.3s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.9);
  transition-delay: 0s;
}

.lightbox__img {
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.24s ease;
}

.lightbox.is-open .lightbox__img {
  transform: scale(1);
  opacity: 1;
}

.lightbox__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 767px) {
  .gallery-main .gallery-grid-wrap {
    padding: 36px 12px 36px;
  }

  .gallery-main .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 18px;
  }

  .lightbox__title {
    font-size: 20px;
  }

  .lightbox__quote {
    font-size: 17px;
    line-height: 1.65;
  }

  .lightbox__desc {
    font-size: 16px;
    line-height: 1.82;
  }

  .lightbox__hint {
    right: 8px;
    bottom: 8px;
    font-size: 11px;
    padding: 5px 8px;
  }
}


@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox__img {
    transition: none;
  }
}

.gallery-main .gallery-item.is-disabled {
  cursor: default;
}

.gallery-main .gallery-item.is-disabled:hover img {
  transform: none;
}


.lightbox__meta {
  width: 100%;
  margin-top: 14px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 170, 235, 0.45);
  border-radius: 8px;
  box-shadow:
    0 0 12px rgba(255, 95, 210, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.lightbox__title {
  margin: 0 0 10px;
  text-align: center;
  font-size: clamp(20px, 1.55vw, 26px);
  font-weight: 700;
  color: #fff;
  text-shadow:
    0 0 4px rgba(255, 150, 235, 0.9),
    0 0 10px rgba(255, 95, 210, 0.62),
    0 0 18px rgba(255, 55, 190, 0.38);
}

.lightbox__quote {
  margin: 8px 0 0;
  font-size: clamp(17px, 1.2vw, 21px);
  line-height: 1.65;
  color: #d9ffe8;
  font-weight: 700;
  white-space: pre-line;
  text-shadow:
    0 0 4px rgba(120, 255, 170, 0.95),
    0 0 10px rgba(70, 255, 145, 0.78),
    0 0 18px rgba(35, 235, 120, 0.58);
}

.lightbox__desc {
  margin: 8px 0 0;
  font-size: clamp(16px, 1.1vw, 19px);
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.95);
  white-space: pre-line;
  text-shadow:
    0 0 4px rgba(255, 150, 235, 0.9),
    0 0 10px rgba(255, 95, 210, 0.62),
    0 0 18px rgba(255, 55, 190, 0.38);
}


.lightbox__media {
  width: fit-content;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.lightbox__image-wrap {
  position: relative;
  width: fit-content;
  max-width: 100%;
  align-self: center;
}

.lightbox__hint {
  position: absolute;
  right: 10px;
  bottom: 22px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.56);
  border: 1px solid rgba(255, 170, 235, 0.65);
  text-shadow: 0 0 6px rgba(255, 95, 210, 0.45);
  z-index: 2;
  pointer-events: none;
}
