/* Insights: article typography and the /insights/ index. Loaded after /styles.css (tokens, nav, footer, cards). */

.ins-page { padding-bottom: 24px; }
.ins-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 22px; }
.ins-crumbs a { color: var(--muted); text-decoration: none; }
.ins-crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Article header ---------- */
.ins-head { padding: 56px 0 28px; border-bottom: 1px solid var(--line); }
.ins-head h1, .ins-hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.06; letter-spacing: -0.03em; max-width: 22ch; }
.ins-lede { color: var(--muted); font-size: clamp(1.08rem, 1.6vw, 1.25rem); line-height: 1.5; max-width: 62ch; margin: 18px 0 0; }
.ins-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 22px 0 0; color: var(--muted); font-size: 14px; }
.ins-meta b { color: var(--ink); font-weight: 600; }
.ins-meta span + span::before { content: "·"; margin-right: 18px; color: var(--muted-2); }
@media (max-width: 560px) { .ins-meta span + span::before { margin-right: 8px; } .ins-meta { gap: 6px 8px; } }

/* ---------- Layout: body plus a sticky table of contents on wide screens ---------- */
.ins-layout { display: grid; gap: 40px; padding-top: 40px; padding-bottom: 32px; }
.ins-body { min-width: 0; max-width: 68ch; }
.ins-toc { display: none; }
@media (min-width: 1080px) {
  .ins-layout { grid-template-columns: 240px minmax(0, 68ch); gap: 64px; justify-content: start; }
  .ins-toc { display: block; position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; font-size: 14px; }
  .ins-toc-m { display: none; }
}
.ins-toc__h { font-size: 13px; font-weight: 600; color: var(--ink); margin: 4px 0 12px; }
.ins-toc ol, .ins-toc-m ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.ins-toc li, .ins-toc-m li { counter-increment: toc; }
.ins-toc a, .ins-toc-m a { display: block; padding: 7px 0 7px 14px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; line-height: 1.35; }
.ins-toc a:hover, .ins-toc-m a:hover { color: var(--ink); border-left-color: var(--ink); }
.ins-toc a.is-active { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }
.ins-toc-m { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 18px; margin: 0 0 32px; }
.ins-toc-m summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.ins-toc-m summary::-webkit-details-marker { display: none; }
.ins-toc-m summary::after { content: "+"; color: var(--accent); font-size: 20px; font-weight: 400; transition: transform .2s; }
.ins-toc-m[open] summary::after { transform: rotate(45deg); }
.ins-toc-m ol { padding-bottom: 14px; }

/* ---------- Prose ---------- */
.ins-prose { font-size: 1.075rem; line-height: 1.72; color: var(--text); overflow-wrap: anywhere; }
.ins-prose > * { margin: 0 0 1.15em; }
.ins-prose h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); line-height: 1.18; letter-spacing: -0.02em; margin: 2.1em 0 .6em; scroll-margin-top: 88px; }
.ins-prose h3 { font-size: 1.22rem; line-height: 1.3; letter-spacing: -0.01em; margin: 1.7em 0 .5em; scroll-margin-top: 88px; }
.ins-prose h4 { font-size: 1.05rem; margin: 1.4em 0 .4em; color: var(--ink); }
.ins-prose > h2:first-child, .ins-prose > h3:first-child { margin-top: 0; }
.ins-prose a:not(.btn) { color: var(--ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.ins-prose a:not(.btn):hover { text-decoration-color: var(--accent); }
.ins-prose strong { color: var(--ink); font-weight: 600; }
.ins-prose ul, .ins-prose ol { padding-left: 1.4em; }
.ins-prose li { margin: .35em 0; padding-left: .2em; }
.ins-prose li > ul, .ins-prose li > ol { margin: .35em 0; }
.ins-prose li::marker { color: var(--accent); font-weight: 600; }
.ins-prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--line-2); color: var(--muted); }
.ins-prose blockquote > :last-child { margin-bottom: 0; }
.ins-prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: .1em .38em; }
.ins-prose pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow-x: auto; font-size: .9rem; line-height: 1.55; }
.ins-prose pre code { background: none; border: 0; padding: 0; }
.ins-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.ins-prose img { max-width: 100%; height: auto; border-radius: 12px; }

/* Tables scroll sideways on phones instead of breaking the page. */
.ins-table { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 1.6em 0; }
.ins-table:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ins-table table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.45; min-width: 520px; }
.ins-table th, .ins-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ins-table th { color: var(--ink); font-weight: 600; background: var(--bg-2); white-space: nowrap; }
.ins-table tr:last-child td { border-bottom: 0; }

/* "Try it" callout */
.ins-try { display: grid; gap: 14px; margin: 2em 0; padding: 20px 22px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); }
.ins-try__body p { margin: 0; color: var(--text); }
.ins-try__body p + p { margin-top: .6em; }
.ins-try__body strong:first-child { color: var(--accent); }
.ins-try__btn { justify-self: start; }
@media (min-width: 720px) { .ins-try { grid-template-columns: 1fr auto; align-items: center; gap: 20px; } }

/* ---------- FAQ ---------- */
.ins-faq { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 40px; }
.ins-faq h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); margin-bottom: 16px; scroll-margin-top: 88px; }
.ins-faq__item { border-bottom: 1px solid var(--line); }
.ins-faq__item summary { list-style: none; cursor: pointer; padding: 18px 44px 18px 0; position: relative; font-weight: 600; font-size: 1.05rem; color: var(--ink); line-height: 1.4; }
.ins-faq__item summary::-webkit-details-marker { display: none; }
.ins-faq__item summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 400; color: var(--accent); transition: transform .25s; }
.ins-faq__item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.ins-faq__item p { margin: 0 0 18px; color: var(--muted); line-height: 1.65; max-width: 62ch; }

/* ---------- End CTA ---------- */
.ins-cta { padding: 40px 0; }
.ins-cta__card { display: grid; gap: 24px; padding: clamp(24px, 4vw, 44px); border-radius: var(--radius-lg); background: var(--ink); color: var(--bg); }
.ins-cta__card .kicker { color: color-mix(in srgb, var(--bg) 70%, transparent); margin-bottom: 12px; }
.ins-cta__card h2 { color: var(--bg); font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.ins-cta__card p { color: color-mix(in srgb, var(--bg) 78%, transparent); max-width: 58ch; margin: 14px 0 0; line-height: 1.55; }
.ins-cta__trust { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 18px 0 0; font-size: 14px; color: color-mix(in srgb, var(--bg) 70%, transparent); }
.ins-cta__trust li::before { content: "✓"; margin-right: 6px; color: var(--accent); }
:root[data-theme="dark"] .ins-cta__trust li::before { color: #1F6B45; }
.ins-cta__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ins-cta__actions .btn--ink { background: var(--bg); color: var(--ink); }
.ins-cta__actions .btn--ghost { color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.ins-cta__actions .btn--ghost:hover { border-color: var(--bg); }
@media (min-width: 900px) { .ins-cta__card { grid-template-columns: 1fr auto; align-items: end; } .ins-cta__actions { flex-direction: column; align-items: stretch; } }
@media (max-width: 560px) { .ins-cta__actions .btn { flex: 1 1 100%; } }

/* ---------- Related ---------- */
.ins-related { padding: 32px 0 56px; }
.ins-related h2 { font-size: clamp(1.5rem, 2.6vw, 1.95rem); margin-bottom: 20px; }
.ins-related__all { margin: 20px 0 0; }
.ins-related__all a { color: var(--ink); font-weight: 500; }

/* ---------- Index ---------- */
.ins-hero { padding: 56px 0 8px; }
.ins-index { padding: 28px 0 40px; }
.ins-tools { display: grid; gap: 14px; margin-bottom: 24px; }
@media (min-width: 900px) { .ins-tools { grid-template-columns: minmax(260px, 340px) 1fr; align-items: center; } }
.ins-search { position: relative; display: block; }
.ins-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ins-search input { width: 100%; height: 46px; padding: 0 14px 0 42px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 400 15px/1 var(--font); }
.ins-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.ins-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ins-chip { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font: 500 14px/1 var(--font); cursor: pointer; }
.ins-chip b { font-weight: 600; color: var(--muted-2); font-size: 12.5px; }
.ins-chip:hover { color: var(--ink); border-color: var(--ink); }
.ins-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.ins-chip[aria-pressed="true"] b { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.ins-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 680px) { .ins-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .ins-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ins-list .ins-card__title { font-size: 1.2rem; }
.ins-empty { color: var(--muted); padding: 24px 0; }
.ins-more { margin: 24px 0 0; text-align: center; }

/* Preview banner (routine drafts opened from the email link) */
.ins-banner { background: #fff4d6; color: #5a4300; border-bottom: 1px solid #f0d78a; font-size: 14px; }
.ins-banner .wrap { padding-top: 10px; padding-bottom: 10px; }
:root[data-theme="dark"] .ins-banner { background: #2a2310; color: #f3dc94; border-color: #4a3d14; }
.ins-chip[hidden] { display: none; }

/* Author box, soft seminar invite, copy buttons */
.ins-author { display: flex; gap: 16px; align-items: center; margin-top: 36px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ins-author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; }
.ins-author p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.ins-author .ins-author__name { color: var(--ink); font-weight: 600; font-size: 15.5px; margin-bottom: 2px; }
.ins-soft { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin-top: 14px; padding: 16px 18px; border-radius: 16px; background: color-mix(in srgb, var(--brand-green) 8%, transparent); border: 1px solid color-mix(in srgb, var(--brand-green) 22%, transparent); }
.ins-soft p { margin: 0; color: var(--ink); font-size: 15px; flex: 1 1 280px; }
.ins-prose pre { position: relative; }
.ins-copy { position: absolute; top: 8px; right: 8px; appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 12.5px/1 var(--font); padding: 8px 10px; border-radius: 8px; cursor: pointer; min-height: 32px; }
.ins-copy:hover { border-color: var(--brand-green); }

/* Newsletter signup and lead magnet (rendered by insights-render.mjs, posts to /api/newsletter) */
.ins-sub { margin-top: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ins-sub h2 { font-size: 1.12rem; line-height: 1.35; margin: 0 0 12px; color: var(--ink); }
.ins-sub p { margin: 0; }
.ins-sub > p:not(.kicker):not(.ins-sub__done) { color: var(--muted); font-size: 15px; line-height: 1.5; margin: 0 0 14px; }
.ins-sub--magnet { margin: 36px 0 0; padding: 24px; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.ins-sub--magnet h2 { font-size: clamp(1.25rem, 2.2vw, 1.5rem); margin-bottom: 8px; }
.ins-sub--magnet .kicker { margin: 0 0 8px; }
.ins-sub__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ins-sub__row { display: flex; flex-wrap: wrap; gap: 10px; }
.ins-sub__row input { flex: 1 1 220px; min-width: 0; height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); font: 400 16px/1 var(--font); }
.ins-sub__row input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ins-sub__row .btn { flex: 0 0 auto; min-height: 46px; }
@media (max-width: 480px) { .ins-sub__row .btn { flex: 1 1 100%; } }
.ins-sub__msg { min-height: 0; margin-top: 8px !important; font-size: 14px; color: var(--muted); }
.ins-sub__msg:empty { display: none; }
.ins-sub__done { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; color: var(--ink); font-size: 15px; }
.ins-sub__done[hidden], .ins-sub__form[hidden] { display: none; }
/* Newsletter thanks: free student account offer (stage 2b) */
.ins-sub__join { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ins-sub__join > p:first-child { flex: 1 1 260px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.ins-sub__join b { color: var(--ink); }
.ins-sub__join .btn { min-height: 44px; }
.ins-sub__join .ins-sub__msg { flex: 1 1 100%; margin-top: 0 !important; }
/* FAQ as a plain Q and A list (2026-10-19): bold Q, then the bold A under it, everything visible. */
.ins-faq__item { padding: 18px 0; }
.ins-faq__item .ins-faq__q { margin: 0 0 8px; color: var(--ink); font-weight: 600; font-size: 1.05rem; line-height: 1.45; }
.ins-faq__item .ins-faq__a { margin: 0; }
.ins-faq__q b, .ins-faq__a b { color: var(--accent); font-weight: 700; margin-right: 4px; }
