/* Gallery page */
.gallery-page {
  padding-top: 140px;
  padding-bottom: 80px;
  min-height: 60vh;
}

.gallery-page .section-title h2 {
  margin-bottom: 10px;
}

.gallery-page .section-title p {
  max-width: 640px;
  margin: 0 auto 40px;
  color: #666;
}

.gallery-status {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  font-size: 16px;
}

.gallery-status.is-error {
  color: #8a4b3a;
}

.gallery-month {
  margin-bottom: 48px;
}

.gallery-month__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.gallery-month__title {
  font-size: 22px;
  font-weight: 600;
  color: #241e5e;
  text-transform: lowercase;
  white-space: nowrap;
  margin: 0;
}

.gallery-month__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #e5aa8f 0%, rgba(229, 170, 143, 0.15) 100%);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 991px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .gallery-page {
    padding-top: 110px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .gallery-month__title {
    font-size: 18px;
  }
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #faf0ec;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover,
.gallery-item:focus {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(36, 30, 94, 0.12);
  outline: none;
}

.gallery-item__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #f7e5dd;
}

.gallery-item__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(36, 30, 94, 0.72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: 18px;
}

.gallery-item__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 10px 10px;
  background: linear-gradient(180deg, transparent 0%, rgba(36, 30, 94, 0.78) 100%);
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
}

.gallery-load-more {
  text-align: center;
  margin-top: 10px;
}

.gallery-load-more .theme_btn {
  min-width: 180px;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 30, 0.92);
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox__stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px 72px;
}

.gallery-lightbox__media-wrap {
  max-width: min(92vw, 1200px);
  max-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox__media-wrap img,
.gallery-lightbox__media-wrap video {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  background: #000;
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 90px;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
}

.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus {
  background: rgba(255, 255, 255, 0.32);
  outline: none;
}

.gallery-lightbox__nav--prev {
  left: 12px;
  border-radius: 0 8px 8px 0;
}

.gallery-lightbox__nav--next {
  right: 12px;
  border-radius: 8px 0 0 8px;
}

.gallery-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__close:focus {
  background: rgba(255, 255, 255, 0.32);
  outline: none;
}

.gallery-lightbox__caption {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: min(90vw, 720px);
  color: #fff;
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  padding: 0 16px;
}

.gallery-lightbox__counter {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  letter-spacing: 0.04em;
}

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

body.gallery-lightbox-open #scrollUp {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 767px) {
  .gallery-lightbox__stage {
    padding: 64px 8px 80px;
  }

  .gallery-lightbox__nav {
    width: 42px;
    height: 72px;
    font-size: 22px;
  }

  .gallery-lightbox__nav--prev {
    left: 0;
  }

  .gallery-lightbox__nav--next {
    right: 0;
  }
}
