/*
 * .post-slider — head with arrows + slider of resource cards
 * (template-parts/global/post-slider.php, layout `post_slider`).
 * Figma: /customer-success 337:14147 + 337:14153 (M 337:13931);
 * Related Stories 337:12793; Featured Webinar 337:10305 (M 337:10196);
 * Relevant articles 337:10995 (M 337:10691).
 *
 * The section has no bottom padding: in every design the next block
 * (listing, CTA) brings its own top spacing.
 * Slider mechanics and arrows: slider.css + .slider-arrow of index.css.
 */

.post-slider {
  padding-top: var(--nv-section-y);

  /* .post-slider .slider — head above the track: 40 → 75 px from the title's baseline
     (the title keeps its bottom leading so the arrows line up with the line box) */
  & .slider {
    display: flex;
    flex-direction: column;
    gap: clamp(2.5rem, 1.7225rem + 3.3176vw, 4.6875rem);
  }
}

/* .post-slider--cloud — light grey-blue band; a cloud listing below continues it */
.post-slider--cloud {
  background-color: var(--nv-cloud);
}

/* .post-slider--related — related posts of a story or article: 50 → 100 px to the CTA card
   (Figma 1574:13452 frame padding; the CTA card itself has no top spacing) */
.post-slider--related {
  padding-bottom: var(--nv-section-y);

  /* @media (width >= 48em) .post-slider--related::after — hairline over the CTA that follows,
     at the 1400 px container width (Figma article 1574:12157, story 1574:13921; phones: none) */
  &:has(+ .page-sections) {
    @media (width >= 48em) {
      position: relative;

      &::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: max(0.9375rem, (100% - 87.5rem) / 2);
        right: max(0.9375rem, (100% - 87.5rem) / 2);
        border-top: 0.0625rem solid rgba(26, 121, 191, 0.1);
      }
    }
  }
}

/* .post-slider--wide — articles sit closer: 40 → 50 px */
.post-slider--wide .slider {
  gap: var(--nv-flow-gap);
}

/* .post-slider--dark — featured webinar: 30 → 50 px (Figma M 337:10196, D 337:10305) */
.post-slider--dark .slider {
  gap: clamp(1.875rem, 1.4306rem + 1.8957vw, 3.125rem);
}

/* .post-slider__head — eyebrow over the full row, title + arrows below;
   the title's cap sits on the top of the arrows row (Figma webinars 1574:11327, article 1574:11795;
   the story mock 1574:13452 centres it — the rule after this one) */
.post-slider__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.875rem, 1.4306rem + 1.8957vw, 3.125rem) 1.25rem;
  align-items: start;
}

/* @media (width >= 64.0625em) .post-slider--related:has(.feature-card) .post-slider__actions — story only:
   arrows centred on the title, the cards 6.5 px closer (Figma 1574:13452, matched visually 2026-10-14) */
@media (width >= 64.0625em) {
  .post-slider--related:has(.feature-card) .post-slider__actions {
    margin-top: -0.40625rem;
  }
}

/* @media (width >= 64.0625em) .post-slider__head:has(.post-slider__eyebrow) .post-slider__actions — page sections
   with an eyebrow: the arrows sit on the title's last line and add no height, the cards 75 px under the baseline
   (Figma Guides 18:45098, Customer Success 18:34468; related posts keep the arrows on the cap, rule above) */
@media (width >= 64.0625em) {
  .post-slider:not(.post-slider--related) .post-slider__head:has(.post-slider__eyebrow) .post-slider__actions {
    align-self: end;
    margin-top: -4.875rem;
  }
}

/* .post-slider__eyebrow — pill: 10 px around the cap height, 8.5 px rhomb, 5 px gap */
.post-slider__eyebrow {
  display: inline-flex;
  grid-column: 1 / -1;
  align-items: flex-start;
  gap: 0.3125rem;
  padding: calc(0.625rem - 0.14em) 0.625rem;
  color: var(--nv-green);
  font-weight: 500;
  font-size: clamp(1rem, 0.9111rem + 0.3792vw, 1.25rem);
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;

  /* @media (width >= 48em) .post-slider__eyebrow — the phone mocks track 5 %, the desktop ones 10 % */
  @media (width >= 48em) {
    letter-spacing: 0.1em;
  }

  /* .post-slider__eyebrow::before — rhomb */
  &::before {
    content: "";
    flex-shrink: 0;
    width: 0.53rem;
    height: 0.53rem;
    margin-top: calc(0.5lh - 0.265rem);
    background: url("../../img/icons/rhomb.svg") center / contain no-repeat;
  }
}

/* .post-slider__title — cap on the head gap */
.post-slider__title {
  /* Full row while the arrows are hidden: the column gap would narrow it. */
  grid-column: 1 / -1;
  max-width: 82rem;
  margin-top: -0.14em;
  margin-bottom: -0.14em;
  color: var(--nv-navy);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.3892rem + 4.7393vw, 5.625rem);
  line-height: 1;
  letter-spacing: -0.02em;

  /* @media (width >= 64.0625em) .post-slider__title — arrows on the right */
  @media (width >= 64.0625em) {
    grid-column: 1;
  }

  & strong {
    color: var(--nv-green);
    font-weight: inherit;
  }
}

/* .post-slider__actions — arrows; phones and tablets swipe */
.post-slider__actions {
  display: none;

  /* @media (width >= 64.0625em) .post-slider__actions */
  @media (width >= 64.0625em) {
    display: block;
    grid-column: 2;
  }
}

/* .post-slider__feature — feature-card slide, desktop only */
.post-slider__feature {
  display: none;
  height: 100%;
}

/* .post-slider__compact, .post-slider__card — regular card slides */
.post-slider__compact,
.post-slider__card {
  height: 100%;
}

/* .post-slider__compact strong — green title start (hero_accent), Figma M 337:10196 */
.post-slider__compact .resources__title-card strong {
  color: var(--nv-green);
  font-weight: inherit;
}

/* @media (width >= 64.0625em) .post-slider__feature / __compact */
@media (width >= 64.0625em) {
  .post-slider__feature {
    display: block;
  }

  .post-slider__compact {
    display: none;
  }
}

/* .page-id-122 .post-slider--feature .slider — Guides phone frame (18:51445): 30 px from the title's ink to the card,
   10 px less than the shared value; the shared clamp returns from 768 px */
.page-id-122 .post-slider--feature .slider {
  gap: 1.875rem;

  /* @media (width >= 48em) .page-id-122 .post-slider--feature .slider */
  @media (width >= 48em) {
    gap: clamp(2.5rem, 1.7225rem + 3.3176vw, 4.6875rem);
  }
}
