/* Both hosts already establish the containing block for their photographs. */
[data-edition-carousel] > .edition-carousel-controls {
  position: absolute;
  z-index: 2;
  inset-block-start: 12px;
  inset-inline-end: var(--gutter, 16px);
  display: flex;
  gap: 2px;
  pointer-events: none;
}

.cover-plate[data-edition-carousel] > .edition-carousel-controls {
  inset-block-start: calc(clamp(18px, 2vw, 32px) + 3.5rem);
}

.edition-carousel-controls > button {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 0;
  appearance: none;
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: 50%;
  background: rgb(18 25 22 / 88%);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
}

.edition-carousel-controls > button:hover { background: #161c19; }
.edition-carousel-controls > button:disabled { cursor: default; }

[data-edition-carousel] > .edition-carousel-controls > button:focus-visible {
  outline: 3px solid white;
  outline-offset: 1px;
  box-shadow: 0 0 0 6px #161c19;
}

.edition-carousel-controls > button::before {
  content: "";
  box-sizing: border-box;
}

.edition-carousel-controls > [data-carousel-action="toggle"]::before {
  width: 12px;
  height: 14px;
  border-inline: 4px solid currentColor;
}

.edition-carousel-controls > [aria-pressed="false"]::before {
  width: 0;
  height: 0;
  margin-left: 3px;
  border: solid transparent;
  border-width: 7px 0 7px 11px;
  border-left-color: currentColor;
}

.edition-carousel-controls > :is([data-carousel-action="prev"], [data-carousel-action="next"])::before {
  width: 10px;
  height: 10px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: translateX(-2px) rotate(45deg);
}

.edition-carousel-controls > [data-carousel-action="prev"]::before {
  transform: translateX(2px) rotate(-135deg);
}

.cover-plate[data-edition-carousel] > img {
  opacity: 1;
  pointer-events: none;
}

.cover-plate[data-edition-carousel] > img[aria-hidden="true"] { opacity: 0; }

/* Keep the adjacent project count aligned to the original caption width. */
@media (min-width: 721px) {
  .cover-plate [data-carousel-measure]::before {
    content: attr(data-carousel-measure);
    display: block;
    height: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cover-plate[data-edition-carousel] > img { transition: opacity 550ms ease; }
  .studio-front[data-edition-carousel] > .studio-front-photo {
    transition: opacity 550ms ease, visibility 550ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-edition-carousel] > img { transition: none; }
}
