/* The blog (/blog, PLAN.md D-71), on top of system.css and page.css (fonts, colours, light and dark). Pages are written by
   scripts/make-blog.py: a slim header, the article in one column narrow enough to read, a card about Findy, links to
   more guides, a small footer. /blog lists the posts as cards, two across from 860 px. */

/* the header: logo, three links, Buy Now; it stays at the top while you read */
.bl-nav { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); }
.bl-nav__bar { display: flex; align-items: center; gap: var(--s-5); height: 64px; }
.bl-nav .nav__logo img, .bl-foot .nav__logo img { width: 28px; height: 28px; border-radius: 7px; }
.bl-nav__links { display: flex; gap: var(--s-5); margin-left: auto; font-size: 15px; color: var(--muted); }
.bl-nav__links a { transition: color .15s ease; }
.bl-nav__links a:hover, .bl-nav__links a[aria-current] { color: var(--ink); }
.bl-nav .btn { height: 40px; padding-inline: 18px; font-size: 15px; }
@media (max-width: 639px) {
  .bl-nav__bar { gap: var(--s-4); height: 58px; }
  .bl-nav__links a:not([href="/blog"]) { display: none; }
}

.bl { padding-block: var(--s-6) var(--s-9); }

/* an article */
.bl-article { width: min(100% - 2 * var(--gut), 720px); margin-inline: auto; }
.bl-crumbs { display: flex; gap: var(--s-2); font-size: var(--t-small); color: var(--muted); }
.bl-crumbs a:hover { color: var(--ink); }
.bl-head { display: grid; gap: var(--s-4); margin: var(--s-6) 0 var(--s-7); padding-bottom: var(--s-6); border-bottom: 1px solid var(--line); }
.bl-head h1 { font-size: clamp(38px, 2.4vw + 27px, 60px); line-height: 1.06; }
.bl-head .t-lead { color: var(--muted); }
.bl-byline { font-size: var(--t-small); color: var(--muted); }
.bl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: var(--t-small); color: var(--muted); }
.bl-tag { padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 500; letter-spacing: .02em; }

.bl-body { display: grid; gap: var(--s-5); font-size: 18px; line-height: 1.7; }
.bl-body > * { min-width: 0; }
.bl-body h2 { margin-top: var(--s-6); font-size: clamp(30px, 1vw + 25px, 38px); line-height: 1.12; scroll-margin-top: 88px; }
.bl-body h3 { margin-top: var(--s-3); font: 600 20px/1.35 var(--font-text); letter-spacing: -0.01em; scroll-margin-top: 88px; }
.bl-body h2 + *, .bl-body h3 + * { margin-top: calc(-1 * var(--s-2)); }
.bl-body ul, .bl-body ol { display: grid; gap: var(--s-3); padding-left: 1.3em; }
.bl-body ul { list-style: disc; }
.bl-body ol { list-style: decimal; }
.bl-body li { min-width: 0; }
.bl-body li > pre { margin-top: var(--s-3); }
.bl-body li::marker { color: var(--muted); }
.bl-body b, .bl-body strong { font-weight: 600; }
.bl-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.bl-body a:hover { text-decoration-color: currentColor; }
/* inline, not inline-block: a full stop after a key never wraps onto a line of its own */
.bl-body kbd { display: inline; padding: 2px 7px; -webkit-box-decoration-break: clone; box-decoration-break: clone; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px;
  background: var(--card-bg); font: 500 .82em/1.4 var(--font-text); white-space: nowrap; }
.bl-body code { padding: 1px 6px; border-radius: 6px; background: var(--surface); font: 400 .86em/1.5 var(--font-mono); overflow-wrap: anywhere; }
.bl-body pre { margin: 0; overflow-x: auto; padding: var(--s-4) var(--s-5); border-radius: 14px; background: #1c1c1e; color: #f0f0f0;
  font: 400 14px/1.65 var(--font-mono); tab-size: 2; }
.bl-body pre code { padding: 0; background: none; font: inherit; overflow-wrap: normal; }
.bl-body .menu { font-weight: 500; }

/* the answer to the question in the title, first, for readers in a hurry (and for search engines' snippets) */
.bl-body .answer { display: grid; gap: var(--s-2); padding: var(--s-5); border: 1px solid var(--line); border-radius: 18px; background: var(--card-bg); }
.bl-body .answer > p:first-child { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
/* a tip or a warning beside the steps */
.bl-body .tip { display: grid; gap: var(--s-2); padding: var(--s-4) var(--s-5); border-left: 3px solid var(--ink); border-radius: 0 14px 14px 0;
  background: var(--surface); font-size: 16px; line-height: 1.6; }
.bl-body .tip > p:first-child { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bl-body .tip--warn { border-left-color: var(--danger); }

/* searches you can type into Findy, drawn as its search field */
.bl-body .try { display: grid; gap: var(--s-2); padding: 0; list-style: none; }
.bl-body .try li { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 10px var(--s-4); border: 1px solid var(--line);
  border-radius: 14px; background: var(--card-bg); font-size: 17px; line-height: 1.4; box-shadow: 0 1px 2px rgba(11, 18, 40, .04); }
.bl-body .try li::before { content: ""; flex: none; width: 16px; height: 16px; background: var(--muted);
  -webkit-mask: var(--glass) center / contain no-repeat; mask: var(--glass) center / contain no-repeat; }
.bl-body .try { --glass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='6.8' cy='6.8' r='5' fill='none' stroke='black' stroke-width='1.7'/%3E%3Cpath d='m10.6 10.6 4 4' stroke='black' stroke-width='1.7' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* a comparison: scrolls sideways on its own on a phone, never the page */
.bl-body .table { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card-bg); }
.bl-body table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.bl-body th, .bl-body td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.bl-body th { font-weight: 600; background: var(--surface); }
.bl-body tr:last-child td { border-bottom: 0; }

/* a picture with its credit; images live in web/images/blog/<post>/, never on another server (D-71) */
.bl-body figure { display: grid; gap: var(--s-2); margin: 0; }
.bl-body figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.bl-body figcaption { font-size: var(--t-small); line-height: 1.5; color: var(--muted); }

/* the card about Findy after the article */
.bl-cta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4) var(--s-5); margin-top: var(--s-8); padding: var(--s-6);
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card-bg);
  box-shadow: 0 1px 2px rgba(11, 18, 40, .04), 0 8px 24px -12px rgba(11, 18, 40, .10); }
.bl-cta img { width: 56px; height: 56px; border-radius: 13px; }
.bl-cta__text { display: grid; gap: var(--s-2); color: var(--muted); }
.bl-cta__title { font: 400 32px/1.1 var(--font-display); letter-spacing: -0.02em; color: var(--ink); }
.bl-cta__actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--s-3); }
@media (max-width: 639px) {
  .bl-cta { grid-template-columns: minmax(0, 1fr); padding: var(--s-5); }
  .bl-cta__actions { grid-column: 1; }
  .bl-cta__actions .btn { flex: 1 1 100%; }
}

.bl-more { margin-top: var(--s-8); }
.bl-more h2 { margin-bottom: var(--s-3); font: 600 12px/1.4 var(--font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.bl-more ul { border-top: 1px solid var(--line); }
.bl-more a { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--line);
  font-size: 17px; font-weight: 500; }
.bl-more svg, .bl-card__more svg { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s ease; }
.bl-more a:hover svg, .bl-card:hover .bl-card__more svg { transform: translateX(3px); }

/* /blog */
.bl-index { width: min(100% - 2 * var(--gut), 1040px); margin-inline: auto; }
.bl-index__head { display: grid; gap: var(--s-3); max-width: 720px; margin: var(--s-7) 0 var(--s-7); }
.bl-index__head .t-lead { color: var(--muted); }
.bl-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.bl-card { display: flex; flex-direction: column; gap: var(--s-3); height: 100%; padding: var(--s-6); border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--card-bg); transition: border-color .15s ease, box-shadow .15s ease; }
.bl-card:hover { border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(11, 18, 40, .04), 0 8px 24px -12px rgba(11, 18, 40, .12); }
.bl-card h2 { margin-top: var(--s-2); font-size: clamp(26px, .6vw + 22px, 30px); line-height: 1.12; }
.bl-card__desc { color: var(--muted); }
.bl-card__more { display: inline-flex; align-items: center; gap: var(--s-2); margin-top: auto; padding-top: var(--s-2); font-weight: 500; }
@media (max-width: 859px) { .bl-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 639px) { .bl-card { padding: var(--s-5); } .bl-index__head { margin: var(--s-6) 0; } }

/* the footer */
.bl-foot { border-top: 1px solid var(--line); padding-block: var(--s-7) var(--s-6); font-size: var(--t-small); color: var(--muted); }
.bl-foot__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-5) var(--s-7); }
.bl-foot__brand { display: grid; gap: var(--s-2); }
.bl-foot .nav__logo { color: var(--ink); }
.bl-foot__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-content: start; }
.bl-foot__links a:hover, .bl-foot__legal a:hover { color: var(--ink); }
.bl-foot__legal { grid-column: 1 / -1; display: grid; gap: var(--s-1); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.bl-foot__legal a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
@media (max-width: 639px) { .bl-foot__in { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-color-scheme: dark) {
  .bl-body pre { background: #242426; }
  .bl-body .answer pre { background: #111112; }
  .bl-body .try li, .bl-cta, .bl-card:hover { box-shadow: none; }
}
