/* Video-specific carousel for the eight portfolio reels. */
.mobile-gallery-head {
  color: var(--muted);
  letter-spacing: .16em;
  text-transform: uppercase;
  justify-content: space-between;
  align-items: center;
  margin: -18px 0 22px;
  font-size: 8px;
  display: flex;
}

.mobile-gallery-head > div {
  display: flex;
  gap: 8px;
}

.mobile-gallery-head button {
  color: var(--ivory);
  cursor: pointer;
  background: transparent;
  border: 1px solid #ffffff35;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
}

.mobile-gallery-head button:hover,
.mobile-gallery-head button:focus-visible {
  color: var(--gold);
  border-color: var(--gold);
  outline: none;
}

.grid.reels {
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  grid-template-columns: none;
  gap: 24px;
  margin: 0;
  padding: 0 0 18px;
  display: flex;
  overflow-x: auto;
}

.grid.reels::-webkit-scrollbar {
  display: none;
}

.grid.reels article,
.reels article:nth-child(4n+2),
.reels article:nth-child(4n+4) {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  flex: 0 0 calc((100% - 48px) / 3);
  margin: 0;
  order: initial;
}

.grid.reels .cover {
  aspect-ratio: 9 / 16;
}

@media (width <= 1024px) {
  .grid.reels {
    gap: 18px;
    margin: 0 -24px;
    padding: 0 24px 18px;
  }

  .grid.reels article,
  .reels article:nth-child(4n+2),
  .reels article:nth-child(4n+4) {
    scroll-snap-align: center;
    flex-basis: 76vw;
  }
}

@media (width <= 650px) {
  .mobile-gallery-head {
    margin: -14px 0 18px;
  }

  .mobile-gallery-head button {
    width: 38px;
    height: 38px;
  }

  .grid.reels {
    gap: 14px;
    margin: 0 -20px;
    padding: 0 20px 18px;
  }

  .grid.reels article,
  .reels article:nth-child(4n+2),
  .reels article:nth-child(4n+4) {
    flex-basis: 84vw;
    order: initial;
  }
}

@media (prefers-reduced-motion: reduce) {
  .grid.reels {
    scroll-behavior: auto;
  }
}
