.ad-markets {
  --ad-markets-graphite: #2b2b2b;
  box-sizing: border-box;
  container-type: inline-size;
  font-family: "Plus Jakarta Sans", sans-serif;
  margin: 0;
  padding: 0 0 56px;
  width: 100%;
}

.ad-markets *,
.ad-markets *::before,
.ad-markets *::after {
  box-sizing: border-box;
}

.ad-markets__grid {
  display: flex;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  scroll-behavior: smooth;
  scroll-padding-inline: 0;
  scroll-snap-type: none;
  scrollbar-width: none;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.ad-markets__grid::-webkit-scrollbar {
  display: none;
}

.ad-markets__start-spacer {
  align-self: stretch;
  display: block;
  flex: 0 0 40px;
  min-width: 40px;
  pointer-events: none;
}

.ad-markets__card {
  aspect-ratio: auto;
  background: var(--ad-markets-graphite);
  color: #fff;
  container-type: inline-size;
  flex: 0 0 clamp(190px, 17cqw, 265px);
  height: clamp(197px, 17.6cqw, 274px);
  isolation: isolate;
  min-width: 0;
  overflow: hidden;
  position: relative;
  scroll-snap-align: start;
  transition: flex-basis 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.ad-markets__card::before {
  background: linear-gradient(
    to bottom,
    rgba(0, 59, 92, 0.65) 0%,
    rgba(0, 59, 92, 0) 32%
  );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.ad-markets__card::after {
  background: rgba(0, 59, 92, 0.72);
  content: "";
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 0.35s ease;
  z-index: 1;
}

.ad-markets__image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  inset: 0;
  position: absolute;
  transform: scale(1.001);
  transition: transform 0.55s cubic-bezier(0.24, 0.46, 0.45, 0.94);
  z-index: 0;
}

.ad-markets__title,
.ad-markets h3.ad-markets__title {
  color: #fff !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: var(
    --ad-markets-resting-font-size,
    clamp(20px, 10cqi, var(--ad-markets-configured-title-size, 28px))
  ) !important;
  font-style: normal !important;
  font-variant-caps: normal !important;
  left: 0;
  letter-spacing: normal !important;
  line-height: 1.16 !important;
  margin: 0 !important;
  max-width: 100%;
  overflow-wrap: normal !important;
  padding: var(
    --ad-markets-resting-title-padding,
    var(--ad-markets-default-title-padding, clamp(16px, 8cqi, 24px))
  ) !important;
  position: absolute;
  right: 0;
  text-align: left !important;
  text-decoration: none !important;
  text-shadow: none !important;
  text-transform: none !important;
  top: 0;
  white-space: normal;
  width: var(--ad-markets-resting-width, 100%);
  word-break: normal !important;
  z-index: 2;
}

.ad-markets__card-link {
  border-radius: inherit;
  inset: 0;
  position: absolute;
  z-index: 3;
}

.ad-markets__description {
  background: transparent;
  color: #fff;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 15px;
  left: clamp(16px, 6cqi, 24px);
  line-height: 1.45;
  margin: 0;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: absolute;
  right: clamp(16px, 6cqi, 24px);
  top: clamp(88px, 25cqi, 112px);
  transform: translateY(10px);
  transition: opacity 0.25s ease 0.12s, transform 0.3s ease 0.12s;
  visibility: hidden;
  z-index: 2;
}

.ad-markets__market-cue {
  background: transparent;
  bottom: 14px;
  display: block;
  height: 36px;
  opacity: 0;
  padding: 0;
  position: absolute;
  right: 14px;
  transform: translateY(8px);
  transition: opacity 0.25s ease 0.16s, transform 0.3s ease 0.16s;
  visibility: hidden;
  width: 36px;
  z-index: 2;
}

.ad-markets__market-cue svg {
  display: block;
  height: 100%;
  width: 100%;
}

.ad-markets__card-link:focus-visible {
  outline: 3px solid #0074a7;
  outline-offset: -5px;
}

@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .ad-markets__card:hover,
  .ad-markets__card:focus-within {
    flex-basis: clamp(280px, 22cqw, 350px);
  }

  .ad-markets__card:hover .ad-markets__image,
  .ad-markets__card:focus-within .ad-markets__image {
    transform: scale(1.015);
  }

  .ad-markets__card:hover::after,
  .ad-markets__card:focus-within::after {
    opacity: 1;
  }

  .ad-markets__card:hover .ad-markets__description,
  .ad-markets__card:focus-within .ad-markets__description {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }

  .ad-markets__card:hover .ad-markets__market-cue,
  .ad-markets__card:focus-within .ad-markets__market-cue {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }
}

.ad-markets__navigation {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
}

.ad-markets__nav-button {
  align-items: center;
  appearance: none;
  background: #fff;
  border: 1.5px solid #2b2b2b;
  border-radius: 50%;
  color: #2b2b2b;
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  padding: 0;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  width: 36px;
}

.ad-markets__nav-button span {
  border-bottom: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  display: block;
  height: 8px;
  width: 8px;
}

.ad-markets__nav-button--previous span {
  margin-left: 3px;
  transform: rotate(135deg);
}

.ad-markets__nav-button--next span {
  margin-right: 3px;
  transform: rotate(-45deg);
}

.ad-markets__nav-button:hover:not(:disabled) {
  background: #2b2b2b;
  color: #fff;
}

.ad-markets__nav-button:focus-visible {
  outline: 3px solid rgba(0, 116, 167, 0.45);
  outline-offset: 3px;
}

.ad-markets__nav-button:active:not(:disabled) {
  transform: translateY(1px);
}

.ad-markets__nav-button:disabled {
  cursor: default;
  opacity: 0.3;
}

@container (max-width: 699px) {
  .ad-markets__title,
  .ad-markets h3.ad-markets__title {
    --ad-markets-default-title-padding: clamp(12px, 8cqi, 16px);
    line-height: 1.14 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }
}

@supports not (container-type: inline-size) {
  .ad-markets__card {
    flex-basis: 17vw;
  }

  @media (hover: hover) and (pointer: fine) and (min-width: 900px) {
    .ad-markets__card:hover,
    .ad-markets__card:focus-within {
      flex-basis: 22vw;
    }
  }
}

@media (max-width: 899px) {
  .ad-markets__grid {
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .ad-markets__grid::-webkit-scrollbar {
    display: none;
  }

  .ad-markets__card {
    aspect-ratio: 4 / 5;
    flex: 0 0 38%;
    height: auto;
    scroll-snap-stop: normal;
    transition: none;
  }

  .ad-markets__description,
  .ad-markets__navigation {
    display: none;
  }

  .ad-markets__market-cue {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-markets__card,
  .ad-markets__grid,
  .ad-markets__image,
  .ad-markets__description,
  .ad-markets__market-cue,
  .ad-markets__nav-button {
    scroll-behavior: auto;
    transition: none;
  }
}
