/* ====== SLIDER BASE ====== */
.gs-slider {
  margin: 24px 0;

  /* configurable variables */
  --gs-per: 8; /* number of cards on desktop (overwritten by JS if needed) */
  --gs-gap: 16px; /* gap between cards (overwritten by JS if needed) */
  --gs-gif-opacity: 0.85; /* GIF opacity on hover (0..1) */

  /* TYPOGRAPHY/COLORS from Elementor Globals (with fallbacks) */
  color: var(--e-global-color-text, inherit);
  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: var(--e-global-typography-text-font-size, inherit);
  font-weight: var(--e-global-typography-text-font-weight, inherit);
  line-height: var(--e-global-typography-text-line-height, inherit);
}

/* Inherit typography and color for all nested elements (except svg/img) */
.gs-slider,
.gs-slider *:where(:not(svg, svg *, img)) {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

/* Block title — linked to global heading typography (Secondary) */
.gs-slider__title {
  margin-bottom: 12px;
  color: var(--e-global-color-text, inherit);
  font-family: var(--e-global-typography-title-font-family, inherit);
  font-size: var(--e-global-typography-title-font-size, inherit);
  font-weight: var(--e-global-typography-title-font-weight, inherit);
  line-height: var(--e-global-typography-title-line-height, inherit);
}

/* Swiper container */
.gs-slider .gs-slider__swiper {
  position: relative;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Card */
.gs-slider .swiper-slide {
  overflow: visible;
  box-sizing: border-box;
}

/* When slides ≤ --gs-per — center and disable transform */
.gs-slider.is-short .swiper-wrapper {
  justify-content: center !important;
  transform: none !important;
}
.gs-slider.is-short .gs-slider__swiper {
  max-width: none;
}

/* ====== HEADER + NAV (inline with title) ====== */
.gs-slider__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.gs-slider__header .gs-slider__title { margin: 0; }

.gs-slider__nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.gs-slider__nav .gs-prev,
.gs-slider__nav .gs-next {
  position: relative;
  width: 44px;
  height: 44px;
  cursor: pointer;
  border: 0;
  padding: 0;
  background-color: transparent;
  -webkit-appearance: none;
  appearance: none;

  /* background badge image */
  background-image: var(--gs-nav-bg, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;

  /* smooth hover */
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
}

/* arrow glyphs */
.gs-slider__nav .gs-prev::before,
.gs-slider__nav .gs-next::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0; height: 0;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.3));
}
.gs-slider__nav .gs-next::before {
  border-left: 10px solid #ffffff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  transform: translate(-30%, -50%);
}
.gs-slider__nav .gs-prev::before {
  border-right: 10px solid #ffffff;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  transform: translate(-70%, -50%);
}

/* hover/focus polish */
.gs-slider__nav .gs-prev:hover,
.gs-slider__nav .gs-prev:focus-visible,
.gs-slider__nav .gs-next:hover,
.gs-slider__nav .gs-next:focus-visible {
  transform: scale(1.06);
  background-color: transparent !important;
  box-shadow: none !important;
}

/* ensure no theme hover styles paint a background */
.gs-slider__nav .gs-prev:where(:hover, :active, :focus),
.gs-slider__nav .gs-next:where(:hover, :active, :focus) {
  background-color: transparent !important;
  background-image: var(--gs-nav-bg, none);
}

/* keep a subtle focus ring without background fill */
.gs-slider__nav .gs-prev:focus-visible,
.gs-slider__nav .gs-next:focus-visible {
  outline: 2px solid color-mix(in srgb, currentColor 60%, transparent);
  outline-offset: 2px;
}
.swiper-button-disabled {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.2);
}

/* Hide header navigation on tablet and mobile */
@media (max-width: 1023.98px) {
  .gs-slider__nav { display: none !important; }
}

/* ====== ROW/SLIDES ====== */
.gs-slider .swiper-wrapper {
  display: flex;
  align-items: stretch;
  justify-content: flex-start !important;
  /* gap: var(--gs-gap); */
}
.gs-slider .swiper {
  --swiper-theme-color: currentColor;
  overflow: hidden;
  /* add breathing room so first/last card borders aren't clipped */
  --gs-edge: 6px;
  padding-left: var(--gs-edge);
  padding-right: var(--gs-edge);
  box-sizing: border-box;
}

/* ====== SLIDE CONTENT ====== */
.gs-slide {
  overflow: visible;
}

.gs-slide__link {
  display: block;
  text-decoration: none !important;
  color: inherit;
}

/* Image container */
.gs-slide__image {
  position: relative;
  overflow: hidden;

  isolation: isolate;
  aspect-ratio: var(--gs-ratio, 7/10);
  border-radius: 5px;
}

/* decorative border image overlay for game cards */
.gs-slide__image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--gs-card-border, none);
  background-repeat: no-repeat;
  background-position: center;
  /* fill the card exactly to avoid inner margins */
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 3;
  border-radius: 5px;
}

/* Base image */
.gs-slide__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease, opacity 0.35s ease;
  z-index: 0;
  border-radius: 5px;
}

/* Overlay */
.gs-slide__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.35s ease;
  z-index: 1;
}

/* GIF layer */
.gs-slide__gif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: multiply;
  border-radius: 5px;
}

/* Button (linked to Global Primary color) */
.gs-slide__btn {
  /* positioning */
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  /* size and shape (square button) */
  --gs-play-size: 56px;
  width: var(--gs-play-size);
  height: var(--gs-play-size);
  padding: 0;
  border-radius: 8px;
  display: inline-block;

  /* look & feel: green-teal gradient with dark border */
  background-image: linear-gradient(
    135deg,
    var(--gs-play-grad-start, #19f3c8) 0%,
    var(--gs-play-grad-end, #0ed26b) 100%
  );
  border: 2px solid var(--gs-play-stroke, rgba(8, 24, 44, 0.9));
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.35) inset;

  /* hide the PLAY text visually but keep the element */
  color: transparent;
  font-size: 0;
  line-height: 0;

  /* show/hide transitions */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease,
    filter 0.25s ease;
  z-index: 4; /* above decorative border */
}

/* triangle play glyph */
.gs-slide__btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  /* triangle using borders */
  border-left: 16px solid rgba(10, 12, 27, 0.9);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  transform: translate(-35%, -50%);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.1));
}

/* ====== HOVER ====== */
.gs-slide__image:hover::after,
.gs-slide__link:focus .gs-slide__image::after {
  background: rgba(174, 165, 165, 0.15);
}

.gs-slide__image:hover .gs-slide__img,
.gs-slide__link:focus .gs-slide__img {
  transform: scale(1.03);
  opacity: 1 !important;
}

.gs-slide__image:hover .gs-slide__gif,
.gs-slide__link:focus .gs-slide__gif {
  opacity: var(--gs-gif-opacity) !important;
  visibility: visible !important;
  transition: opacity 0.25s ease, visibility 0s linear 0s;
}

.gs-slide__image:hover .gs-slide__btn,
.gs-slide__link:focus .gs-slide__btn {
  /* show on hover */
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1.05);
}

/* replace gradient with provided hover image (if set) */
.gs-slider.gs-has-play-hover .gs-slide__image:hover .gs-slide__btn,
.gs-slider.gs-has-play-hover .gs-slide__link:focus .gs-slide__btn {
  background-image: var(--gs-play-hover-img, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  box-shadow: none;
}

/* hide the triangle glyph when image is shown */
.gs-slider.gs-has-play-hover .gs-slide__image:hover .gs-slide__btn::before,
.gs-slider.gs-has-play-hover .gs-slide__link:focus .gs-slide__btn::before {
  content: none;
}

/* responsive: slightly smaller on narrow screens */
@media (max-width: 640px) {
  .gs-slide__btn {
    --gs-play-size: 48px;
    border-radius: 6px;
  }
  .gs-slide__btn::before {
    border-left-width: 14px;
    border-top-width: 9px;
    border-bottom-width: 9px;
  }
}

/* ====== GAME TITLE (match global paragraph `p` style) ====== */
.gs-slide__name {
  margin-top: 8px;
  text-align: center;
  /* Use paragraph (text) typography tokens */
  color: var(--e-global-color-text, inherit);
  font-family: var(--e-global-typography-text-font-family, inherit);
  font-size: var(--e-global-typography-text-font-size, 1em);
  font-weight: var(--e-global-typography-text-font-weight, inherit);
  line-height: var(--e-global-typography-text-line-height, 1.4);
  letter-spacing: var(--e-global-typography-text-letter-spacing, normal);
  text-decoration: var(--e-global-typography-text-text-decoration, none);

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

/* ====== PAGINATION ====== */
.gs-pagination {
  margin-top: 10px;
  position: relative;
  z-index: 2;
}

/* ====== LINKS ====== */
.gs-slide__link:hover,
.gs-slide__link:focus,
.gs-slide__link:visited {
  text-decoration: none !important;
}

/* ====== RESPONSIVE GAPS ====== */
@media (max-width: 639.98px) {
  .gs-slider {
    --gs-gap: 12px;
  }
}
@media (min-width: 640px) and (max-width: 1023.98px) {
  .gs-slider {
    --gs-gap: 14px;
  }
}

/* ====== ACCESSIBILITY ====== */
@media (prefers-reduced-motion: reduce) {
  .gs-slide__img,
  .gs-slide__image::after,
  .gs-slide__btn,
  .gs-slider__nav .gs-prev,
  .gs-slider__nav .gs-next,
  .gs-slide__gif {
    transition: none !important;
  }
}
