.ombre-gallery {
  --og-gap: clamp(0.75rem, 1.6vw, 1rem);
  --og-radius: 0.9rem;
  --og-thumb-width: clamp(112px, 15vw, 170px);
  display: grid;
  gap: var(--og-gap);
}

.ombre-gallery__desktop-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--og-gap);
}

.ombre-gallery__top-btn,
.ombre-gallery__mobile-hero,
.ombre-gallery__thumb,
.ombre-gallery__open-btn {
  border: 0;
  margin: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  background: transparent;
}

.ombre-gallery__top-btn,
.ombre-gallery__mobile-hero,
.ombre-gallery__thumb {
  cursor: pointer;
}

.ombre-gallery__frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--og-radius);
  aspect-ratio: 16 / 9;
}

.ombre-gallery__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.ombre-gallery__mobile-top {
  display: none;
}

.ombre-gallery__desktop-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.1rem;
}

.ombre-gallery__open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  background: rgba(177, 116, 87, 0.14);
  color: #b17457;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.ombre-gallery__open-btn:hover,
.ombre-gallery__open-btn:focus-visible {
  background: rgba(177, 116, 87, 0.22);
  outline: none;
}

.ombre-gallery__thumbs {
  overflow: hidden;
  width: 100%;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.ombre-gallery__thumbs.is-dragging {
  cursor: grabbing;
}

.ombre-gallery__thumbs.is-dragging .ombre-gallery__thumb {
  pointer-events: none;
}

.ombre-gallery__rail {
  display: flex;
  width: max-content;
  will-change: transform;
}

.ombre-gallery__track {
  display: flex;
  gap: 0.7rem;
  padding-block: 0.1rem;
  padding-inline-end: 0.7rem;
}

.ombre-gallery__thumb {
  width: var(--og-thumb-width);
  flex: 0 0 auto;
  touch-action: pan-y;
}

.ombre-gallery__thumb:focus-visible,
.ombre-gallery__top-btn:focus-visible,
.ombre-gallery__mobile-hero:focus-visible {
  outline: 2px solid rgba(177, 116, 87, 0.45);
  outline-offset: 2px;
}

.ombre-gallery__thumb .ombre-gallery__frame {
  border-radius: 0.7rem;
  touch-action: pan-y;
}

.ombre-gallery__thumb .ombre-gallery__frame img {
  touch-action: pan-y;
}

.ombre-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
}

.ombre-gallery-lightbox.is-open {
  display: grid;
  place-items: center;
}

.ombre-gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.ombre-gallery-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(94vw, 1280px);
  max-height: 90vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: start;
  color: #faf7f0;
}

.ombre-gallery-lightbox__close,
.ombre-gallery-lightbox__prev,
.ombre-gallery-lightbox__next {
  border: 0;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 999px;
  background: rgba(78, 78, 78, 0.86);
  color: #faf7f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.ombre-gallery-lightbox__close {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  z-index: 2;
}

.ombre-gallery-lightbox__prev {
  position: absolute;
  left: clamp(0.5rem, 2vw, 1rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.ombre-gallery-lightbox__next {
  position: absolute;
  right: clamp(0.5rem, 2vw, 1rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.ombre-gallery-lightbox__figure {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  width: 100%;
  display: grid;
  place-items: center;
  touch-action: pan-y;
}

.ombre-gallery-lightbox__figure img {
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
}

.ombre-gallery-lightbox__counter {
  grid-column: 1;
  grid-row: 2;
  justify-self: center;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.ombre-gallery-lightbox__close:hover,
.ombre-gallery-lightbox__close:focus-visible,
.ombre-gallery-lightbox__prev:hover,
.ombre-gallery-lightbox__prev:focus-visible,
.ombre-gallery-lightbox__next:hover,
.ombre-gallery-lightbox__next:focus-visible {
  background: rgba(102, 102, 102, 0.95);
  outline: none;
}

@media (max-width: 599px) {
  .ombre-gallery {
    --og-thumb-width: clamp(98px, 34vw, 130px);
  }

  .ombre-gallery__desktop-top {
    display: none;
  }

  .ombre-gallery__mobile-top {
    display: grid;
    gap: 0.75rem;
  }

  .ombre-gallery-lightbox__figure img {
    max-width: 90vw;
    max-height: 74vh;
  }

  .ombre-gallery-lightbox__prev,
  .ombre-gallery-lightbox__next,
  .ombre-gallery-lightbox__close {
    width: 2.45rem;
    height: 2.45rem;
  }
}
