/* ==========================
   Галерея — главная страница
   ========================== */

.gallery-section {
  margin-bottom: 1rem;
}

/* ── Лэйаут: слайдер + вертикальный столбик превью ── */
.gallery-layout {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: flex-start;
}

.gallery-layout .gallery-swiper-wrap {
  flex: 0 1 635px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.gallery-layout .gallery-thumbs {
  flex: 1 1 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
  max-height: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) rgba(0,0,0,.3);
}

.gallery-layout .gallery-thumbs::-webkit-scrollbar       { width: 3px; }
.gallery-layout .gallery-thumbs::-webkit-scrollbar-track { background: rgba(0,0,0,.3); border-radius: 2px; }
.gallery-layout .gallery-thumbs::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.gallery-thumb {
  position: relative;
  border: 1px solid rgba(var(--color-gold-rgb), .2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  background-color: rgba(0,0,0,.4);
  transition: border-color .25s, box-shadow .25s;
}

.gallery-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: filter .3s, transform .35s;
  filter: brightness(.6) saturate(.85);
}

.gallery-thumb:hover img,
.gallery-thumb.is-active img {
  filter: brightness(.95) saturate(1.15);
  transform: scale(1.06);
}

.gallery-thumb.is-active {
  border-color: var(--color-gold);
  box-shadow: 0 0 10px rgba(var(--color-gold-rgb), .4);
}

/* < 1200px: превью скрыты, слайдер резиновый на всю ширину блока */
@media (max-width: 1199.98px) {
  .gallery-layout .gallery-swiper-wrap { flex: 1 1 auto; }
  .gallery-layout .gallery-thumbs      { display: none; }
}

/* ── Swiper обёртка ── */
.gallery-swiper {
  position: relative;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: var(--gallery-aspect, 16 / 9);
  background-color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.gallery-slide {
  position: relative;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Угловые рамки */
.gallery-swiper::before,
.gallery-swiper::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border-color: var(--color-gold);
  border-style: solid;
  z-index: 3;
  pointer-events: none;
  opacity: .7;
  transition: opacity .3s;
}
.gallery-swiper::before {
  top: 8px; left: 8px;
  border-width: 2px 0 0 2px;
  border-radius: 2px 0 0 0;
}
.gallery-swiper::after {
  bottom: 8px; right: 8px;
  border-width: 0 2px 2px 0;
  border-radius: 0 0 2px 0;
}
.gallery-swiper:hover::before,
.gallery-swiper:hover::after { opacity: 1; }

/* ── Подпись ── */
.gallery-main__caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px 14px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%);
  font-family: "Oranienbaum", serif;
  font-size: .95rem;
  letter-spacing: .06em;
  color: var(--color-gold);
  pointer-events: none;
  z-index: 2;
}
.gallery-main__caption span {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: .7rem;
  font-weight: 400;
  color: rgba(240, 240, 240, .55);
  margin-top: 2px;
  font-style: italic;
}
.gallery-main__caption span:first-child {
  font-family: "Oranienbaum", serif;
  font-size: .95rem;
  color: inherit;
  font-style: normal;
}

/* ── Стрелки ── */
.gallery-main__arrow {
  position: absolute;
  top: 0; bottom: 0;
  width: 13%;
  z-index: 10;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem;
  line-height: 1;
  color: rgba(255, 255, 255, .2);
  cursor: pointer;
  transition: color .3s, background .3s;
  user-select: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.gallery-main__arrow--prev { left: 0; }
.gallery-main__arrow--next { right: 0; }
.gallery-main__arrow--prev:hover {
  color: rgba(255, 255, 255, .7);
  background: linear-gradient(to right, rgba(0,0,0,.2) 0%, transparent 100%);
}
.gallery-main__arrow--next:hover {
  color: rgba(255, 255, 255, .7);
  background: linear-gradient(to left, rgba(0,0,0,.2) 0%, transparent 100%);
}

/* ── Прогресс-бар ── */
.gallery-main__progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--color-gold);
  z-index: 4;
  pointer-events: none;
  opacity: .7;
}
.gallery-main__progress.is-running {
  animation: gallery-progress linear forwards;
  animation-duration: var(--gallery-autoplay, 5000ms);
}
@keyframes gallery-progress {
  from { width: 0%; }
  to   { width: 100%; }
}

/* ── Футер: пагинация + счётчик ── */
.gallery-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}

.gallery-swiper-pagination {
  display: flex;
  gap: 5px;
  flex: 1;
}

/* Swiper перезаписывает bullet — переопределяем */
.gallery-swiper-pagination .swiper-pagination-bullet,
.gallery-dot {
  width: 20px !important;
  height: 3px !important;
  border-radius: 2px !important;
  background: rgba(255,255,255,.15) !important;
  opacity: 1 !important;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background .25s, transform .2s;
  flex-shrink: 0;
}
.gallery-swiper-pagination .swiper-pagination-bullet-active,
.gallery-dot.is-active {
  background: var(--color-gold) !important;
  transform: scaleY(1.6);
}

.gallery-counter {
  font-family: "Montserrat", sans-serif;
  font-size: .65rem;
  color: rgba(240,240,240,.4);
  letter-spacing: .1em;
  white-space: nowrap;
}

/* ── GLightbox — стилизация под проект ── */
.glightbox-container .goverlay {
  background: rgba(0, 0, 0, .93);
}

/* Картинка с рамкой */
.glightbox-container .gslide-image img {
  border: 1px solid rgba(var(--color-gold-rgb), .35);
  border-radius: var(--radius-sm);
}

/* Подложка описания — прозрачная */
.glightbox-container .gdesc-inner,
.glightbox-clean .gdesc-inner,
.glightbox-clean .description-bottom .gdesc-inner {
  background: transparent;
  border-top: none;
  padding: 8px 0 0;
}

.glightbox-clean .gslide-description {
  background: transparent;
}

.glightbox-clean .gslide-description.description-bottom {
  background: transparent;
}

/* Заголовок — перебиваем нативные стили */
.glightbox-container .gslide-title,
.glightbox-clean .gslide-title {
  font-family: "Oranienbaum", serif !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  color: var(--color-gold) !important;
  letter-spacing: .06em;
  margin: 0 0 2px !important;
  line-height: 1.3 !important;
}

/* Описание */
.glightbox-container .gslide-desc,
.glightbox-clean .gslide-desc {
  font-family: "Montserrat", sans-serif;
  font-size: .72rem;
  color: rgba(240, 240, 240, .45);
  font-style: italic;
}

/* Кнопка закрытия */
.glightbox-container .gclose {
  background: rgba(0, 0, 0, .7);
  border: 1px solid rgba(var(--color-gold-rgb), .45);
  border-radius: 50%;
  color: var(--color-gold);
  transition: background .2s, border-color .2s;
}
.glightbox-container .gclose:hover {
  background: #5a0f0f;
  border-color: #8b1a1a;
  color: #fff;
}
.glightbox-container .gclose svg path {
  fill: currentColor;
}

/* Стрелки */
.glightbox-container .gnext,
.glightbox-container .gprev {
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(var(--color-gold-rgb), .3);
  border-radius: var(--radius-sm);
  color: var(--color-gold);
  transition: background .2s, border-color .2s;
}
.glightbox-container .gnext:hover,
.glightbox-container .gprev:hover {
  background: rgba(var(--color-gold-rgb), .18);
  border-color: var(--color-gold);
}
.glightbox-container .gnext svg path,
.glightbox-container .gprev svg path {
  fill: currentColor;
}