/* ============================================================================
   blog.css — Anvil-branded styling for the headless blog (index + article).
   Uses the site's Inter font + neutral palette; adds a small accent system per
   content type. Styles the WordPress (Gutenberg) block output as clean "prose".
   ============================================================================ */

:root {
  --blog-accent: #2563eb;
  --blog-ink: #111827;
  --blog-muted: #6b7280;
  --blog-line: #e5e7eb;
  --blog-bg-soft: #f9fafb;
}

.blog-main { background: #fff; color: var(--blog-ink); font-family: var(--font, 'Inter', sans-serif); }
.blog-wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.blog-hero {
  padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--blog-line);
  background:
    radial-gradient(1200px 320px at 80% -40%, rgba(37, 99, 235, 0.08), transparent 70%),
    #fff;
}
.blog-hero .eyebrow {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--blog-accent); margin: 0 0 0.9rem;
}
.blog-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.08; margin: 0 0 0.9rem; color: var(--blog-ink);
}
.blog-hero p { font-size: clamp(1rem, 2vw, 1.15rem); color: var(--blog-muted); max-width: 60ch; margin: 0; line-height: 1.55; }

/* ── Filter tabs ──────────────────────────────────────────────────────────── */
.blog-filterbar {
  position: sticky; top: 60px; z-index: 20;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--blog-line);
}
.blog-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 1rem 0; margin: 0; }
.blog-filter {
  appearance: none; border: 1px solid var(--blog-line); background: #fff;
  color: var(--blog-ink); font: inherit; font-size: 0.85rem; font-weight: 500;
  padding: 0.5rem 1rem; border-radius: 999px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.blog-filter:hover { border-color: var(--blog-accent); color: var(--blog-accent); }
.blog-filter[aria-pressed="true"] { background: var(--blog-accent); border-color: var(--blog-accent); color: #fff; }

/* ── Sections + grid ──────────────────────────────────────────────────────── */
.blog-section { padding: clamp(2rem, 4vw, 3rem) 0; border-bottom: 1px solid var(--blog-line); }
.blog-section:last-child { border-bottom: none; }
.blog-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.blog-section-head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.blog-section-head a { font-size: 0.85rem; font-weight: 600; color: var(--blog-accent); text-decoration: none; white-space: nowrap; }
.blog-section-head a:hover { text-decoration: underline; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.5rem; }

/* ── Card ─────────────────────────────────────────────────────────────────── */
.post-card {
  display: flex; flex-direction: column; background: #fff;
  border: 1px solid var(--blog-line); border-radius: 14px; overflow: hidden;
  text-decoration: none; color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1); border-color: #d8dee7; }
.post-card-media { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1e3a5f, #2563eb); position: relative; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.55rem; flex: 1; }
.post-card-title { font-size: 1.08rem; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; margin: 0; }
.post-card-excerpt { font-size: 0.88rem; color: var(--blog-muted); line-height: 1.5; margin: 0; flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: 0.6rem; font-size: 0.78rem; color: var(--blog-muted); margin-top: 0.3rem; }

/* Type tag pills — accent per content type */
.type-tag {
  display: inline-block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; padding: 0.28rem 0.6rem; border-radius: 6px;
  color: #fff; background: var(--blog-accent); width: max-content;
}
.type-tag[data-type="article"] { background: #2563eb; }
.type-tag[data-type="user-guide"] { background: #0891b2; }
.type-tag[data-type="case-study"] { background: #7c3aed; }
.type-tag[data-type="product-news"] { background: #059669; }

/* ── States ───────────────────────────────────────────────────────────────── */
.blog-state { padding: 4rem 0; text-align: center; color: var(--blog-muted); }
.blog-skeleton { min-height: 40vh; }

/* ── Skeleton loaders (shown while posts fetch) ───────────────────────────── */
.skel {
  position: relative;
  overflow: hidden;
  background: #e9edf2;
  border-radius: 6px;
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: skel-shimmer 1.25s ease-in-out infinite;
}
@keyframes skel-shimmer { to { transform: translateX(100%); } }

/* Skeleton sitting on the dark hero rather than a white card. */
.skel-on-dark { background: rgba(255, 255, 255, 0.16); border-radius: 8px; }
.skel-on-dark::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent); }

.skel-card { pointer-events: none; }
.post-card-media.skel { background: #e9edf2; border-radius: 0; }
.skel-tag { width: 70px; height: 20px; }
.skel-title { width: 100%; height: 15px; }
.skel-title--short { width: 55%; }
.skel-line { width: 100%; height: 11px; }
.skel-line--short { width: 75%; }
.skel-meta { width: 42%; height: 11px; margin-top: 0.35rem; }
.skel-head { display: inline-block; width: min(220px, 55%); height: 26px; border-radius: 8px; }
.skel-filter { display: inline-block; width: 82px; height: 34px; border-radius: 999px; }

@media (prefers-reduced-motion: reduce) {
  .skel::after { animation: none; }
}

/* Single-article skeleton */
.article-skel { display: flex; flex-direction: column; padding: clamp(2.5rem, 6vw, 4rem) 0 3rem; }
.article-skel .skel { display: block; }
.skel-crumb { width: 180px; height: 12px; margin-bottom: 1.6rem; }
.skel-pill { width: 84px; height: 22px; border-radius: 6px; margin-bottom: 1rem; }
.skel-h1 { width: 100%; height: 30px; border-radius: 8px; margin-bottom: 0.6rem; }
.skel-h1--short { width: 62%; margin-bottom: 1.2rem; }
.skel-metaline { width: 260px; height: 12px; margin-bottom: 2rem; }
.skel-cover { width: 100%; aspect-ratio: 16 / 8; border-radius: 16px; margin-bottom: 2.5rem; }
.skel-prose { width: 100%; height: 13px; margin-bottom: 0.9rem; }
.skel-prose--short { width: 70%; }

/* ── Related posts (bottom of an article) ─────────────────────────────────── */
.article-related {
  border-top: 1px solid var(--blog-line);
  background: var(--blog-bg-soft);
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 4.5rem);
  margin-top: 1rem;
}
.article-related-title {
  font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 1.5rem;
}

/* ============================================================================
   Article + CMS Page — the shared reading layout
   ----------------------------------------------------------------------------
   Used by BOTH the blog single-post template (blog/post.html, rendered by
   blog.js) and WordPress-driven Pages (/cms-page.html, rendered by
   api/lib/render-page.js). Extends the site's existing language rather than
   inventing one: the hero reuses the navy gradient + radial glow from the About
   page, headings sit on the same near-black navy, and the accent is the brand
   blue. The Anvil dots appear exactly twice — as a large cropped watermark in
   the hero, and as the bullet glyph in unordered lists — so the motif stays a
   signature rather than wallpaper.
   ============================================================================ */
:root {
  --a-ink: #0e1b2e;      /* deep navy — headings + hero base */
  --a-navy: #1e3a5f;     /* hero gradient end */
  --a-blue: #2563eb;     /* brand accent */
  --a-sky: #7cb2ff;      /* accent on dark */
  --a-teal: #71b2c9;     /* the Anvil-dots teal */
  --a-body: #374151;
  --a-soft: #f7f9fc;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.cms-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(1200px 500px at 78% -20%, rgba(37, 99, 235, 0.38), transparent 70%),
    linear-gradient(160deg, #0e1b2e 0%, #1e3a5f 100%);
}
.cms-hero-inner {
  position: relative; z-index: 2;
  max-width: 1120px; margin: 0 auto;
  padding: clamp(2.75rem, 6.5vw, 5rem) clamp(1.25rem, 4vw, 2.5rem) clamp(2.75rem, 6.5vw, 4.5rem);
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(1.75rem, 5vw, 4rem); align-items: center;
}
/* No header image → single centred column, and the dots carry the composition. */
.cms-hero--plain .cms-hero-inner { grid-template-columns: 1fr; max-width: 900px; }

/* The dots motif sits BEHIND the header text, centred on it — not cropped off a corner,
   where it reads as an accident rather than a mark. Decorative only. */
/* The dots sit behind the HERO TEXT, not the hero section — the text is left-aligned
   inside a centred container, so centring on the section leaves the mark floating in
   empty space to its right. Anchoring to .cms-hero-text puts it behind the title in
   both hero variants, with no magic offsets.
   Keep it small: the artwork's dots reach almost to the edge of its own viewBox, so it
   reads much larger than its width suggests. */
.cms-hero-text { position: relative; }
.cms-hero-dots {
  position: absolute; z-index: 0;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: clamp(200px, 22vw, 310px); height: auto;
  opacity: 0.22; pointer-events: none; user-select: none;
}
/* Keep the copy above the mark. */
.cms-hero-text > *:not(.cms-hero-dots) { position: relative; z-index: 1; }

.cms-hero .breadcrumb { color: #8fa6c4; margin-bottom: 1.1rem; }
.cms-hero .breadcrumb a { color: #8fa6c4; }
.cms-hero .breadcrumb a:hover { color: #fff; }

.cms-eyebrow {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--a-sky); margin: 0 0 0.9rem;
}
.cms-hero h1 {
  font-size: clamp(1.95rem, 4.6vw, 3.2rem); font-weight: 800; line-height: 1.06;
  letter-spacing: -0.025em; margin: 0 0 1.05rem; max-width: 19ch; color: #fff;
}
.cms-hero--plain h1 { max-width: 22ch; }
.cms-lede {
  font-size: clamp(1rem, 1.9vw, 1.2rem); line-height: 1.62; color: #cdd9ea;
  margin: 0; max-width: 56ch;
}
.cms-hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 1.1rem;
  margin-top: 1.5rem; font-size: 0.85rem; color: #a9bdd8;
}
.cms-hero-meta .type-tag { background: rgba(124, 178, 255, 0.18); color: #cfe2ff; }

.cms-hero-media { position: relative; z-index: 2; }
.cms-hero-media img {
  width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; display: block;
  border-radius: 18px;
  box-shadow: 0 30px 60px -22px rgba(0, 0, 0, 0.6);
  outline: 1px solid rgba(255, 255, 255, 0.14); outline-offset: -1px;
}

/* ── Split hero (blog posts with a cover) ──────────────────────────────────────
   Copy on the left, photograph running off the right edge of the page — the same
   composition as the solution-page heroes, instead of a card sitting inside the hero.
   Scoped to the modifier on purpose: cms-page.html loads this stylesheet too, and the
   CMS pages keep the boxed image. */
.cms-hero--split .cms-hero-inner { grid-template-columns: minmax(0, 1fr); }
/* Hold the copy clear of the photograph. The cap is proportional as well as absolute so
   the text column can't creep under the image on a wide monitor. */
.cms-hero--split .cms-hero-text { max-width: min(34rem, 54%); }

.cms-hero--split .cms-hero-media {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: auto;
  width: 58%;
  z-index: 1;   /* below .cms-hero-inner (z-index 2), so the copy always wins */
  /* Dissolve the photograph into the hero rather than painting a matching colour over
     it: the hero background is a gradient, so any flat overlay leaves a vertical seam
     where the two meet. A mask has nothing to match — whatever is behind simply shows
     through, at any width. */
  -webkit-mask-image: linear-gradient(to right,
    transparent 0%, rgba(0, 0, 0, 0.15) 14%, rgba(0, 0, 0, 0.75) 34%, #000 52%);
  mask-image: linear-gradient(to right,
    transparent 0%, rgba(0, 0, 0, 0.15) 14%, rgba(0, 0, 0, 0.75) 34%, #000 52%);
}
.cms-hero--split .cms-hero-media img {
  width: 100%; height: 100%; aspect-ratio: auto;
  object-fit: cover; object-position: center;
  border-radius: 0; box-shadow: none; outline: 0;
}

@media (max-width: 880px) {
  .cms-hero-inner { grid-template-columns: 1fr; }
  .cms-hero h1, .cms-hero--plain h1 { max-width: none; }
  .cms-hero-media img { aspect-ratio: 16 / 9; }

  /* The split hero stacks: the photograph becomes a full-bleed band under the copy.
     Deliberately not the desktop overlay — a title sitting on a photograph costs
     readability on a narrow screen, and a hero whose height is pinned to the viewport
     width is exactly what clips the copy on /solutions/vanlife-motorhomes at 320px.
     Here the height follows the content, so it cannot happen. */
  .cms-hero--split .cms-hero-text { max-width: none; }
  .cms-hero--split .cms-hero-inner { padding-bottom: clamp(1.75rem, 5vw, 2.5rem); }
  .cms-hero--split .cms-hero-media {
    position: static;
    width: 100%;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .cms-hero--split .cms-hero-media img { aspect-ratio: 16 / 9; height: auto; }
}

/* ── Body ─────────────────────────────────────────────────────────────────── */
.article-wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.breadcrumb { font-size: 0.8rem; color: var(--blog-muted); }
.breadcrumb a { color: var(--blog-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--blog-accent); }

/* Legacy head block (kept for any template still using it) */
.article-head { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; }
.article-head h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem); font-weight: 700; letter-spacing: -0.03em;
  line-height: 1.12; margin: 0.9rem 0 1rem;
}
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; font-size: 0.85rem; color: var(--blog-muted); }

/* Prose — styles the Gutenberg block output cleanly.
   A three-track grid keeps running text at a comfortable measure while letting
   image-led blocks (zigzag rows, figures) break out wider. This is what stops
   the page reading as one flat column. */
.post-content {
  display: grid;
  grid-template-columns:
    [wide-start] minmax(0, 1fr)
    [text-start] min(720px, 100%) [text-end]
    minmax(0, 1fr) [wide-end];
  font-size: 1.08rem; line-height: 1.75; color: var(--a-body);
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2.5rem, 5vw, 3.5rem);
}
.post-content > * { grid-column: text; min-width: 0; }
.post-content > * + * { margin-top: 1.35rem; }

.post-content h2 {
  grid-column: text;
  font-size: clamp(1.45rem, 2.6vw, 1.95rem); font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.25; color: var(--a-ink); margin-top: 3.2rem;
}
/* Structural marker: a short teal→blue rule that says "new section" without
   inventing a false sequence (the content is not numbered steps). */
.post-content h2::before {
  content: ""; display: block; width: 46px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--a-teal), var(--a-blue));
  margin-bottom: 1rem;
}
.post-content h3 {
  font-size: clamp(1.15rem, 2vw, 1.32rem); font-weight: 700; color: var(--a-ink);
  margin-top: 2.2rem; letter-spacing: -0.01em;
}
.post-content h2 + h3 { margin-top: 1.4rem; }
.post-content p { margin-left: 0; margin-right: 0; }
.post-content strong { color: var(--a-ink); font-weight: 600; }
.post-content a { color: var(--a-blue); text-decoration: underline; text-underline-offset: 2px; }
.post-content a:hover { text-decoration-thickness: 2px; }

/* Lists — the dots motif doing an actual job rather than decorating. */
.post-content ul { list-style: none; padding-left: 0; }
.post-content ul > li { position: relative; padding-left: 1.55rem; }
.post-content ul > li::before {
  content: ""; position: absolute; left: 0.3rem; top: 0.62em;
  width: 7px; height: 7px; border-radius: 50%; background: var(--a-teal);
}
.post-content ol { padding-left: 1.35rem; }
.post-content ol > li::marker { color: var(--a-blue); font-weight: 600; }
.post-content li + li { margin-top: 0.55rem; }

/* Benefit lists — opt-in via `anvil-checks` on the <ul> in WordPress.
   A tick, not the default dot, because these lists assert what you get. The plain
   dot stays the default everywhere else: a tick beside a clause in the returns
   policy would be claiming something the sentence isn't saying.
   Drawn as a masked SVG so it inherits currentColor and stays crisp at any zoom. */
.post-content ul.anvil-checks > li {
  padding-left: 2rem;
  line-height: 1.55;
}
.post-content ul.anvil-checks > li::before {
  content: "";
  left: 0;
  top: 0.18em;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  background: var(--a-teal);
  opacity: 0.14;
}
.post-content ul.anvil-checks > li::after {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.45em;
  width: 0.65rem;
  height: 0.65rem;
  background: var(--a-teal);
  -webkit-mask: var(--tick) center / contain no-repeat;
  mask: var(--tick) center / contain no-repeat;
}
.post-content ul.anvil-checks {
  --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

/* Two columns once there is room — eight one-line benefits in a single column is a
   long thin ladder that pushes the next section off the screen.
   Multi-column, not grid: a two-column grid locks each pair into a shared row, so a
   one-line item sitting beside a three-line one leaves a hole under it and the column
   reads ragged. Columns flow item by item and pack tight. break-inside stops an item
   splitting across the gap. */
@media (min-width: 720px) {
  .post-content ul.anvil-checks {
    columns: 2;
    column-gap: 2.5rem;
  }
  .post-content ul.anvil-checks > li {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    margin-top: 0;
    margin-bottom: 0.7rem;
  }
  .post-content ul.anvil-checks > li + li { margin-top: 0; }
}

/* Figures break out past the text measure by default. */
.post-content > figure { grid-column: wide; margin: clamp(2rem, 4vw, 3rem) 0; }
.post-content img { max-width: 100%; height: auto; }
.post-content > figure img { width: 100%; border-radius: 16px; display: block; box-shadow: 0 18px 44px -24px rgba(14, 27, 46, 0.5); }
.post-content figcaption { font-size: 0.82rem; color: var(--blog-muted); text-align: center; margin-top: 0.7rem; }

/* ── Editor alignment + resize ────────────────────────────────────────────────
   A headless front-end ships none of WordPress's block-library CSS, so the
   classes the editor writes (aligncenter / alignleft / alignright / alignwide /
   alignfull, and is-resized) do nothing unless implemented here. Without these,
   choosing "Align center" and dragging an image smaller in the editor had no
   effect on the page: the rule above stretched every image to the full track.

   Note: alignleft/alignright position the image, they do not float text around
   it — the article is a grid, so neighbouring blocks are in their own rows and
   could not wrap regardless. */

/* An explicit size set in the editor must win over the stretch-to-fill default.
   Matching on is-resized / an inline width only, never on the width attribute —
   WordPress emits that on nearly every image for layout stability, so keying off
   it would silently disable the default everywhere.
   Descendant selectors, not child: images are often nested inside a Columns or
   Group block, where a `>` rule would never match. */
.post-content figure.is-resized img,
.post-content figure.wp-block-image img[style*="width"] { width: auto; max-width: 100%; }

.post-content figure.aligncenter img { margin-left: auto; margin-right: auto; }
.post-content figure.alignleft img { margin-left: 0; margin-right: auto; }
.post-content figure.alignright img { margin-left: auto; margin-right: 0; }
.post-content figure.aligncenter { text-align: center; }
.post-content figure.alignleft { text-align: left; }
.post-content figure.alignright { text-align: right; }

/* Width choices from the editor's toolbar. "Full width" maps to the same track as
   "Wide width": the article is capped by .article-wrap, so there is nothing wider
   to break out to without escaping the container. Only direct children of the
   article grid can take a track. */
.post-content > figure.alignnone { grid-column: text; }
.post-content > figure.alignwide,
.post-content > figure.alignfull { grid-column: wide; }

/* ── Other blocks the editor offers ───────────────────────────────────────────
   Same reasoning as the alignment classes: with no WordPress theme CSS, anything
   a colleague inserts renders unstyled. Columns in particular stacked vertically,
   so the editor showed side-by-side and the page did not. */
.post-content > .wp-block-columns { grid-column: wide; }
.post-content .wp-block-columns {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: clamp(1.25rem, 3vw, 2.5rem); margin: clamp(2rem, 4vw, 3rem) 0;
}
.post-content .wp-block-column { flex-grow: 1; flex-basis: 0; min-width: 0; overflow-wrap: break-word; }
/* Mirrors core: a column given an explicit width must not also grow, or an
   authored 50/50 split drifts out of proportion. */
.post-content .wp-block-column[style*="flex-basis"] { flex-grow: 0; }
.post-content .wp-block-column > :first-child { margin-top: 0; }
.post-content .wp-block-column > * + * { margin-top: 1.1rem; }
@media (max-width: 780px) {
  /* Mirrors core: columns stack unless the editor's "don't stack on mobile" is on. */
  .post-content .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
    flex-basis: 100% !important;
  }
}

.post-content > .wp-block-group { grid-column: text; }
.post-content > .wp-block-group.alignwide,
.post-content > .wp-block-group.alignfull { grid-column: wide; }
.post-content .wp-block-group > :first-child { margin-top: 0; }
.post-content .wp-block-group > * + * { margin-top: 1.35rem; }

.post-content .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.6rem 0; }
.post-content .wp-block-buttons.is-content-justification-center { justify-content: center; }
.post-content .wp-block-button__link {
  display: inline-block; background: var(--a-blue); color: #fff; text-decoration: none;
  padding: 0.72rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  line-height: 1.2; transition: background 0.15s ease;
}
.post-content .wp-block-button__link:hover { background: #1d4ed8; text-decoration: none; }
.post-content .wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent; color: var(--a-blue); box-shadow: inset 0 0 0 1px currentColor;
}
.post-content .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: rgba(37, 99, 235, 0.06);
}

.post-content .wp-block-separator {
  border: 0; height: 1px; background: var(--blog-line);
  margin: clamp(2rem, 4vw, 3rem) 0;
}
.post-content .wp-block-spacer { flex: none; }
.post-content .has-text-align-center { text-align: center; }
.post-content .has-text-align-right { text-align: right; }
.post-content .has-text-align-left { text-align: left; }

/* Gallery — images that had no text to pair with sit in a row rather than stacking
   full-width one after another. Written by tools/cms-zigzag.php as a core/gallery. */
.post-content > .wp-block-gallery { grid-column: wide; }
.post-content .wp-block-gallery {
  display: grid; gap: clamp(0.8rem, 2vw, 1.4rem);
  margin: clamp(2rem, 4vw, 3rem) 0; padding: 0;
}
.post-content .wp-block-gallery.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.post-content .wp-block-gallery.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post-content .wp-block-gallery > figure { margin: 0; }
.post-content .wp-block-gallery img {
  width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover;
  border-radius: 14px; display: block;
  box-shadow: 0 18px 44px -24px rgba(14, 27, 46, 0.5);
}
@media (max-width: 700px) {
  .post-content .wp-block-gallery.columns-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .post-content .wp-block-gallery { grid-template-columns: 1fr !important; }
}

.post-content blockquote {
  margin: clamp(2rem, 4vw, 2.6rem) 0; padding: 1.2rem 1.6rem;
  border-left: 3px solid var(--a-teal); background: var(--a-soft);
  border-radius: 0 12px 12px 0; color: #374151; font-size: 1.05rem;
}
.post-content blockquote p { font-style: italic; }
.post-content blockquote cite { display: block; margin-top: 0.6rem; font-style: normal; font-weight: 600; font-size: 0.85rem; color: var(--blog-muted); }
.post-content code { background: var(--a-soft); padding: 0.15em 0.4em; border-radius: 5px; font-size: 0.9em; }
.post-content pre { background: #0f172a; color: #e2e8f0; padding: 1.1rem 1.3rem; border-radius: 12px; overflow-x: auto; }
.post-content pre code { background: none; padding: 0; }

/* ── Related products / related posts (appended by assets/cms-related.js) ─────
   Replaces the dead "Suitable products" heading the Elementor import left behind. */
.cms-related { border-top: 1px solid var(--blog-line); padding: clamp(2.5rem, 5vw, 3.75rem) 0; }
.cms-related--products { background: var(--a-soft); }
.cms-related--posts { background: #fff; }
.cms-related-inner { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.cms-related-head { margin-bottom: 1.6rem; }
.cms-related-title {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem); font-weight: 700; letter-spacing: -0.02em;
  color: var(--a-ink); margin: 0;
}
.cms-related-title::before {
  content: ""; display: block; width: 46px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--a-teal), var(--a-blue)); margin-bottom: 0.9rem;
}
.cms-related-blurb { margin: 0.6rem 0 0; color: var(--blog-muted); font-size: 0.95rem; }
.cms-related-more {
  display: inline-block; margin-top: 1.4rem; font-weight: 600; font-size: 0.9rem;
  color: var(--a-blue); text-decoration: none;
}
.cms-related-more:hover { text-decoration: underline; }

.rel-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.25rem; }
.rel-product {
  display: flex; flex-direction: column; background: #fff; color: inherit; text-decoration: none;
  border: 1px solid var(--blog-line); border-radius: 14px; overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.rel-product:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1); border-color: #d8dee7; }
.rel-product-media { aspect-ratio: 4 / 3; background: #fff; display: flex; align-items: center; justify-content: center; padding: 0.9rem; }
.rel-product-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rel-product-body { padding: 0.85rem 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; border-top: 1px solid var(--blog-line); }
.rel-product-title { font-size: 0.94rem; font-weight: 600; line-height: 1.35; margin: 0; color: var(--a-ink); flex: 1; }
.rel-product-price { font-size: 0.95rem; font-weight: 700; color: var(--a-blue); }

@media (prefers-reduced-motion: reduce) {
  .rel-product, .post-card { transition: none; }
  .rel-product:hover, .post-card:hover { transform: none; }
}

/* Cover image kept for backwards compatibility with any cached markup. */
.article-cover { aspect-ratio: 16 / 8; border-radius: 16px; overflow: hidden; margin: 0 0 2.5rem; background: linear-gradient(135deg, #1e3a5f, #2563eb); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ── Media & Text (Gutenberg "Media & Text" block) → image-beside-text zigzag ──
   The headless site renders WordPress block output itself, so this styles the
   core block the editor already ships. Default = media left / text right; the
   editor's "Show media on right" toggle adds .has-media-on-the-right, which swaps
   the columns — so alternating rows produce the zigzag, WYSIWYG. See the
   "Image + text — zigzag" pattern (cms/mu-plugins/anvil-patterns.php). */
.post-content > .wp-block-media-text { grid-column: wide; }   /* break out past the text measure */
.post-content .wp-block-media-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.25rem);
  align-items: start;            /* top-align image with the heading (no centred gaps) */
  margin: clamp(2.75rem, 6vw, 4.25rem) 0;
}
/* Both children are pinned to row 1 explicitly. Without `grid-row: 1`, a swapped row
   breaks: the media is placed first at column 2, which moves the auto-placement cursor
   past column 1, and the content — asking for column 1 — cannot go backwards under the
   default sparse flow, so it lands on row 2. The result is image top-right with the text
   stranded below-left instead of beside it. */
.post-content .wp-block-media-text__media { margin: 0; grid-column: 1; grid-row: 1; }
.post-content .wp-block-media-text__content { grid-column: 2; grid-row: 1; }
/* "Show media on right" → swap the two columns for the alternating row */
.post-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media { grid-column: 2; grid-row: 1; }
.post-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content { grid-column: 1; grid-row: 1; }
/* Every image gets the SAME fixed shape (cover-cropped) so rows look uniform
   regardless of the source image's dimensions or how much text sits beside it. */
.post-content .wp-block-media-text__media img {
  width: 100%; aspect-ratio: 4 / 3; height: auto;
  object-fit: cover; border-radius: 16px; display: block;
  box-shadow: 0 18px 44px -24px rgba(14, 27, 46, 0.5);
}
/* The zigzag text column carries its own heading, so drop the section rule that
   full-width h2s get — inside a row it would read as a false section break. */
.post-content .wp-block-media-text__content h2::before { display: none; }
.post-content .wp-block-media-text__content h2 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
/* Reset the prose flow-spacing inside the text column so the first heading sits
   flush with the image top, and give the inner blocks their own rhythm. */
.post-content .wp-block-media-text__content > :first-child { margin-top: 0; }
.post-content .wp-block-media-text__content > * + * { margin-top: 1rem; }
.post-content .wp-block-media-text__content h2,
.post-content .wp-block-media-text__content h3 { margin-top: 0; }

@media (max-width: 768px) {
  .post-content .wp-block-media-text,
  .post-content .wp-block-media-text.has-media-on-the-right { grid-template-columns: 1fr; }
  .post-content .wp-block-media-text__media,
  .post-content .wp-block-media-text__content,
  .post-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media,
  .post-content .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content { grid-column: auto; }
  .post-content .wp-block-media-text__media img { aspect-ratio: 16 / 10; }
}

.article-foot { border-top: 1px solid var(--blog-line); padding: 2rem 0 4rem; }
.article-back { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--blog-accent); text-decoration: none; }
.article-back:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .blog-filterbar { top: 0; }
}
