/* DivPic blog. Loads after ../site.css and reuses its tokens, nav and footer. */
:root {
  --note-bg: #eef4ff;  --note-line: #9cc0ff;
  --warn-bg: #fff1f1;  --warn-line: #f6a3a5;
  --tip-bg: #f5f2ff;   --tip-line: #b9adff;
  --ok-bg: #effbf3;    --ok-line: #8fdcac;
  --code-bg: #f4f4f6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --note-bg: #111c33;  --note-line: #2c4f8f;
    --warn-bg: #2b1314;  --warn-line: #7a3336;
    --tip-bg: #1c1838;   --tip-line: #4f45a0;
    --ok-bg: #0e2618;    --ok-line: #2a7044;
    --code-bg: #1b1b1f;
  }
}

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

/* ---------- Listing ---------- */
.blog-hero { padding: 72px 0 48px; border-bottom: 1px solid var(--line); }
.blog-hero h1 { font-size: clamp(44px, 7vw, 84px); line-height: 1; font-weight: 700; }
.blog-hero p { font-size: 20px; color: var(--ink-2); max-width: 620px; margin: 18px 0 32px; }
.search { position: relative; max-width: 560px; }
.search input {
  width: 100%; height: 56px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 17px; padding: 0 20px 0 52px;
  transition: border-color .15s var(--ease);
}
.search input:focus { outline: none; border-color: var(--ink); }
.search svg { position: absolute; left: 20px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); stroke: var(--ink-2); fill: none; stroke-width: 2; }

.featured { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 56px 0 0; }
.featured a { display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); text-decoration: none; transition: transform .15s var(--ease), border-color .15s var(--ease); }
.featured a:hover { transform: translateY(-2px); border-color: var(--ink); }
.featured img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; height: auto; background: var(--soft); }
.featured .meta { padding: 20px 22px 24px; display: grid; gap: 8px; }
.featured .cat { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.featured strong { font-size: 21px; line-height: 1.25; letter-spacing: -0.02em; }

.topic { padding: 64px 0 0; }
.topic h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 8px; }
.topic > p { color: var(--ink-2); margin: 0 0 24px; }
.pills { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 48px; list-style: none; padding: 0; margin: 0; }
.pills a {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 8px; font-size: 15px;
  background: var(--soft); text-decoration: none; font-weight: 500; transition: background .15s var(--ease);
}
.pills a:hover { background: color-mix(in srgb, var(--tile-blue) 16%, var(--soft)); }
.pills a::after { content: "→"; color: var(--ink-2); transition: transform .15s var(--ease); }
.pills a:hover::after { transform: translateX(3px); }
.empty { display: none; padding: 48px 0; color: var(--ink-2); font-size: 18px; }
.blog-end { padding-bottom: 120px; }

/* ---------- Article layout ---------- */
.article-shell { display: grid; grid-template-columns: minmax(0, 760px) 260px; justify-content: space-between; gap: 56px; padding: 48px 24px 120px; max-width: 1200px; margin: 0 auto; }
.article-shell aside { border-left: 1px solid var(--line); padding-left: 32px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 20px; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--ink-2); }
.crumbs .here { background: var(--soft); border-radius: 8px; padding: 4px 10px; font-weight: 500; }

.article h1 { font-size: clamp(32px, 4vw, 44px); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.article .byline { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: 15px; margin: 16px 0 32px; }
.article .lede { font-size: 18px; line-height: 1.6; color: var(--ink-2); margin: 0 0 24px; }

.prose { font-size: 17px; line-height: 1.7; }
.prose > * + * { margin-top: 16px; }
.prose p { margin: 0; }
.prose h2 { font-family: "Inter", sans-serif; font-size: 26px; line-height: 1.25; letter-spacing: -0.015em; font-weight: 600; margin-top: 48px; scroll-margin-top: 96px; position: relative; }
.prose h3 { font-family: "Inter", sans-serif; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-top: 32px; scroll-margin-top: 96px; }
.prose h2 .anchor { position: absolute; left: -28px; opacity: 0; text-decoration: none; color: var(--ink-2); font-weight: 400; transition: opacity .15s var(--ease); }
.prose h2:hover .anchor, .prose h2 .anchor:focus-visible { opacity: 1; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 0; }
.prose li + li { margin-top: 8px; }
.prose li > p { margin-top: 10px; }
.prose a { color: var(--tile-blue); text-underline-offset: 3px; }
.prose code { font: 600 .85em/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }

/* Numbered steps */
.steps-list { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 10px; }
.steps-list li { counter-increment: s; position: relative; padding-left: 36px; }
.steps-list li + li { margin-top: 0; }
.steps-list li::before {
  content: counter(s); position: absolute; left: 0; top: 3px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--soft); color: var(--ink); border: 1px solid var(--line);
}

/* Callouts */
.callout { border: 1px solid; border-radius: 8px; padding: 14px 18px; font-size: 16px; line-height: 1.6; }
.callout > :first-child { margin-top: 0; }
.callout > * + * { margin-top: 10px; }
.callout strong:first-child { font-weight: 700; }
.callout.note { background: var(--note-bg); border-color: var(--note-line); }
.callout.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.callout.tip  { background: var(--tip-bg);  border-color: var(--tip-line); }
.callout ul { margin: 8px 0 0; }

/* "Works with" requirements box */
.requires { border: 1px solid var(--line); background: var(--soft); border-radius: 8px; padding: 16px 18px; }
.requires h2, .requires .title { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
.requires ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 16px; }
.requires li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.requires svg { width: 17px; height: 17px; flex: none; margin-top: 4px; stroke: var(--ink-2); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Tables */
.table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; min-width: 520px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 16px; }
.prose thead th { background: var(--soft); font-weight: 700; }
.prose tbody tr:nth-child(odd) { background: color-mix(in srgb, var(--soft) 55%, transparent); }
.prose tbody th { font-weight: 700; width: 26%; }
.prose td code { white-space: nowrap; }

/* Image blocks: the image sits on its own dotted canvas */
.shot-block { margin: 24px 0 0; }
.shot-block .frame {
  display: block; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 10px; cursor: zoom-in;
  background: var(--soft) radial-gradient(color-mix(in srgb, var(--ink) 14%, transparent) 1px, transparent 1.2px) 0 0 / 16px 16px;
}
.shot-block img { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 12px 32px -16px rgba(14, 14, 16, .35); }
.shot-block figcaption { font-size: 15px; color: var(--ink-2); margin-top: 10px; text-align: center; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1400px, 94vw); max-height: 92vh; }
.lightbox::backdrop { background: rgba(8, 8, 10, .82); }
.lightbox img { max-height: 88vh; width: auto; max-width: 100%; border-radius: 12px; cursor: zoom-out; }


/* Was this helpful? */
.helpful { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.helpful p { margin: 0 6px 0 0; font-size: 17px; font-weight: 600; }
.helpful .btn { min-width: 64px; height: 38px; padding: 0 16px; font-size: 15px; border-width: 1px; border-radius: 8px; }
.helpful .thanks { width: 100%; text-align: right; color: var(--ink-2); margin: 0; font-size: 16px; font-weight: 400; }
.helpful .thanks a { color: var(--tile-blue); }

/* Related */
.related { margin-top: 56px; }
.related h2 { font-family: "Inter", sans-serif; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 10px; }
.related .pills { grid-template-columns: 1fr; }

/* ---------- On this page (TOC) ---------- */
.toc { position: sticky; top: 96px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.toc header { display: flex; align-items: center; gap: 8px; font-size: 15px; padding: 11px 16px; background: var(--soft); border-bottom: 1px solid var(--line); font-weight: 600; }
.toc svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.toc ol { list-style: none; margin: 0; padding: 2px 16px; max-height: calc(100vh - 260px); overflow-y: auto; }
.toc li + li { border-top: 1px solid var(--line); }
.toc a { display: block; padding: 9px 0 9px 12px; margin-left: -12px; border-left: 2px solid transparent; text-decoration: none; color: var(--ink-2); font-size: 14px; line-height: 1.4; transition: color .15s var(--ease), border-color .15s var(--ease); }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); font-weight: 600; border-left-color: var(--tile-blue); }
.toc footer { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.toc-progress { height: 3px; background: var(--tile-blue); width: 0; transition: width .1s linear; }

/* Mobile TOC sits above the article as a collapsible card */
.toc-mobile { display: none; margin-bottom: 28px; border: 1px solid var(--line); border-radius: var(--radius-md); }
.toc-mobile summary { padding: 14px 18px; font-weight: 600; cursor: pointer; }
.toc-mobile ol { margin: 0; padding: 0 18px 14px 40px; }
.toc-mobile a { color: var(--ink-2); text-decoration: none; line-height: 2; }

@media (max-width: 960px) {
  .article-shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 32px; }
  .article-shell aside { display: none; }
  .toc-mobile { display: block; }
  .featured { grid-template-columns: 1fr; }
  .pills { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .article-shell { padding: 24px 16px 88px; }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 27px; margin-top: 52px; }
  .shot-block .frame { padding: 10px; }
  .helpful { justify-content: flex-start; }
  .helpful .thanks { text-align: left; }
  .prose h2 .anchor { display: none; }
}
