/*
 * Copyrighted: the blog, after base.css (which holds the post cards: the
 * photo filed like a print with its ivory label). The index (a featured lead,
 * then a grid with no holes), the archives, and a note: the head (the intro
 * beside the note's print), a table of contents pinned beside the text from
 * 1100 px and collapsed above it below that, the long-form text at ~68ch,
 * the share row, the App Store card on the certificate's paper and related
 * notes. Gold marks what is live, as the foil does everywhere else.
 */

/* ── The index ───────────────────────────────────────────── */
.pg-blog .pg-head { padding-bottom: clamp(32px, 4vw, 56px); }
.blog-list { padding-bottom: clamp(48px, 6vw, 88px); }
.posts--list { gap: clamp(40px, 4vw, 52px) 22px; }
/* Six tracks, a card spanning two: two left over share a row (.post--half), one left over takes it (.post--wide). */
@media (min-width: 900px) {
  .posts--list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .posts--list > .post { grid-column: span 2; }
  .posts--list > .post--half { grid-column: span 3; }
  .posts--list > .post--wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 4vw, 56px); align-items: center; }
}
.posts--list .post h2 { font-size: 24px; }
.posts--list .post--half h2 { font-size: clamp(24px, 2.2vw, 28px); }

/* The lead: the print wide on the left, the text beside it, from 900 px. */
.post--featured { margin-bottom: clamp(48px, 6vw, 80px); padding-bottom: clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--line); }
.post--featured .pic { aspect-ratio: 16 / 10; border-radius: 14px; }
.post--featured .post-label { font-size: 11.5px; padding: 10px 14px; margin-top: -22px; }
.post--featured .post-seal { width: 52px; height: 52px; font-size: 27px; right: 20px; bottom: 20px; }
.post--featured .post-text { gap: 16px; }
.post--featured h2 { font-size: clamp(32px, 3.8vw, 52px); line-height: 1.02; font-weight: 700; letter-spacing: -.025em; font-variation-settings: "opsz" 144; }
.post--featured .post-text > p:not(.tag) { font-size: clamp(16px, 1.3vw, 18px); max-width: 36em; }
.post-when time { color: var(--text); }
.post-more { justify-self: start; margin-top: 6px; font: 600 15px/1 var(--sans); color: var(--gold-hi); border-bottom: 1px dashed var(--line-2);
  padding-bottom: 3px; transition: color .2s, border-color .2s; }
.post--featured:hover .post-more { color: var(--text); border-color: var(--gold); }
@media (min-width: 900px) {
  .post--featured { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 4vw, 56px); align-items: center; }
}

/* Pagination. */
.pager { margin-top: clamp(40px, 5vw, 64px); }
.pager .nav-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pager .page-numbers { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); text-decoration: none; font: 500 13px/1 var(--mono); letter-spacing: .06em; color: var(--muted);
  transition: border-color .2s, color .2s; }
.pager a.page-numbers:hover { border-color: var(--gold); color: var(--gold-hi); }
.pager .page-numbers.current { border-color: var(--line-2); color: var(--text); }
.pager .page-numbers.dots { border: 0; }
.pager .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.blog-empty { padding-bottom: 40px; }

/* The closing call (template-parts/learn-cta.php, shared with Learn). */
.la-cta h2 { font-size: clamp(34px, 4.4vw, 58px); }
.la-cta-links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center; }

/* ── A note: the head ────────────────────────────────────── */
.post-top { padding-top: clamp(24px, 3vw, 40px); background: radial-gradient(ellipse at 85% 0, rgba(214, 178, 94, .08), transparent 55%); }
.post-top .crumbs { margin-bottom: clamp(24px, 4vw, 44px); }
/* The last crumb is the title itself: kept to one line. */
.post-top .crumbs li:last-child { min-width: 0; }
.post-top .crumbs [aria-current] { display: block; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-hero { display: grid; gap: clamp(32px, 4vw, 64px); align-items: center; padding-bottom: clamp(48px, 6vw, 88px); border-bottom: 1px solid var(--line); }
@media (min-width: 900px) { .post-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); } }
.post-intro { display: grid; gap: 20px; justify-items: start; }
.post-intro h1 { font-size: clamp(38px, 5vw, 68px); line-height: 1.02; }
.post-intro .lede { max-width: 34em; }
.post-chip { font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; padding: 8px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--gold-hi); text-decoration: none; transition: background-color .2s, border-color .2s; }
.post-chip:hover { color: var(--gold-hi); border-color: var(--gold); background: rgba(214, 178, 94, .1); }
/* The separators are dots in the flex gap, not text: each item carries its dot to its left, and the row is pulled
   left (and padded back) and clipped there, so an item that starts a wrapped line has its dot cut off. */
.post-byline { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 0 0 0 -26px; padding-left: 26px; clip-path: inset(-4px -4px -4px 26px);
  font: 500 12px/1.5 var(--mono); letter-spacing: .08em; color: var(--muted); }
.post-byline > * { position: relative; }
.post-byline > *::before { content: ""; position: absolute; left: -15px; top: 50%; width: 4px; height: 4px; margin-top: -2px;
  border-radius: 50%; background: var(--gold); opacity: .7; }
.post-figure { transform: rotate(.8deg); }
.post-figure .pic { aspect-ratio: 1; border-radius: 12px; box-shadow: 0 40px 100px rgba(0, 0, 0, .5); }
.post-figure .post-seal { width: 64px; height: 64px; font-size: 32px; right: 20px; bottom: 20px; }
.post-figure .post-label { font-size: 11px; padding: 10px 14px; margin-top: -22px; }
@media (max-width: 899.98px) {
  /* On a phone the square print would push the text a screen down: a wide crop instead. */
  .post-figure { transform: none; }
  .post-figure .pic { aspect-ratio: 4 / 3; }
}

/* ── A note: contents and text ───────────────────────────── */
.post-layout { display: grid; gap: 28px; padding-top: clamp(40px, 5vw, 64px); }
.post-main { min-width: 0; max-width: 68ch; }
@media (min-width: 1100px) {
  .post-layout.has-toc { grid-template-columns: 250px minmax(0, 68ch); gap: 72px; justify-content: start; }
}

.toc details { border: 1px solid var(--line); border-radius: 18px; background: var(--ink-2); padding: 0 20px; }
.toc summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font: 400 20px/1 var(--mono); color: var(--gold); transition: transform .3s; }
.toc details[open] summary::after { transform: rotate(45deg); }
.toc summary .tag { color: var(--text); }
.toc ol { margin: 0; padding: 0 0 18px; list-style: none; counter-reset: toc; display: grid; gap: 2px; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 30px 1fr; padding: 7px 0; text-decoration: none; color: var(--muted); font-size: 15px; line-height: 1.35; transition: color .2s; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 500 10px/2.1 var(--mono); letter-spacing: .08em; color: var(--muted); transition: color .2s; }
.toc a:hover, .toc a[aria-current] { color: var(--text); }
.toc a[aria-current]::before { color: var(--gold); }
@media (min-width: 1100px) {
  .toc { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; }
  .toc details { border: 0; background: none; padding: 0; }
  .toc summary { cursor: default; pointer-events: none; padding: 4px 0 14px; }
  .toc summary::after { display: none; }
  .toc ol { border-left: 1px solid var(--line); padding: 0 0 0 16px; }
  .toc a { position: relative; }
  .toc a[aria-current]::after { content: ""; position: absolute; left: -17px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--gold);
    box-shadow: 0 0 10px rgba(214, 178, 94, .6); }
}
@media (max-width: 1099.98px) { .toc { max-width: 68ch; } }

/* The long-form text. */
.post-body { font-size: 18px; line-height: 1.75; color: rgba(238, 240, 245, .9); }
.post-body > * { margin: 0; }
.post-body > * + * { margin-top: 1.1em; }
.post-body > p:first-child { font-size: clamp(19px, 1.55vw, 20.5px); line-height: 1.65; color: var(--text); }
.post-body h2 { font-size: clamp(27px, 2.8vw, 36px); line-height: 1.08; margin-top: 2.1em; scroll-margin-top: 96px; }
.post-body h3 { font-size: clamp(20px, 1.9vw, 23px); margin-top: 1.8em; scroll-margin-top: 96px; }
.post-body h2 + *, .post-body h3 + * { margin-top: .7em; }
.post-body strong { color: var(--text); font-weight: 600; }
.post-body a { color: var(--gold-hi); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
  text-decoration-color: rgba(214, 178, 94, .5); transition: text-decoration-color .2s, color .2s; }
.post-body a:hover { color: var(--text); text-decoration-color: var(--gold); }
.post-body code { font: 500 .84em/1.5 var(--mono); padding: .1em .38em; border-radius: 6px; background: var(--ink-3); color: var(--gold-hi);
  border: 1px solid var(--line); overflow-wrap: anywhere; }
.post-body ul, .post-body ol { padding: 0; list-style: none; display: grid; gap: .55em; }
.post-body li { position: relative; padding-left: 30px; }
.post-body ul > li::before { content: "©"; position: absolute; left: 2px; top: 0; color: var(--gold); font: 600 .9em/1.95 var(--serif); }
.post-body ol { counter-reset: li; }
.post-body ol > li { counter-increment: li; padding-left: 42px; }
.post-body ol > li::before { content: counter(li, decimal-leading-zero); position: absolute; left: 0; top: .22em; width: 28px; height: 28px;
  display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); font: 500 10px/1 var(--mono); letter-spacing: .04em; color: var(--gold-hi); }
.post-body blockquote { padding: 4px 0 4px 22px; border-left: 2px solid var(--gold); font: 600 clamp(20px, 2vw, 24px)/1.35 var(--serif); color: var(--text); }
.post-body blockquote p { margin: 0; }
.post-body hr { border: 0; border-top: 1px dashed var(--line-2); margin-block: 2.4em; }

/* ── Share ───────────────────────────────────────────────── */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-top: clamp(40px, 5vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); }
.share > .tag { margin-right: 6px; }
.share-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 600 15px/1 var(--sans); transition: border-color .2s, color .2s; }
.share-btn[hidden] { display: none; }
.share-btn:hover { border-color: var(--gold); color: var(--gold-hi); }
.share-btn.is-done { border-color: var(--ok); color: var(--ok); }
.share-url { flex: 1 1 260px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--ink-2);
  color: var(--text); font: 400 14px var(--mono); }
.share-url[hidden] { display: none; }
.share-status { font-size: 14px; color: var(--ok); }

/* ── The App Store card, on the certificate's paper ──────── */
.post-cta { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 20px 26px; align-items: start; margin-top: clamp(40px, 5vw, 56px);
  padding: clamp(26px, 3vw, 36px); border-radius: 6px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 34px 80px rgba(0, 0, 0, .45);
  background-image: radial-gradient(circle at 100% 0, rgba(214, 178, 94, .2), transparent 42%); }
.post-cta::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(176, 138, 60, .5); border-radius: 3px; pointer-events: none; }
.post-cta::after { content: ""; position: absolute; inset: 13px; border: 1px dashed rgba(176, 138, 60, .32); border-radius: 2px; pointer-events: none; }
.post-cta > * { position: relative; z-index: 1; }
.post-cta-icon { width: 88px; height: 88px; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .25)); }
.post-cta-text { display: grid; gap: 10px; }
.post-cta-k { margin: 0; font: 500 10.5px/1.5 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--paper-muted); }
.post-cta-title { margin: 0; font: 700 clamp(26px, 2.6vw, 32px)/1.08 var(--serif); letter-spacing: -.02em; color: var(--paper-ink); text-wrap: balance; }
.post-cta-title em { font-style: italic; font-weight: 500; color: #7a5a17; }
.post-cta-text p:not(.post-cta-title):not(.post-cta-k) { margin: 0; color: #4a453b; font-size: 16px; line-height: 1.6; }
.post-cta-links { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin-top: 8px; }
.post-cta-check { color: #6b4f12; font: 600 15px/1.2 var(--sans); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: .25em; text-decoration-color: rgba(107, 79, 18, .45); }
.post-cta-check:hover { color: var(--paper-ink); }
.post-cta :focus-visible { outline-color: #6b4f12; }
@media (max-width: 560px) {
  .post-cta { grid-template-columns: 1fr; }
  .post-cta-icon { width: 64px; height: 64px; }
}

/* ── Related ─────────────────────────────────────────────── */
.post-related { padding-block: clamp(72px, 9vw, 120px) clamp(56px, 7vw, 96px); }
.post-related-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px;
  padding-top: clamp(48px, 6vw, 72px); border-top: 1px solid var(--line); margin-bottom: clamp(28px, 3vw, 40px); }
.post-related-head h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.02; }

@media (max-width: 620px) {
  .post-body { font-size: 17px; }
}
