/*
Theme Name: Wisegrid Blog
Theme URI: https://wisegrid.co/blog
Author: Wisegrid (Frankie / frontend)
Author URI: https://wisegrid.co
Description: Custom WordPress theme that visually matches the wisegrid.co marketing site (same header/nav, footer, colors, typography, button styles). Design tokens extracted from the React marketing app (frontend/src/styles.css, the .lp-* landing palette). System font stack only — no web fonts loaded.
Version: 1.3.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: Proprietary — Wisegrid internal
Text Domain: wisegrid-blog
*/

/* ════════════════════════════════════════════════════════════════════
 *  DESIGN TOKENS — mirrored 1:1 from the marketing site's .lp-* palette
 *  (frontend/src/styles.css :503-4530). Keep in lockstep with that file.
 * ════════════════════════════════════════════════════════════════════ */

:root {
  /* Linear-style palette: near-white bg, near-black ink, restrained indigo accent */
  --lp-bg: #fcfcfd;
  --lp-surface: #ffffff;
  --lp-ink: #08090a;
  --lp-ink-soft: #5e6c7b;
  --lp-ink-faint: #94a0ad;
  --lp-border: #ebedf0;
  --lp-primary: #5e6ad2;          /* desaturated indigo — logo chip + links */
  --lp-primary-hover: #4b53b3;
  --lp-primary-soft: #eef0fc;
  --lp-accent: #d97757;
  --lp-accent-soft: #fff7ed;
  --lp-success: #16a34a;
  --lp-success-soft: #ecfdf5;
  --lp-warn: #d97706;
  --lp-warn-soft: #fffbeb;
  --lp-radius: 12px;
  --lp-radius-lg: 18px;
  --lp-shadow-sm: 0 1px 2px rgba(8, 9, 10, 0.04);
  --lp-shadow-md: 0 10px 30px -10px rgba(8, 9, 10, 0.10);
  --lp-shadow-lg: 0 28px 70px -20px rgba(8, 9, 10, 0.16);

  /* Article-specific tokens (additive — not on the marketing site, but
     derived from its palette so the reading experience stays on-brand) */
  --article-max: 680px;       /* M3: comfortable ~66-char measure at 17.5px */
  --article-wide: 980px;      /* hero band / full-bleed elements */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

/* ════════════════════════════════════════════════════════════════════
 *  BASE
 * ════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--lp-ink);
  background: var(--lp-bg);
  font-feature-settings: 'ss01', 'cv02', 'cv03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--lp-primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.wg-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--lp-ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 200;
}
.wg-skip-link:focus { left: 16px; top: 12px; }

/* ── Layout container — matches .lp-container (1180px / 28px) ───────── */

.lp-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ════════════════════════════════════════════════════════════════════
 *  HEADER + NAV — mirrors .lp-header / .lp-nav / .lp-logo
 * ════════════════════════════════════════════════════════════════════ */

.lp-header {
  position: sticky;
  top: 0;
  background: rgba(250, 251, 252, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(232, 235, 240, 0.6);
  z-index: 50;
}

.lp-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.lp-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--lp-ink);
}
.lp-logo:hover { text-decoration: none; }

/* Glyph wordmark chip — identical treatment to the React .lp-logo-mark.
   The React app renders the ▦ glyph; we render the same glyph so the blog
   header is byte-for-byte the same mark without needing an external asset. */
.lp-logo-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--lp-primary);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}

.lp-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.lp-nav a {
  color: var(--lp-ink-soft);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.lp-nav a:hover { color: var(--lp-ink); }

/* "Blog" is the current page in this theme — give it the active ink color */
.lp-nav a.is-active { color: var(--lp-ink); }

.lp-nav-signin { color: var(--lp-ink) !important; }

/* Primary CTA inside the nav must read as primary (matches the React
   .lp-nav a.lp-btn-primary specificity fix). */
.lp-nav a.lp-btn-primary {
  color: #fff;
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════
 *  BUTTONS — mirrors .lp-btn family
 * ════════════════════════════════════════════════════════════════════ */

.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 90ms ease, background 120ms ease, border 120ms ease, box-shadow 120ms ease;
  white-space: nowrap;
}
.lp-btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.lp-btn-primary {
  background: var(--lp-ink);
  color: #fff;
}
.lp-btn-primary:hover {
  background: #1d2536;
  box-shadow: var(--lp-shadow-md);
}

.lp-btn-ghost {
  background: transparent;
  color: var(--lp-ink);
}
.lp-btn-ghost:hover { background: rgba(14, 21, 37, 0.04); }

.lp-btn-outline {
  background: var(--lp-surface);
  color: var(--lp-ink);
  border-color: var(--lp-border);
}
.lp-btn-outline:hover { border-color: var(--lp-ink); }

.lp-btn-lg {
  padding: 14px 22px;
  font-size: 15px;
  border-radius: 12px;
}

/* ── Eyebrow + dot ─────────────────────────────────────────────── */

.lp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--lp-ink-soft);
  margin-bottom: 16px;
}
.lp-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lp-primary);
}

/* ════════════════════════════════════════════════════════════════════
 *  BLOG SHELL
 * ════════════════════════════════════════════════════════════════════ */

.wg-main { min-height: 60vh; }

.wg-blog-head {
  padding: 64px 0 8px;
  background:
    radial-gradient(50% 60% at 50% -10%, rgba(94, 106, 210, 0.07), transparent 70%);
}
.wg-blog-head h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--lp-ink);
}
.wg-blog-head p {
  color: var(--lp-ink-soft);
  font-size: 17px;
  max-width: 620px;
  margin: 0;
}

/* ── Post list (cards) — index.php / archive.php ───────────────────── */

.wg-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 40px 0 64px;
}

.wg-card {
  display: flex;
  flex-direction: column;
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-lg);
  overflow: hidden;
  box-shadow: var(--lp-shadow-sm);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.wg-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--lp-shadow-md);
  border-color: #dfe2ea;
}

.wg-card-thumb {
  display: flex;
  aspect-ratio: 16 / 9;
  background: var(--lp-primary-soft);
  overflow: hidden;
}
.wg-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Generated cover art (no image assets) ─────────────────────────
   A deterministic, on-brand inline SVG of a stylized spreadsheet — crisp light
   panel on a soft-indigo field, a header row + precise cell grid with a few
   accent-filled cells, a sparkline, and the ▦ logo chip. Built per-post by
   wisegrid_blog_cover_svg(); the title is NOT overlaid (it renders below the
   cover). Matches the React home teaser (frontend blogCoverArt.js) exactly. */
.wg-cover {
  flex: 1 1 auto;
  align-self: stretch;
  display: block;
  width: 100%;
  min-height: 100%;
  background: var(--lp-primary-soft, #eef0fc);
  overflow: hidden;
}
.wg-cover-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.wg-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 24px 24px;
  flex: 1;
}

.wg-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 9px;
  font-size: 12.5px;
  color: var(--lp-ink-faint);
  letter-spacing: 0.02em;
}
.wg-card-meta .wg-dot-sep { color: var(--lp-border); }

/* Category pill — shared between index cards, archive, masthead, feature. */
.wg-cat-pill {
  display: inline-block;
  background: var(--lp-primary-soft);
  color: var(--lp-primary-hover);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 10.5px;
  line-height: 1.5;
  padding: 2px 9px;
  border-radius: 999px;
}
a.wg-cat-pill:hover { text-decoration: none; color: var(--lp-primary); }

/* ── H4: featured post — full-width hero card atop the grid ───────── */
.wg-feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-lg);
  overflow: hidden;
  box-shadow: var(--lp-shadow-sm);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.wg-feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--lp-shadow-md);
  border-color: #dfe2ea;
}
.wg-feature-thumb {
  display: flex;
  position: relative;
  min-height: 280px;
  background: var(--lp-primary-soft);
  overflow: hidden;
}
.wg-feature-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wg-feature-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px 38px;
  justify-content: center;
}
.wg-feature-eyebrow .lp-eyebrow { margin-bottom: 0; }
.wg-feature-title {
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0;
}
.wg-feature-title a { color: var(--lp-ink); }
.wg-feature-title a:hover { color: var(--lp-primary); text-decoration: none; }
.wg-feature-excerpt {
  color: var(--lp-ink-soft);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}
.wg-feature-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  font-size: 12.5px;
  color: var(--lp-ink-faint);
}
.wg-feature-meta .wg-dot-sep { color: var(--lp-border); }
.wg-feature .wg-card-readmore { margin-top: 4px; }

.wg-card-title {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
}
.wg-card-title a { color: var(--lp-ink); }
.wg-card-title a:hover { color: var(--lp-primary); text-decoration: none; }

.wg-card-excerpt {
  color: var(--lp-ink-soft);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.wg-card-readmore {
  margin-top: auto;
  padding-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--lp-primary);
}
.wg-card-readmore:hover { text-decoration: none; }
.wg-card-readmore .wg-arrow { transition: transform 120ms ease; display: inline-block; }
.wg-card:hover .wg-card-readmore .wg-arrow { transform: translateX(3px); }

/* ── Pagination ────────────────────────────────────────────────── */

.wg-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 0 0 72px;
}
.wg-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--lp-border);
  border-radius: 10px;
  background: var(--lp-surface);
  color: var(--lp-ink-soft);
  font-size: 14px;
  font-weight: 500;
}
.wg-pagination .page-numbers:hover { border-color: var(--lp-ink); color: var(--lp-ink); text-decoration: none; }
.wg-pagination .page-numbers.current {
  background: var(--lp-ink);
  border-color: var(--lp-ink);
  color: #fff;
}
.wg-pagination .page-numbers.dots { border: none; background: transparent; }

/* ════════════════════════════════════════════════════════════════════
 *  SINGLE ARTICLE — single.php
 * ════════════════════════════════════════════════════════════════════ */

.wg-article {
  padding: 0 0 24px;
}

/* ── H1: article masthead — a layered hero band so the piece has an
   entrance, mirroring the marketing hero's tinted radial depth ────── */
.wg-article-masthead {
  position: relative;
  padding: 60px 0 48px;
  background:
    radial-gradient(52% 70% at 50% -8%, rgba(94, 106, 210, 0.10), transparent 70%),
    radial-gradient(40% 50% at 92% 8%, rgba(155, 109, 222, 0.06), transparent 65%);
  border-bottom: 1px solid var(--lp-border);
  overflow: hidden;
}
.wg-article-masthead::before {
  /* faint grid motif — evokes the product, stays subtle */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(94, 106, 210, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 106, 210, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(70% 80% at 50% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(70% 80% at 50% 0%, #000 0%, transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.wg-article-head {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.wg-article-head .wg-article-eyebrow {
  margin-bottom: 18px;
  justify-content: center;
}
.wg-article-head h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--lp-ink);
}
.wg-article-head .wg-article-dek {
  font-size: 19px;
  line-height: 1.55;
  color: var(--lp-ink-soft);
  margin: 0 auto;
  max-width: 600px;
}
.wg-article-head .wg-article-meta {
  font-size: 13.5px;
  color: var(--lp-ink-faint);
  letter-spacing: 0.02em;
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  justify-content: center;
}
.wg-article-head .wg-article-meta .wg-dot-sep { color: var(--lp-border); }

/* H2: masthead category pill — a touch larger than the card pills (the shared
   .wg-cat-pill base lives in the card section; this only bumps the scale). */
.wg-article-eyebrow .wg-cat-pill {
  font-size: 11.5px;
  padding: 4px 11px;
}

/* The body opens below the masthead */
.wg-article-body { padding-top: 48px; }

.wg-article-hero {
  max-width: 980px;
  margin: 0 auto 44px;
  border-radius: var(--lp-radius-lg);
  overflow: hidden;
  box-shadow: var(--lp-shadow-md);
}
.wg-article-hero img { width: 100%; display: block; }

/* The readable content column + rich typography */
.wg-prose {
  max-width: var(--article-max);
  margin: 0 auto;
  font-size: 17.5px;
  line-height: 1.72;
  color: #20242b;
}

.wg-prose > * + * { margin-top: 1.35em; }

.wg-prose h2 {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--lp-ink);
  margin-top: 2.2em;
  margin-bottom: 0.1em;
}
.wg-prose h3 {
  font-size: clamp(21px, 2.2vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--lp-ink);
  margin-top: 1.8em;
}
.wg-prose h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--lp-ink);
  margin-top: 1.6em;
}

/* B1 fix: paragraphs carry their own bottom rhythm (the blanket `margin:0`
   here used to beat the `> * + *` stack rule via equal specificity + source
   order, collapsing the whole body into a wall of text). */
.wg-prose p { margin: 0 0 1.05em; }
.wg-prose > p:last-child { margin-bottom: 0; }

.wg-prose a {
  color: var(--lp-primary);
  text-decoration: underline;
  text-decoration-color: rgba(94, 106, 210, 0.35);
  text-underline-offset: 2px;
}
.wg-prose a:hover { text-decoration-color: var(--lp-primary); }

.wg-prose strong { color: var(--lp-ink); font-weight: 700; }

.wg-prose ul, .wg-prose ol {
  margin: 0;
  padding-left: 1.4em;
}
.wg-prose li { margin: 0.35em 0; }
.wg-prose li::marker { color: var(--lp-ink-faint); }

/* Checklists — Otto's converter emits task items as a bare
   `<li><input type="checkbox" disabled [checked]> …` with NO wrapper class,
   so we target the checkbox directly. Any <li> that contains a checkbox drops
   its marker and lays out as a flex row; the box gets the brand treatment.
   (Also kept the GFM `.task-list-item` selectors for forward-compat with a
   future renderer.) */
.wg-prose li:has(> input[type="checkbox"]),
.wg-prose .task-list-item {
  list-style: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
/* Pull task <li>s flush-left even though the parent <ul> keeps padding for
   any normal items mixed in. */
.wg-prose li:has(> input[type="checkbox"]) { margin-left: -1.4em; }
.wg-prose li > input[type="checkbox"],
.wg-prose .task-list-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 4px 0 0;
  border: 1.5px solid var(--lp-border);
  border-radius: 5px;
  background: var(--lp-surface);
  flex: 0 0 auto;
  position: relative;
}
.wg-prose li > input[type="checkbox"]:checked,
.wg-prose .task-list-item input[type="checkbox"]:checked {
  background: var(--lp-success);
  border-color: var(--lp-success);
}
.wg-prose li > input[type="checkbox"]:checked::after,
.wg-prose .task-list-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* P3: pull-quote — a tinted card with a soft leading mark so the one "money"
   quote per post carries real weight (vs the old flat 3px-rule treatment). */
.wg-prose blockquote {
  position: relative;
  margin: 2em 0;
  padding: 24px 26px 24px 30px;
  border: 1px solid var(--lp-border);
  border-left: 4px solid var(--lp-primary);
  border-radius: var(--lp-radius);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(94, 106, 210, 0.06), transparent 60%),
    var(--lp-surface);
  color: var(--lp-ink);
  font-size: 1.12em;
  line-height: 1.55;
  font-weight: 500;
  font-style: normal;
  box-shadow: var(--lp-shadow-sm);
}
.wg-prose blockquote::before {
  content: '\201C'; /* leading curly quote */
  position: absolute;
  top: 2px;
  left: 14px;
  font-size: 2.4em;
  line-height: 1;
  color: var(--lp-primary);
  opacity: 0.28;
  font-family: Georgia, 'Times New Roman', serif;
  pointer-events: none;
}
.wg-prose blockquote p { margin: 0; }
.wg-prose blockquote p + p { margin-top: 0.7em; }
.wg-prose blockquote cite {
  display: block;
  margin-top: 12px;
  font-size: 0.82em;
  font-weight: 600;
  font-style: normal;
  color: var(--lp-ink-soft);
  letter-spacing: 0.01em;
}

/* P4: inline code — darkened to --lp-primary-hover for AA contrast against the
   indigo-soft chip at the body's small ~13.2px rendered size.
   Mobile-overflow fix: inline body code chips must WRAP so a run of chips
   (e.g. "(`CHILDREN` / `PARENT` / `ANCESTORS` / `DESCENDANTS`)") can't push the
   last chip past the viewport at 375px. `overflow-wrap: anywhere` lets a long
   token break; `white-space: normal` lets a run of chips wrap to the next line.
   This is INLINE body code only — `pre` and table code keep `nowrap` below. */
.wg-prose code {
  font-family: var(--font-mono);
  background: var(--lp-primary-soft);
  color: var(--lp-primary-hover);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.86em;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Fenced code blocks */
.wg-prose pre {
  font-family: var(--font-mono);
  background: #0e1116;
  color: #e6e9ef;
  padding: 18px 20px;
  border-radius: var(--lp-radius);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: var(--lp-shadow-sm);
}
.wg-prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-weight: 400;
  font-size: inherit;
  /* Block code keeps nowrap — the `pre` is a horizontal-scroll container
     (overflow-x: auto above), so code lines must NOT wrap. Re-asserted here
     because the inline `.wg-prose code` rule now allows wrapping. */
  white-space: nowrap;
  overflow-wrap: normal;
}

/* Comparison-table code keeps nowrap too: code inside a formula table scrolls
   inside its own `.wg-table-wrap` container (overflow-x: auto) — it must not
   wrap. Distinct from inline body code, which wraps to avoid viewport overflow. */
.wg-prose .wg-table-wrap code {
  white-space: nowrap;
  overflow-wrap: normal;
}

/* Tables — launch posts ARE Wisegrid-vs-Smartsheet comparisons, so the table
   should read as the showpiece, like the /vs/smartsheet page. M1: stronger
   header tint, an outer shadow, heavier dividers, and a success-tinted
   "Wisegrid wins" column (tagged server-side by the comparison filter). */
.wg-prose .wg-table-wrap {
  overflow-x: auto;
  margin: 2em 0;
  border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow-md);
  -webkit-overflow-scrolling: touch;
}
.wg-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  overflow: hidden;
}
.wg-prose thead th {
  background: var(--lp-primary-soft);
  color: var(--lp-ink);
  font-weight: 700;
  text-align: left;
  letter-spacing: -0.01em;
  border-bottom: 2px solid #dadffa;
}
.wg-prose th, .wg-prose td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--lp-border);
  vertical-align: top;
}
.wg-prose tbody tr:last-child td { border-bottom: none; }
.wg-prose tbody tr:nth-child(even) td { background: #fafbfd; }

/* M1: the affirmative "Wisegrid" column — tinted + confident, the way the
   marketing comparison table treats the wins column. */
.wg-prose thead th.wg-col-win {
  background: #e3f5ea;
  color: var(--lp-success);
  border-bottom-color: #bfe8cf;
}
.wg-prose td.wg-col-win {
  background: var(--lp-success-soft);
  color: var(--lp-ink);
  font-weight: 600;
  box-shadow: inset 1px 0 0 #d7f0e0, inset -1px 0 0 #d7f0e0;
}
.wg-prose tbody tr:nth-child(even) td.wg-col-win { background: #eafaf0; }
.wg-prose td.wg-col-win strong { color: var(--lp-success); }

/* Horizontal rule */
.wg-prose hr {
  border: none;
  border-top: 1px solid var(--lp-border);
  margin: 2.4em 0;
}

/* Figures / captions */
.wg-prose figure { margin: 1.8em 0; }
.wg-prose figure img { border-radius: var(--lp-radius); box-shadow: var(--lp-shadow-sm); }
.wg-prose figcaption {
  margin-top: 8px;
  font-size: 13.5px;
  color: var(--lp-ink-faint);
  text-align: center;
}

/* ── H3: Table of contents card ("On this page") ─────────────────── */
.wg-prose .wg-toc {
  margin: 2.2em 0;
  padding: 22px 24px 20px;
  background:
    radial-gradient(120% 130% at 0% 0%, rgba(94, 106, 210, 0.05), transparent 60%),
    var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  box-shadow: var(--lp-shadow-sm);
}
.wg-toc-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lp-ink-soft);
  margin-bottom: 14px;
}
/* Reset the prose-list treatment inside the card → counter-numbered, no discs */
.wg-prose .wg-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: wg-toc;
  display: grid;
  gap: 2px;
}
.wg-prose .wg-toc li {
  margin: 0;
  counter-increment: wg-toc;
  display: flex;
  align-items: baseline;
}
.wg-prose .wg-toc li::marker { content: none; }
.wg-prose .wg-toc li::before {
  content: counter(wg-toc, decimal-leading-zero);
  flex: 0 0 auto;
  width: 26px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--lp-ink-faint);
  letter-spacing: 0.02em;
}
.wg-prose .wg-toc a {
  display: block;
  flex: 1;
  padding: 5px 8px;
  margin-left: -8px;
  border-radius: 8px;
  color: var(--lp-ink-soft);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
  transition: background 120ms ease, color 120ms ease;
}
.wg-prose .wg-toc a:hover {
  background: var(--lp-primary-soft);
  color: var(--lp-ink);
  text-decoration: none;
}

/* ── Article footer: tags + CTA ────────────────────────────────── */

.wg-article-foot {
  max-width: var(--article-max);
  margin: 48px auto 0;
}

.wg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 40px;
}
.wg-tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--lp-ink-soft);
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: 999px;
  padding: 5px 12px;
}
.wg-tag:hover { border-color: var(--lp-ink); color: var(--lp-ink); text-decoration: none; }

.wg-cta {
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(94, 106, 210, 0.10), transparent 60%),
    var(--lp-ink);
  color: #fff;
  border-radius: var(--lp-radius-lg);
  padding: 40px 36px;
  text-align: center;
  box-shadow: var(--lp-shadow-lg);
}
.wg-cta h2 {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
  color: #fff;
  font-weight: 700;
}
.wg-cta p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  margin: 0 auto 22px;
  max-width: 460px;
}
.wg-cta .lp-btn-primary {
  background: #fff;
  color: var(--lp-ink);
}
.wg-cta .lp-btn-primary:hover { background: #f0f1f5; }
.wg-cta .wg-cta-fine {
  margin-top: 14px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ── M4: "Keep reading" — related posts ──────────────────────────── */
.wg-related {
  max-width: var(--article-wide);
  margin: 64px auto 0;
}
.wg-related-head { margin-bottom: 20px; }
.wg-related-head .lp-eyebrow { margin-bottom: 0; }
.wg-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.wg-related-card {
  display: flex;
  flex-direction: column;
  background: var(--lp-surface);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-lg);
  overflow: hidden;
  box-shadow: var(--lp-shadow-sm);
  color: var(--lp-ink);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.wg-related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--lp-shadow-md);
  border-color: #dfe2ea;
  text-decoration: none;
}
.wg-related-thumb {
  display: flex;
  aspect-ratio: 16 / 9;
  background: var(--lp-primary-soft);
  overflow: hidden;
}
.wg-related-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
}
.wg-related-cat {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--lp-primary-hover);
}
.wg-related-title {
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--lp-ink);
}

/* Prev / next post nav */
.wg-postnav {
  max-width: var(--article-wide);
  margin: 44px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.wg-postnav a {
  flex: 1 1 240px;
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius);
  padding: 14px 18px;
  background: var(--lp-surface);
  color: var(--lp-ink);
}
.wg-postnav a:hover { border-color: var(--lp-ink); text-decoration: none; box-shadow: var(--lp-shadow-sm); }
.wg-postnav .wg-postnav-label { font-size: 12px; color: var(--lp-ink-faint); display: block; margin-bottom: 4px; }
.wg-postnav .wg-postnav-title { font-weight: 600; font-size: 15px; line-height: 1.3; }
.wg-postnav .wg-postnav-next { text-align: right; }

/* ════════════════════════════════════════════════════════════════════
 *  STATIC PAGES — page.php
 * ════════════════════════════════════════════════════════════════════ */

.wg-page { padding: 56px 0 64px; }
.wg-page-head { max-width: var(--article-max); margin: 0 auto 28px; }
.wg-page-head h1 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0;
  color: var(--lp-ink);
}

/* ════════════════════════════════════════════════════════════════════
 *  404 / EMPTY STATES
 * ════════════════════════════════════════════════════════════════════ */

.wg-empty {
  text-align: center;
  padding: 96px 0 120px;
  max-width: 560px;
  margin: 0 auto;
}
.wg-empty h1 {
  font-size: clamp(40px, 8vw, 80px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--lp-ink);
}
.wg-empty p {
  color: var(--lp-ink-soft);
  font-size: 17px;
  margin: 0 0 28px;
}
.wg-empty-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════════════
 *  FOOTER — mirrors .lp-footer
 * ════════════════════════════════════════════════════════════════════ */

.lp-footer {
  padding: 32px 0;
  border-top: 1px solid var(--lp-border);
  background: var(--lp-surface);
  margin-top: 40px;
}
.lp-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.lp-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.lp-footer-nav a {
  color: var(--lp-ink-soft);
  font-size: 14px;
  text-decoration: none;
}
.lp-footer-nav a:hover { color: var(--lp-ink); }
.lp-footer-meta {
  font-size: 13px;
  color: var(--lp-ink-faint);
}

/* ════════════════════════════════════════════════════════════════════
 *  RESPONSIVE — matches the marketing breakpoints
 *  (940px = nav collapse on the marketing site; 720/640/540 = content)
 * ════════════════════════════════════════════════════════════════════ */

@media (max-width: 940px) {
  /* The marketing header hides text nav links < 940px, leaving the logo +
     the primary CTA. Replicate exactly so the two headers match. */
  .lp-nav { gap: 14px; }
  .lp-nav a:not(.lp-btn) { display: none; }
}

/* Related-posts: 3-up → 2-up on tablet. */
@media (max-width: 900px) {
  .wg-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .wg-card-grid { grid-template-columns: 1fr; gap: 18px; }
  /* Featured post stacks: art on top, body below — like a tall card. */
  .wg-feature { grid-template-columns: 1fr; }
  .wg-feature-thumb { min-height: 0; aspect-ratio: 16 / 9; }
  .wg-feature-body { padding: 26px 24px; }
}

@media (max-width: 640px) {
  .lp-container { padding: 0 18px; }
  .wg-blog-head { padding: 40px 0 4px; }
  /* The masthead replaces the old top padding; tighten it on phones. */
  .wg-article-masthead { padding: 40px 0 32px; }
  .wg-article-body { padding-top: 32px; }
  .wg-prose { font-size: 16.5px; }
  .wg-cta { padding: 32px 22px; }
  .wg-related-grid { grid-template-columns: 1fr; }
  .wg-postnav .wg-postnav-next { text-align: left; }
  .lp-footer-row { gap: 16px; }
  /* Comparison-table win-column inset shadows look heavy in a tight scroll
     area on phones — soften to just the tint. */
  .wg-prose td.wg-col-win { box-shadow: none; }
}
