/* OPTIN blog. Builds on redesign.css tokens (paper ground, forest, sage). */

.nav-links a[aria-current="page"] { color: var(--ink); background: var(--line); }

/* ---------- Index ---------- */
.b-hero { padding-block: clamp(128px, 16vh, 168px) clamp(28px, 4vw, 44px); }
.b-hero h1 {
  margin-top: 20px;
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
  max-width: 16ch;
}
.b-lead { margin-top: 22px; max-width: 58ch; color: var(--muted); font-size: clamp(1.05rem, 1.3vw, 1.2rem); line-height: 1.6; }

.b-featured-wrap { padding-block: 0 clamp(56px, 7vw, 96px); }
.b-featured-link {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  border-radius: calc(var(--r) + 8px);
  overflow: hidden;
  background: var(--forest);
  color: var(--on-forest);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.b-featured-link:hover { transform: translateY(-4px); box-shadow: 0 40px 80px -40px rgba(15, 43, 33, 0.6); }
.b-featured-img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
.b-featured-body { padding: clamp(28px, 4vw, 52px); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.b-featured-body h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); max-width: 20ch; }
.b-featured .b-cat { color: var(--accent); }
.b-featured .b-excerpt, .b-featured .b-meta { color: var(--on-forest-muted); }
.b-read { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent); }
.b-read i { transition: transform 0.35s var(--ease); }
.b-featured-link:hover .b-read i { transform: translateX(4px); }

.b-list { padding-top: 0; }
.b-list-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.b-list-head h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.b-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.b-filter {
  padding: 9px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.b-filter:hover { border-color: var(--ink); color: var(--ink); }
.b-filter[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: var(--on-forest); }

.b-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.b-card[hidden] { display: none; }
.b-card-link {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.b-card-link:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.b-card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.b-card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.b-card-body h3 { font-size: 1.2rem; line-height: 1.25; }
.b-card-body .b-meta { margin-top: auto; padding-top: 8px; }
.b-cat { font-size: 0.8rem; font-weight: 600; color: var(--accent-text); letter-spacing: 0.02em; }
.b-excerpt { color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.b-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.84rem; color: var(--muted); }
.b-empty { padding: 32px; border-radius: var(--r); background: var(--surface); border: 1px dashed var(--line); color: var(--muted); }
.b-empty a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }

/* Cover placeholder when a post has no image */
.b-cover-blank {
  display: grid;
  place-items: end start;
  padding: 18px 20px;
  background:
    repeating-radial-gradient(circle at 100% 0%, transparent 0 26px, rgba(151, 199, 160, 0.22) 26px 28px),
    var(--forest-2);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}
.b-featured .b-cover-blank { background: repeating-radial-gradient(circle at 100% 0%, transparent 0 34px, rgba(151, 199, 160, 0.2) 34px 36px), var(--forest-2); }

/* CTA band */
.b-cta { background: var(--bg-2); padding-block: clamp(64px, 8vw, 104px); }
.b-cta-in { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.b-cta h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); max-width: 20ch; }
.b-cta p { margin-top: 14px; max-width: 56ch; color: var(--muted); }

/* ---------- Article ---------- */
.a-head { padding-block: clamp(128px, 16vh, 160px) clamp(28px, 4vw, 40px); }
.a-head-in { max-width: calc(860px + 2 * var(--gut)); }
.a-crumbs { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); }
.a-crumbs a { text-decoration: underline; text-underline-offset: 3px; }
.a-draft { margin-top: 16px; display: inline-block; padding: 6px 12px; border-radius: var(--pill); background: #f3e2b8; color: #6b4a07; font-size: 0.85rem; font-weight: 600; }
.a-head h1 { margin-top: 18px; font-size: clamp(2.3rem, 4.8vw, 3.9rem); letter-spacing: -0.04em; line-height: 1.02; max-width: 22ch; }
.a-dek { margin-top: 20px; font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: var(--muted); line-height: 1.5; max-width: 60ch; }
.a-byline { margin-top: 28px; display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; }
.a-byline img, .a-byline .mono-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.a-byline .mono-av { display: grid; place-items: center; background: var(--forest); color: var(--accent); font-family: var(--f-mono); font-size: 0.8rem; font-weight: 600; }
.a-byline strong { display: block; font-weight: 600; }
.a-byline div span { font-size: 0.9rem; color: var(--muted); }
.a-byline .b-meta { flex-basis: 100%; }
@media (min-width: 700px) { .a-byline .b-meta { flex-basis: auto; margin-left: auto; } }
.a-cover { width: 100%; max-height: 540px; object-fit: cover; border-radius: calc(var(--r) + 8px); }

.a-grid { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: clamp(32px, 6vw, 88px); justify-content: center; padding-block: clamp(40px, 5vw, 64px) clamp(64px, 8vw, 104px); }
.a-toc { position: sticky; top: 110px; align-self: start; display: flex; flex-direction: column; gap: 14px; }
.a-toc-h { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); }
.a-toc ol { display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line); }
.a-toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; font-size: 0.92rem; line-height: 1.4; color: var(--muted); transition: color 0.2s ease, border-color 0.2s ease; }
.a-toc li a:hover, .a-toc li a.is-active { color: var(--ink); border-left-color: var(--accent-deep); }
.a-toc .btn { align-self: flex-start; margin-top: 10px; }

.a-takeaways { margin-bottom: 36px; padding: 24px 26px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.a-takeaways ul { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.a-takeaways li { position: relative; padding-left: 26px; line-height: 1.55; }
.a-takeaways li::before { content: ""; position: absolute; left: 4px; top: 0.55em; width: 9px; height: 9px; border-radius: 2px; background: var(--accent-deep); transform: rotate(45deg); }

.prose { font-size: 1.08rem; line-height: 1.75; color: var(--ink); }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .a-faq h2 { max-width: none; }
.prose h2 { margin-top: 2.2em; font-size: clamp(1.5rem, 2.4vw, 1.9rem); scroll-margin-top: 110px; }
.prose h3 { margin-top: 1.8em; font-size: 1.25rem; scroll-margin-top: 110px; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose p, .prose li { color: color-mix(in srgb, var(--ink) 88%, transparent); }
.prose a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; display: flex; flex-direction: column; gap: 0.45em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--accent-text); }
.prose strong { font-weight: 650; }
.prose blockquote { padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); font-size: 1.15rem; color: var(--muted); }
.prose img { border-radius: var(--r); }
.prose code { font-family: var(--f-mono); font-size: 0.9em; padding: 2px 6px; border-radius: 6px; background: var(--bg-2); }
.prose pre { overflow-x: auto; padding: 18px 20px; border-radius: 14px; background: var(--forest); color: var(--on-forest); }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 600; }

.a-faq { margin-top: 56px; display: flex; flex-direction: column; gap: 12px; }
.a-faq h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-bottom: 8px; }

.a-author { margin-top: 56px; padding: 26px; border-radius: var(--r); background: var(--forest); color: var(--on-forest); display: flex; gap: 18px; align-items: flex-start; }
.a-author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.a-author .a-toc-h { color: var(--accent); }
.a-author strong { display: block; margin-top: 8px; font-size: 1.1rem; }
.a-author span { display: block; font-size: 0.92rem; color: var(--on-forest-muted); }
.a-author p:not(.a-toc-h) { margin-top: 10px; color: var(--on-forest-muted); font-size: 0.95rem; line-height: 1.6; }

.b-related { padding-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .b-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .a-grid { grid-template-columns: minmax(0, 1fr); }
  .a-toc { position: static; }
  .a-toc ol { display: none; }
  .a-toc .a-toc-h, .a-toc .btn { display: none; }
}
@media (max-width: 760px) {
  .b-featured-link { grid-template-columns: minmax(0, 1fr); }
  .b-featured-img { min-height: 200px; aspect-ratio: 16 / 9; }
  .b-grid { grid-template-columns: minmax(0, 1fr); }
  .a-author { flex-direction: column; }
}

/* Multiple authors: overlapping avatars */
.a-avatars { display: flex; }
.a-avatars > * + * { margin-left: -10px; }
.a-avatars img, .a-avatars .mono-av { border: 2px solid var(--bg); box-sizing: content-box; }
.a-author + .a-author { margin-top: 12px; }
.a-author .mono-av { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--forest-2); color: var(--accent); font-family: var(--f-mono); }
