/* ==================================================================== *
 * BLOG
 *
 * Layer 5, loaded after sections.css. Owns only blog routes: the index,
 * single posts, archives, search and 404. Nothing here targets a class used
 * by the homepage, service pages or location pages, so those layouts cannot
 * be reached from this file.
 *
 * Every colour is an existing token. The blog design files use the identical
 * palette the rest of the site already ships, so not one new value is
 * introduced here.
 *
 * Images always declare a ratio AND object-fit. The location delivery image
 * broke precisely because height and object-fit were omitted, which let the
 * HTML height attribute win and stretch a landscape photo into a portrait
 * box. Every image rule below closes that hole.
 * ==================================================================== */

/* ------------------------------------------------------------------ *
 * Breadcrumb bar — approved design, unchanged.
 * ------------------------------------------------------------------ */
.rfw-crumbbar {
  background: var(--rfw-crumb-bg);
  color: var(--rfw-crumb-text);
}

.rfw-crumbbar .rfw-wrap {
  min-height: 46px;
  display: flex;
  align-items: center;
}

.rfw-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  font-size: .82rem;
}

.rfw-crumbs li {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Long post titles must wrap rather than push the bar wider. */
  min-width: 0;
}

/* The separator is generated, so it is never read aloud as content. */
.rfw-crumbs li + li::before {
  content: "\203A";
  color: var(--rfw-crumb-text);
}

.rfw-crumbs a {
  color: var(--rfw-crumb-link);
  transition: color .2s ease;
}

.rfw-crumbs a:hover {
  color: var(--rfw-on-dark);
}

.rfw-crumbs strong {
  color: var(--rfw-on-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ *
 * Blog hero
 * ------------------------------------------------------------------ */
.rfw-blog-hero {
  padding: 68px 0 74px;
  border-bottom: 1px solid var(--rfw-section-line);
  background:
    radial-gradient(circle at 11% 15%, var(--rfw-hero-glow-1), transparent 28%),
    radial-gradient(circle at 91% 6%, var(--rfw-hero-glow-2), transparent 30%),
    var(--rfw-paper);
}

.rfw-blog-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
}

/*
 * line-height clears Manrope's ink floor. Cap-height (~.73em) + descender
 * (~.25em) needs ~.98em between baselines; the design's .94 made the line box
 * smaller than the glyphs, so descenders landed on the capitals below. Measured
 * overlap in live copy before this fix: 4-5px on the location hero at every
 * width, 3px on Personal Training. Ratio-based, so it scales with clamp().
 */
.rfw-blog-hero h1 {
  margin: 0;
  font-size: clamp(3.1rem, 6vw, 6rem);
  line-height: 1.02;
  letter-spacing: -.07em;
  overflow-wrap: break-word;
}

.rfw-blog-hero h1 span {
  color: var(--rfw-accent-deep);
}

.rfw-blog-hero-lead {
  max-width: 690px;
  margin: 24px 0 0;
  color: var(--rfw-section-muted);
  font-size: 1.1rem;
}

.rfw-blog-stat {
  padding: 30px;
  border-radius: 28px;
  background: var(--rfw-card-dark);
  color: var(--rfw-on-dark);
  box-shadow: var(--rfw-shadow);
}

.rfw-blog-stat .rfw-eyebrow {
  color: var(--rfw-accent-on-dark);
}

.rfw-blog-stat h2 {
  margin: 0;
  font-size: 1.9rem;
  line-height: 1.12;
}

.rfw-blog-stat p {
  margin: 10px 0 0;
  color: var(--rfw-on-dark-soft);
  font-size: .95rem;
}

/* ------------------------------------------------------------------ *
 * Category strip — sticky, horizontally scrollable on small screens.
 * ------------------------------------------------------------------ */
.rfw-cat-strip {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rfw-section-line);
  background: var(--rfw-white);
}

.rfw-cat-strip .rfw-wrap {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.rfw-cat-strip .rfw-wrap::-webkit-scrollbar {
  display: none;
}

.rfw-chip {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid var(--rfw-section-line);
  border-radius: 999px;
  color: var(--rfw-muted);
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.rfw-chip:hover,
.rfw-chip.is-active {
  background: var(--rfw-accent-soft);
  border-color: var(--rfw-pill-border);
  color: var(--rfw-accent-text);
}

/* ------------------------------------------------------------------ *
 * Featured article
 * ------------------------------------------------------------------ */
.rfw-featured-post {
  padding: 92px 0;
}

.rfw-featured-post-card {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  overflow: hidden;
  border: 1px solid var(--rfw-section-line);
  border-radius: 30px;
  background: var(--rfw-white);
  box-shadow: var(--rfw-shadow);
}

/*
 * The image keeps its own aspect ratio: no fixed box, no object-fit crop.
 * Its height follows its width. The column still stretches to the card's
 * height, so when the copy panel is taller the image sits centred on the
 * soft media tint rather than white. The card's radius + overflow clip the
 * corners.
 */
.rfw-featured-post-media {
  display: flex;
  align-items: center;
  background: var(--rfw-media-bg-2);
}

.rfw-featured-post-media img {
  display: block;
  width: 100%;
  height: auto;
}

/* No featured image: keep the designed placeholder box. */
.rfw-featured-post-media:not(:has(img)) {
  min-height: 470px;
}

.rfw-featured-post-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 46px;
  background: var(--rfw-grad-featured);
}

.rfw-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--rfw-muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rfw-post-meta span + span::before {
  content: "\2022";
  margin-right: 10px;
  color: var(--rfw-section-line);
}

.rfw-featured-post-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.65rem);
  line-height: 1.04;
  letter-spacing: -.05em;
}

.rfw-featured-post-copy p {
  color: var(--rfw-section-muted);
}

.rfw-featured-post-copy .rfw-btn {
  margin-top: 20px;
  align-self: flex-start;
}

/* ------------------------------------------------------------------ *
 * Grid section, toolbar and search
 * ------------------------------------------------------------------ */
.rfw-blog-grid-section {
  padding: 88px 0;
  border-top: 1px solid var(--rfw-section-line);
  border-bottom: 1px solid var(--rfw-section-line);
  background: var(--rfw-paper-2);
}

.rfw-blog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
}

.rfw-search-form {
  display: flex;
  gap: 8px;
}

.rfw-search-form input[type="search"] {
  min-width: 250px;
  padding: 12px 16px;
  border: 1px solid var(--rfw-section-line);
  border-radius: 999px;
  background: var(--rfw-white);
  color: var(--rfw-text);
}

.rfw-search-form input[type="search"]::placeholder {
  color: var(--rfw-muted);
}

.rfw-post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

/* ------------------------------------------------------------------ *
 * Post card — one component, four placements.
 * ------------------------------------------------------------------ */
.rfw-post-card {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--rfw-section-line);
  border-radius: 22px;
  background: var(--rfw-white);
  box-shadow: var(--rfw-shadow-card);
  transition: transform .22s ease, box-shadow .22s ease;
}

.rfw-post-card-link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

@media (hover: hover) {
  .rfw-post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--rfw-shadow-card-hover);
  }
}

.rfw-post-card:focus-within {
  outline: 2px solid var(--rfw-accent);
  outline-offset: 3px;
}

/* The ratio lives on the wrapper, so a missing featured image reserves
   exactly the same space as a present one and every card in a row matches.
   32:13 (~2.46:1) is the shape of the blog's banner uploads. The image is
   contained, never covered: any other shape shrinks to fit on the media
   tint instead of losing its edges. min-height: 0 stops a taller image
   from growing the box past its ratio (aspect-ratio's automatic minimum). */
.rfw-post-card-media {
  min-height: 0;
  aspect-ratio: 32 / 13;
  background: var(--rfw-media-bg-2);
}

.rfw-post-card-media img,
.rfw-post-card-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.rfw-post-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px;
}

.rfw-post-card-cat {
  color: var(--rfw-accent-deep);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.rfw-post-card-title {
  margin: 13px 0 9px;
  font-size: 1.28rem;
  line-height: 1.15;
}

.rfw-post-card-excerpt {
  margin: 0;
  color: var(--rfw-section-muted);
  font-size: .9rem;
}

.rfw-post-card-more {
  margin-top: auto;
  padding-top: 20px;
  color: var(--rfw-accent-deep);
  font-size: .86rem;
  font-weight: 800;
}

.rfw-post-card-more::after {
  content: " \2192";
}

.rfw-post-card--related .rfw-post-card-body {
  padding: 20px;
}

/* ------------------------------------------------------------------ *
 * Pagination + empty state
 * ------------------------------------------------------------------ */
.rfw-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 46px;
}

.rfw-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rfw-section-line);
  border-radius: 999px;
  background: var(--rfw-white);
  color: var(--rfw-text);
  font-size: .9rem;
  font-weight: 700;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.rfw-pagination .page-numbers:hover {
  border-color: var(--rfw-pill-border);
  color: var(--rfw-accent-text);
}

.rfw-pagination .page-numbers.current {
  background: var(--rfw-accent-soft);
  border-color: var(--rfw-pill-border);
  color: var(--rfw-accent-text);
}

.rfw-pagination .page-numbers.dots {
  border-color: transparent;
  background: none;
}

.rfw-empty {
  margin-top: 40px;
  padding: 44px;
  border: 1px solid var(--rfw-section-line);
  border-radius: 22px;
  background: var(--rfw-white);
  text-align: center;
}

.rfw-empty h2 {
  margin: 0 0 10px;
  font-size: 1.5rem;
}

.rfw-empty p {
  margin: 0 auto;
  max-width: 38rem;
  color: var(--rfw-section-muted);
}

.rfw-empty .rfw-search-form {
  justify-content: center;
  margin-top: 26px;
}

/* ------------------------------------------------------------------ *
 * Single post — hero
 * ------------------------------------------------------------------ */
.rfw-article-hero {
  padding: 58px 0 66px;
  border-bottom: 1px solid var(--rfw-section-line);
  background:
    radial-gradient(circle at 11% 15%, var(--rfw-hero-glow-1), transparent 28%),
    radial-gradient(circle at 91% 6%, var(--rfw-hero-glow-2), transparent 30%),
    var(--rfw-paper);
}

.rfw-article-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--rfw-muted);
  font-size: .77rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.rfw-article-kicker > * + *::before {
  content: "\2022";
  margin-right: 10px;
  color: var(--rfw-section-line);
}

.rfw-article-kicker a {
  color: var(--rfw-accent-deep);
}

.rfw-article-hero h1 {
  margin: 0;
  font-size: clamp(3rem, 6vw, 6rem);
  line-height: .98;
  letter-spacing: -.065em;
}

.rfw-article-deck {
  max-width: 850px;
  margin: 24px 0 0;
  color: var(--rfw-section-muted);
  font-size: 1.16rem;
}

.rfw-article-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  color: var(--rfw-section-muted);
  font-size: .9rem;
}

.rfw-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: var(--rfw-card-dark);
  color: var(--rfw-accent-on-dark);
  font-weight: 800;
}

.rfw-article-image {
  margin-top: 40px;
  overflow: hidden;
  border-radius: 28px;
  box-shadow: var(--rfw-shadow);
  background: var(--rfw-media-bg-2);
}

/* The whole upload at its own ratio: no fixed box, no cover crop. Height
   follows width; the wrapper's radius + overflow round the corners. */
.rfw-article-image img {
  display: block;
  width: 100%;
  height: auto;
}

/* ------------------------------------------------------------------ *
 * Single post — body + table of contents
 * ------------------------------------------------------------------ */
.rfw-article-wrap {
  width: min(1120px, calc(100% - 48px));
  margin: auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 720px);
  gap: 70px;
  align-items: start;
  padding: 82px 0;
}

.rfw-toc {
  position: sticky;
  top: 28px;
  padding: 22px;
  border: 1px solid var(--rfw-section-line);
  border-radius: 20px;
  background: var(--rfw-paper);
}

.rfw-toc > strong {
  display: block;
  margin-bottom: 12px;
}

.rfw-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rfw-toc;
}

.rfw-toc a {
  display: block;
  padding: 6px 0;
  color: var(--rfw-section-muted);
  font-size: .88rem;
  transition: color .2s ease;
}

.rfw-toc a:hover {
  color: var(--rfw-accent-deep);
}

/* Anchors must not land under the sticky category strip / viewport edge. */
.rfw-article-body h2 {
  scroll-margin-top: 90px;
}

/* ------------------------------------------------------------------ *
 * Editor block styles — how the design's callout and key-box are authored.
 *
 * Both are NATIVE blocks with a registered style, so the client picks them
 * from the editor sidebar instead of writing HTML:
 *   callout  = Quote block,  style "Callout"
 *   key box  = Group block,  style "Key takeaways"
 * ------------------------------------------------------------------ */
.rfw-prose .is-style-rfw-callout {
  margin: 30px 0;
  padding: 24px;
  border: 0;
  border-left: 5px solid var(--rfw-accent);
  border-radius: 0 18px 18px 0;
  background: var(--rfw-paper-2);
  color: var(--rfw-section-muted);
  font-style: normal;
}

.rfw-prose .is-style-rfw-callout p {
  margin: 0 0 .6em;
}

.rfw-prose .is-style-rfw-callout > :last-child {
  margin-bottom: 0;
}

.rfw-prose .is-style-rfw-callout cite {
  color: var(--rfw-text-strong);
  font-family: Manrope, sans-serif;
  font-style: normal;
  font-weight: 800;
}

.rfw-prose .is-style-rfw-keybox {
  margin: 36px 0;
  padding: 28px;
  border-radius: 22px;
  background: var(--rfw-card-dark);
  color: var(--rfw-on-dark);
}

.rfw-prose .is-style-rfw-keybox :where(h2, h3, h4) {
  margin: 0 0 14px;
  color: var(--rfw-on-dark);
}

.rfw-prose .is-style-rfw-keybox :where(p, li) {
  color: var(--rfw-on-dark-soft);
}

.rfw-prose .is-style-rfw-keybox > :last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ *
 * Author box, related, article CTA
 * ------------------------------------------------------------------ */
.rfw-author-box {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 18px;
  margin-top: 56px;
  padding: 28px;
  border: 1px solid var(--rfw-section-line);
  border-radius: 22px;
  background: var(--rfw-paper);
}

.rfw-author-box .rfw-avatar {
  width: 70px;
  height: 70px;
  flex-basis: 70px;
}

.rfw-author-box h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.rfw-author-box p {
  margin: 0;
  color: var(--rfw-section-muted);
  font-size: .92rem;
}

.rfw-related {
  padding: 84px 0;
  border-top: 1px solid var(--rfw-section-line);
  background: var(--rfw-paper-2);
}

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

.rfw-article-cta {
  padding: 82px 0;
}

.rfw-article-cta-shell {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
  padding: 38px;
  border-radius: 28px;
  background: var(--rfw-card-dark);
  color: var(--rfw-on-dark);
}

.rfw-article-cta-shell .rfw-eyebrow {
  color: var(--rfw-accent-on-dark);
}

.rfw-article-cta-shell h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -.05em;
}

.rfw-article-cta-shell p {
  color: var(--rfw-on-dark-soft);
}

.rfw-article-cta-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ *
 * 404
 * ------------------------------------------------------------------ */
.rfw-404 {
  padding: 96px 0 104px;
}

.rfw-404 h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6rem);
  line-height: 1.02;
  letter-spacing: -.06em;
  overflow-wrap: break-word;
}

.rfw-404-lead {
  max-width: 38rem;
  margin: 20px 0 0;
  color: var(--rfw-section-muted);
  font-size: 1.05rem;
}

.rfw-404-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 44px;
}

.rfw-404-links a {
  padding: 22px;
  border: 1px solid var(--rfw-section-line);
  border-radius: 18px;
  background: var(--rfw-white);
  font-family: Manrope, sans-serif;
  font-weight: 800;
  transition: border-color .2s ease, color .2s ease;
}

.rfw-404-links a:hover {
  border-color: var(--rfw-pill-border);
  color: var(--rfw-accent-text);
}

.rfw-404-links span {
  display: block;
  margin-top: 6px;
  color: var(--rfw-section-muted);
  font-family: "DM Sans", sans-serif;
  font-size: .88rem;
  font-weight: 400;
}

/* ==================================================================== *
 * RESPONSIVE — the theme's two existing breakpoints, plus the 1020px
 * switch the TOC needs. No new breakpoint is introduced.
 * ==================================================================== */
@media (max-width: 1020px) {
  .rfw-blog-hero h1,
  .rfw-404 h1 {
    line-height: 1.04;
  }

  .rfw-blog-hero-grid,
  .rfw-featured-post-card,
  .rfw-article-cta-shell {
    grid-template-columns: 1fr;
  }

  .rfw-post-grid,
  .rfw-related-grid {
    grid-template-columns: 1fr 1fr;
  }

  .rfw-blog-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .rfw-article-cta-actions {
    justify-content: flex-start;
  }

  /* Placeholder only — a real image already sizes itself from its ratio. */
  .rfw-featured-post-media:not(:has(img)) {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  /* TOC stops being a sidebar and becomes a native disclosure. No JS. */
  .rfw-article-wrap {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .rfw-toc {
    position: static;
  }

  .rfw-404-links {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 650px) {
  .rfw-blog-hero h1,
  .rfw-404 h1 {
    line-height: 1.06;
  }

  .rfw-blog-hero,
  .rfw-featured-post,
  .rfw-blog-grid-section,
  .rfw-related,
  .rfw-article-cta {
    padding: 70px 0;
  }

  .rfw-post-grid,
  .rfw-related-grid,
  .rfw-404-links {
    grid-template-columns: 1fr;
  }

  .rfw-featured-post-copy {
    padding: 28px;
  }

  .rfw-article-cta-shell {
    padding: 28px;
  }

  .rfw-article-hero {
    padding: 48px 0 54px;
  }

  .rfw-article-wrap {
    width: min(100% - 32px, 1120px);
    padding: 64px 0;
  }

  /* Full-width search so the field stays usable at 360px. */
  .rfw-search-form {
    width: 100%;
  }

  .rfw-search-form input[type="search"] {
    min-width: 0;
    flex: 1;
  }

  .rfw-author-box {
    grid-template-columns: 1fr;
  }

  .rfw-empty {
    padding: 28px;
  }
}
