.home-gallery {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(64px, 8vw, 110px) 24px;
}

.home-gallery__inner { max-width: 1152px; margin-inline: auto; }
.home-gallery__tiles {
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 40px 0 0;
  list-style: none;
}
.home-gallery__tile {
  position: relative;
  isolation: isolate;
  flex: 1 1 0;
  min-width: 0;
  height: 440px;
  overflow: hidden;
  border-radius: 16px;
  background: #17232b;
  color: #fff;
  transition: flex-grow 500ms ease;
}
.home-gallery__tile img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 400ms ease, transform 500ms ease;
}
.home-gallery__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgb(0 0 0 / 88%), rgb(0 0 0 / 25%) 65%, transparent);
}
.home-gallery__trigger {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.home-gallery__trigger:focus { outline: none; box-shadow: none; }
.home-gallery__trigger:focus-visible { outline: 2px solid #fff; outline-offset: -6px; border-radius: inherit; }
.home-gallery__caption { position: absolute; inset: auto 24px 24px; pointer-events: none; }
.home-gallery__caption h3 { margin: 0 0 10px; font-size: clamp(20px, 2.3vw, 28px); }
.home-gallery__caption p { margin: 0; font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.home-gallery__collapsed { display: none; }
.is-enhanced .home-gallery__tile[data-active="true"] { flex-grow: 5; }
.is-enhanced .home-gallery__tile[data-active="false"] img { filter: grayscale(1); transform: scale(1.06); }
.is-enhanced .home-gallery__tile[data-active="false"] .home-gallery__caption { visibility: hidden; opacity: 0; }
.is-enhanced .home-gallery__tile[data-active="false"] .home-gallery__collapsed {
  display: block;
  position: absolute;
  bottom: 24px;
  left: 50%;
  writing-mode: vertical-rl;
  transform: translateX(-50%);
  max-height: calc(100% - 48px);
  overflow: hidden;
  font-size: 16px;
}
.home-gallery__tiles:not(.is-enhanced) { flex-wrap: wrap; }
.home-gallery__tiles:not(.is-enhanced) .home-gallery__tile { flex-basis: 280px; }
@media (max-width: 767px) {
  .home-gallery { padding-inline: 16px; }
  .home-gallery__tiles { flex-direction: column; }
  .home-gallery__tile { flex: none; height: 300px; }
  .is-enhanced .home-gallery__tile { flex: none; height: 110px; transition: height 500ms ease; }
  .is-enhanced .home-gallery__tile[data-active="true"] { height: 340px; }
  .is-enhanced .home-gallery__tile[data-active="false"] .home-gallery__collapsed {
    writing-mode: horizontal-tb;
    transform: none;
    inset: 0 20px;
    max-height: none;
    display: flex;
    align-items: center;
    text-align: right;
  }
  .home-gallery__caption { inset-inline: 20px; bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-gallery__tile, .home-gallery__tile img, .is-enhanced .home-gallery__tile { transition: none; }
}
