/* CMS homepage gallery: one photo and caption at a time. */
.cms-gallery {
  padding: clamp(48px, 7vw, 96px) 0;
  border-top: 1px solid #ffffff15;
}
.cms-gallery[hidden],
.cms-gallery [hidden] {
  display: none;
}
.cms-gallery h2 {
  font-size: clamp(30px, 4.5vw, 60px);
  line-height: 1.05;
  overflow-wrap: anywhere;
  margin: 18px 0 28px;
}
.cms-gallery-description {
  max-width: 680px;
  color: #b8b8bd;
  line-height: 1.75;
  white-space: pre-line;
  overflow-wrap: anywhere;
  margin: -8px 0 32px;
}
.cms-gallery-carousel {
  --gallery-height: clamp(240px, 48vw, 600px);
  position: relative;
  max-width: 1100px;
  margin: 36px auto 0;
  background: #18191d;
  border: 1px solid #ffffff16;
  box-shadow: 0 24px 70px #0005;
}
.cms-gallery-carousel::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(
    to right,
    var(--red) var(--gallery-progress, 100%),
    #ffffff12 var(--gallery-progress, 100%)
  );
  transition: background 0.2s;
}
.cms-gallery-item {
  min-width: 0;
  margin: 0;
  overflow: hidden;
}
.cms-gallery-item img {
  display: block;
  width: 100%;
  height: var(--gallery-height);
  object-fit: contain;
  background: radial-gradient(ellipse at center, #24252a, #0c0d10 80%);
  animation: gallery-reveal 0.35s ease-out;
}
.cms-gallery-item figcaption {
  position: relative;
  padding: 28px 38px 8px;
  margin: 0;
  border-top: 1px solid #ffffff0b;
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.7;
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: #ededf0;
}
.cms-gallery-item figcaption::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 34px;
  width: 3px;
  height: 24px;
  background: var(--red);
  transform: skewX(-12deg);
}
.cms-gallery-controls {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 30px;
  padding: 0 26px 8px;
}
.cms-gallery-arrow {
  position: absolute;
  top: calc(var(--gallery-height) / 2);
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 52px;
  height: 56px;
  border: 1px solid #ffffff35;
  background: #111216c9;
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 27px;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}
#cmsGalleryPrev {
  left: 18px;
}
#cmsGalleryNext {
  right: 18px;
}
.cms-gallery-arrow:hover {
  background: var(--red);
  border-color: var(--red);
}
.cms-gallery-arrow:focus-visible,
.cms-gallery-carousel:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 5px;
}
#cmsGalleryStatus {
  font: 700 13px var(--head);
  letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums;
  color: #a8a9b0;
}
@keyframes gallery-reveal {
  from {
    opacity: 0.65;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 600px) {
  .cms-gallery-carousel {
    margin-top: 24px;
  }
  .cms-gallery-item figcaption {
    padding: 22px 22px 8px 30px;
  }
  .cms-gallery-item figcaption::before {
    left: 14px;
    top: 27px;
    height: 18px;
  }
  .cms-gallery-arrow {
    width: 44px;
    height: 48px;
  }
  #cmsGalleryPrev {
    left: 10px;
  }
  #cmsGalleryNext {
    right: 10px;
  }
  .cms-gallery-controls {
    padding-right: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cms-gallery-item img {
    animation: none;
  }
  .cms-gallery-arrow,
  .cms-gallery-carousel::after {
    transition: none;
  }
}

/* Keep uploaded partner logos compact and preserve their original proportions. */
.sponsor-logo .cms-partner-logo {
  display: block;
  width: 200px;
  max-width: 100%;
  height: 65px;
  flex-shrink: 0;
  object-fit: contain;
}

/* ASTON KARTING - Cinematic hero photo. Append AFTER existing styles in assets/cms.css.
   Only applies to an image selected for the CMS Hero visual, not to circuit.svg fallback. */
:root {
  --aston-hero-photo-opacity: 0.77;
} /* 0 = invisible, 1 = fully opaque */
@media (min-width: 921px) {
  .home-hero .hero-copy {
    position: relative;
    z-index: 2;
  }
  .home-hero .hero-art {
    z-index: 1;
  }
  .home-hero .hero-art img.circuit:not([src$="circuit.svg"]) {
    top: -2%;
    left: -46%;
    right: auto;
    width: 161%;
    height: 107%;
    max-width: none;
    object-fit: cover;
    object-position: 54% center;
    opacity: var(--aston-hero-photo-opacity, 0.77);
    filter: brightness(0.78) contrast(1.03) saturate(0.94);
    mask-image: linear-gradient(
      to right,
      transparent 0%,
      rgba(0, 0, 0, 0.48) 20%,
      #000 42%,
      #000 94%
    );
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0%,
      rgba(0, 0, 0, 0.48) 20%,
      #000 42%,
      #000 94%
    );
  }
}
@media (max-width: 920px) {
  .home-hero .hero-art img.circuit:not([src$="circuit.svg"]) {
    top: -22%;
    right: -5%;
    left: auto;
    width: 112%;
    height: 130%;
    max-width: none;
    object-fit: cover;
    object-position: center 45%;
    opacity: 0.7;
    filter: brightness(0.76) contrast(1.03) saturate(0.95);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 26%, #000 89%, transparent 100%);
    -webkit-mask-image: linear-gradient(
      to bottom,
      transparent 0%,
      #000 26%,
      #000 89%,
      transparent 100%
    );
  }
}
@media (max-width: 640px) {
  .home-hero .hero-art img.circuit:not([src$="circuit.svg"]) {
    top: -10%;
    right: -4%;
    width: 112%;
    height: 114%;
    object-position: 60% center;
  }
}

/* When the main visual is a photo, do not stack a second optional hero overlay on top. */
.home-hero .hero-art:has(img.circuit:not([src$="circuit.svg"])) .cms-hero-photo {
  display: none;
}

/* Merchandise catalogue */
.merch-page .inner-hero {
  padding-bottom: 24px;
}
.merch-page .inner-hero h1 {
  font-size: clamp(36px, 8vw, 115px);
  overflow-wrap: anywhere;
}
#merchIntroduction {
  white-space: pre-line;
}
.merch-section {
  padding: 48px 0 90px;
  background: #111112;
}
.merch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.merch-grid > p {
  grid-column: 1/-1;
  color: #ccc;
}
.merch-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(145deg, #27272e, #18181d);
  border: 1px solid #45454f;
  box-shadow: 0 16px 40px #00000038;
  color: #fff;
  display: flex;
  flex-direction: column;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.merch-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #ff244f, #ff5286 35%, transparent 85%);
  z-index: 1;
  pointer-events: none;
}
.merch-card:hover,
.merch-card:focus-within {
  border-color: #858592;
  box-shadow: 0 20px 48px #00000055;
}
.merch-photo {
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #25252c, #111112);
  overflow: hidden;
  color: #999;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.merch-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #19191d;
}
.merch-details {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  gap: 16px;
  border-top: 1px solid #ffffff12;
  background: linear-gradient(135deg, #ffffff04, transparent 65%);
}
.merch-details h2 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  overflow-wrap: anywhere;
  margin: 0;
}
.merch-description {
  white-space: pre-line;
  color: #bcbcc5;
  overflow-wrap: anywhere;
  margin: 0;
}
.merch-prices {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px 16px;
  width: 100%;
  margin: auto 0 0;
}
.merch-availability {
  width: 100%;
}
.merch-price,
.merch-member-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  margin: 0;
  font-size: 16px;
}
.merch-member-price {
  margin-left: auto;
  justify-content: flex-end;
  color: #ff9ab2;
}
.merch-price strong,
.merch-member-price strong {
  color: inherit;
  font-size: inherit;
  font-weight: 800;
}
.merch-size-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: #bcbcc5;
}
.merch-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0;
}
.merch-size {
  min-width: 40px;
  padding: 5px 7px;
  line-height: 1.3;
  text-align: center;
  border: 1px solid #ffffff20;
  border-radius: 4px;
  background: #ffffff04;
  color: #bcbcc5;
}
.merch-size dt {
  font-size: 10px;
  font-weight: 800;
}
.merch-size dd {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 700;
}
.merch-size.available {
  color: #83efb0;
  background: #163b2b;
  border-color: #4aa87380;
}
.merch-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #ffffff24;
  background: #ffffff08;
}
.merch-status::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: currentColor;
}
.merch-status.available {
  color: #6ce5a0;
}
.merch-status.sold-out {
  color: #ff7c88;
}
.merch-status.preorder {
  color: #c9e6ff;
  border-color: #69b8ff70;
  background: linear-gradient(120deg, #154576, #17304b);
  box-shadow: inset 0 1px #ffffff12;
}
.merch-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 14px 18px;
  width: 100%;
  border: 1px solid #ff6a88;
  border-radius: 6px;
  background: linear-gradient(110deg, #b90935, #a20c42);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 6px 18px #00000030, inset 0 1px #ffffff20;
  transition: background 180ms ease, border-color 180ms ease;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
  min-width: 0;
}
.merch-contact::after {
  content: "\2197";
  font-size: 20px;
  line-height: 1;
}
.merch-contact:hover {
  background: #c31548;
  color: #fff;
  border-color: #ffb2c3;
}
.is-preorder .merch-contact {
  background: linear-gradient(110deg, #185a9d, #214980);
  border-color: #70baff;
}
.is-preorder .merch-contact:hover {
  background: #2467ab;
  border-color: #c9e6ff;
}
.merch-contact:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .merch-card,
  .merch-contact {
    transition: none;
  }
}
@media (max-width: 1100px) {
  .merch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .merch-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .merch-details {
    padding: 20px;
  }
}
@media (min-width: 921px) and (max-width: 1200px) {
  .desktop-nav {
    gap: 12px;
  }
  .nav-link {
    font-size: 12px;
  }
  .nav-shell {
    gap: 12px;
  }
}
.event-race-cost {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  margin: 12px 0 18px;
  padding: 7px 10px;
  border: 1px solid #fff;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.event-race-cost strong {
  font-weight: 700;
}
.event-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.event-card .event-labels {
  margin-inline: 26px;
}
.event-meet-up-home {
  margin: 0 26px 16px;
}
.event-meet-up-home small {
  display: block;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.event-labels .race-type-tag,
.event-labels .event-race-cost {
  margin: 0;
  padding: 6px 10px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.09em;
}
