
.gallery-page {
  padding-bottom: 160px;
}

.gallery-page__crumbs {
  font-size: 16px;
  padding: 66px 0 24px;
  gap: 8px;
}

.gallery-page__title {
  margin: 0 0 17px;
  font-size: 64px;
  font-weight: 500;
  line-height: 1.1;
  color: var(--color-dark);
}

.gallery__btn {
  width: 100%;
}

.gallery-page__intro {
  letter-spacing: -0.54px;
  max-width: 708px;
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--color-dark);
}

.gallery-page__divider {
  height: 1px;
  border: 0;
  margin: 0 0 22px;
  background: var(--color-border-light);
}

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

.gallery-filters {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.gallery-filters::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 64px;
  background: linear-gradient(to right, rgba(242, 242, 242, 0), var(--color-bg));
  pointer-events: none;
}

.gallery-filters__track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 48px;
  cursor: grab;
}

.gallery-filters__track.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.gallery-filters__track::-webkit-scrollbar {
  display: none;
}

.gallery-filters__track .tab-pill {
  flex-shrink: 0;
  scroll-snap-align: start;
  white-space: nowrap;
}

.gallery-toolbar__nav {
  flex-shrink: 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: row;
  grid-auto-rows: 1px;
  column-gap: 24px;
  row-gap: 0;
  margin-bottom: 32px;
}

.gallery-grid[hidden] {
  display: none;
}

.gallery-grid__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 24px;
  object-fit: cover;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.gallery-grid__img[hidden] {
  display: none;
}

.gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 0 32px;
  padding: 64px 0;
  text-align: center;
  font-size: 16px;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border-radius: 24px;
}

.gallery-empty[hidden] {
  display: none;
}

.gallery-page__more {
  display: flex;
  justify-content: center;
}

.gallery-page__more[hidden] {
  display: none;
}

.gallery-lightbox .modal__overlay {
  cursor: default;
}

.gallery-lightbox.modal {
  align-items: center;
}

.gallery-lightbox__media {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(880px, 90vw);
  max-height: 85vh;
  max-height: 85dvh;
  border-radius: 16px;
  overflow: hidden;
}

.gallery-lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(880px, 90vw);
  max-height: 85vh;
  max-height: 85dvh;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.gallery-lightbox__close {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.gallery-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.08);
}

.gallery-lightbox__close svg {
  width: 24px;
  height: 24px;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-lightbox__close {
    transition: none;
  }

  .gallery-lightbox__close:hover {
    transform: none;
  }
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-dark);
  cursor: pointer;
}

.gallery-lightbox__nav svg {
  width: 24px;
  height: 24px;
}

.gallery-lightbox__nav--prev {
  left: max(24px, 8vw);
}

.gallery-lightbox__nav--next {
  right: max(24px, 8vw);
}

