/* Blog: article pages (/blog/<slug>, from _post.html) and the article list on blog.html. */
/* Head on the page ground (Every-style): title, deck, byline with photo, then "read with your AI". */
.post-head { padding: clamp(40px, 6vw, 88px) 0 0; }
.post-head .crumb { margin-bottom: 24px; }
.post-head h1 { font-size: var(--step-head); line-height: 1.08; letter-spacing: -0.015em; max-width: 30ch; text-wrap: balance; } /* titles are full SEO sentences: heading size, not display */
.post-deck { margin-top: 20px; max-width: 46ch; font-size: var(--step-lead); line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.byline { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.byline img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 45% 20%; }
.byline b { display: block; font: 600 var(--step-body)/1.3 var(--sans); color: var(--ink); }
.byline span { font-size: var(--step-small); color: var(--muted); }
.byline time { white-space: nowrap; }
.ask-ai { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.ask-ai a, .ask-ai button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-input); border-radius: 0; background: transparent; font: 500 var(--step-label)/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); text-decoration: none; cursor: pointer; transition: background-color 160ms ease, border-color 160ms ease; }
.ask-ai a:hover, .ask-ai button:hover { background: var(--mint); border-color: var(--ink); }
.ask-ai a:focus-visible, .ask-ai button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ask-ai svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.ask-ai [hidden] { display: none; }
.post-wrap { max-width: calc(720px + 2 * var(--m)); padding-top: 40px; padding-bottom: 96px; }
.post-cover { margin: 0 0 48px; }
.post-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r); background: var(--mint); }
.post-body { font-size: 1.125rem; line-height: 1.75; color: var(--text); overflow-wrap: break-word; }
.post-body > * + * { margin-top: 1.15em; }
.post-body h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.2; margin-top: 2.1em; text-wrap: balance; }
.post-body h3 { font-size: var(--step-lead); margin-top: 1.7em; }
.post-body h4 { font-size: var(--step-body); margin-top: 1.5em; }
.post-body h2 + *, .post-body h3 + *, .post-body h4 + * { margin-top: 0.6em; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body a { color: var(--ink); font-weight: 500; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.post-body a:hover { text-decoration-color: var(--ink); }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; } /* styles.css resets every list; steps need their numbers */
.post-body li + li { margin-top: 0.45em; }
.post-body li::marker { color: var(--ochre); }
.post-body blockquote { margin-left: 0; margin-right: 0; font: italic 600 var(--step-lead)/1.45 var(--serif); color: var(--ink); padding: 8px 0; }
.post-body figure { margin-left: 0; margin-right: 0; }
.post-body figure img { width: auto; max-width: 100%; max-height: min(720px, 80vh); margin: 0 auto; border-radius: var(--r); }
.post-body figcaption { margin-top: 8px; font-size: var(--step-small); color: var(--muted); }
.post-body code { font: 500 0.9em var(--mono); background: var(--mint); padding: 0.1em 0.35em; border-radius: 0; }
/* A post that opens with a bold label ("Quick answer:") gets that paragraph as a quiet panel: a tone step, no border. */
.post-body > p:first-child:has(> strong:first-child) { padding: 24px 28px; background: var(--mint); border-radius: var(--r); font-size: 1.1875rem; line-height: 1.65; color: var(--ink); }
.post-body > p:first-child:has(> strong:first-child) > strong:first-child { display: block; margin-bottom: 4px; font: 700 var(--step-lead)/1.3 var(--serif); }
.post-video { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: center; padding: 12px; background: var(--mint); border-radius: var(--r); text-decoration: none !important; font-weight: 600; transition: background-color 180ms ease; }
.post-video:hover { background: #e9e2d0; }
.post-video img { width: 200px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0; }
.post-video span::after { content: " →"; }
.post-author { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-author img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: 45% 20%; }
.post-author p { flex: 1 1 220px; margin: 0; }
.post-author b { display: block; font: 600 var(--step-body)/1.3 var(--serif); color: var(--ink); }
.post-author span { font-size: var(--step-small); color: var(--muted); }
.post-note { margin-top: 24px; font-size: var(--step-small); color: var(--muted); }
/* Wide screens (Every's guides): each section heading sits in the margin beside its text. */
@media (min-width: 1200px) {
  .post-wrap, .post-head .wrap { max-width: calc(1020px + 2 * var(--m)); } /* body column 680px: about 78 characters a line */
  .post-wrap > * { margin-left: 340px; }
  .post-wrap > .post-cover { margin-left: 0; }
  .post-body > h2 { float: left; clear: left; width: 290px; margin: 3rem 0 0 -340px; font-size: 1.625rem; line-height: 1.2; }
  .post-body > h2 + * { margin-top: 3rem; }
}
@media (max-width: 560px) {
  .post-body { font-size: 1.0625rem; }
  .post-body > p:first-child:has(> strong:first-child) { padding: 20px; font-size: 1.0625rem; }
  .post-video { grid-template-columns: 120px 1fr; gap: 14px; }
  .post-video img { width: 120px; }
}

/* Article list on blog.html (shown only once a post is published), after Every's front page: two stories, the newest
   as the lead and a "Recent" list, then one section per topic with the older posts as cards. */
.article-list a { text-decoration: none; color: inherit; }
.article-list .pic { display: block; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--green); }
.article-list .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease-out); }
.article-list a:hover .pic img { transform: scale(1.03); }
.article-list .pic.blank { display: grid; place-items: end start; padding: 16px; color: var(--gold); font: 700 1.5rem/1 var(--serif); }
.article-list small { display: block; font-size: var(--step-small); color: var(--muted); }
.article-list time { white-space: nowrap; }
.article-list h3 { color: var(--ink); text-wrap: balance; letter-spacing: -0.01em; }
.article-list a:hover h3, .recent a:hover b { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
.article-list p { color: var(--muted); text-wrap: pretty; }
.article-list a:focus-visible { outline: 2px solid var(--focus); outline-offset: 6px; border-radius: var(--r); }

.front { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr); grid-template-areas: "side lead recent"; gap: clamp(24px, 3vw, 48px); align-items: start; }
.front.solo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lead"; max-width: 860px; margin: 0 auto; }
.lead-post { grid-area: lead; display: block; }
.lead-post small { margin-top: 20px; }
.lead-post h3 { margin-top: 12px; font: 300 clamp(1.75rem, 1.1rem + 1.6vw, 2.5rem)/1.08 var(--display); text-transform: uppercase; letter-spacing: -0.01em; }
.lead-post p { max-width: 48ch; margin-top: 16px; font-size: var(--step-lead); line-height: 1.5; }
.side { grid-area: side; display: grid; gap: 40px; }
.story small { margin-top: 14px; }
.story h3 { margin-top: 6px; font-size: clamp(1.1875rem, 1.05rem + 0.3vw, 1.375rem); line-height: 1.22; }
.story p { margin-top: 8px; font-size: var(--step-small); line-height: 1.55; }
.recent { grid-area: recent; }
.recent h3 { padding-bottom: 12px; border-bottom: 2px solid var(--ink); font-size: var(--step-lead); }
.recent ul { list-style: none; margin: 0; padding: 0; }
.recent li + li { border-top: 1px solid var(--line); }
.recent a { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 0; }
.recent .pic { border-radius: 0; }
.recent b { display: block; font: 600 1.0625rem/1.3 var(--serif); color: var(--ink); text-wrap: balance; }
.recent small { margin-top: 6px; }

.topic { margin-top: clamp(72px, 9vw, 128px); }
.topic-head { padding-top: 20px; border-top: 2px solid var(--ink); }
.topic-head h2 { font-size: clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem); }
.topic-head p { margin-top: 8px; max-width: 60ch; font-size: var(--step-lead); }
.cards { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 48px clamp(20px, 2.4vw, 36px); }
.cards .t { display: none; } /* the section already names the topic */
.cards .story p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 1100px) {
  .front { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "lead lead" "side recent"; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .front { grid-template-columns: minmax(0, 1fr); grid-template-areas: "lead" "side" "recent"; gap: 48px; }
  /* Phones: every card below the lead becomes a row, text left and picture right, as on Every. */
  .side { gap: 0; }
  .side .story, .cards .story { display: grid; grid-template-columns: minmax(0, 1fr) 112px; grid-template-areas: "meta pic" "title pic"; column-gap: 16px; padding: 20px 0; border-top: 1px solid var(--line); }
  .story .pic { grid-area: pic; align-self: start; border-radius: 0; }
  .story small { grid-area: meta; margin-top: 0; }
  .story h3 { grid-area: title; font-size: 1.125rem; }
  .story p { display: none !important; }
  .story .t { display: none; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 16px; }
}

/* Guides: the reader (/blog/guides/<slug>, a flip book of the PDF) and the shelf on the blog page. */
.guide .post-head .wrap { padding-bottom: 8px; }
.book-wrap { padding-top: 32px; padding-bottom: 96px; }
.book { position: relative; display: grid; justify-items: center; gap: 20px; min-height: 420px; outline: none; }
.book-cover { width: min(100%, 240px); aspect-ratio: 8.5 / 11; border-radius: 0; overflow: hidden; background: var(--green); color: var(--on-green);
  box-shadow: inset 6px 0 0 rgba(0, 0, 0, 0.18), 0 18px 40px -18px rgba(14, 44, 36, 0.55); display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 32px; }
.book-cover:has(img) { padding: 0; }
.book-cover img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.book-cover .mark { font: 600 3rem/1 var(--serif); color: var(--gold); margin-bottom: auto; }
.book-cover b { font: 600 clamp(1.5rem, 1.2rem + 1vw, 2rem)/1.15 var(--serif); text-wrap: balance; }
.book-cover small { font: 500 var(--step-label)/1 var(--mono); letter-spacing: 0.04em; color: var(--on-green-muted); }
.book-gate { width: min(100%, 360px); text-align: center; display: grid; gap: 8px; justify-items: center; }
@media (min-width: 760px) {
  .book:has(.book-gate) { grid-template-columns: 300px 360px; justify-content: center; align-items: center; gap: 64px; }
  .book:has(.book-gate) .book-gate { text-align: left; justify-items: start; }
  .book-cover { width: 300px; }
}
.book-gate .signin-h { font: 600 var(--step-lead)/1.3 var(--sans); color: var(--ink); }
.book-gate .fine { color: var(--muted); font-size: var(--step-small); margin-bottom: 8px; }
.book.loading .book-cover { animation: book-breathe 1.6s var(--ease-out) infinite alternate; }
@keyframes book-breathe { to { opacity: 0.72; } }
.book-status { font-size: var(--step-small); color: var(--muted); text-align: center; }
.book-status a { color: var(--ink); font-weight: 600; }
.book-stage { width: 100%; margin-inline: auto; }
.book-pages { width: 100%; filter: drop-shadow(0 18px 30px rgba(14, 44, 36, 0.22)); }
.book-pages .pg { background: #fff; }
.book-pages .pg img { display: block; width: 100%; height: 100%; object-fit: contain; }
.book-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px 16px; }
.book-bar .btn { min-width: 48px; min-height: 44px; padding: 0 14px; font-size: 1.125rem; }
.book-bar .btn:disabled { opacity: 0.35; cursor: default; }
.book-bar .count { min-width: 9.5em; text-align: center; font: 500 var(--step-small)/1 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.book-pdf { flex-basis: 100%; text-align: center; font-size: var(--step-small); color: var(--ink); font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 0.2em; }
.book:focus-visible .book-stage { outline: 2px solid var(--focus); outline-offset: 8px; }

/* Guides on the blog page: a topic like the others, in compact rows (thumbnail, title) rather than cards. */
.guides { padding-bottom: clamp(72px, 9vw, 128px); }
.guides .topic-head { margin-top: clamp(24px, 3vw, 48px); }
.guide-rows { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: clamp(20px, 2.4vw, 36px); }
.guide-rows li { border-top: 1px solid var(--line); }
.guide-rows a { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px 0; color: var(--ink); text-decoration: none; }
.guide-rows .thumb { aspect-ratio: 4 / 5; border-radius: 0; overflow: hidden; background: var(--green); box-shadow: 0 2px 6px -2px rgba(14, 44, 36, 0.35); }
.guide-rows .thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; transition: transform 400ms var(--ease-out); } /* the covers' empty foot is cropped, the title stays */
.guide-rows a:hover .thumb img { transform: scale(1.04); }
.guide-rows b { display: block; font: 600 1rem/1.3 var(--serif); text-wrap: pretty; }
.guide-rows small { display: block; margin-top: 4px; font-size: var(--step-small); color: var(--muted); }
.guide-rows a:hover b { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
.guide-rows a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 0; }
.guide-more { margin-top: 24px; }
@media (max-width: 1100px) { .guide-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .guide-rows { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .book.loading .book-cover { animation: none; } }
