:root {
  --athlete-grid-gap: clamp(1.125rem, 2.5vw, 1.75rem);
  --athlete-aspect-ratio: 3 / 4;
  --athlete-columns-desktop: 3;
  --athlete-object-position: center 25%;
  --athlete-accent: #1d4ed8;
  --athlete-accent-light: #60a5fa;
  --athlete-card-bg: #ffffff;
  --athlete-card-border: rgba(15, 23, 42, 0.08);
  --athlete-card-radius: 1rem;
  --athlete-card-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 10px 24px -4px rgba(15, 23, 42, 0.08);
  --athlete-card-shadow-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.14), 0 20px 36px -8px rgba(15, 23, 42, 0.12);
  --athlete-text-primary: #0f172a;
  --athlete-text-secondary: #475569;
  --athlete-focus-color: #1d4ed8;
}

.mod-athlete-gallery {
  width: 100%;
  box-sizing: border-box;
}

.athlete-gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--athlete-grid-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 48rem) {
  .athlete-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 64rem) {
  .athlete-gallery-grid {
    grid-template-columns: repeat(var(--athlete-columns-desktop, 3), 1fr);
  }
}

.athlete-card {
  display: flex;
  flex-direction: column;
  background-color: var(--athlete-card-bg);
  border: 1px solid var(--athlete-card-border);
  border-radius: var(--athlete-card-radius);
  overflow: hidden;
  box-shadow: var(--athlete-card-shadow);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.athlete-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--athlete-card-shadow-hover);
  border-color: rgba(29, 78, 216, 0.22);
}

.athlete-figure {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
  padding: 0;
}

.athlete-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: var(--athlete-aspect-ratio);
  overflow: hidden;
  background-color: #e2e8f0;
}

.athlete-image-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}

.athlete-image-trigger:focus-visible {
  outline: 3px solid var(--athlete-focus-color);
  outline-offset: -3px;
  border-radius: var(--athlete-card-radius);
}

.athlete-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--athlete-object-position, center 25%);
  display: block;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.athlete-card:hover .athlete-img,
.athlete-image-trigger:focus-visible .athlete-img {
  transform: scale(1.05);
}

.athlete-zoom-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #ffffff;
  opacity: 0.8;
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
}

.athlete-card:hover .athlete-zoom-badge,
.athlete-image-trigger:focus-visible .athlete-zoom-badge {
  opacity: 1;
  transform: scale(1.08);
  background-color: var(--athlete-accent);
  border-color: rgba(255, 255, 255, 0.55);
}

.athlete-style-overlay .athlete-card {
  background-color: #0f172a;
  border-color: rgba(15, 23, 42, 0.14);
}

.athlete-style-overlay .athlete-caption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  pointer-events: none;
  padding: clamp(2.5rem, 6vw, 3.5rem) clamp(1rem, 2vw, 1.35rem) clamp(1rem, 2vw, 1.25rem);
  background: linear-gradient(
    to top,
    rgba(15, 23, 42, 0.92) 0%,
    rgba(15, 23, 42, 0.65) 55%,
    rgba(15, 23, 42, 0) 100%
  );
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.athlete-style-overlay .athlete-caption::before {
  content: "";
  display: block;
  width: 2rem;
  height: 3px;
  border-radius: 999px;
  background-color: var(--athlete-accent-light);
  margin-bottom: 0.35rem;
  transition: width 0.3s ease;
}

.athlete-style-overlay .athlete-card:hover .athlete-caption::before {
  width: 3.25rem;
}

.athlete-style-overlay .athlete-name {
  margin: 0;
  font-size: clamp(1.05rem, 1.5vw + 0.45rem, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.athlete-style-overlay .athlete-subtitle {
  margin: 0;
  font-size: clamp(0.85rem, 1vw + 0.3rem, 0.95rem);
  line-height: 1.35;
  color: #e2e8f0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.athlete-style-card .athlete-caption {
  padding: clamp(0.875rem, 1.5vw, 1.15rem) clamp(1rem, 1.8vw, 1.25rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  flex-grow: 1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.athlete-style-card .athlete-name {
  margin: 0;
  padding-left: 0.7rem;
  border-left: 3px solid var(--athlete-accent);
  font-size: clamp(1.05rem, 1.4vw + 0.45rem, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--athlete-text-primary);
}

.athlete-style-card .athlete-subtitle {
  margin: 0.15rem 0 0;
  padding-left: calc(0.7rem + 3px);
  font-size: clamp(0.85rem, 1vw + 0.3rem, 0.95rem);
  line-height: 1.4;
  color: var(--athlete-text-secondary);
}

html.athlete-lightbox-open {
  overflow: hidden;
}

@keyframes athleteLightboxIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.athlete-lightbox {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  max-width: min(94vw, 1200px);
  max-height: 94vh;
  overflow: visible;
  color: #ffffff;
}

.athlete-lightbox[open] {
  animation: athleteLightboxIn 0.22s ease-out;
}

.athlete-lightbox:not([open]) {
  display: none;
}

.athlete-lightbox::backdrop {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.athlete-lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 1.25rem);
  box-sizing: border-box;
}

.athlete-lightbox-counter {
  position: fixed;
  top: clamp(0.85rem, 2vw, 1.5rem);
  left: clamp(0.85rem, 2vw, 1.5rem);
  z-index: 2;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.athlete-lightbox-close {
  position: fixed;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background-color: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 1.75rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.athlete-lightbox-close:hover {
  background-color: var(--athlete-accent);
  border-color: #ffffff;
  transform: scale(1.05);
}

.athlete-lightbox-close:focus-visible,
.athlete-lightbox-nav:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.athlete-lightbox-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  max-width: 100%;
}

.athlete-lightbox-figure {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  max-width: 100%;
}

.athlete-lightbox-img {
  display: block;
  max-width: min(80vw, 1000px);
  max-height: 76vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  background-color: #0f172a;
}

.athlete-lightbox-caption {
  text-align: center;
  max-width: 65ch;
  padding: 0.25rem 0.5rem;
}

.athlete-lightbox-title {
  margin: 0;
  font-size: clamp(1.1rem, 2vw + 0.4rem, 1.4rem);
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
}

.athlete-lightbox-subtitle {
  margin: 0.25rem 0 0;
  font-size: clamp(0.9rem, 1.2vw + 0.3rem, 1.05rem);
  line-height: 1.4;
  color: #e2e8f0;
}

.athlete-lightbox-nav {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background-color: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 1.75rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.athlete-lightbox-nav:hover {
  background-color: var(--athlete-accent);
  border-color: #ffffff;
  transform: scale(1.05);
}

@media (max-width: 40rem) {
  .athlete-lightbox-img {
    max-width: 90vw;
    max-height: 70vh;
  }

  .athlete-lightbox-nav {
    position: fixed;
    bottom: 1rem;
    z-index: 2;
  }

  .athlete-lightbox-prev {
    left: 1rem;
  }

  .athlete-lightbox-next {
    right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .athlete-card,
  .athlete-img,
  .athlete-zoom-badge,
  .athlete-style-overlay .athlete-caption::before,
  .athlete-lightbox[open],
  .athlete-lightbox-close,
  .athlete-lightbox-nav {
    transition: none !important;
    animation: none !important;
  }

  .athlete-card:hover,
  .athlete-card:hover .athlete-img,
  .athlete-image-trigger:focus-visible .athlete-img,
  .athlete-card:hover .athlete-zoom-badge,
  .athlete-image-trigger:focus-visible .athlete-zoom-badge,
  .athlete-lightbox-close:hover,
  .athlete-lightbox-nav:hover {
    transform: none !important;
  }
}
