.premium-gallery-section {
  padding: 90px 0 110px;
  color: #17120e;
  background: #fff;
}

.gallery-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 45px;
}

.gallery-eyebrow {
  color: #c58d3d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.gallery-intro h1 {
  margin: 8px 0 0;
  font-size: clamp(38px, 5vw, 60px);
  font-weight: 600;
  line-height: 1.05;
}

.gallery-intro p {
  max-width: 525px;
  margin: 0;
  color: #70665e;
  font-size: 17px;
  line-height: 1.7;
}

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e8ded5;
}

.gallery-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 17px;
  border: 1px solid #dfd2c5;
  color: #5b4d41;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color .25s ease, background .25s ease, border-color .25s ease, transform .25s ease;
}

.gallery-tab span {
  display: grid;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  place-items: center;
  border-radius: 99px;
  background: #f2ebe4;
  font-size: 11px;
}

.gallery-tab:hover,
.gallery-tab.is-active {
  color: #fff;
  border-color: #75491f;
  background: #75491f;
  transform: translateY(-1px);
}

.gallery-tab.is-active span {
  color: #75491f;
  background: #fff;
}

.premium-gallery-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-auto-rows: 150px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.premium-gallery-item {
  grid-row: span 2;
  min-width: 0;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity .35s ease, transform .35s ease;
}

.premium-gallery-item.gallery-item-wide {
  grid-column: span 2;
}

.premium-gallery-item.is-filtering-out {
  opacity: 0;
  transform: translateY(18px) scale(.97);
}

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

.gallery-image-button {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #e9dfd5;
  cursor: zoom-in;
}

.gallery-image-button > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .65s cubic-bezier(.2,.7,.2,1), filter .35s ease;
}

.gallery-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 28px;
  color: #fff;
  text-align: left;
  background: linear-gradient(180deg, transparent 30%, rgba(30, 15, 5, .88));
  opacity: .92;
  transition: opacity .35s ease;
}

.gallery-image-overlay strong {
  font-size: 24px;
  line-height: 1.2;
}

.gallery-image-overlay small {
  max-width: 460px;
  margin-top: 7px;
  color: rgba(255,255,255,.8);
  font-size: 13px;
}

.gallery-image-categories {
  margin-bottom: 8px;
  color: #e5bd87;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.gallery-image-overlay > i {
  position: absolute;
  top: 23px;
  right: 23px;
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .3s ease, transform .3s ease;
}

.gallery-image-button:hover > img,
.gallery-image-button:focus-visible > img {
  filter: saturate(1.08);
  transform: scale(1.055);
}

.gallery-image-button:hover .gallery-image-overlay > i,
.gallery-image-button:focus-visible .gallery-image-overlay > i {
  opacity: 1;
  transform: translateY(0);
}

.gallery-image-button:focus-visible,
.gallery-tab:focus-visible,
.gallery-lightbox button:focus-visible {
  outline: 3px solid #d6a35e;
  outline-offset: 3px;
}

.gallery-empty {
  padding: 75px 25px;
  border: 1px solid #e5d9cd;
  text-align: center;
  background: #faf7f3;
}

.gallery-empty > i {
  color: #b67c3c;
  font-size: 48px;
}

.gallery-empty h2 {
  margin: 17px 0 8px;
}

.gallery-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  padding: 0;
  border: 0;
  color: #fff;
  background: transparent;
}

.gallery-lightbox::backdrop {
  background: rgba(12, 8, 5, .92);
  backdrop-filter: blur(6px);
}

.gallery-lightbox-backdrop {
  position: fixed;
  inset: 0;
}

.gallery-lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 65px 100px;
}

.gallery-lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(1100px, 100%);
  max-height: 100%;
  margin: 0;
}

.gallery-lightbox figure > img {
  max-width: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
  box-shadow: 0 20px 70px rgba(0,0,0,.4);
}

.gallery-lightbox figcaption {
  width: min(780px, 100%);
  padding-top: 18px;
  text-align: center;
}

.gallery-lightbox h2 {
  margin: 0 0 5px;
  color: #fff;
  font-size: 25px;
}

.gallery-lightbox p {
  margin: 0;
  color: rgba(255,255,255,.72);
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  position: fixed;
  z-index: 2;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  color: #fff;
  background: rgba(40, 23, 11, .45);
  font-size: 22px;
}

.gallery-lightbox-close {
  top: 25px;
  right: 30px;
}

.gallery-lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox-nav.previous {
  left: 28px;
}

.gallery-lightbox-nav.next {
  right: 28px;
}

@media (max-width: 900px) {
  .gallery-intro {
    align-items: flex-start;
    flex-direction: column;
  }

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

@media (max-width: 600px) {
  .premium-gallery-section {
    padding: 65px 0 80px;
  }

  .gallery-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 14px;
    scrollbar-width: thin;
  }

  .gallery-tab {
    flex: 0 0 auto;
  }

  .premium-gallery-grid {
    display: grid;
    grid-auto-rows: 280px;
    grid-template-columns: 1fr;
  }

  .premium-gallery-item,
  .premium-gallery-item.gallery-item-wide {
    grid-column: span 1;
    grid-row: span 1;
  }

  .gallery-image-overlay {
    padding: 22px;
  }

  .gallery-lightbox-panel {
    padding: 70px 15px 110px;
  }

  .gallery-lightbox-nav {
    top: auto;
    bottom: 28px;
    transform: none;
  }

  .gallery-lightbox-nav.previous {
    left: calc(50% - 65px);
  }

  .gallery-lightbox-nav.next {
    right: calc(50% - 65px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .premium-gallery-item,
  .gallery-image-button > img,
  .gallery-image-overlay > i {
    transition: none;
  }
}
