/* ==========================================================================
   Recommended by Agents — Insights (blog index + posts)
   Loaded after styles.css. Uses the tokens defined there; adds none of its own
   colors. Sections: 1 shared, 2 post hero, 3 post layout, 4 article type,
   5 components (tldr, takeaways, table, code, faq), 6 cards, 7 index, 8 motion.
   ========================================================================== */

/* ---------- 1. Shared ---------- */

.crumbs { margin-bottom: 28px; font-size: 14px; color: var(--lavender); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.crumbs li { display: inline-flex; align-items: center; gap: 10px; }
.crumbs li + li::before { content: "/"; color: var(--muted); }
.crumbs a { padding-block: 4px; text-decoration: none; color: var(--lavender); transition: color .2s var(--ease); }
.crumbs a:hover { color: var(--paper); }
.crumbs [aria-current] { color: var(--paper); }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 14px; color: var(--lavender); }
.meta > * + *::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 14px;
  border: 1.5px solid var(--electric); border-radius: 50%; vertical-align: 1px;
}

/* ---------- 2. Post hero ---------- */

.post-hero { padding-bottom: 64px; }
.post-hero h1 { max-width: 19em; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.08; }
.post-hero .lede { max-width: 40em; font-size: clamp(18px, 1.6vw, 20px); }
.post-hero .meta { margin-top: 36px; }
@media (min-width: 900px) { .post-hero { padding-bottom: 96px; } }

/* ---------- 3. Post layout ---------- */

/* The figure sits wholly on the light section: padding (not a margin, which
   would collapse through the section) keeps clear air between hero and image. */
.post-wrap { padding-top: clamp(32px, 4.5vw, 64px); }
.post-figure {
  position: relative; max-width: 1200px; margin: 0 auto clamp(48px, 7vw, 96px);
}
.post-figure img {
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover;
  border-radius: clamp(16px, 2.4vw, var(--radius)); background: var(--surface-dark);
  box-shadow: 0 50px 100px -60px rgba(var(--ink-rgb), .9);
}
.post-figure figcaption { margin-top: 12px; font-size: 13px; color: var(--muted-on-light); }

.post-grid { display: grid; gap: 40px; }
.toc { font-size: 15px; }
.toc__title { margin-bottom: 14px; font-size: 14px; font-weight: 500; color: var(--muted-on-light); }
.toc ol { display: grid; gap: 2px; border-left: 1px solid var(--line-light); }
.toc a {
  display: block; margin-left: -1px; padding: 7px 0 7px 18px; border-left: 1px solid transparent;
  line-height: 1.35; text-decoration: none; color: var(--muted-on-light);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.toc a:hover { color: var(--indigo); border-left-color: var(--accent-text); }

.post { min-width: 0; max-width: 68ch; font-size: 18px; line-height: 1.7; }

@media (min-width: 1100px) {
  .post-grid { grid-template-columns: minmax(200px, 260px) minmax(0, 68ch); justify-content: center; column-gap: clamp(48px, 7vw, 120px); }
  .toc { position: sticky; top: calc(var(--header-h) + 32px); align-self: start; max-height: calc(100vh - var(--header-h) - 64px); overflow-y: auto; }
}
@media (max-width: 1099.98px) {
  .post-grid { justify-items: center; }
  .toc, .post { width: 100%; max-width: 68ch; }
  .toc { padding: 24px; border: 1px solid var(--line-light); border-radius: 20px; }
}

/* ---------- 4. Article typography ---------- */

.post > * + * { margin-top: 1.2em; }
.post__intro { font-size: clamp(20px, 2vw, 23px); line-height: 1.5; letter-spacing: -.01em; color: var(--indigo); }
.post h2 {
  margin-top: 2.2em; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.15; letter-spacing: -.02em;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.post h3 { margin-top: 2em; font-size: clamp(20px, 2vw, 24px); line-height: 1.25; letter-spacing: -.015em; scroll-margin-top: calc(var(--header-h) + 24px); }
.post h2 + *, .post h3 + * { margin-top: .8em; }
.post a:not(.btn) {
  color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  text-decoration-color: rgba(var(--electric-rgb), .6); transition: text-decoration-color .2s var(--ease);
}
.post a:not(.btn):hover { text-decoration-color: currentColor; }
.post strong { font-weight: 600; }

.post ul, .post ol { display: grid; gap: .7em; padding-left: 0; }
.post ul > li, .post ol > li { position: relative; padding-left: 2em; }
.post ul > li::before {
  content: ""; position: absolute; left: .3em; top: .62em; width: 9px; height: 9px;
  border: 2px solid var(--accent-text); border-radius: 50%;
}
.post ol { counter-reset: step; }
.post ol[start="4"] { counter-reset: step 3; }
.post ol[start="10"] { counter-reset: step 9; }
.post ol[start="12"] { counter-reset: step 11; }
.post ol > li { counter-increment: step; }
.post ol > li::before {
  content: counter(step); position: absolute; left: 0; top: .1em; min-width: 1.4em;
  font-size: .9em; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent-text);
}
.post ol.post-steps { gap: 0; border-top: 1px solid var(--line-light); }
.post ol.post-steps > li { padding: 20px 0 20px 3em; border-bottom: 1px solid var(--line-light); }
.post ol.post-steps > li::before { top: 17px; font-size: 1.25em; font-weight: 300; letter-spacing: -.02em; }

/* ---------- 5. Components ---------- */

/* Short answer */
.tldr {
  position: relative; margin-block: 2.2em; padding: clamp(24px, 4vw, 36px); overflow: hidden;
  border-radius: 24px; color: var(--paper);
  background: linear-gradient(150deg, var(--panel-deep), var(--panel-from) 70%, var(--panel-mid) 160%);
}
.tldr::after {
  content: ""; position: absolute; right: -70px; top: -70px; width: 200px; height: 200px; border-radius: 50%;
  border: 1.5px solid rgba(var(--electric-rgb), .55); box-shadow: 0 0 0 34px rgba(var(--electric-rgb), .07), 0 0 0 35px rgba(var(--electric-rgb), .2);
  pointer-events: none;
}
@media (max-width: 699.98px) { .tldr::after { right: -110px; top: -110px; } }
.post .tldr__title { margin: 0 0 12px; font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: .02em; color: var(--electric); }
.tldr p { position: relative; max-width: 34em; font-size: clamp(18px, 1.7vw, 20px); line-height: 1.55; }

/* Key takeaways */
.takeaways { margin-top: 3em; padding: clamp(24px, 4vw, 36px); border: 1px solid var(--line-light); border-radius: 24px; background: var(--paper-2); }
.post .takeaways h2 { margin-top: 0; font-size: clamp(22px, 2.2vw, 26px); }
.post .takeaways ul { margin-top: 1em; }
.post .takeaways li::before {
  top: .5em; width: 12px; height: 7px; border: 0; border-radius: 0;
  border-left: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: rotate(-45deg);
}

/* Tables */
.table-wrap { margin-block: 2em; overflow-x: auto; border: 1px solid var(--line-light); border-radius: 20px; -webkit-overflow-scrolling: touch; }
.post table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.post caption { padding: 16px 20px; text-align: left; font-size: 13px; color: var(--muted-on-light); caption-side: bottom; border-top: 1px solid var(--line-light); }
.post th, .post td { padding: 14px 20px; text-align: left; vertical-align: top; }
.post thead th { font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--paper); background: var(--ink-2); }
.post tbody tr + tr > * { border-top: 1px solid var(--line-light); }
.post tbody th { font-weight: 600; }
.post tbody tr:nth-child(even) { background: var(--paper-2); }

/* Long unbroken strings (emails, user-agent strings) wrap inside list items on narrow screens */
.post li { min-width: 0; overflow-wrap: break-word; }

/* Contains visually hidden labels inside scrolled tables so they can't widen the page */
.table-wrap { position: relative; }
/* Score bars and numeric cells (audit tables). The number is the accessible value; the bar is decorative. */
.post table.table--results { min-width: 640px; font-size: 14px; }
.post table.table--results th, .post table.table--results td { padding: 13px 10px; }
.post table.table--results tr > :first-child { padding-left: 18px; }
.post table.table--results tr > :last-child { padding-right: 18px; min-width: 168px; }
.post table.table--results .score { min-width: 92px; gap: 8px; }
.post table.table--checks { min-width: 560px; }
.post td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.post tbody th[scope="row"] { min-width: 7.5em; }
.score { display: flex; align-items: center; gap: 10px; min-width: 116px; }
.score__num { flex: 0 0 2.1em; font-weight: 600; font-variant-numeric: tabular-nums; }
.score__bar { flex: 1 1 auto; height: 6px; overflow: hidden; border-radius: 3px; background: rgba(var(--indigo-rgb), .12); }
.score__bar > span { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--violet), var(--electric)); }
.post caption a { color: var(--accent-text); }
@media print { .score__bar { display: none; } }

/* Code */
.post pre {
  margin-block: 1.8em; padding: 24px; overflow-x: auto; border-radius: 20px; tab-size: 2;
  font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--cyan); background: var(--ink);
}
.post :not(pre) > code { padding: .12em .4em; border-radius: 6px; font-size: .9em; background: var(--paper-2); overflow-wrap: anywhere; }

/* FAQ */
.faq { margin-top: 3.2em; }
.faq__list { margin-top: 1.4em; border-top: 1px solid var(--indigo); }
.faq details { border-bottom: 1px solid var(--line-light); }
.faq summary { position: relative; display: block; padding: 22px 44px 22px 0; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.post .faq summary h3 { margin: 0; font-size: clamp(18px, 1.8vw, 21px); line-height: 1.35; }
.faq summary::before, .faq summary::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 16px; height: 1.5px; background: var(--indigo);
  transition: transform .3s var(--ease);
}
.faq summary::after { transform: rotate(90deg); }
.faq details[open] summary::after { transform: rotate(0deg); }
.faq summary:hover h3 { color: var(--accent-text); }
.faq details > p { margin: 0; padding: 0 44px 26px 0; font-size: 17px; }

/* Byline / share footer */
.post-foot { margin-top: 3em; padding-top: 24px; border-top: 1px solid var(--line-light); font-size: 15px; color: var(--muted-on-light); }

/* ---------- 6. Cards ---------- */

.post-cards { display: grid; gap: 24px; margin-top: 48px; }
@media (min-width: 700px) { .post-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .post-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter) 32px; } .post-cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.post-cards.post-cards--1 { grid-template-columns: minmax(0, 1fr); }

.post-card {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 14px 14px 26px;
  border: 1px solid var(--line-light); border-radius: 24px; background: var(--paper); color: var(--indigo);
  transition: border-color .3s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.post-card__media { overflow: hidden; border-radius: 14px; background: var(--ink); aspect-ratio: 2 / 1; }
.post-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.post-card > :not(.post-card__media) { margin-inline: 12px; }
.post-card .meta { margin-top: 8px; font-size: 13px; color: var(--muted-on-light); }
.post-card .meta > * + *::before { border-color: var(--accent-text); }
.post-card h2, .post-card h3 { font-size: clamp(20px, 1.8vw, 23px); line-height: 1.22; letter-spacing: -.02em; text-wrap: pretty; }
.post-card h2 a, .post-card h3 a { text-decoration: none; }
.post-card h2 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 24px; }
.post-card h2 a:focus-visible, .post-card h3 a:focus-visible { outline: 0; }
.post-card:has(a:focus-visible) { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.post-card p { font-size: 15px; line-height: 1.55; color: var(--muted-on-light); }
.post-card__more { margin-top: auto; padding-top: 6px; font-size: 15px; font-weight: 500; color: var(--accent-text); }
.post-card__more::after { content: " \2192"; display: inline-block; margin-left: 4px; transition: transform .3s var(--ease); }
@media (hover: hover) {
  .post-card:hover { border-color: rgba(var(--indigo-rgb), .4); transform: translateY(-4px); box-shadow: 0 36px 70px -48px rgba(var(--indigo-rgb), .55); }
  .post-card:hover .post-card__media img { transform: scale(1.04); }
  .post-card:hover .post-card__more::after { transform: translateX(4px); }
}

/* Featured card on the index */
@media (min-width: 900px) {
  .post-card--feature { flex-direction: row; align-items: stretch; gap: 0; padding: 16px; }
  .post-card--feature .post-card__media { flex: 0 0 56%; border-radius: 16px; aspect-ratio: auto; min-height: 340px; }
  .post-card--feature .post-card__text { display: flex; flex-direction: column; gap: 16px; padding: 28px clamp(24px, 3vw, 48px); }
  .post-card--feature h2 { font-size: clamp(26px, 2.6vw, 36px); line-height: 1.12; }
  .post-card--feature p { font-size: 17px; }
}
.post-card--feature > .post-card__text { margin-inline: 12px; }
.post-card__text { display: flex; flex-direction: column; gap: 14px; flex: 1; }
@media (min-width: 900px) { .post-card--feature > .post-card__text { margin-inline: 0; } }

/* In-article figure: sits in the text column, not full width */
.post .post-figure--inline { max-width: none; margin: 2.4em 0; }
.post .post-figure--inline img { border-radius: 20px; box-shadow: none; }

/* Sources list at the end of a researched post */
.sources { margin-top: 3em; padding-top: 2em; border-top: 1px solid var(--line-light); }
.post .sources h2 { margin-top: 0; font-size: clamp(22px, 2.2vw, 26px); }
.post .sources p, .post .sources__list { font-size: 15px; line-height: 1.6; }
.post .sources p { color: var(--muted-on-light); }

/* Related */
.related__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 24px; }
.related__head .text-link { margin: 0; }

/* ---------- 7. Index ---------- */

.blog-list { padding-top: clamp(48px, 6vw, 88px); }
.blog-list .post-cards { margin-top: 32px; }
.blog-note { margin-top: 56px; max-width: 44em; font-size: 15px; color: var(--muted-on-light); }
.blog-note a { color: var(--accent-text); }

/* ---------- 8. Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  .post-card, .post-card__media img, .post-card__more::after, .faq summary::before, .faq summary::after, .toc a, .crumbs a { transition: none; }
  .post-card:hover { transform: none; }
  .post-card:hover .post-card__media img { transform: none; }
}

@media print {
  .site-header, .site-footer, .cta, .related, .toc { display: none; }
  .post-hero, .tldr, .post pre, .post thead th { background: none; color: #000; }
  .post-figure { margin-top: 0; }
}
