/* ==========================================================================
   SayTheWord — blog stylesheet (articles + index)
   Extracted from 130 byte-identical inline <style> blocks and rewritten
   against /theme.css, so the blog is the same design system as the app and
   the marketing site rather than a third one with its own hard-coded palette.
   Every colour, size, radius, shadow and family below is a token. The skip
   link and the quick-exit pill come from assets/chrome.css.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, figure, blockquote { margin: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* theme.css owns :focus-visible; pills get a matching ring. */
.filter-btn:focus-visible, .load-more:focus-visible, .cta-btn:focus-visible { border-radius: var(--radius-pill); }

/* === SITE CHROME (shared header/footer, written by tools/build-chrome.py) ===
   Scoped to nav.site-nav: a bare `nav {}` rule made the in-article
   <nav class="related"> sticky as well, and it slid over the CTA box. */
nav.site-nav {
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Nav, footer and content share one width per page type, so the logo lines
   up with the column beneath it. Articles read at --w-prose; the index is a
   card grid and gets the full --w-page shell. The gutter lives on the shell,
   not the bar, so the nav content edge lines up with the page content edge. */
nav.site-nav .inner {
  max-width: var(--w-prose);
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-nav .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--touch);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-body-lg);
  color: var(--fg);
  letter-spacing: 0;
}

.site-nav .back {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  font-family: var(--font-body);
  color: var(--muted);
  font-size: var(--t-label);
  font-weight: 500;
}

.site-nav .back:hover { color: var(--fg); }

footer {
  max-width: var(--w-prose);
  margin: 0 auto;
  padding: 2rem var(--gutter) calc(2rem + var(--safe-bottom));
  text-align: center;
  color: var(--muted);
  font-size: var(--t-caption);
}

footer a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding-inline: 0.25rem;
}

footer a:hover { color: var(--fg); }

/* === ARTICLE === */
/* Prose wants a narrow measure; a card grid wants width. */
.page { max-width: var(--w-prose); margin: 0 auto; padding: 2rem var(--gutter) 4rem; }

body.blog-index .page,
body.blog-index nav.site-nav .inner,
body.blog-index footer { max-width: var(--w-page); }

/* The one card recipe: a hairline, a radius, the small shadow. No top bar. */
article,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

article { padding: 3rem 3.5rem 3.5rem; }

/* The one tracked-caps style. */
.cat,
.card-cat,
.rel-cat,
.related h3 {
  font-family: var(--font-body);
  display: inline-block;
  font-size: var(--t-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.cat { margin-bottom: 1.2rem; }

h1 {
  font-family: var(--font-display);
  font-size: var(--t-title-lg);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin-bottom: 0.6rem;
  color: var(--fg);
  text-wrap: balance;
}

.subtitle {
  font-size: var(--t-body-lg);
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
  max-width: 60ch;
}

.meta-line {
  font-family: var(--font-body);
  color: var(--muted);
  font-size: var(--t-caption);
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* Headings share the display face with the rest of the site. */
article h2 {
  font-family: var(--font-display);
  font-size: var(--t-heading);
  font-weight: 500;
  margin: 2.75rem 0 0.9rem;
  color: var(--fg);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

article p {
  margin-bottom: 1.4rem;
  font-size: var(--t-body-lg);
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 68ch;
}

blockquote {
  border-left: 3px solid var(--accent);
  margin: 2rem 0;
  padding: 0.8rem 1.5rem;
  color: var(--muted);
  font-style: italic;
}

ul, ol { margin: 0.5rem 0 1.4rem 1.5rem; color: var(--text-secondary); font-size: var(--t-body); }
li { margin-bottom: 0.4rem; }

/* Quick-exit note on articles about abuse, monitoring and leaving safely. */
.exit-note {
  font-family: var(--font-body);
  font-size: var(--t-label);
  color: var(--fg);
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  max-width: 60ch;
}

.exit-note a { text-decoration: underline; text-underline-offset: 0.2em; font-weight: 500; }

/* === RELATED === */
.related { margin: 3rem 0 0; padding-top: 2rem; border-top: 1px solid var(--border); }

.related h3 { margin-bottom: 1rem; }

.related ul { list-style: none; margin: 0; padding: 0; }
.related li { margin: 0; border-bottom: 1px solid var(--border); }
.related li:last-child { border-bottom: 0; }

.related a {
  display: block;
  padding: 0.9rem 0;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.45;
  min-height: var(--btn-md);
}

.related a:hover { color: var(--accent); }

.related .rel-cat {
  display: block;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 0.15rem;
}

/* === IN-ARTICLE CTA === */
.cta-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  margin: 3rem 0 1rem;
  background: var(--bg-alt);
}

.cta-box h3 {
  font-family: var(--font-display);
  font-size: var(--t-heading);
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--fg);
}

.cta-box p { color: var(--muted); margin-bottom: 1rem; font-size: var(--t-label); }

.cta-btn {
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--btn-lg);
  padding: 0 1.75rem;
  border: 1px solid var(--accent);
  background: var(--accent-fill);
  color: var(--on-accent);
  font-weight: 500;
  border-radius: var(--radius-pill);
  font-size: var(--t-body);
  white-space: nowrap;
  transition: background var(--dur) ease, border-color var(--dur) ease;
}

.cta-btn:hover { background: var(--accent-fill-hover); border-color: var(--accent-hover); }

.disclaimer {
  font-family: var(--font-body);
  font-size: var(--t-caption);
  color: var(--muted);
  text-align: center;
  margin-top: 0.75rem;
}

/* === INDEX === */
.hero { text-align: center; margin-bottom: 2.5rem; }

.hero h1 { font-family: var(--font-display); color: var(--fg); }
.hero p { color: var(--muted); font-size: var(--t-body-lg); max-width: 55ch; margin: 0 auto; }

.controls { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; align-items: center; }

.search-box {
  flex: 1;
  min-width: 200px;
  min-height: var(--input-h);
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--t-body);
  background: var(--surface);
  color: var(--fg);
  transition: border-color var(--dur) ease;
}

.search-box::placeholder { color: var(--muted); }
.search-box:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }

/* Filters: chips on wide screens, a native <select> on phones. Both are
   rendered from the same category groups in the config. */
.filters-wrap { position: relative; width: 100%; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; width: 100%; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  min-height: var(--chip-h);
  padding: 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--t-label);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur) ease, color var(--dur) ease, border-color var(--dur) ease;
  white-space: nowrap;
}

/* Hover is a hint (tinted); active is a statement (filled). They never
   look the same, so the current filter is legible while the pointer moves. */
.filter-btn:hover { background: var(--accent-soft); color: var(--fg); border-color: var(--accent-2); }
.filter-btn.active, .filter-btn[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); border-color: var(--accent); }

.filter-select {
  display: none;
  width: 100%;
  min-height: var(--input-h);
  padding: 0 2.5rem 0 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--t-body);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.filter-select-wrap { display: none; position: relative; width: 100%; }

.filter-select-wrap::after {
  content: '';
  position: absolute;
  right: 1.1rem;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

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

a.card {
  overflow: hidden;
  transition: transform var(--dur) ease, box-shadow var(--dur) ease, border-color var(--dur) ease;
  color: inherit;
  display: flex;
  flex-direction: column;
}

a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-2); }
.card-body { padding: 1.5rem 1.5rem 1.4rem; flex: 1; display: flex; flex-direction: column; }

.card-cat { margin-bottom: 0.5rem; }

.card-title {
  font-family: var(--font-display);
  font-size: var(--t-body-lg);
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.5rem;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.card-meta { font-size: var(--t-body); color: var(--text-secondary); line-height: 1.5; margin: 0 0 0.8rem; flex: 1; }
.card-footer { font-size: var(--t-caption); color: var(--muted); }
.no-results { text-align: center; padding: 3rem; color: var(--muted); font-size: var(--t-body); }

.load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2.5rem auto 0;
  min-height: var(--btn-lg);
  padding: 0 2rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--t-body);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--dur) ease, color var(--dur) ease;
}

.load-more:hover { border-color: var(--accent); color: var(--accent); }
.result-count { text-align: center; color: var(--muted); font-size: var(--t-label); margin-top: 1.25rem; }

@media (max-width: 700px) {
  .page { padding: 1.5rem var(--gutter) 3rem; }
  article { padding: 2rem 1.5rem 2.5rem; }
  .grid { grid-template-columns: 1fr; }
  .controls { flex-direction: column; }
  .search-box { min-width: 100%; }
  /* A 3,683px strip of 24 chips became a select. */
  .filters { display: none; }
  .filter-select-wrap { display: block; }
  .filter-select { display: block; }
}
