/**
 * The hero slideshow.
 *
 * The still keeps its place in the flow and so keeps defining the figure's
 * box. The films are layered over it, which means no reflow when a slide
 * changes and no layout shift when the first one finally arrives.
 */

.hero-slides {
  position: relative;
}

/*
 * One 16:9 box for every slide.
 *
 * The films are 16:9; the photograph is 3:2. Left to the photograph's shape
 * the box is 1.6:1 and a film either gets cropped top and bottom or sits
 * letterboxed in it. Pinning the box to 16:9 means a film fills it exactly --
 * no crop, no bars -- and the photograph crops instead, which nobody notices
 * on a corridor shot.
 *
 * Keyed on the markup that is already there -- the image component's masked
 * box -- and not on the class the script adds, because a class that arrives
 * with the script would resize the hero after it had already been painted.
 * This sheet only loads when the films exist, so the shape and the slideshow
 * arrive together or not at all.
 */
.hero__media .ph.mask,
.hero-slides__frame {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

/*
 * Only the fallback box needs a corner given to it. The image component's
 * masked box already has the one the rest of the site uses, and setting it
 * here from a token quietly changed it from 20px to 14px.
 */
.hero-slides__frame:not(.mask) {
  border-radius: var(--r-lg, 14px);
}

.hero__media .ph.mask img,
.hero-slides__frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-slides img {
  transition: opacity .5s ease;
}

.hero-slides img.is-hidden {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slides img { transition: none; }
}

.hero-slides__layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
  border-radius: inherit;
  overflow: hidden;
  z-index: 1;
}

.hero-slides__layer.is-active {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slides__layer { transition: none; }
}

.hero-slides__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.hero-slides__video[hidden] {
  display: none;
}

/* ── Controls ───────────────────────────────────────────────────────── */

/*
 * Below the frame rather than over it. On the page's own background now, so
 * the colours come from the ink tokens instead of white-on-dark.
 */
.hero-slides__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.hero-slides__nav[hidden] {
  display: none;
}

.hero-slides__arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--edge, rgba(23, 27, 34, .16));
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft, #47566D);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}

.hero-slides__arrow:hover {
  border-color: var(--tone, #0F766E);
  color: var(--tone, #0F766E);
}

.hero-slides__arrow:focus-visible,
.hero-slides__dot:focus-visible {
  outline: 2px solid var(--tone, #0F766E);
  outline-offset: 2px;
}

.hero-slides__dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-slides__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--edge, rgba(23, 27, 34, .22));
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}

.hero-slides__dot[aria-current="true"] {
  background: var(--tone, #0F766E);
  transform: scale(1.3);
}

@media (prefers-reduced-motion: reduce) {
  .hero-slides__dot { transition: none; }
}

@media (max-width: 560px) {
  .hero-slides__nav { gap: 8px; margin-top: 10px; }
}

/* ── Transport, above the frame, to the right ───────────────────────── */

.hero-slides__transport {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  margin-bottom: 8px;
}

.hero-slides__transport[hidden] {
  display: none;
}

.hero-slides__tbtn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-mute, #8A95A6);
  cursor: pointer;
  opacity: .62;
  transition: opacity .2s ease, color .2s ease;
}

.hero-slides__tbtn:hover {
  opacity: 1;
  color: var(--tone, #0F766E);
}

.hero-slides__tbtn:focus-visible {
  opacity: 1;
  outline: 2px solid var(--tone, #0F766E);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-slides__tbtn { transition: none; }
}
