/* =============================================================================
   CodeCobra — Ghost theme
   Tokens + layout + components in one file. Fonts loaded via Google Fonts in
   default.hbs so this file stays self-contained and cacheable.
   ========================================================================== */

/* ── Tokens ───────────────────────────────────────────────────────────────── */
:root {
  --accent:         #1A6B4E;
  --accent-mid:     #2D9B6E;
  --accent-light:   #E8F5EE;
  --accent-subtle:  rgba(26, 107, 78, 0.06);
  --on-accent:      #FFFFFF;
  --gradient:       linear-gradient(135deg, #1A6B4E, #0EA5E9);
  --gradient-soft:  linear-gradient(135deg, rgba(26,107,78,0.9), rgba(14,165,233,0.9));

  --bg:             #FAFAF8;
  --bg-2:           #F3F2EE;
  --surface:        #F7F6F3;
  --card:           #FFFFFF;

  --text:           #1A1A1A;
  --text-2:         #4A4A4A;
  --text-3:         #8A8A82;
  --text-4:         #96968E;

  --border:         #E5E4E0;
  --border-2:       #D8D7D2;

  --serif:          'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans:           'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:           'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;

  --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 4px rgba(0, 0, 0, 0.03);
  --shadow-md:      0 2px 8px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
  --shadow-lg:      0 4px 16px rgba(0, 0, 0, 0.05), 0 12px 40px rgba(0, 0, 0, 0.04);
  --shadow-hero:    0 20px 60px rgba(26, 107, 78, 0.18);

  --r:              12px;
  --r-lg:           18px;
  --r-xl:           24px;

  /* Default tag color (overridden by .tag-ctx--<slug> below). */
  --tag-bg:         #F1F5F9;
  --tag-fg:         #334155;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
/* Class names mirror frontend/app/landing.css so the blog and the homepage
   render the same chrome — deliberate duplication so the marketing site
   can change without breaking the blog, and vice versa. */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.nav-in {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 32px);
  height: clamp(56px, 7.5vw, 64px);
  gap: 24px;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.3px;
}
.nav-brand .cobra-logo { color: var(--accent); width: 32px; height: 32px; flex-shrink: 0; }

.nav-links {
  display: flex; align-items: center; gap: 2rem;
}
.nav-links a {
  color: var(--text-3); font-size: 0.875rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.is-current { color: var(--text); }

.nav-r { display: flex; align-items: center; gap: 8px; }

.btn-ghost {
  padding: 7px 16px; border-radius: 8px;
  font-family: var(--sans); font-size: 0.85rem; font-weight: 500;
  color: var(--text-2); background: transparent;
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--border-2); color: var(--text); background: var(--card); }

.btn-primary {
  padding: 7px 20px; border-radius: 8px;
  font-family: var(--sans); font-size: 0.85rem; font-weight: 600;
  color: var(--on-accent); background: var(--gradient);
  border: none; cursor: pointer;
  transition: filter 0.25s, transform 0.25s, box-shadow 0.25s;
}
.btn-primary:hover {
  filter: brightness(1.1); transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Legacy in-content button classes kept for cards / article CTAs.
   .btn--ghost / .btn--accent aren't used in the nav anymore but they
   show up in list / article templates for "Read the essay" and share. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: 8px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s, border-color 0.15s;
}
.btn--ghost {
  border-color: var(--border); color: var(--text-2); background: transparent;
  font-weight: 500;
}
.btn--ghost:hover { background: var(--card); color: var(--text); }
.btn--accent {
  background: var(--gradient); color: var(--on-accent); border: 0;
}
.btn--accent:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--outline {
  border-color: var(--border); color: var(--text-2); background: transparent;
  padding: 8px 14px; font-weight: 500; font-size: 12.5px;
}
.btn--outline:hover { border-color: var(--border-2); color: var(--text); }
.btn--read {
  margin-top: 22px; padding: 12px 22px; border-radius: 10px;
  background: var(--text); color: var(--bg);
  font-size: 13.5px;
}
.btn--read:hover { background: #000; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border); color: var(--text-2);
  transition: border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--border-2); color: var(--text); }

/* ── List: hero ───────────────────────────────────────────────────────────── */
.list-hero { padding: 56px 0 32px; }
.list-hero__inner { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.list-hero__eyebrow {
  font-family: var(--mono); font-size: 11px; color: var(--accent);
  letter-spacing: 3px; text-transform: uppercase; font-weight: 700;
  margin-bottom: 12px;
}
.list-hero__title {
  font-family: var(--serif); font-size: 68px; font-weight: 700;
  line-height: 1.02; letter-spacing: -2.2px; margin: 0;
  color: var(--text);
}
.list-hero__title em {
  font-style: italic;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.list-hero__title--sm { font-size: 40px; letter-spacing: -1.2px; }
.list-hero__dek {
  font-size: 17px; line-height: 1.6; color: var(--text-3);
  max-width: 620px; margin: 20px 0 0;
}
.list-hero__tags {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 28px; padding-top: 28px;
  border-top: 1px solid var(--border);
}
.list-hero__meta {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-top: 24px; font-size: 13px; color: var(--text-3);
}
.list-hero__count { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.5px; }
.list-hero__author { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.list-hero__avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 100px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  color: var(--text-2); background: transparent;
  border: 1px solid var(--border);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.is-active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.chip__count {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  opacity: 0.5; margin-left: 2px;
}
.chip.is-active .chip__count { opacity: 0.7; }

/* ── List: featured ───────────────────────────────────────────────────────── */
.list-featured { padding: 0 40px 56px; }
.post-featured {
  display: grid; grid-template-columns: 1.2fr 1fr;
  gap: 44px; align-items: center;
}
.post-featured__media {
  order: -1;
  position: relative; aspect-ratio: 5 / 4;
  background: var(--gradient);
  border-radius: var(--r-xl); overflow: hidden;
  box-shadow: var(--shadow-hero);
  display: block;
}
.post-featured__media img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.post-featured__glyph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-style: italic; font-weight: 700;
  font-size: clamp(140px, 22vw, 260px); letter-spacing: -8px;
  color: rgba(255, 255, 255, 0.14);
  overflow: hidden; padding: 0 20px;
  text-align: center; white-space: nowrap;
}
.post-featured__overlay {
  position: absolute; bottom: 20px; left: 24px; right: 24px;
  display: flex; align-items: center; gap: 10px; color: #fff;
}
.post-featured__chip {
  padding: 5px 12px; border-radius: 100px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase;
}
.post-featured__time { font-size: 12px; opacity: 0.85; font-family: var(--mono); }
.post-featured__title {
  font-family: var(--serif); font-size: 40px; font-weight: 700;
  line-height: 1.1; letter-spacing: -1.2px;
  margin: 18px 0 14px; color: var(--text);
}
.post-featured__title a:hover { color: var(--accent); }
.post-featured__dek {
  font-size: 16px; line-height: 1.65; color: var(--text-2);
  margin: 0 0 22px;
}

/* ── List: secondary pair ─────────────────────────────────────────────────── */
.list-secondary { padding: 0 40px 48px; display: grid; gap: 28px; grid-template-columns: 1fr 1fr; max-width: 1200px; margin: 0 auto; }

.post-card--secondary {
  display: grid; grid-template-columns: 170px 1fr;
  background: var(--card); border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.post-card--secondary .post-card__media {
  position: relative;
  background: var(--tag-bg);
  display: block;
}
.post-card--secondary .post-card__media img {
  width: 100%; height: 100%; object-fit: cover;
}
.post-card--secondary .post-card__body {
  padding: 20px 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.post-card--secondary .post-card__title {
  font-family: var(--serif); font-size: 20px; font-weight: 700;
  line-height: 1.2; letter-spacing: -0.4px;
  margin: 0; color: var(--text);
}
.post-card--secondary .post-card__dek {
  font-size: 13.5px; line-height: 1.55; color: var(--text-3);
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card--secondary .post-card__foot { margin-top: auto; padding-top: 8px; }

/* ── List: divider ────────────────────────────────────────────────────────── */
.list-divider {
  padding: 0 40px 36px;
  display: flex; align-items: center; gap: 20px;
  border-top: 1px solid var(--border); padding-top: 32px;
  margin-top: 0;
}
.list-divider__label {
  font-family: var(--serif); font-size: 28px; font-weight: 700;
  letter-spacing: -0.6px; margin: 0; color: var(--text);
}
.list-divider__rule { flex: 1; }

/* ── List: grid of 6 ──────────────────────────────────────────────────────── */
.list-grid {
  padding: 0 40px 56px;
  display: grid; gap: 28px;
  grid-template-columns: repeat(3, 1fr);
}
.list-grid--wide { padding-top: 48px; }

.post-card--grid {
  background: var(--card); border-radius: var(--r-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex; flex-direction: column;
}
.post-card--grid:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
}
.post-card--grid .post-card__media {
  aspect-ratio: 16 / 10;
  background: var(--tag-bg);
  position: relative;
  border-bottom: 1px solid var(--border);
  display: block;
}
.post-card--grid .post-card__media img {
  width: 100%; height: 100%; object-fit: cover;
}
.post-card__chip {
  position: absolute; top: 14px; left: 14px;
}
.post-card--grid .post-card__body {
  padding: 18px 20px 20px;
  display: flex; flex-direction: column; gap: 10px;
  flex: 1;
}
.post-card--grid .post-card__title {
  font-family: var(--serif); font-size: 18px; font-weight: 700;
  line-height: 1.25; letter-spacing: -0.3px;
  margin: 0; color: var(--text);
}
.post-card--grid .post-card__title a:hover { color: var(--accent); }
.post-card--grid .post-card__dek {
  font-size: 13px; line-height: 1.55; color: var(--text-3);
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3);
}
.post-card__author {
  display: flex; align-items: center; gap: 6px;
  font-weight: 600; color: var(--text-2);
}
.post-card__read {
  display: inline-flex; align-items: center; gap: 4px;
}

/* ── Placeholder art ──────────────────────────────────────────────────────── */
.placeholder-art {
  position: absolute; inset: 0;
  background: var(--tag-bg);
}
.placeholder-art__line {
  stroke: var(--tag-fg);
  stroke-width: 0.5;
  opacity: 0.15;
}

/* ── Byline ───────────────────────────────────────────────────────────────── */
.byline {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 12px; color: var(--text-3);
}
.byline--lg { font-size: 13.5px; }
.byline__avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.byline__avatar img { width: 100%; height: 100%; object-fit: cover; }
.byline--lg .byline__avatar { width: 32px; height: 32px; }
.byline__avatar--xs { width: 20px; height: 20px; }
.byline__name { color: var(--text-2); font-weight: 600; }
.byline__name:hover { color: var(--text); }
.byline__sep { color: var(--border-2); }

/* ── List: archive (plain row list) ───────────────────────────────────────── */
.list-archive {
  padding: 0 40px 80px;
}
.list-archive__label {
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  letter-spacing: -0.4px; margin: 0 0 20px; color: var(--text);
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.post-row {
  display: grid; grid-template-columns: 140px 1fr auto;
  gap: 28px; align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.post-row:last-child { border-bottom: 0; }
.post-row__date {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-3); letter-spacing: 0.5px;
}
.post-row__meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.post-row__read { font-size: 11px; color: var(--text-3); }
.post-row__title {
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  letter-spacing: -0.3px; line-height: 1.3;
  margin: 0; color: var(--text);
}
.post-row__title a:hover { color: var(--accent); }
.post-row__arrow {
  color: var(--text-3); padding: 8px;
  transition: color 0.15s, transform 0.15s;
}
.post-row__arrow:hover { color: var(--accent); transform: translateX(2px); }

/* ── Newsletter ───────────────────────────────────────────────────────────── */
.newsletter {
  background: var(--accent);
  border-radius: var(--r-xl);
  padding: 48px 56px;
  display: grid; gap: 40px;
  grid-template-columns: 1.3fr 1fr;
  align-items: center;
  color: #fff;
  position: relative; overflow: hidden;
}
.newsletter__glow {
  position: absolute; top: -120px; right: -80px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
  pointer-events: none;
}
.newsletter__copy { position: relative; }
.newsletter__eyebrow {
  font-family: var(--mono); font-size: 11px; opacity: 0.7;
  letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 10px;
}
.newsletter__headline {
  font-family: var(--serif); font-size: 34px; font-weight: 700;
  margin: 0; line-height: 1.15; letter-spacing: -0.5px;
}
.newsletter__dek {
  font-family: var(--sans); font-size: 14px; margin: 10px 0 0;
  opacity: 0.82; line-height: 1.55; max-width: 440px;
}
.newsletter__form {
  display: flex; gap: 8px; position: relative;
  flex-wrap: wrap;
}
.newsletter__form input[type="email"] {
  flex: 1; min-width: 200px;
  padding: 13px 16px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1); color: #fff;
  font-family: var(--sans); font-size: 14px; outline: none;
}
.newsletter__form input[type="email"]::placeholder { color: rgba(255, 255, 255, 0.6); }
.newsletter__form input[type="email"]:focus {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
}
.newsletter__submit {
  padding: 13px 22px; border-radius: 10px;
  background: #fff; color: var(--accent);
  font-weight: 700; font-family: var(--sans); font-size: 13.5px;
  white-space: nowrap;
  transition: transform 0.15s;
}
.newsletter__submit:hover { transform: translateY(-1px); }
.newsletter__status {
  flex-basis: 100%; font-size: 13px; padding: 6px 2px 0;
  color: rgba(255, 255, 255, 0.9);
}
.newsletter__status--error { color: #FFD9D9; }

/* ── Reading progress bar ─────────────────────────────────────────────────── */
.reading-progress {
  position: sticky; top: 62px;
  height: 3px; background: var(--border);
  z-index: 15;
}
.reading-progress__fill {
  width: 0%; height: 100%;
  background: var(--gradient);
  transition: width 0.08s linear;
}

/* ── Post hero ────────────────────────────────────────────────────────────── */
.post-hero {
  max-width: 760px !important; margin: 0 auto;
  padding: 64px 40px 0;
}
.post-hero__back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-3);
  margin-bottom: 22px;
}
.post-hero__back:hover { color: var(--text); }
.post-hero__eyebrow {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.post-hero__kind {
  font-family: var(--mono); font-size: 11px; color: var(--text-3);
  letter-spacing: 0.5px;
}
.post-hero__title {
  font-family: var(--serif); font-size: 56px; font-weight: 700;
  line-height: 1.05; letter-spacing: -1.8px;
  margin: 0 0 20px; color: var(--text);
}
.post-hero__dek {
  font-family: var(--serif); font-size: 22px; line-height: 1.5;
  color: var(--text-3); margin: 0 0 32px;
  font-style: italic; letter-spacing: -0.3px;
}
.post-hero__meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 0; gap: 20px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.post-hero__author { display: flex; align-items: center; gap: 14px; }
.post-hero__avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); overflow: hidden; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.post-hero__avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-hero__name { font-size: 14px; font-weight: 700; color: var(--text); }
.post-hero__role { font-size: 12px; color: var(--text-3); }
.post-hero__actions { display: flex; gap: 6px; }
.post-hero--page .post-hero__title { font-size: 44px; }

/* ── Post cover ───────────────────────────────────────────────────────────── */
.post-cover {
  max-width: 1040px !important; margin: 36px auto 0;
  padding: 0 40px;
}
.post-cover img {
  width: 100%; aspect-ratio: 21 / 9; object-fit: cover;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-hero);
}
.post-cover--fallback {
  position: relative;
}
.post-cover__glyph {
  aspect-ratio: 21 / 9;
  background: var(--gradient);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-hero);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-style: italic; font-weight: 700;
  font-size: clamp(120px, 18vw, 220px); letter-spacing: -8px;
  color: rgba(255, 255, 255, 0.16);
  overflow: hidden; padding: 0 20px;
  white-space: nowrap;
}
.post-cover figcaption {
  font-size: 13px; color: var(--text-3);
  padding: 10px 4px 0;
  font-family: var(--sans);
}

/* ── Post body: TOC + reader column ───────────────────────────────────────── */
.post-body {
  max-width: 1180px !important; margin: 0 auto;
  padding: 56px 40px 80px;
  display: grid; grid-template-columns: 220px 1fr;
  gap: 64px;
}
.post-body--no-toc { grid-template-columns: 1fr; }
.post-body--no-toc .post-article { max-width: 760px; margin: 0 auto; }

.post-toc {
  position: sticky; top: 100px;
  align-self: start;
}
.post-toc:empty { display: none; }
.post-toc__eyebrow {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-3);
  letter-spacing: 1.8px; text-transform: uppercase; font-weight: 700;
  margin-bottom: 16px;
}
.post-toc__nav {
  display: flex; flex-direction: column; gap: 2px;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}
.post-toc__nav:empty { display: none; }
.post-toc__nav a {
  display: block; padding: 5px 0;
  font-family: var(--sans); font-size: 13.5px; font-weight: 500;
  color: var(--text-3); line-height: 1.4;
  transition: color 0.15s;
}
.post-toc__nav a[data-depth="1"] { font-size: 12.5px; padding-left: 12px; }
.post-toc__nav a:hover { color: var(--text); }
.post-toc__nav a.is-active {
  color: var(--accent); font-weight: 600;
  border-left: 2px solid var(--accent);
  margin-left: -16px; padding-left: 14px;
}
.post-toc__nav a.is-active[data-depth="1"] { padding-left: 26px; }

/* ── Post article content ─────────────────────────────────────────────────── */
.post-article { max-width: 720px; }
.post-article__content {
  font-family: var(--serif); font-size: 19px; line-height: 1.7;
  color: var(--text-2); letter-spacing: -0.1px;
}
.post-article__content > * + * { margin-top: 22px; }
.post-article__content p { margin: 0; }
.post-article__content a {
  color: var(--accent); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.post-article__content a:hover { color: var(--accent-mid); }

.post-article__content h2 {
  font-family: var(--serif); font-size: 32px; font-weight: 700;
  letter-spacing: -0.8px; line-height: 1.2;
  margin: 40px 0 18px; color: var(--text);
  scroll-margin-top: 80px;
}
.post-article__content h3 {
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  letter-spacing: -0.4px; line-height: 1.3;
  margin: 32px 0 14px; color: var(--text);
  scroll-margin-top: 80px;
}
.post-article__content h2 + h3 { margin-top: 18px; }
.post-article__content strong { color: var(--text); font-weight: 700; }
.post-article__content em { font-style: italic; }
.post-article__content code {
  font-family: var(--mono); font-size: 0.88em;
  padding: 2px 6px; border-radius: 5px;
  background: var(--accent-subtle); color: var(--accent);
}

.post-article__content blockquote {
  margin: 36px -20px; padding: 4px 32px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif); font-size: 26px; font-weight: 500;
  font-style: italic; line-height: 1.35; letter-spacing: -0.5px;
  color: var(--text);
}
.post-article__content blockquote p { margin: 0; }

/* Code blocks with macOS chrome. Ghost emits <pre><code class="language-xml">. */
.post-article__content pre {
  margin: 28px 0;
  padding: 18px 20px 18px 20px;
  background: #1B1D23; color: #ABB2BF;
  border-radius: 10px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  overflow: auto;
  position: relative;
}
.post-article__content pre::before {
  content: '';
  display: block;
  height: 9px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 5px 4px,  #FF6259 4.5px, transparent 5px),
    radial-gradient(circle at 20px 4px, #FFBF2F 4.5px, transparent 5px),
    radial-gradient(circle at 35px 4px, #29CE42 4.5px, transparent 5px);
  background-repeat: no-repeat;
}
.post-article__content pre code {
  background: transparent; color: inherit;
  padding: 0; font-size: inherit; white-space: pre;
  display: block;
}

.post-article__content ul, .post-article__content ol {
  margin: 0 0 24px; padding: 0 0 0 0;
  list-style: none;
}
.post-article__content ul li {
  position: relative; padding-left: 24px; margin-bottom: 14px;
  font-family: var(--serif); font-size: 18px; line-height: 1.65;
  color: var(--text-2);
}
.post-article__content ul li::before {
  content: ''; position: absolute; left: 0; top: 12px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.post-article__content ol { counter-reset: ol-count; }
.post-article__content ol li {
  position: relative; padding-left: 32px; margin-bottom: 14px;
  font-family: var(--serif); font-size: 18px; line-height: 1.65;
  color: var(--text-2); counter-increment: ol-count;
}
.post-article__content ol li::before {
  content: counter(ol-count);
  position: absolute; left: 0; top: 1px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--accent);
  width: 20px; text-align: right; padding-right: 4px;
}

/* Ghost Koenig cards + wide/full image variants (required by gscan) */
.post-article__content .kg-card { margin: 28px 0; }
.post-article__content figure img { width: 100%; border-radius: var(--r); }
.post-article__content figcaption {
  text-align: center; font-size: 13px; font-family: var(--sans);
  color: var(--text-3); margin-top: 10px;
}
.post-article__content .kg-width-wide {
  position: relative;
  width: min(100vw, 1040px);
  margin-left: 50%; transform: translateX(-50%);
}
.post-article__content .kg-width-wide img { border-radius: var(--r-lg); }
.post-article__content .kg-width-full {
  position: relative;
  width: 100vw;
  margin-left: 50%; transform: translateX(-50%);
  max-width: none;
}
.post-article__content .kg-width-full img { border-radius: 0; }
/* Koenig bookmark cards */
.post-article__content .kg-bookmark-card {
  margin: 28px 0;
  border: 1px solid var(--border); border-radius: var(--r);
  overflow: hidden; background: var(--card);
}
.post-article__content .kg-bookmark-container {
  display: flex; text-decoration: none; color: inherit;
}
.post-article__content .kg-bookmark-content { padding: 20px; flex: 1; }
.post-article__content .kg-bookmark-title {
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.post-article__content .kg-bookmark-description {
  font-size: 13px; color: var(--text-3); line-height: 1.5;
}
.post-article__content .kg-bookmark-thumbnail img {
  width: 180px; height: 100%; object-fit: cover; border-radius: 0;
}
.post-article__content hr {
  border: 0; border-top: 1px solid var(--border); margin: 40px 0;
}
.post-article__content .kg-callout-card,
.post-article__content .kg-callout-card-accent {
  margin: 28px 0; padding: 18px 22px;
  background: var(--accent-light);
  border: 1px solid rgba(26, 107, 78, 0.15);
  border-radius: 12px;
  display: flex; gap: 14px; align-items: flex-start;
  font-family: var(--sans); font-size: 14.5px; line-height: 1.6;
  color: var(--text-2);
}
.post-article__content .kg-callout-emoji { font-size: 22px; line-height: 1; }

/* Article footer */
.post-article__foot {
  margin-top: 56px; padding: 28px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
}
.post-article__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.post-article__share { display: flex; gap: 6px; flex-wrap: wrap; }

/* Author card */
.author-card {
  margin-top: 28px; padding: 24px 28px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex; gap: 20px; align-items: flex-start;
}
.author-card__avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); overflow: hidden; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.author-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card__body { flex: 1; }
.author-card__name { font-size: 15px; font-weight: 700; color: var(--text); }
.author-card__name a:hover { color: var(--accent); }
.author-card__role { font-size: 12.5px; color: var(--accent); font-weight: 600; margin: 2px 0 8px; }
.author-card__meta { font-size: 14px; line-height: 1.6; color: var(--text-3); margin: 0; }
.author-card__meta a:hover { color: var(--accent); }

/* ── Related ──────────────────────────────────────────────────────────────── */
.related { max-width: 1180px !important; margin: 0 auto; padding: 0 40px 48px; }
.related > div { border-top: 1px solid var(--border); padding-top: 40px; }
.related__title {
  font-family: var(--serif); font-size: 28px; font-weight: 700;
  letter-spacing: -0.6px; margin: 0 0 24px; color: var(--text);
}
.related__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}

/* ── Tag pills (slug-mapped colors) ───────────────────────────────────────── */
.tag-pill {
  display: inline-block;
  font-family: var(--sans); font-weight: 600; letter-spacing: 0.2px;
  background: var(--tag-bg); color: var(--tag-fg);
  border: 1px solid transparent;
  white-space: nowrap;
}
.tag-pill--sm { font-size: 10.5px; padding: 3px 9px; border-radius: 5px; }
.tag-pill--md { font-size: 11.5px; padding: 4px 11px; border-radius: 6px; }
.tag-pill--lg { font-size: 12.5px; padding: 5px 13px; border-radius: 7px; }

/* Slug-mapped color palette. Matches the editorial mock's TAG_COLORS.
   Define on the post context (tag-ctx--<slug>) so nested placeholders,
   chips, etc. inherit. Falls back to the neutral :root defaults. */
.tag-ctx--case-studies   { --tag-bg: #FFF4E6; --tag-fg: #B45309; }
.tag-ctx--tutorials      { --tag-bg: #E8F5EE; --tag-fg: #1A6B4E; }
.tag-ctx--odoo           { --tag-bg: #F3E8FF; --tag-fg: #6B21A8; }
.tag-ctx--ask-codecobra  { --tag-bg: #E8F0FE; --tag-fg: #1E40AF; }
.tag-ctx--ai-industry    { --tag-bg: #FEE2E2; --tag-fg: #991B1B; }
.tag-ctx--ai             { --tag-bg: #FEE2E2; --tag-fg: #991B1B; }
.tag-ctx--product        { --tag-bg: #ECFEFF; --tag-fg: #155E75; }
.tag-ctx--changelog      { --tag-bg: #F1F5F9; --tag-fg: #334155; }
.tag-ctx--vibe-coding    { --tag-bg: #FEF9C3; --tag-fg: #854D0E; }
.tag-ctx--open-source    { --tag-bg: #DCFCE7; --tag-fg: #166534; }
.tag-ctx--careers        { --tag-bg: #FFE4E6; --tag-fg: #9F1239; }
.tag-ctx--automation     { --tag-bg: #E0F2FE; --tag-fg: #075985; }
.tag-ctx--codecobra      { --tag-bg: #D1FAE5; --tag-fg: #065F46; }

/* Also apply directly to .tag-pill--<slug> so the chip picks up its own color
   when it's sitting outside a tag context (e.g. the post footer tag strip). */
.tag--case-studies   { background: #FFF4E6; color: #B45309; }
.tag--tutorials      { background: #E8F5EE; color: #1A6B4E; }
.tag--odoo           { background: #F3E8FF; color: #6B21A8; }
.tag--ask-codecobra  { background: #E8F0FE; color: #1E40AF; }
.tag--ai-industry    { background: #FEE2E2; color: #991B1B; }
.tag--ai             { background: #FEE2E2; color: #991B1B; }
.tag--product        { background: #ECFEFF; color: #155E75; }
.tag--changelog      { background: #F1F5F9; color: #334155; }
.tag--vibe-coding    { background: #FEF9C3; color: #854D0E; }
.tag--open-source    { background: #DCFCE7; color: #166534; }
.tag--careers        { background: #FFE4E6; color: #9F1239; }
.tag--automation     { background: #E0F2FE; color: #075985; }
.tag--codecobra      { background: #D1FAE5; color: #065F46; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
/* Class names mirror frontend/app/landing.css — same three-column shape,
   same token colors, same logo treatment as the homepage footer. */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  margin-top: 40px;
  background: var(--bg);
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
}
.footer-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 700;
  color: var(--text-3); font-size: 0.9rem;
}
.footer-brand .cobra-logo { color: var(--accent); width: 22px; height: 22px; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a {
  color: var(--text-4); font-size: 0.8rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-2); }
.footer-copy { font-size: 0.76rem; color: var(--text-4); }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
  max-width: 1200px; margin: 0 auto 56px;
  padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--sans); font-size: 13px;
  color: var(--text-3);
}
.pagination a {
  padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--text-2);
  font-weight: 600;
}
.pagination a:hover { border-color: var(--border-2); color: var(--text); }
.pagination .page-number { font-family: var(--mono); }

/* ── Error page ───────────────────────────────────────────────────────────── */
.error { padding: 80px 40px 120px; }
.error__inner { max-width: 640px; margin: 0 auto; text-align: center; }
.error__code {
  font-family: var(--mono); font-size: 14px; color: var(--accent);
  letter-spacing: 4px; text-transform: uppercase; font-weight: 700;
  margin-bottom: 14px;
}
.error__title {
  font-family: var(--serif); font-size: 48px; font-weight: 700;
  letter-spacing: -1.5px; line-height: 1.1; margin: 0 0 16px;
}
.error__dek {
  font-size: 17px; line-height: 1.6; color: var(--text-3);
  margin: 0 auto 28px; max-width: 480px;
}
.error__actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .list-hero { padding: 40px 0 24px; }
  .list-hero__title { font-size: 44px; letter-spacing: -1.4px; }
  .post-featured {
    grid-template-columns: 1fr; gap: 24px;
  }
  .post-featured__media { order: 0; }
  .post-featured__title { font-size: 30px; }
  .list-secondary { grid-template-columns: 1fr; }
  .post-card--secondary { grid-template-columns: 120px 1fr; }
  .list-grid { grid-template-columns: repeat(2, 1fr); }
  .related__grid { grid-template-columns: 1fr; }
  .post-hero__title { font-size: 40px; letter-spacing: -1.2px; }
  .post-hero__dek { font-size: 18px; }
  .post-body {
    grid-template-columns: 1fr; gap: 24px;
    padding: 32px 20px 60px;
  }
  .post-toc { position: static; }
  .newsletter {
    grid-template-columns: 1fr; padding: 32px 28px; gap: 20px;
  }
  .newsletter__headline { font-size: 26px; }
}

@media (max-width: 640px) {
  .container, .list-hero__inner, .footer-inner, .nav-in { padding-left: 20px; padding-right: 20px; }
  .list-hero__title { font-size: 36px; letter-spacing: -1.2px; }
  .post-hero { padding: 40px 20px 0; }
  .post-hero__title { font-size: 32px; letter-spacing: -1px; }
  .post-hero__dek { font-size: 17px; }
  .post-hero__meta { flex-direction: column; align-items: flex-start; gap: 14px; }
  .post-cover { padding: 0 20px; }
  .list-grid, .list-featured, .list-secondary, .list-archive { padding-left: 20px; padding-right: 20px; }
  .list-grid { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 1fr auto; }
  .post-row__date { grid-column: 1 / -1; }
  .post-article__content { font-size: 17px; }
  .post-article__content blockquote { margin: 28px 0; padding: 0 20px; font-size: 22px; }
  .post-article__content h2 { font-size: 26px; }
  .post-article__foot { flex-direction: column; align-items: stretch; }
}
