.dp-gallery-section {
  --gallery-bg: var(--club-white);
  --gallery-columns: 5;
  --gallery-gap: 12px;
  background: var(--gallery-bg);
  padding: 16px 0 64px;
}

.dp-gallery-section__inner {
  width: var(--content-width);
  max-width: 1160px;
  margin-inline: auto;
}

.dp-gallery-section--width-narrow .dp-gallery-section__inner {
  max-width: 1080px;
}

.dp-gallery-section--width-wide .dp-gallery-section__inner {
  width: calc(100% - 48px);
  max-width: 1440px;
}

.dp-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns), minmax(0, 1fr));
  gap: var(--gallery-gap);
}

.dp-gallery-item {
  margin: 0;
  min-width: 0;
  overflow: hidden;
}

.dp-gallery-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.dp-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.dp-gallery-trigger:hover img,
.dp-gallery-trigger:focus-visible img {
  transform: scale(1.04);
}

.dp-gallery-section--ratio-square .dp-gallery-item {
  aspect-ratio: 1;
}

.dp-gallery-section--ratio-landscape .dp-gallery-item {
  aspect-ratio: 4 / 3;
}

.dp-gallery-section--ratio-portrait .dp-gallery-item {
  aspect-ratio: 3 / 4;
}

.dp-gallery-section--ratio-auto .dp-gallery-item img {
  height: auto;
}

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

.dp-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 56px;
}

.dp-gallery-modal.is-open {
  display: flex;
}

.dp-gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--club-ink-backdrop);
}

.dp-gallery-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
}

.dp-gallery-modal__slider {
  overflow: hidden;
  background: var(--club-ink);
  box-shadow: 0 24px 60px var(--club-ink-shadow-strong);
}

.dp-gallery-modal__slide {
  margin: 0;
}

.dp-gallery-modal__slide img {
  width: 100%;
  max-height: min(78vh, 760px);
  object-fit: contain;
  background: var(--club-ink);
}

.dp-gallery-modal__close {
  position: absolute;
  top: -44px;
  right: 0;
  z-index: 3;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.dp-gallery-modal__close::before,
.dp-gallery-modal__close::after {
  content: "";
  position: absolute;
  top: 16px;
  left: 4px;
  width: 26px;
  height: 2px;
  background: var(--club-white);
}

.dp-gallery-modal__close::before {
  transform: rotate(45deg);
}

.dp-gallery-modal__close::after {
  transform: rotate(-45deg);
}

.dp-gallery-modal__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  width: 44px;
  height: 41px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translateY(-50%);
}

.dp-gallery-modal__arrow--prev {
  left: -64px;
}

.dp-gallery-modal__arrow--next {
  right: -64px;
}

.dp-gallery-modal__arrow img {
  width: 44px;
  height: 41px;
  object-fit: contain;
}

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

  .dp-gallery-modal__arrow--prev {
    left: 12px;
  }

  .dp-gallery-modal__arrow--next {
    right: 12px;
  }
}

@media (max-width: 767px) {
  .dp-gallery-section {
    padding: 12px 0 48px;
  }

  .dp-gallery-modal {
    padding: 48px 20px;
  }

  .dp-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dp-gallery-section--width-wide .dp-gallery-section__inner {
    width: var(--content-width);
  }
}
