/* ==========================================================================
   GALLERY PAGE STYLES (Vermeer Style)
   ========================================================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  margin-top: 30px;
  margin-bottom: 50px;
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  cursor: pointer;
  aspect-ratio: 4 / 3;
  border: 2px solid transparent;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: var(--color-brand-black);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Эффекты при наведении */
.gallery-item:hover {
  border-color: var(--color-brand-yellow);
  box-shadow: 0 10px 25px rgba(255, 184, 28, 0.15);
  transform: translateY(-5px);
}

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

/* Наложение при наведении (Overlay) */
.gallery-item__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(17, 17, 17, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.gallery-item:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__caption {
  color: white;
  margin: 0;
  font-family: var(--font-heading), sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.05rem;
  letter-spacing: 1px;
  transform: translateY(10px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item__sub {
  color: var(--color-brand-yellow);
  font-size: 0.85rem;
  margin: 3px 0 0 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  transform: translateY(10px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.05s;
}

.gallery-item:hover .gallery-item__caption,
.gallery-item:hover .gallery-item__sub {
  transform: translateY(0);
}

/* Иконка увеличения по центру */
.gallery-item__zoom-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 50px;
  height: 50px;
  background-color: var(--color-brand-yellow);
  color: var(--color-brand-black);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

.gallery-item:hover .gallery-item__zoom-icon {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ==========================================================================
   LIGHTBOX MODAL STYLES
   ========================================================================== */

.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 17, 17, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.lightbox-modal__close {
  position: absolute;
  top: 30px;
  right: 30px;
  font-size: 2.5rem;
  color: white;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  z-index: 10002;
}

.lightbox-modal__close:hover {
  color: var(--color-brand-yellow);
}

.lightbox-modal__content {
  position: relative;
  max-width: 90%;
  max-height: 85%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-modal__img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  border: 2px solid #333;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lightbox-modal.active .lightbox-modal__img {
  transform: scale(1);
}

.lightbox-modal__info {
  margin-top: 15px;
  text-align: center;
  color: white;
}

.lightbox-modal__title {
  margin: 0;
  font-family: var(--font-heading), sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lightbox-modal__desc {
  margin: 5px 0 0 0;
  color: var(--color-brand-yellow);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Анимация переходов картинок в лайтбоксе */
.lightbox-modal__img.fade-effect {
  animation: imgFade 0.25s ease;
}

@keyframes imgFade {
  0% { opacity: 0.3; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1); }
}

/* Стрелки навигации */
.lightbox-modal__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  padding: 10px 20px;
  z-index: 10001;
}

.lightbox-modal__arrow:hover {
  color: var(--color-brand-yellow);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-modal__arrow--left {
  left: 20px;
}

.lightbox-modal__arrow--right {
  right: 20px;
}

@media (max-width: 768px) {
  .lightbox-modal__arrow {
    font-size: 2.2rem;
    padding: 5px 10px;
  }
  .lightbox-modal__arrow--left { left: 5px; }
  .lightbox-modal__arrow--right { right: 5px; }
  .lightbox-modal__close { top: 15px; right: 15px; font-size: 2rem; }
}
