/*
 * Run Fit Well V2 — Service Sub-category pages
 * ---------------------------------------------------------------------------
 * Layouts from the six Corporate Wellness sub-category designs, built on the
 * site's own section library. Hero, section nav, overview card, image frame,
 * step grid, FAQ accordion and closing CTA are the existing components; this
 * file adds only what the site had no component for: chips, tick points,
 * feature cards, format rows, location cards and related cards.
 *
 * COLOUR: tokens.css only — this file contains no colour literal. The designs
 * used seven colours outside the site palette; each is mapped to the nearest
 * existing token:
 *
 *   #465d65 → --rfw-text-soft      tick-point text
 *   #a8bbc1 → --rfw-on-dark-soft   lead on the dark locations band
 *   #cbdcd5 → --rfw-line-step      step rules (already the site's value)
 *   #d9e5df → --rfw-line           chip border
 *   #dfe9e4 → --rfw-line-2         tick-point border
 *   #f4fbf7 → --rfw-grad-cta       How It Works band
 *   #f8fbf9 → --rfw-surface-alt    tick-point fill
 *
 * Hover behaviour matches the site's cards: lift plus the card-hover shadow.
 * Breakpoints are the site's: 1020px and 650px.
 */

/* ------------------------------------------------------------------ *
 * Breadcrumb — the site's crumb bar (blog.css), unchanged in look. Only
 * the separator moves: it trails each item instead of leading the next,
 * so when a long title wraps on a phone the new line starts with the
 * title, never with a stray "›". Scoped to sub-category pages; blog
 * breadcrumbs are untouched.
 * ------------------------------------------------------------------ */
.rfw-system-subservice .rfw-crumbs li + li::before {
  content: none;
}

.rfw-system-subservice .rfw-crumbs li:not(:last-child)::after {
  content: "\203A";
  color: var(--rfw-crumb-text);
}

/* ------------------------------------------------------------------ *
 * Hero chips
 * ------------------------------------------------------------------ */
.rfw-sub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.rfw-sub-chips li {
  padding: 7px 11px;
  border: 1px solid var(--rfw-line);
  border-radius: 999px;
  background: var(--rfw-white);
  color: var(--rfw-text-micro);
  font-size: .8rem;
  font-weight: 700;
}

.rfw-sub-chips li::before,
.rfw-sub-points li::before {
  content: "\2713\00a0";
  color: var(--rfw-accent-deep);
  font-weight: 900;
}

/* ------------------------------------------------------------------ *
 * Overview tick points
 * ------------------------------------------------------------------ */
.rfw-sub-points {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.rfw-sub-points li {
  padding: 12px 14px;
  border: 1px solid var(--rfw-line-2);
  border-radius: 14px;
  background: var(--rfw-surface-alt);
  color: var(--rfw-text-soft);
  font-size: .88rem;
}

/* ------------------------------------------------------------------ *
 * What's Included
 * ------------------------------------------------------------------ */
.rfw-sub-features {
  padding: 96px 0;
}

.rfw-sub-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 42px;
}

.rfw-sub-feature {
  min-height: 280px;
  padding: 27px;
  border: 1px solid var(--rfw-line-2);
  border-radius: 24px;
  background: var(--rfw-surface);
  box-shadow: var(--rfw-shadow-card);
  transition: .22s ease;
}

.rfw-sub-feature:hover {
  transform: translateY(-5px);
  box-shadow: var(--rfw-shadow-card-hover);
}

.rfw-sub-feature-num {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--rfw-pill-bg);
  color: var(--rfw-accent-deep);
  font-weight: 800;
}

.rfw-sub-feature h3 {
  margin: 24px 0 10px;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: -.035em;
}

.rfw-sub-feature-num + h3 {
  margin-top: 24px;
}

.rfw-sub-feature h3:first-child {
  margin-top: 0;
}

.rfw-sub-feature p {
  margin: 0;
  color: var(--rfw-muted);
  font-size: .92rem;
}

/* ------------------------------------------------------------------ *
 * Flexible Formats — the image frame is .rfw-delivery--split's.
 * ------------------------------------------------------------------ */
.rfw-sub-format-list {
  margin-top: 26px;
}

.rfw-sub-format {
  padding: 16px 0;
  border-top: 1px solid var(--rfw-line);
}

.rfw-sub-format strong {
  display: block;
  font-family: Manrope, sans-serif;
}

.rfw-sub-format span {
  color: var(--rfw-muted);
  font-size: .9rem;
}

/* ------------------------------------------------------------------ *
 * How It Works — the step grid is .rfw-process--grid's; only the band
 * colour and the column count are set here.
 * ------------------------------------------------------------------ */
.rfw-sub-process {
  background: var(--rfw-grad-cta);
}

.rfw-process--grid .rfw-sub-steps--1 { grid-template-columns: 1fr; }
.rfw-process--grid .rfw-sub-steps--2 { grid-template-columns: repeat(2, 1fr); }
.rfw-process--grid .rfw-sub-steps--3 { grid-template-columns: repeat(3, 1fr); }
.rfw-process--grid .rfw-sub-steps--4 { grid-template-columns: repeat(4, 1fr); }

/* 5 or 6 steps: two rows of three. */
.rfw-process--grid .rfw-sub-steps--3x2 {
  grid-template-columns: repeat(3, 1fr);
}

.rfw-process--grid .rfw-sub-steps--3x2 .rfw-step:nth-child(3n + 1) {
  padding-left: 0;
}

.rfw-process--grid .rfw-sub-steps--3x2 .rfw-step:nth-child(3n) {
  padding-right: 0;
  border-right: 0;
}

.rfw-process--grid .rfw-sub-steps--3x2 .rfw-step:nth-child(-n + 3) {
  border-bottom: 1px solid var(--rfw-line-step);
}

/* ------------------------------------------------------------------ *
 * Service Areas — dark band, location cards.
 * ------------------------------------------------------------------ */
.rfw-sub-places {
  padding: 90px 0;
}

.rfw-sub-places .rfw-section-lead {
  color: var(--rfw-on-dark-soft);
}

.rfw-sub-place-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 36px;
}

.rfw-sub-place {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 23px;
  border: 1px solid var(--rfw-section-line);
  border-radius: 20px;
  background: var(--rfw-fill-subtle);
  color: var(--rfw-section-fg);
  transition: .22s ease;
}

a.rfw-sub-place:hover {
  transform: translateY(-5px);
  border-color: var(--rfw-accent);
}

.rfw-sub-place small {
  color: var(--rfw-section-eyebrow);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.rfw-sub-place h3 {
  margin: 28px 0 8px;
  font-size: 1.3rem;
  line-height: 1.12;
}

.rfw-sub-place small + h3 {
  margin-top: 28px;
}

.rfw-sub-place h3:first-child {
  margin-top: 0;
}

.rfw-sub-place p {
  margin: 0;
  color: var(--rfw-section-muted);
  font-size: .86rem;
}

.rfw-sub-place-more {
  margin-top: auto;
  padding-top: 18px;
  font-weight: 800;
}

a.rfw-sub-place:hover .rfw-sub-place-more {
  color: var(--rfw-accent);
}

/* ------------------------------------------------------------------ *
 * Related services
 * ------------------------------------------------------------------ */
.rfw-sub-related {
  padding: 88px 0;
}

.rfw-sub-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 36px;
}

.rfw-sub-rel {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--rfw-line);
  border-radius: 20px;
  background: var(--rfw-surface);
  transition: .22s ease;
}

.rfw-sub-rel:hover {
  transform: translateY(-5px);
  box-shadow: var(--rfw-shadow-card-hover);
}

.rfw-sub-rel small {
  color: var(--rfw-accent-deep);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.rfw-sub-rel h3 {
  margin: 14px 0 8px;
  font-size: 1.3rem;
  line-height: 1.12;
  letter-spacing: -.03em;
}

.rfw-sub-rel h3:first-child {
  margin-top: 0;
}

.rfw-sub-rel p {
  margin: 0;
  color: var(--rfw-muted);
  font-size: .86rem;
}

/* Same colour and weight as the site's program-card link. */
.rfw-sub-rel-link {
  margin-top: auto;
  padding-top: 18px;
  color: var(--rfw-accent-text);
  font-size: .9rem;
  font-weight: 800;
}

.rfw-sub-rel-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ *
 * Additional content — block-editor output inside .rfw-prose.
 * ------------------------------------------------------------------ */
.rfw-sub-extra {
  padding: 88px 0;
  border-top: 1px solid var(--rfw-line-3);
}

.rfw-sub-extra-head {
  margin-bottom: 32px;
}

/* Wide blocks (columns, images, galleries) may use the full container. */
.rfw-sub-extra-body {
  max-width: none;
}

.rfw-sub-extra-body > p,
.rfw-sub-extra-body > ul,
.rfw-sub-extra-body > ol,
.rfw-sub-extra-body > h2,
.rfw-sub-extra-body > h3,
.rfw-sub-extra-body > h4,
.rfw-sub-extra-body > blockquote {
  max-width: 38rem;
}

.rfw-sub-extra-body .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--rfw-btn-primary-bg);
  color: var(--rfw-btn-primary-text);
  font-weight: 800;
  text-decoration: none;
  transition: .22s ease;
}

.rfw-sub-extra-body .wp-block-button__link:hover {
  background: var(--rfw-btn-primary-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 1020px) {
  /* Joins the hero's tablet reorder (sections.css): after the buttons. */
  .rfw-sub-chips {
    order: 4;
    margin-top: 0;
  }

  .rfw-sub-feature-grid,
  .rfw-sub-place-grid,
  .rfw-sub-related-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Every step gets its own lower rule once rows wrap. */
  .rfw-process--grid .rfw-sub-steps {
    grid-template-columns: 1fr 1fr;
    border-bottom: 0;
  }

  .rfw-process--grid .rfw-sub-steps .rfw-step {
    border-bottom: 1px solid var(--rfw-line-step);
  }

  .rfw-process--grid .rfw-sub-steps .rfw-step:nth-child(odd) {
    padding-left: 0;
    padding-right: 22px;
    border-right: 1px solid var(--rfw-line-step);
  }

  .rfw-process--grid .rfw-sub-steps .rfw-step:nth-child(even) {
    padding-left: 22px;
    padding-right: 0;
    border-right: 0;
  }

  .rfw-sub-feature {
    min-height: 0;
  }
}

@media (max-width: 650px) {
  .rfw-sub-features,
  .rfw-sub-places,
  .rfw-sub-related,
  .rfw-sub-extra {
    padding: 70px 0;
  }

  .rfw-sub-points,
  .rfw-sub-feature-grid,
  .rfw-sub-place-grid,
  .rfw-sub-related-grid {
    grid-template-columns: 1fr;
  }

  .rfw-process--grid .rfw-sub-steps {
    grid-template-columns: 1fr;
  }

  .rfw-process--grid .rfw-sub-steps .rfw-step:nth-child(n) {
    padding-inline: 0;
    border-right: 0;
  }

  .rfw-sub-place {
    min-height: 0;
  }
}
