/* Shared recently viewed race strip. */

.recent-races-section {
  --recent-section-width: min(1180px, calc(100% - 44px));
  --recent-section-margin-top: 72px;
  --recent-card-width: 92px;
  --recent-card-min-height: 124px;
  --recent-card-label-size: 0.62rem;
  width: var(--recent-section-width);
  margin: var(--recent-section-margin-top) auto 38px;
  padding-top: 24px;
  border-top: 1px solid rgba(214, 207, 184, 0.12);
}

.recent-races-title {
  margin: 0 0 18px;
  font-family: var(--font-heading);
  font-size: clamp(0.86rem, 1vw, 1rem);
  line-height: 1;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(201, 195, 174, 0.68);
  text-align: center;
}

.recent-races-strip {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.recent-race-card {
  position: relative;
  overflow: hidden;
  width: var(--recent-card-width);
  min-height: var(--recent-card-min-height);
  border: 1px solid rgba(214, 207, 184, 0.15);
  border-radius: 12px;
  background: rgba(13, 13, 22, 0.72);
  text-decoration: none;
  color: rgba(226, 222, 205, 0.78);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.recent-race-card:is(:hover, :focus-visible) {
  transform: translateY(-4px);
  border-color: rgba(226, 222, 205, 0.42);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 20px rgba(207, 197, 153, 0.12);
}

.recent-race-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.15;
  object-fit: cover;
  object-position: 50% 26%;
  filter: contrast(1.03) brightness(0.88) saturate(0.9);
}

.recent-race-card span {
  display: block;
  padding: 8px 6px 10px;
  font-family: var(--font-heading);
  font-size: var(--recent-card-label-size);
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

.recent-races-section--race-page {
  margin-top: clamp(38px, 5vw, 76px);
  margin-bottom: clamp(34px, 4vw, 54px);
}

@media (max-width: 720px) {
  .recent-races-section {
    --recent-section-width: min(100% - 28px, 520px);
    --recent-section-margin-top: 46px;
    --recent-card-width: 76px;
    --recent-card-min-height: 110px;
    --recent-card-label-size: 0.54rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .recent-race-card {
    transition: none !important;
  }
}
