/* ===== BLOG SHARED STYLES =====
   Uses the same light-theme tokens as styles.css:
   --bg: #f5f8f6  --ink: #14181a  --ink-dim: #3c4642
   --ink-muted: #66716a  --ink-faint: #98a29b
   --surface: #ffffff  --surface-2: #eef5f1
   --line: rgba(20,24,21,.09)  --line-strong: rgba(20,24,21,.16)
   --accent: #2f8f5b  --accent-hover: #267a4c
   ============================================================ */

/* ---- Layout containers ---- */

.blog-container {
  max-width: 860px;
  padding-top: 6rem;
  padding-bottom: 5rem;
}

.article-container {
  max-width: 720px;
  padding-top: 6rem;
  padding-bottom: 5rem;
}

/* ---- Breadcrumb ---- */

.breadcrumb ol {
  display: flex;
  gap: .4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  font-size: .85rem;
  color: var(--ink-muted);
}
.breadcrumb ol li + li::before {
  content: "/";
  margin-right: .4rem;
  color: var(--ink-faint);
}
.breadcrumb a {
  color: var(--accent-hover);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }

/* ---- Blog index header ---- */

.blog-header {
  margin-bottom: 3rem;
}
.blog-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: .75rem;
  color: var(--ink);
}
.blog-header p {
  font-size: 1.05rem;
  color: var(--ink-muted);
  max-width: 560px;
  line-height: 1.6;
}

/* ---- Blog grid ---- */

.blog-grid {
  display: grid;
  gap: 1.5rem;
}

/* Article pages: a thin progress line under the top edge fills as you
   read (a scroll-driven animation; browsers without it show nothing). */
@supports (animation-timeline: scroll()) {
  body:has(.article-body)::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 200;
    background: var(--accent-hover);
    transform-origin: left center;
    transform: scaleX(0);
    animation: read-progress linear both;
    animation-timeline: scroll(root block);
    pointer-events: none;
  }

  /* Blog home: cards below the fold rise in as they scroll into view
     (cards already on screen at load are simply there). */
  .blog-card {
    animation: card-rise linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 25%;
  }
}

@keyframes read-progress {
  to {
    transform: scaleX(1);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
}

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

.blog-card {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 1.75rem;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.blog-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px -8px rgba(47,143,91,.15);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: .9rem;
  font-size: .8rem;
  color: var(--ink-muted);
}

.blog-tag {
  background: var(--accent-tint, #eaf6f0);
  color: var(--accent-hover);
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.blog-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: .6rem;
  color: var(--ink);
}
.blog-card h2 a {
  color: var(--ink);
  text-decoration: none;
}
.blog-card h2 a:hover { color: var(--accent-hover); }

.blog-card p {
  font-size: .95rem;
  color: var(--ink-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.blog-read-more {
  font-size: .875rem;
  color: var(--accent-hover);
  text-decoration: none;
  font-weight: 600;
}
.blog-read-more:hover { text-decoration: underline; }

/* ---- Article header ---- */

.article-header {
  margin-bottom: 2.5rem;
}
.article-header .blog-tag {
  display: inline-block;
  margin-bottom: .75rem;
}
.article-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: .75rem;
  color: var(--ink);
}
.article-meta {
  font-size: .85rem;
  color: var(--ink-muted);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- Article body ---- */

.article-body {
  font-size: 1.0625rem;   /* 17px — comfortable long-form reading size */
  line-height: 1.8;
  color: var(--ink-dim);  /* #3c4642 — strong contrast on #f5f8f6, ~8:1 */
}

.article-body h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin: 2.75rem 0 .75rem;
  line-height: 1.25;
  color: var(--ink);      /* #14181a — maximum contrast for headings */
}

.article-body h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 .5rem;
  color: var(--ink);
}

.article-body p {
  margin-bottom: 1.35rem;
}

.article-body ul,
.article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.35rem;
}

.article-body li {
  margin-bottom: .5rem;
  color: var(--ink-dim);
}

/* Links: green + underline on hover, clear focus ring */
.article-body a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-color: rgba(38,122,76,.35);
  text-underline-offset: 3px;
  transition: text-decoration-color .15s;
}
.article-body a:hover {
  text-decoration-color: var(--accent-hover);
}
.article-body a:focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Buttons inside article body must not inherit link styles */
.article-body a.btn,
.article-cta a.btn {
  color: var(--accent-ink, #ffffff);
  text-decoration: none;
  text-decoration-color: transparent;
  display: inline-flex;
}
.article-body a.btn:hover,
.article-cta a.btn:hover {
  color: var(--accent-ink, #ffffff);
  text-decoration: none;
  text-decoration-color: transparent;
}
.article-body a.btn:focus-visible,
.article-cta a.btn:focus-visible {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

.article-body strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---- Callout / note box ---- */

.article-body .callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-tint, #eaf6f0);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  margin: 1.75rem 0;
  font-size: .975rem;
  color: var(--ink-dim);
  line-height: 1.65;
}
.article-body .callout strong {
  color: var(--accent-hover);
}

/* ---- Article CTA box ---- */

.article-cta {
  margin-top: 3rem;
  padding: 2rem;
  border: 1px solid rgba(47,143,91,.25);
  border-radius: 12px;
  background: var(--accent-tint, #eaf6f0);
  text-align: center;
}
.article-cta h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--ink);
}
.article-cta p {
  font-size: .975rem;
  color: var(--ink-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* ---- Related articles ---- */

.related-articles {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-strong);
}
.related-articles h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--ink);
}
.related-list {
  display: grid;
  gap: .75rem;
  list-style: none;
  padding: 0;
}
.related-list li a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-color: rgba(38,122,76,.35);
  text-underline-offset: 3px;
  font-size: .975rem;
  font-weight: 500;
}
.related-list li a:hover {
  text-decoration-color: var(--accent-hover);
}

/* ---- Mobile ---- */

@media (max-width: 768px) {
  .blog-container,
  .article-container {
    padding-top: 5rem;
    padding-bottom: 3rem;
  }
  .article-body {
    font-size: 1rem;
    line-height: 1.75;
  }
  .article-body h2 {
    font-size: 1.2rem;
    margin-top: 2.25rem;
  }
  .article-body h3 {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .blog-card {
    padding: 1.25rem;
  }
  .article-cta {
    padding: 1.5rem 1.25rem;
  }
}

/* ---- Answer-first summary (the paragraph search and AI answers quote) ---- */

.article-body .answer-first {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--ink);
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line, rgba(20,24,21,.09));
  border-radius: 12px;
  margin-bottom: 2rem;
}

/* ---- Sample WhatsApp chat (static, same colours as the home-page mockups) ---- */

.chat-sample {
  margin: 1.75rem 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line, rgba(20,24,21,.09));
  background: var(--wa-bg, #e7e0d2);
}
.chat-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem .9rem;
  background: var(--surface);
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line, rgba(20,24,21,.09));
}
.chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .7rem;
  color: #fff;
  background: linear-gradient(155deg, var(--accent-light, #3da372), var(--accent-deep, #163e2b));
}
.chat-feed {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1rem;
}
.chat-msg {
  max-width: 82%;
  padding: .5rem .75rem .35rem;
  border-radius: 10px;
  font-size: .95rem;
  line-height: 1.45;
  color: var(--wa-text, #111b21);
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.chat-msg time {
  display: block;
  text-align: right;
  font-size: .7rem;
  color: #667781;
  margin-top: .15rem;
}
.chat-msg time b { color: var(--wa-tick, #53bdeb); letter-spacing: -.15em; margin-left: .2em; }
.chat-in { align-self: flex-start; background: var(--wa-in, #fff); border-top-left-radius: 3px; }
.chat-out { align-self: flex-end; background: var(--wa-out, #d9fdd3); border-top-right-radius: 3px; }
.chat-chip {
  align-self: center;
  margin-top: .35rem;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-hover);
  background: var(--accent-tint, #eaf6f0);
  padding: .3rem .7rem;
  border-radius: 9px;
}
.chat-sample figcaption {
  padding: .55rem .9rem;
  font-size: .8rem;
  color: var(--ink-muted);
  background: var(--surface);
  border-top: 1px solid var(--line, rgba(20,24,21,.09));
}

/* ---- FAQ accordion ---- */

.faq-list {
  border-top: 1px solid var(--line, rgba(20,24,21,.09));
  margin-bottom: 1rem;
}
.faq-list details {
  border-bottom: 1px solid var(--line, rgba(20,24,21,.09));
  padding: .9rem 0;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--accent-hover); font-weight: 500; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list summary:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; border-radius: 4px; }
.faq-list details p { margin: .6rem 0 0; }

/* ---- Comparison table ---- */

.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--line, rgba(20,24,21,.09));
  border-radius: 12px;
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  min-width: 560px;
}
.table-wrap th,
.table-wrap td {
  text-align: left;
  vertical-align: top;
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--line, rgba(20,24,21,.09));
  color: var(--ink-dim);
  line-height: 1.5;
}
.table-wrap thead th { background: var(--surface-2, #eef5f1); color: var(--ink); font-weight: 600; }
.table-wrap td:first-child { font-weight: 600; color: var(--ink); }
.table-wrap tr:last-child td { border-bottom: 0; }

/* On phones the fixed nav wraps to two rows (~92px), so give the first line
   of content room to clear it. */
@media (max-width: 720px) {
  .blog-container,
  .article-container {
    padding-top: 7.25rem;
  }
}

/* ---- Legal pages (privacy, terms) ---- */

/* Section links land below the fixed nav */
.article-body h2[id] {
  scroll-margin-top: 96px;
}

.legal-toc {
  margin: 0 0 2.25rem;
  background: var(--surface);
  border: 1px solid var(--line, rgba(20,24,21,.09));
  border-radius: 12px;
}
.legal-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: .75rem 1.25rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  border-radius: 12px;
}
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
}
.legal-toc[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.legal-toc summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.legal-toc ol {
  margin: 0;
  padding: .25rem 1.25rem 1rem 2.6rem;
  font-size: .95rem;
  line-height: 1.5;
  columns: 2;
  column-gap: 2rem;
}
.legal-toc li {
  margin-bottom: .45rem;
  break-inside: avoid;
}
.legal-toc a {
  color: var(--ink-dim);
  text-decoration: none;
}
.legal-toc a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Unfilled legal details stand out until they are replaced */
.article-body mark {
  background: #fff3c4;
  color: var(--ink);
  padding: 0 .2em;
  border-radius: 3px;
}

.legal-related {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line, rgba(20,24,21,.09));
  font-size: .95rem;
  color: var(--ink-muted);
}
.legal-related a { font-weight: 600; }

@media (max-width: 720px) {
  .article-body h2[id] { scroll-margin-top: 124px; }
  .legal-toc ol { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .legal-toc summary::after { transition: none; }
}
