.story-family-gallery {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(82px, 9vw, 138px) 0;
}

.story-family-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: clamp(38px, 8vw, 130px);
  align-items: end;
  margin-bottom: 42px;
}

.story-family-heading h2 {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: clamp(44px, 5vw, 76px);
  font-weight: 400;
  line-height: .98;
}

.story-family-heading > p {
  margin: 0 0 7px;
  color: var(--muted-text);
  font-size: 18px;
  line-height: 1.65;
}

.story-family-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.story-family-photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e8ebe5;
}

.story-family-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-family-photo img[alt="Loretta nella boutique DAN Roma"] {
  object-position: center top;
}

.story-family-photo figcaption {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  width: max-content;
  max-width: calc(100% - 36px);
  padding: 10px 13px;
  color: #fff;
  background: rgba(23, 35, 31, .84);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.story-family-motion {
  margin-bottom: clamp(62px, 7vw, 96px);
}

.story-family-motion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "style roots"
    "style world";
  gap: 22px;
  align-items: start;
}

.story-family-film {
  min-width: 0;
  margin: 0;
}

.story-family-film--roots { grid-area: roots; }
.story-family-film--style {
  grid-area: style;
  align-self: start;
}
.story-family-film--world { grid-area: world; }

.story-family-film-frame {
  position: relative;
  overflow: hidden;
  background: #e8ebe5;
}

.story-family-film video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #e8ebe5;
}

.story-family-film-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 50%;
  color: #fff;
  background: rgba(23, 57, 47, .86);
  box-shadow: 0 8px 24px rgba(10, 27, 23, .22);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.story-family-film-toggle:hover,
.story-family-film-toggle:focus-visible,
.story-family-film-frame[data-family-film-state="ended"] .story-family-film-toggle {
  color: #17392f;
  background: #f6f3ec;
}

.story-family-film-toggle:focus-visible {
  outline: 3px solid #c28d3d;
  outline-offset: 3px;
}

.story-family-film-toggle:active {
  transform: scale(.96);
}

[dir="rtl"] .story-family-film-toggle {
  right: auto;
  left: 12px;
}

.story-family-film figcaption {
  margin-top: 12px;
  color: #17392f;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .14em;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Share the bottom caption track: both film edges align even when translations wrap. */
@supports (grid-template-rows: subgrid) {
@media (min-width: 761px) {
  .story-family-motion-grid {
    grid-template-areas: none;
    grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    column-gap: 22px;
    row-gap: 0;
    align-items: stretch;
  }

  .story-family-film {
    display: grid;
    grid-template-rows: subgrid;
    min-height: 0;
    align-self: stretch;
  }

  .story-family-film--style { grid-area: 1 / 1 / 5 / 2; }
  .story-family-film--roots { grid-area: 1 / 2 / 3 / 3; }
  .story-family-film--world { grid-area: 3 / 2 / 5 / 3; }
  .story-family-film--style .story-family-film-frame { grid-row: 1 / 4; }
  .story-family-film--style figcaption { grid-row: 4; }
  .story-family-film--roots figcaption { margin-bottom: 22px; }

  .story-family-film:not(.story-family-film--style) .story-family-film-frame {
    min-height: 0;
  }

  .story-family-film:not(.story-family-film--style) video {
    position: absolute;
    inset: 0;
    height: 100%;
    object-fit: cover;
  }
}
}

.story-family-motion + .story-family-grid {
  padding-top: clamp(48px, 6vw, 78px);
  border-top: 1px solid rgba(23, 57, 47, .16);
}

@media (max-width: 768px) {
  .content-card--family img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center;
  }

  .story-family-photo:first-child img {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
  }
}

@media (max-width: 760px) {
  .story-family-heading,
  .story-family-grid,
  .story-family-motion-grid {
    grid-template-columns: 1fr;
  }

  .story-family-heading {
    gap: 20px;
    margin-bottom: 28px;
  }

  .story-family-heading > p {
    font-size: 16px;
  }

  .story-family-motion-grid {
    grid-template-areas:
      "roots"
      "style"
      "world";
    gap: 34px;
  }

  .story-family-film--style {
    width: min(100%, 430px);
    justify-self: center;
  }

  .story-family-film-toggle {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-family-film-toggle {
    transition: none;
  }
}
