/* HD Results Carousel widget (lib/widgets/hd-results-carousel.php).
   Ported from the homepage's [hd-client-results-loop] section (Elementor custom CSS on
   post 147574 + hd-shortcodes.css), with Swiper replaced by a CSS scroll-snap track.
   Everything here works without JS; hd-results-carousel.js only adds .is-ready, the
   arrows' disabled state and the dots. */

.hd-results-carousel {
  --hd-rc-navy: #0a1254;
  --hd-rc-line: #e0e3e8;
  --hd-rc-muted: var(--sj-muted, #6b7280);
  --hd-rc-gap: 16px;
  --hd-rc-per-view: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  text-align: center;
  font-family: Helvetica, Arial, sans-serif;
}

@media (min-width: 1024px) {
  .hd-results-carousel {
    --hd-rc-per-view: 3;
  }
}

/* ── Intro ── */
.hd-results-carousel__intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hd-results-carousel .hd-results-carousel__eyebrow {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 2.5px;
  color: #000;
}

.hd-results-carousel .hd-results-carousel__heading {
  margin: 0;
  font-family: "Anton", sans-serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 38px;
  letter-spacing: 2.5px;
  color: #000;
}

.hd-results-carousel__heading em {
  font-style: normal;
  color: var(--hd-rc-navy);
}

.hd-results-carousel__description {
  max-width: 600px;
  font-size: 16px;
  line-height: 25.6px;
  color: #333;
}

.hd-results-carousel__description p,
.hd-results-carousel__disclaimer p {
  margin: 0;
}

@media (min-width: 768px) {
  .hd-results-carousel .hd-results-carousel__eyebrow {
    margin-top: 40px;
    font-size: 24px;
  }

  .hd-results-carousel .hd-results-carousel__heading {
    font-size: 56px;
    line-height: 61.2px;
  }
}

/* ── Carousel ── */
.hd-results-carousel__carousel {
  width: 100%;
  margin: 28px 0 8px;
}

@media (min-width: 768px) {
  .hd-results-carousel__carousel {
    margin-bottom: 12px;
  }
}

.hd-results-carousel__viewport {
  position: relative;
}

.hd-results-carousel .hd-results-carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--hd-rc-per-view) - 1) * var(--hd-rc-gap)) / var(--hd-rc-per-view));
  gap: var(--hd-rc-gap);
  margin: 0;
  /* Room for the card's hover lift, which the scroll container would otherwise clip. */
  padding: 4px 0 0;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  text-align: left;
}

.hd-results-carousel__track::-webkit-scrollbar {
  display: none;
}

.hd-results-carousel__track:focus-visible {
  outline: 2px solid var(--hd-rc-navy);
  outline-offset: 4px;
}

.hd-results-carousel .hd-results-carousel__slide {
  margin: 0;
  padding: 0;
  scroll-snap-align: start;
}

@media (prefers-reduced-motion: no-preference) {
  .hd-results-carousel__track {
    scroll-behavior: smooth;
  }
}

/* ── Arrows ── */
.hd-results-carousel .hd-results-carousel__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--sj-line, rgba(10, 14, 44, 0.1));
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(10, 14, 44, 0.14);
  color: var(--hd-rc-navy);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 0.3s, opacity 0.2s ease;
  /* Hidden until the script is ready to drive them; absolute, so no layout shift. */
  visibility: hidden;
}

.hd-results-carousel.is-ready .hd-results-carousel__nav {
  visibility: visible;
}

.hd-results-carousel.is-single .hd-results-carousel__nav,
.hd-results-carousel.is-single .hd-results-carousel__dots {
  display: none;
}

.hd-results-carousel__nav--prev {
  left: 8px;
}

.hd-results-carousel__nav--next {
  right: 8px;
}

.hd-results-carousel__nav svg {
  width: 16px;
  height: 16px;
  stroke: var(--hd-rc-navy);
}

.hd-results-carousel .hd-results-carousel__nav:hover,
.hd-results-carousel .hd-results-carousel__nav:focus-visible {
  border-color: var(--hd-rc-navy);
  background: var(--hd-rc-navy);
}

.hd-results-carousel__nav:hover svg {
  stroke: var(--sj-gold, #ffff00);
}

.hd-results-carousel__nav:focus-visible svg {
  stroke: #fff;
}

.hd-results-carousel .hd-results-carousel__nav[aria-disabled="true"] {
  opacity: 0.3;
  pointer-events: none;
}

/* ── Dots (built by the script; the row's height is reserved up front) ── */
.hd-results-carousel__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 8px;
  margin-top: 16px;
}

.hd-results-carousel .hd-results-carousel__dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--hd-rc-navy);
  opacity: 0.3;
  cursor: pointer;
}

.hd-results-carousel .hd-results-carousel__dot[aria-current="true"] {
  opacity: 1;
}

/* ── Card ── */
.hd-results-carousel__card {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--hd-rc-line);
  border-radius: 12px;
  background: var(--sj-white, #fff);
  color: inherit;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hd-results-carousel__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(10, 18, 84, 0.08);
}

.hd-results-carousel__card--link:hover,
.hd-results-carousel__card--link:focus {
  color: inherit;
  text-decoration: none;
}

.hd-results-carousel__card--link:focus-visible {
  outline: 2px solid var(--hd-rc-navy);
  outline-offset: -2px;
}

.hd-results-carousel .hd-results-carousel__image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top center;
}

.hd-results-carousel__body {
  padding: 26px;
  border-top: 1px solid var(--hd-rc-line);
}

@media (min-width: 768px) {
  .hd-results-carousel__body {
    padding: 16px;
  }
}

.hd-results-carousel .hd-results-carousel__amount {
  margin: 0 0 4px;
  font-size: clamp(24px, 3vw + 0.5rem, 34px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--hd-rc-navy);
}

.hd-results-carousel .hd-results-carousel__status {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--hd-rc-muted);
}

.hd-results-carousel .hd-results-carousel__details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.hd-results-carousel__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.3;
}

.hd-results-carousel .hd-results-carousel__row dt {
  flex-shrink: 0;
  margin: 0 8px 0 0;
  font-weight: 400;
  color: var(--hd-rc-muted);
}

.hd-results-carousel .hd-results-carousel__row dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  color: #000;
}

@media (min-width: 768px) {
  .hd-results-carousel .hd-results-carousel__status {
    margin-bottom: 10px;
  }

  .hd-results-carousel__row {
    font-size: 13px;
  }

  .hd-results-carousel .hd-results-carousel__row dt {
    margin-right: 12px;
  }
}

/* ── Buttons: one per device, as on the homepage (Elementor's desktop breakpoint is 1025px) ── */
.hd-results-carousel__cta {
  width: 100%;
}

@media (max-width: 767px) {
  .hd-results-carousel__cta .elementor-button {
    padding: 15px 0;
  }
}

@media (max-width: 1024px) {
  .hd-results-carousel__cta--desktop:not(.hd-results-carousel__cta--only) {
    display: none;
  }
}

@media (min-width: 1025px) {
  .hd-results-carousel__cta--mobile:not(.hd-results-carousel__cta--only) {
    display: none;
  }
}

/* ── Disclaimer ── */
.hd-results-carousel__disclaimer {
  max-width: 680px;
  font-size: 11px;
  line-height: 1.5;
  color: #6b7280;
}

.hd-results-carousel__disclaimer a {
  color: inherit;
}
