/* Athlete photo archive — a continuous, edge-to-edge sports reel. */

.athlete-gallery-loop {
  grid-column: 1 / -1;
  display: block;
  min-height: 0;
  padding: 0 0 18px;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--hero) 28%, var(--line));
  background: #080d27;
  cursor: default;
}

.athlete-gallery-loop:hover { transform: none; }
.athlete-gallery-loop .bento-spotlight { z-index: 4; }

.athlete-loop-viewport {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(12px, 1.4vw, 18px) 0 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  cursor: grab;
  touch-action: pan-x pan-y;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 2.5%, #000 97.5%, transparent);
}

.athlete-loop-viewport:active { cursor: grabbing; }
.athlete-loop-viewport::-webkit-scrollbar { display: none; }

.athlete-loop-track {
  display: flex;
  width: max-content;
}

.athlete-loop-set {
  display: flex;
  gap: clamp(14px, 1.6vw, 20px);
  padding-left: clamp(14px, 1.6vw, 20px);
}

.athlete-loop-card {
  position: relative;
  flex: 0 0 clamp(320px, 33vw, 450px);
  width: clamp(320px, 33vw, 450px);
  height: clamp(500px, 47vw, 650px);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: clamp(22px, 2vw, 30px);
  background: #111735;
  color: #fff;
  box-shadow: 0 24px 54px -28px rgba(0, 0, 0, 0.88);
  isolation: isolate;
}

.athlete-loop-card.is-wide {
  flex-basis: clamp(520px, 57vw, 780px);
  width: clamp(520px, 57vw, 780px);
}

.athlete-loop-card::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 8, 24, 0.08), transparent 48%),
    linear-gradient(180deg, transparent 55%, rgba(4, 8, 24, 0.88) 100%);
  content: "";
  pointer-events: none;
}

.athlete-loop-card img,
.athlete-loop-card video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--athlete-position, center);
  filter: saturate(0.98) contrast(1.035);
  transform: scale(1.045);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.athlete-loop-card video { background: #080d27; }

.athlete-loop-card:hover img,
.athlete-loop-card:hover video { transform: scale(1.085); }

.athlete-loop-card figcaption {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  padding: clamp(24px, 3vw, 38px);
}

.athlete-loop-card figcaption span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.athlete-loop-card figcaption h3 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 3.6vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 0.96;
}

.athlete-loop-controls {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 5px clamp(18px, 2.4vw, 30px) 0;
}

.athlete-loop-controls button {
  min-width: 42px;
  height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.athlete-loop-controls button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.athlete-loop-controls button:focus-visible,
.athlete-loop-viewport:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.athlete-loop-controls button:disabled {
  cursor: default;
  opacity: 0.62;
  transform: none;
}

@media (max-width: 680px) {
  .athlete-loop-card,
  .athlete-loop-card.is-wide {
    flex-basis: min(82vw, 430px);
    width: min(82vw, 430px);
    height: min(68svh, 570px);
  }

  .athlete-loop-set {
    gap: 12px;
    padding-left: 12px;
  }

  .athlete-loop-card figcaption { padding: 24px 22px; }
  .athlete-loop-card figcaption h3 { font-size: clamp(2rem, 10vw, 3.1rem); }
  .athlete-loop-controls { padding-inline: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .athlete-loop-card img { transition: none; transform: none; }
  .athlete-loop-card:hover img { transform: none; }
}
