.gallery-page.dv-home {
  --gallery-ink: #2b241e;
  --gallery-text: #655d56;
  --gallery-muted: #7b736b;
  --gallery-gold: #a8844d;
  --gallery-line: rgba(65, 51, 41, .14);
  --gallery-cream: #f6f2eb;
  --gallery-warm: #fbf9f5;
  --gallery-surface: #fff;
  background: var(--gallery-warm);
  color: var(--gallery-text);
}

.gallery-page.dv-home main {
  overflow: clip;
}

.gallery-page.dv-home .container {
  width: min(100% - 96px, 1200px);
  margin-inline: auto;
}

.gallery-page.dv-home main :is(h1, h2, h3) {
  color: var(--gallery-ink);
}

.gallery-hero {
  position: relative;
  padding: clamp(42px, 5vw, 66px) 0 clamp(54px, 6vw, 78px);
  background:
    radial-gradient(circle at 76% 24%, rgba(255, 255, 255, .9), transparent 34%),
    linear-gradient(135deg, #f8f5ef, var(--gallery-cream));
}

.gallery-hero__layout {
  position: relative;
  display: grid;
  min-height: 430px;
  grid-template-columns: minmax(0, .92fr) minmax(460px, 1.08fr);
  align-items: center;
  gap: clamp(42px, 6vw, 78px);
}

.gallery-hero__content {
  position: relative;
  z-index: 4;
  max-width: 610px;
}

.gallery-hero__content h1 {
  max-width: 9em;
  margin: 0;
  font-size: clamp(2.6rem, 4.2vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: -.03em;
}

.gallery-hero__content h1 :is(span, em) {
  display: block;
}

.gallery-hero__content h1 em {
  color: var(--gallery-gold);
}

.gallery-hero__content > p {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--gallery-text);
  font-size: 1.05rem;
  line-height: 1.7;
}

.gallery-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 26px;
}

.gallery-hero__collage {
  position: relative;
  min-height: 430px;
}

.gallery-hero-photo {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border: 6px solid rgba(255, 255, 255, .94);
  border-radius: 20px;
  background: #e3dacd;
  box-shadow: 0 18px 42px rgba(65, 51, 41, .12);
  transition: transform 420ms var(--ease-standard), box-shadow 420ms var(--ease-standard);
}

.gallery-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-standard);
}

.gallery-hero-photo--interior {
  top: 3%;
  left: 9%;
  width: 61%;
  height: 58%;
}

.gallery-hero-photo--treatment {
  right: 1%;
  bottom: 3%;
  z-index: 3;
  width: 31%;
  height: 48%;
  transform: rotate(2deg);
}

.gallery-hero-photo--treatment img {
  object-position: center 34%;
}

.gallery-hero-photo--consultation {
  top: 0;
  right: 3%;
  z-index: 2;
  width: 28%;
  height: 35%;
  transform: rotate(1.5deg);
}

.gallery-hero-photo--entrance {
  bottom: 0;
  left: 1%;
  z-index: 2;
  width: 28%;
  height: 39%;
  transform: rotate(-2deg);
}

.gallery-hero-photo--team {
  right: 20%;
  bottom: 0;
  z-index: 1;
  width: 42%;
  height: 31%;
  transform: rotate(-1deg);
}

.gallery-hero-photo--team img {
  object-position: center 42%;
}

.gallery-hero-label {
  position: absolute;
  z-index: 5;
  padding: 8px 12px;
  border: 1px solid var(--gallery-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 22px rgba(65, 51, 41, .08);
  color: var(--gallery-ink);
  font-size: .67rem;
  font-weight: 600;
}

.gallery-hero-label--place { top: 8%; left: 0; }
.gallery-hero-label--care { right: 0; bottom: 9%; }

.gallery-hero__scroll {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gallery-muted);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.gallery-hero__scroll span:last-child {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--gallery-line);
  border-radius: 50%;
}

.gallery-collection {
  padding: clamp(68px, 7vw, 96px) 0 clamp(76px, 8vw, 112px);
  background: var(--gallery-warm);
}

.gallery-collection__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .62fr);
  align-items: end;
  gap: clamp(34px, 7vw, 110px);
  margin-bottom: 34px;
}

.gallery-collection__header h2 {
  max-width: 11em;
}

.gallery-collection__header h2 :is(span, em) {
  display: block;
}

.gallery-collection__header h2 em {
  color: var(--gallery-gold);
}

.gallery-collection__header > p {
  max-width: 470px;
  margin: 0 0 4px;
  color: var(--gallery-text);
  line-height: 1.7;
}

.gallery-filter {
  display: flex;
  max-width: 100%;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--gallery-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  scrollbar-width: none;
  scroll-padding-inline: 6px;
  overscroll-behavior-inline: contain;
}

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

.gallery-filter__button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--gallery-text);
  font: 600 .76rem/1.2 var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 260ms ease,
    background-color 260ms ease,
    border-color 260ms ease,
    transform 260ms var(--ease-standard);
}

.gallery-filter__button.is-active,
.gallery-filter__button[aria-pressed="true"] {
  border-color: #413329;
  background: #413329;
  color: #fbf9f5;
}

.gallery-filter__status {
  min-height: 22px;
  margin: 0 0 28px;
  padding-left: 8px;
  color: var(--gallery-muted);
  font-size: .76rem;
  line-height: 1.5;
}

.gallery-collection__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: start;
  gap: clamp(14px, 1.5vw, 20px);
}

.gallery-card {
  grid-column: span 4;
  min-width: 0;
  padding: 6px;
  overflow: hidden;
  border: 1px solid var(--gallery-line);
  border-radius: 20px;
  background: var(--gallery-surface);
  box-shadow: 0 14px 36px rgba(65, 51, 41, .07);
  color: var(--gallery-ink);
  cursor: zoom-in;
  appearance: none;
  text-align: left;
  transition:
    opacity 240ms ease,
    transform 340ms var(--ease-standard),
    box-shadow 340ms var(--ease-standard),
    border-color 280ms ease;
}

.gallery-card--wide { grid-column: span 8; }
.gallery-card--result { grid-column: span 6; }

.gallery-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 15px;
  aspect-ratio: 4 / 3;
  background: #e8e1d6;
}

.gallery-card--wide .gallery-card__media { aspect-ratio: 16 / 9; }
.gallery-card--tall .gallery-card__media { aspect-ratio: 4 / 5; }
.gallery-card--square .gallery-card__media,
.gallery-card--result .gallery-card__media { aspect-ratio: 1; }

.gallery-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-standard);
}

.gallery-card--tall .gallery-card__media img {
  object-position: center 34%;
}

.gallery-card--result .gallery-card__media {
  background: #f7f3ec;
}

.gallery-card--result .gallery-card__media img {
  object-fit: contain;
}

.gallery-card__view {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(65, 51, 41, .12);
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--gallery-ink);
  font-size: 1rem;
  opacity: .92;
}

.gallery-card__caption {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 10px 8px;
  font-size: clamp(.88rem, 1.1vw, .98rem);
  font-weight: 650;
  line-height: 1.35;
}

.gallery-card__caption > span:first-child {
  display: grid;
  gap: 4px;
}

.gallery-card__caption small {
  color: var(--gallery-gold);
  font-size: .59rem;
  font-weight: 750;
  letter-spacing: .13em;
  line-height: 1.3;
  text-transform: uppercase;
}

.gallery-card.is-filtered-out {
  opacity: 0;
  transform: translateY(8px) scale(.985);
}

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

.gallery-page-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 42px);
  color: #fff;
}

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

.gallery-page-lightbox__backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: rgba(22, 18, 15, .94);
  cursor: zoom-out;
}

.gallery-page-lightbox__panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 1280px);
  max-height: 92svh;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  opacity: 0;
  transform: scale(.98);
  transition: opacity 240ms ease, transform 280ms var(--ease-standard);
}

.gallery-page-lightbox.is-open .gallery-page-lightbox__panel {
  opacity: 1;
  transform: scale(1);
}

.gallery-page-lightbox__figure {
  min-width: 0;
  margin: 0;
}

.gallery-page-lightbox__figure img {
  display: block;
  width: 100%;
  max-width: min(100%, 1120px);
  max-height: min(76svh, 790px);
  margin-inline: auto;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, .04);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .42);
}

.gallery-page-lightbox__caption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  color: rgba(255, 255, 255, .64);
  font-size: .72rem;
}

.gallery-page-lightbox__caption span:first-child {
  color: #fff;
  font-size: clamp(.98rem, 1.4vw, 1.2rem);
  font-weight: 650;
}

.gallery-page-lightbox__caption span:nth-child(2) {
  color: #d8c39d;
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.gallery-page-lightbox__close,
.gallery-page-lightbox__nav {
  display: grid;
  width: 50px;
  min-width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: inherit;
  font-size: 1.35rem;
  cursor: pointer;
  transition: background-color 220ms ease, border-color 220ms ease, transform 220ms var(--ease-standard);
}

.gallery-page-lightbox__close {
  position: absolute;
  top: -10px;
  right: -10px;
  z-index: 3;
  background: #413329;
}

.gallery-page-lightbox__nav--prev { justify-self: end; }
.gallery-page-lightbox__nav--next { justify-self: start; }

body.gallery-page-lightbox-open { overflow: hidden; }

.gallery-page :is(.gallery-filter__button, .gallery-card, .gallery-hero__scroll):focus-visible,
.gallery-page-lightbox :is(.gallery-page-lightbox__close, .gallery-page-lightbox__nav):focus-visible {
  outline: 3px solid var(--gallery-gold);
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .gallery-hero-photo:hover img,
  .gallery-card:hover img {
    transform: scale(1.025);
  }

  .gallery-hero-photo--treatment:hover,
  .gallery-hero-photo--consultation:hover {
    transform: rotate(.5deg) translateY(-3px);
  }

  .gallery-hero-photo--entrance:hover,
  .gallery-hero-photo--team:hover {
    transform: rotate(-.4deg) translateY(-3px);
  }

  .gallery-card:hover {
    border-color: rgba(168, 132, 77, .38);
    box-shadow: 0 20px 48px rgba(65, 51, 41, .11);
    transform: translateY(-3px);
  }

  .gallery-card--result:hover img {
    transform: none;
  }

  .gallery-filter__button:hover {
    border-color: rgba(168, 132, 77, .34);
    color: var(--gallery-gold);
    transform: translateY(-1px);
  }

  .gallery-filter__button:is(.is-active, [aria-pressed="true"]):hover {
    color: #fbf9f5;
  }

  .gallery-page-lightbox__close:hover,
  .gallery-page-lightbox__nav:hover {
    border-color: #d8c39d;
    background: rgba(168, 132, 77, .5);
    transform: translateY(-2px);
  }
}

@media (max-width: 1100px) {
  .gallery-page.dv-home .container {
    width: min(100% - 64px, 1200px);
  }

  .gallery-hero__layout {
    grid-template-columns: minmax(0, .9fr) minmax(400px, 1.1fr);
    gap: 36px;
  }

  .gallery-card,
  .gallery-card--wide,
  .gallery-card--result {
    grid-column: span 6;
  }

  .gallery-card--wide .gallery-card__media {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 900px) {
  .gallery-hero__layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .gallery-hero__content { max-width: 680px; }

  .gallery-hero__collage {
    width: min(100%, 620px);
    min-height: 390px;
    margin-inline: auto;
  }

  .gallery-collection__header {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

@media (max-width: 700px) {
  .gallery-page.dv-home .container {
    width: calc(100% - 40px);
  }

  .gallery-hero {
    padding: 36px 0 54px;
  }

  .gallery-hero__content > p {
    margin-top: 16px;
    font-size: .94rem;
  }

  .gallery-hero__actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: 22px;
  }

  .gallery-hero__actions .dv-button { width: 100%; }

  .gallery-hero__collage {
    min-height: min(102vw, 410px);
  }

  .gallery-hero-photo {
    border-width: 5px;
    border-radius: 16px;
  }

  .gallery-hero-photo--interior { left: 2%; width: 70%; }
  .gallery-hero-photo--consultation { right: 0; width: 31%; }
  .gallery-hero-photo--treatment { right: 0; width: 38%; }
  .gallery-hero-photo--entrance { left: 0; width: 32%; }
  .gallery-hero-photo--team { right: 18%; width: 50%; }
  .gallery-hero-label { display: none; }
  .gallery-hero__scroll { display: none; }

  .gallery-collection {
    padding: 54px 0 70px;
  }

  .gallery-filter {
    width: calc(100vw - 40px);
    scroll-snap-type: x proximity;
  }

  .gallery-filter__button {
    min-height: 44px;
    scroll-snap-align: start;
  }

  .gallery-card__caption {
    min-height: 68px;
    font-size: .9rem;
  }

  .gallery-page-lightbox {
    padding: 14px;
  }

  .gallery-page-lightbox__panel {
    width: 100%;
    max-height: calc(100svh - 28px);
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .gallery-page-lightbox__figure {
    grid-column: 1 / -1;
    order: 1;
  }

  .gallery-page-lightbox__figure img {
    max-height: calc(100svh - 190px);
    border-radius: 14px;
  }

  .gallery-page-lightbox__caption {
    grid-template-columns: 1fr auto;
    gap: 7px 12px;
  }

  .gallery-page-lightbox__caption span:first-child {
    grid-column: 1 / -1;
  }

  .gallery-page-lightbox__nav {
    order: 2;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    border-radius: 12px;
  }

  .gallery-page-lightbox__close {
    top: 8px;
    right: 8px;
  }
}

@media (max-width: 640px) {
  .gallery-collection__grid {
    grid-template-columns: 1fr;
  }

  .gallery-card,
  .gallery-card--wide,
  .gallery-card--result {
    grid-column: 1;
  }

  .gallery-card--wide .gallery-card__media {
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 390px) {
  .gallery-hero__collage { min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-page :is(.gallery-hero-photo, .gallery-hero-photo img, .gallery-filter__button,
    .gallery-card, .gallery-card img),
  .gallery-page-lightbox :is(.gallery-page-lightbox__panel, .gallery-page-lightbox__close,
    .gallery-page-lightbox__nav) {
    animation: none;
    transition: none;
  }

  .gallery-page :is(.gallery-hero-photo, .gallery-card):hover,
  .gallery-page :is(.gallery-hero-photo, .gallery-card):hover img {
    transform: none;
  }
}
