/* blog.css — the stylesheet for Mervia's own server-rendered blog (#3887).
 *
 * STANDALONE BY DESIGN. These pages are rendered by the backend and must look right with NO
 * frontend build present — CI never runs `npm run build`, and a server-rendered page that
 * depended on a hashed Vite artefact would be styled on a developer's machine and naked in
 * production the first time a build was skipped. So this file imports nothing and is served
 * verbatim from `backend/static/` by `routes/blog_pages.py`.
 *
 * THE TOKENS BELOW ARE A SNAPSHOT of `src/mervia_marketing/frontend/src/styles/tokens.css`
 * (the navy-ink + copper theme adopted in #3167), taken 2026-08-21. IT IS A SNAPSHOT, NOT A
 * BINDING: nothing keeps the two in sync, and nothing should — coupling a public HTML page to
 * the SPA's design system would reintroduce exactly the build dependency this file exists to
 * avoid. If the brand palette moves, these values are updated by hand, and until then the blog
 * simply looks like the site did at the snapshot. Only the tokens this stylesheet actually uses
 * are copied; the full set lives in the source file.
 *
 * The font stack matches `styles/base.css`. "Inter" is not loaded here (no webfont request from
 * a page whose whole purpose is to be fast and crawlable) — it renders in Inter for a visitor who
 * already has it and in the platform UI face otherwise, which is a difference of a few
 * hundredths of an em.
 */

:root {
  /* Brand — navy ink + copper accent. */
  --primary: #a85234;
  --primary-deep: #96492c;
  --primary-tint: #fbf1ed;
  --primary-fade: #fdf8f6;

  /* Slate / ink */
  --ink: #0b1f3a;
  --ink-soft: #2c3e52;
  --ink-mute: #5a6b7d;
  --ink-faint: #8a97a5;

  /* Surfaces */
  --canvas: #ffffff;
  --canvas-soft: #f7f8fa;
  --canvas-sunken: #eff1f4;

  /* Lines */
  --hairline: #e4e8ed;
  --hairline-strong: #d3dae2;

  /* Dark emphasis band — the footer. */
  --night: #0b1f3a;
  --on-night: #e3e9f0;
  --on-night-mute: #a9b8c8;

  /* Radius + shadow */
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(11, 31, 58, 0.04), 0 1px 3px rgba(11, 31, 58, 0.04);

  /* Article measure. ~72 characters at this size — the width prose is comfortable at, which is
   * the one layout decision on this page that matters. */
  --blog-measure: 720px;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Matches the app's `--font-mono`: the system's own fixed face. This page loads no webfont, so
     naming one here only made the token mean two different things in two places. */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── page chrome ─────────────────────────────────────────────────────────── */

.blog-header {
  border-bottom: 1px solid var(--hairline);
  background: var(--canvas);
}

.blog-header nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.blog-header a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
}

.blog-header a:hover {
  color: var(--primary-deep);
}

.blog-wordmark {
  font-weight: 650;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
}

.blog-nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.blog-nav-spacer {
  margin-left: auto;
}

.blog-header a.current {
  color: var(--ink);
  font-weight: 550;
}

@media (max-width: 640px) {
  .blog-nav-links {
    display: none;
  }
}

.blog-cta {
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--primary);
  color: #fff !important;
  font-weight: 550;
}

.blog-cta:hover {
  background: var(--primary-deep);
}

.blog-footer {
  margin-top: 80px;
  padding: 44px 24px;
  background: var(--night);
  color: var(--on-night-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  justify-content: center;
  font-size: 14px;
}

.blog-footer div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
}

.blog-footer a {
  color: var(--on-night-mute);
  text-decoration: none;
}

.blog-footer a:hover {
  color: var(--on-night);
}

.blog-footer-label {
  color: var(--on-night);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

/* ── the index ───────────────────────────────────────────────────────────── */
/* The grid, feature card, category pill and meta line all match the 2026-08-22 "Mervia Blog"
 * mock (docs/product/gtam-agents/mock/Mervia Blog.html); the values are copied from its inline
 * styles so this server-rendered page reads as the same page the SPA marketing site presents. */

.blog-index {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px 0;
}

.blog-head {
  max-width: 760px;
  margin: 0 0 36px;
}

.blog-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}

.blog-head h1 {
  font-size: 38px;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0;
}

.blog-lead {
  margin: 14px 0 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-mute);
}

.blog-empty {
  color: var(--ink-mute);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 24px 26px 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms, transform 140ms, box-shadow 140ms;
}

.blog-card:hover {
  border-color: var(--hairline-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.blog-card.feature {
  grid-column: span 2;
}

.blog-card h3 {
  margin: 2px 0 0;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.blog-card.feature h3 {
  font-size: 22px;
}

.blog-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-mute);
}

.blog-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary-deep);
  background: var(--primary-tint);
  border-radius: 999px;
  padding: 3px 10px;
}

.blog-meta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 12px;
  color: var(--ink-faint);
}

/* The email-subscribe band. */
.blog-sub {
  margin: 44px 0 0;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  background: var(--canvas-soft);
}

.blog-sub-h {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.blog-sub p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--ink-mute);
}

.blog-sub .btn-primary {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 550;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.blog-sub .btn-primary:hover {
  background: var(--primary-deep);
}

@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-card.feature {
    grid-column: auto;
  }
  .blog-head h1 {
    font-size: 30px;
  }
}

/* ── the article ─────────────────────────────────────────────────────────── */

.blog-post {
  max-width: var(--blog-measure);
  margin: 0 auto;
  padding: 56px 24px 0;
}

.blog-post h1 {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}

.blog-byline {
  color: var(--ink-mute);
  font-size: 14px;
  margin-bottom: 28px;
}

.blog-author {
  color: var(--ink-soft);
  font-weight: 550;
}

.blog-hero {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--hairline);
  margin-bottom: 32px;
}

.blog-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 36px 0 0;
}

.blog-tags li {
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--primary-fade);
  color: var(--primary-deep);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.blog-back {
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}

.blog-back a {
  color: var(--primary-deep);
  text-decoration: none;
  font-size: 15px;
}

/* ── the article BODY ────────────────────────────────────────────────────────
 *
 * Everything below is ELEMENT-SCOPED under `.blog-body`, with no class selectors, because the
 * HTML policy (`backend/blog/html_policy.py`) allows no `class` attribute on anything a writer
 * submits. That is not a limitation to work around — it is what keeps this stylesheet a closed
 * contract with a known set of tags rather than an open one with whatever a writer typed. If a
 * class vocabulary is ever added there, its rules go here, named, one at a time. */

.blog-body {
  font-size: 18px;
  line-height: 1.72;
  color: var(--ink-soft);
}

.blog-body p {
  margin: 0 0 22px;
}

.blog-body h2 {
  margin: 46px 0 14px;
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.blog-body h3 {
  margin: 34px 0 10px;
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.blog-body h4 {
  margin: 26px 0 8px;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.blog-body ul,
.blog-body ol {
  margin: 0 0 22px;
  padding-left: 26px;
}

.blog-body li {
  margin-bottom: 8px;
}

.blog-body a {
  color: var(--primary-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.blog-body a:hover {
  color: var(--primary);
}

.blog-body strong {
  color: var(--ink);
  font-weight: 650;
}

.blog-body blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--primary);
  color: var(--ink);
  font-size: 19px;
}

.blog-body blockquote p:last-child {
  margin-bottom: 0;
}

.blog-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--canvas-sunken);
  border-radius: 5px;
  padding: 2px 6px;
}

.blog-body pre {
  margin: 0 0 24px;
  padding: 18px 20px;
  background: var(--canvas-sunken);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  /* Wide code scrolls INSIDE its own box; the page body must never scroll sideways. */
  overflow-x: auto;
}

.blog-body pre code {
  background: none;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}

.blog-body hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 40px 0;
}

.blog-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 26px;
  font-size: 15px;
  /* A comparison table is the highest-leverage element on the page for an AI answer engine, so
   * it must survive a narrow viewport intact rather than being squeezed into ambiguity. */
  display: block;
  overflow-x: auto;
}

.blog-body caption {
  caption-side: bottom;
  padding-top: 10px;
  color: var(--ink-mute);
  font-size: 13px;
  text-align: left;
}

.blog-body th,
.blog-body td {
  border: 1px solid var(--hairline);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.blog-body th {
  background: var(--canvas-soft);
  color: var(--ink);
  font-weight: 600;
}

.blog-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.blog-body figure {
  margin: 32px 0;
}

.blog-body figcaption {
  margin-top: 10px;
  color: var(--ink-mute);
  font-size: 14px;
}

.blog-body video {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.blog-body iframe {
  /* The policy allows `width`/`height` attributes, and a fixed pixel width would overflow a
   * phone. `aspect-ratio` + `width: 100%` overrides them with a responsive box that keeps the
   * player's proportions. */
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: var(--radius-md);
  margin: 0 0 26px;
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .blog-index > h1,
  .blog-post h1 {
    font-size: 30px;
  }

  .blog-body {
    font-size: 17px;
  }

  .blog-card {
    flex-direction: column;
  }

  .blog-card-thumb {
    width: 100%;
    height: 176px;
  }
}
