/* Raceworx Home Marquee — isolated from GK Stora (no `all:initial`; it blocks positioning) */

/* Flow spacer (manual) or absolute pin host (pinned). */
#rwx-home-marquee-slot {
  display: block !important;
  box-sizing: border-box !important;
  max-width: 100% !important;
  padding: 0 !important;
  overflow: visible !important;
  clear: both !important;
  float: none !important;
}

#rwx-home-marquee-slot:not(.is-pinned) {
  position: relative !important;
  width: 100% !important;
}

#rwx-home-marquee-slot.is-top1 {
  /* Absolute under #gkTop1 bottom + downward offset — same edge on every Mac/browser */
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  top: 100% !important;
  bottom: auto !important;
  width: auto !important;
  float: none !important;
  clear: both !important;
  transform: none !important;
  -webkit-transform: none !important;
}

#rwx-home-marquee-slot.is-stora {
  /* Normal flow inside GK Stora #gkTop2 — must defeat template #gkTop2 .box { float:left } */
  position: relative !important;
  width: 100% !important;
  top: auto !important;
  float: none !important;
  clear: both !important;
  transform: none !important;
  -webkit-transform: none !important;
}

/* Desktop only — small screens hide host + strip; never collapse #gkTop2 (Stora owns that). */
@media (min-width: 992px) {
  /* Stora floats .box in top positions → parent height collapses → banners slide under the strip */
  #gkTop2:has(#rwx-mq-stora-host),
  #gkTop2:has(#rwx-home-marquee-slot) {
    display: block !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  #gkTop2:has(#rwx-mq-stora-host)::after,
  #gkTop2:has(#rwx-home-marquee-slot)::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
  }

  #gkTop2:has(#rwx-mq-stora-host) .box,
  #gkTop2:has(#rwx-mq-stora-host) .box-wrap,
  #gkTop2:has(#rwx-mq-stora-host) .content,
  #gkTop2:has(#rwx-home-marquee-slot) .box,
  #gkTop2:has(#rwx-home-marquee-slot) .box-wrap,
  #gkTop2:has(#rwx-home-marquee-slot) .content {
    float: none !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  #rwx-mq-stora-host {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
    padding: 0;
    clear: both !important;
    float: none !important;
    overflow: visible !important;
  }
}

@media (max-width: 991px) {
  #rwx-mq-stora-host,
  #rwx-home-marquee-slot,
  #rwx-home-marquee {
    display: none !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
  }
}

#rwx-home-marquee-slot.is-pinned {
  /* left/right/bottom set by injected CSS */
  width: auto !important;
  transform: none !important;
  -webkit-transform: none !important;
}

#rwx-home-marquee {
  display: block !important;
  box-sizing: border-box !important;
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: visible !important; /* allow outer drop-shadow; clip children instead */
  clear: both !important;
  float: none !important;
  border-radius: var(--rwx-mq-radius, 10px);
  font-family: "Barlow", "Segoe UI", system-ui, sans-serif !important;
  font-optical-sizing: auto;
  line-height: 1 !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
  font-synthesis: none;
  /* Vertical shift is on #rwx-home-marquee-slot — keep strip transform-free */
  transform: none !important;
  -webkit-transform: none !important;
}

#rwx-home-marquee.has-depth {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 -2px 4px rgba(0, 0, 0, 0.45) inset,
    0 3px 0 rgba(0, 0, 0, 0.22),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

#rwx-home-marquee *,
#rwx-home-marquee *::before,
#rwx-home-marquee *::after {
  box-sizing: border-box;
}

#rwx-home-marquee .rwx-mq-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
  overflow: hidden;
}

#rwx-home-marquee.has-depth .rwx-mq-bg {
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.02) 38%,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.28) 100%
  );
}

#rwx-home-marquee .rwx-mq-viewport {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  border-radius: inherit;
}

/* Soft edge fades — overlays match strip bg so text dissolves in/out */
#rwx-home-marquee .rwx-mq-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
  width: var(--rwx-mq-fade, 72px);
}

#rwx-home-marquee .rwx-mq-fade-left {
  left: 0;
  border-radius: var(--rwx-mq-radius, 10px) 0 0 var(--rwx-mq-radius, 10px);
  background: linear-gradient(
    to right,
    var(--rwx-mq-fade-color, rgba(10, 10, 10, 0.92)) 0%,
    var(--rwx-mq-fade-transparent, rgba(10, 10, 10, 0)) 100%
  );
}

#rwx-home-marquee .rwx-mq-fade-right {
  right: 0;
  border-radius: 0 var(--rwx-mq-radius, 10px) var(--rwx-mq-radius, 10px) 0;
  background: linear-gradient(
    to left,
    var(--rwx-mq-fade-color, rgba(10, 10, 10, 0.92)) 0%,
    var(--rwx-mq-fade-transparent, rgba(10, 10, 10, 0)) 100%
  );
}

#rwx-home-marquee:not(.has-edge-fade) .rwx-mq-fade {
  display: none;
}

#rwx-home-marquee .rwx-mq-track {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: max-content;
  height: 100%;
  will-change: transform;
  animation-name: rwx-mq-scroll-left;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

#rwx-home-marquee.is-right .rwx-mq-track {
  animation-name: rwx-mq-scroll-right;
}

#rwx-home-marquee.is-paused .rwx-mq-track {
  animation-play-state: paused;
}

#rwx-home-marquee .rwx-mq-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  height: 100%;
}

#rwx-home-marquee .rwx-mq-item {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
  opacity: 1;
}

#rwx-home-marquee .rwx-mq-item img {
  display: block;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

#rwx-home-marquee .rwx-mq-label {
  display: inline-block;
  font-family: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

#rwx-home-marquee .rwx-mq-sep {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}

@keyframes rwx-mq-scroll-left {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

@keyframes rwx-mq-scroll-right {
  from { transform: translate3d(-50%, 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  #rwx-home-marquee .rwx-mq-track {
    animation: none !important;
  }
}
