/* Local Rank Tracker blog. Loaded after the app's own /assets/site.css (header, footer, buttons, colours),
   so only blog parts live here. Colours come from site.css variables, with the same values as fallbacks. */

/* ---------- breadcrumbs */
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 0 0 18px; padding: 0; font-size: .88rem; color: var(--muted, #5b6b67); }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.crumbs li + li::before { content: ''; width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-top: 1.6px solid currentColor; transform: rotate(45deg); opacity: .6; margin-right: 4px; }
.crumbs a { color: var(--ink-2, #2b3a36); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--brand, #0f5c4d); text-decoration: underline; }
.crumbs [aria-current] { color: var(--muted, #5b6b67); overflow-wrap: anywhere; }

/* ---------- article header */
.post-head { padding: 40px 0 28px; background: radial-gradient(1200px 420px at 85% 0%, #e2f1eb 0%, rgba(246, 248, 246, 0) 60%), var(--paper, #f6f8f6); }
.post-head h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); max-width: 24ch; margin-bottom: .45em; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0; color: var(--muted, #5b6b67); font-size: .95rem; }
.post-byline { font-weight: 700; color: var(--ink-2, #2b3a36); }
.post-updated { margin-left: 0; }
.post-updated::before { content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; vertical-align: middle; margin-right: 14px; opacity: .6; }

/* ---------- article layout: contents on the left, the article on the right */
.post-grid { display: grid; grid-template-columns: 230px minmax(0, 760px); gap: 48px; justify-content: start; padding-top: 12px; padding-bottom: 72px; }
.post-grid.no-toc { grid-template-columns: minmax(0, 760px); }
.post-aside { min-width: 0; }
.post-toc { position: sticky; top: 88px; padding: 16px 18px; background: var(--card, #fff); border: 1px solid var(--line, #dfe6e2); border-radius: var(--radius, 12px); }
.post-toc summary { cursor: pointer; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-2, #13806b); list-style: none; }
.post-toc summary::-webkit-details-marker { display: none; }
.post-toc summary::after { content: ''; float: right; width: 7px; height: 7px; margin-top: 4px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.post-toc[open] summary::after { transform: rotate(-135deg); margin-top: 8px; }
.post-toc ol { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: toc; }
.post-toc li { counter-increment: toc; border-top: 1px solid var(--line, #dfe6e2); }
.post-toc a { display: block; padding: 8px 0; color: var(--ink-2, #2b3a36); text-decoration: none; font-size: .92rem; line-height: 1.4; font-weight: 600; }
.post-toc a:hover { color: var(--brand, #0f5c4d); }
.post-main { min-width: 0; }
.post-hero { margin: 0 0 32px; }
.post-hero img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius, 12px); box-shadow: var(--shadow, 0 8px 24px rgba(18, 32, 28, .06)); background: var(--brand-soft, #e3f1ec); }
@media (max-width: 900px) {
  .post-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .post-toc { position: static; margin-bottom: 24px; }
}

/* ---------- article text */
.post-body { font-size: 1.07rem; line-height: 1.72; color: var(--ink, #12201c); overflow-wrap: break-word; }
.post-body > :first-child { margin-top: 0; }
.post-body p, .post-body ul, .post-body ol { margin: 0 0 1.1em; }
.post-body h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin: 1.9em 0 .6em; scroll-margin-top: 84px; }
.post-body h3 { font-size: 1.2rem; margin: 1.6em 0 .5em; scroll-margin-top: 84px; }
.post-body h4 { font-size: 1.02rem; margin: 1.4em 0 .4em; scroll-margin-top: 84px; }
.post-body h2:focus, .post-body h3:focus, .post-body h4:focus { outline: none; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li { margin-bottom: .45em; }
.post-body li > ul, .post-body li > ol { margin: .45em 0 0; }
.post-body li::marker { color: var(--brand-2, #13806b); font-weight: 700; }
.post-body strong { color: var(--ink, #12201c); }
.post-body a { text-underline-offset: 2px; }
.post-body blockquote { margin: 1.6em 0; padding: 16px 20px; border-left: 4px solid var(--brand, #0f5c4d); background: var(--brand-soft, #e3f1ec); border-radius: 0 10px 10px 0; color: var(--ink-2, #2b3a36); }
.post-body blockquote > :last-child { margin-bottom: 0; }
.post-body pre { margin: 1.4em 0; padding: 16px 18px; overflow-x: auto; background: var(--ink, #12201c); color: #e7efec; border-radius: 10px; font-size: .9rem; line-height: 1.55; }
.post-body pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.post-body pre:focus-visible, .post-table:focus-visible { outline: 3px solid rgba(19, 128, 107, .35); outline-offset: 2px; }
.post-figure { margin: 1.8em 0; }
.post-figure img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line, #dfe6e2); }
.post-table { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--line, #dfe6e2); border-radius: var(--radius, 12px); background: var(--card, #fff); }
.post-table table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.5; }
.post-table th, .post-table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line, #dfe6e2); }
.post-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted, #5b6b67); background: var(--paper, #f6f8f6); }
.post-table tbody tr:last-child td { border-bottom: 0; }

/* ---------- graphics: [VISUAL n] figures. Each post's visuals/visuals.css adds its own parts on top. */
.article-visual { --visual-ink: var(--ink, #12201c); --visual-muted: var(--muted, #5b6b67); --visual-line: var(--line, #dfe6e2);
  --visual-surface: var(--paper, #f6f8f6); --visual-brand: var(--brand, #0f5c4d); --visual-accent: var(--sun, #f6c344);
  margin: 2em 0; padding: 24px; background: var(--card, #fff); border: 1px solid var(--line, #dfe6e2); border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 8px 24px rgba(18, 32, 28, .06)); font-size: .97rem; line-height: 1.55; }
.post-body .article-visual h3 { margin: 0 0 4px; font-size: 1.12rem; }
.article-visual h4 { margin: 0 0 6px; font-size: 1rem; }
.article-visual p { margin: 0; }
.article-visual .figure-subtitle { color: var(--visual-muted); margin-top: 4px; }
.article-visual .figure-note { margin-top: 16px; color: var(--visual-muted); font-size: .9rem; }
.article-visual figcaption { margin-top: 18px; color: var(--visual-muted); font-size: .88rem; }
.article-visual ol, .article-visual ul { margin: 0; padding: 0; list-style: none; }
.article-visual li { margin: 0; }
/* Steps in a row with arrows between them (stacks on phones). */
.article-visual .figure-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 28px; margin-top: 18px; }
.figure-flow > li { position: relative; display: flex; min-width: 0; }
.figure-step { flex: 1; padding: 16px; border: 1px solid var(--visual-line); border-radius: 10px; background: var(--visual-surface); }
.figure-step p { font-size: .92rem; color: var(--ink-2, #2b3a36); }
.figure-arrow { display: flex; align-items: center; justify-content: center; color: var(--visual-muted); }
.figure-arrow svg { width: 20px; height: 20px; }
.figure-flow .figure-arrow { position: absolute; left: calc(100% + 4px); top: 50%; width: 20px; transform: translateY(-50%); }
.figure-flow > li:last-child .figure-arrow { display: none; }
.article-visual .figure-highlight { background: var(--visual-brand); border-color: var(--visual-brand); color: #fff; }
.article-visual .figure-highlight p, .article-visual .figure-highlight h4 { color: #fff; }
/* Big numbers. */
.figure-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0 0; }
.figure-stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; padding: 16px; border-radius: 10px; background: var(--visual-surface); border: 1px solid var(--visual-line); }
.figure-stats dt { font-size: .9rem; color: var(--ink-2, #2b3a36); }
.figure-stats dd { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--visual-brand); line-height: 1.1; }
/* A rank grid: <ol class="figure-grid" style="--cols: 5"><li class="pin good">1</li> ... good / ok / weak / none / you. */
.article-visual .figure-grid { display: grid; grid-template-columns: repeat(var(--cols, 5), 38px); gap: 10px; justify-content: center; margin: 22px auto 6px; padding: 18px; border-radius: 10px; background: #eaf0ec; width: max-content; max-width: 100%; }
.figure-grid .pin { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1.6px solid var(--ink, #12201c); font-weight: 800; font-size: .82rem; color: var(--ink, #12201c); }
.figure-grid .pin.good { background: var(--good, #1f9d63); color: #fff; }
.figure-grid .pin.ok { background: var(--ok, #f0b429); }
.figure-grid .pin.weak { background: var(--weak, #e2554b); color: #fff; }
.figure-grid .pin.none { background: var(--none, #9aa7a3); color: #fff; font-size: .68rem; }
.figure-grid .pin.off { visibility: hidden; }
.figure-grid .pin.you { box-shadow: 0 0 0 3px var(--sun, #f6c344); }
.figure-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 12px; font-size: .86rem; color: var(--visual-muted); }
.figure-key span { display: inline-flex; align-items: center; gap: 6px; }
.figure-key i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--ink, #12201c); }
.figure-key .good { background: var(--good, #1f9d63); } .figure-key .ok { background: var(--ok, #f0b429); }
.figure-key .weak { background: var(--weak, #e2554b); } .figure-key .none { background: var(--none, #9aa7a3); }
@media (max-width: 640px) {
  .article-visual { padding: 18px 16px; }
  .article-visual .figure-flow { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .figure-flow .figure-arrow { left: calc(50% - 10px); top: calc(100% + 5px); transform: rotate(90deg); }
  .article-visual .figure-grid { grid-template-columns: repeat(var(--cols, 5), 30px); gap: 7px; padding: 14px; }
  .figure-grid .pin { width: 30px; height: 30px; font-size: .74rem; }
}

/* ---------- blog index */
.blog-hero { padding-bottom: 8px; }
.blog-hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
.blog-hero .fine { margin-top: -.4em; }
.blog-list { padding-top: 24px; }
.post-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.post-card { display: flex; flex-direction: column; overflow: hidden; background: var(--card, #fff); border: 1px solid var(--line, #dfe6e2); border-radius: var(--radius, 12px); box-shadow: var(--shadow, 0 8px 24px rgba(18, 32, 28, .06)); transition: transform .15s, box-shadow .15s; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(18, 32, 28, .06), 0 14px 32px rgba(18, 32, 28, .1); }
.post-card-image { display: block; background: var(--brand-soft, #e3f1ec); }
.post-card-image img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.post-card-copy { padding: 20px 22px 24px; }
.post-card-date { margin: 0 0 6px; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-2, #13806b); }
.post-card h2 { font-size: 1.25rem; line-height: 1.25; margin: 0 0 .5em; }
.post-card h2 a { color: var(--ink, #12201c); text-decoration: none; }
.post-card h2 a:hover { color: var(--brand, #0f5c4d); text-decoration: underline; }
.post-card h2 a::after { content: ''; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card p:last-child { margin: 0; color: var(--ink-2, #2b3a36); font-size: .97rem; }
.blog-empty { max-width: 620px; text-align: center; margin: 0 auto; padding: 36px 28px; }
.blog-empty h2 { font-size: 1.5rem; }
.blog-empty p { margin: 0; }
@media (max-width: 760px) { .post-cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- pages */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 36px; }
.pager ol { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.pager li a, .pager li span { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line, #dfe6e2); background: var(--card, #fff); color: var(--ink-2, #2b3a36); font-weight: 700; text-decoration: none; }
.pager li a:hover { border-color: var(--brand, #0f5c4d); color: var(--brand, #0f5c4d); }
.pager li [aria-current] { background: var(--brand, #0f5c4d); border-color: var(--brand, #0f5c4d); color: #fff; }
.pager li.gap { display: grid; place-items: center; min-width: 20px; color: var(--muted, #5b6b67); }
.pager-newer, .pager-older { font-weight: 700; text-decoration: none; min-width: 110px; }
.pager-older { text-align: right; }
@media (max-width: 520px) { .pager { justify-content: center; } .pager-newer, .pager-older { min-width: 0; } }

/* ---------- 404: the footer sits at the bottom of the window even though the page is short */
body.blog-404 { min-height: 100vh; display: flex; flex-direction: column; }
body.blog-404 main { flex: 1; }
.blog-404-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
