/*
 * Camera Grid: the blog. The index (a featured lead, then a grid), the
 * archives, and a note: a head set like a guide page's (the intro beside the
 * art), a table of contents that is sticky beside the text from 1100 px and
 * a collapsible block above it below that, the long-form text at ~68ch, the
 * share row, the App Store card and related notes. The page head and the
 * post cards themselves are in base.css. Mint marks what is live (links, the
 * section in view), as it marks a lock in the app.
 */

/* ── The index ───────────────────────────────────────────── */
.blog-list { padding-bottom: clamp(24px, 4vw, 48px); }
.posts--list { gap: clamp(36px, 4vw, 48px) 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; }

/* The lead: the art 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: 26px; }
.post--featured .post-text { gap: 16px; }
.post--featured h2 { font: 800 clamp(32px, 3.8vw, 52px)/1 var(--display); letter-spacing: -.035em; }
.post--featured p { font-size: clamp(16px, 1.3vw, 18px); max-width: 36em; }
.post--featured .eng time { color: var(--text); }
.post-more { justify-self: start; margin-top: 6px; font: 600 15px/1 var(--body); color: var(--text); border-bottom: 1px dashed var(--line-2);
  padding-bottom: 3px; transition: color .2s, border-color .2s; }
.post--featured:hover .post-more { color: var(--mint); border-color: var(--mint); }
@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: rgba(61, 220, 151, .6); color: var(--mint); }
.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; }

/* ── A note: the head ────────────────────────────────────── */
.post-head { padding-top: clamp(24px, 3.5vw, 44px); }
.post-head .crumbs { margin-bottom: clamp(22px, 3vw, 36px); }
/* The last crumb is the title itself: kept to one line. */
.post-head .crumbs li:last-child { min-width: 0; }
.post-head .crumbs [aria-current] { display: block; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-hero { display: grid; gap: clamp(28px, 4vw, 56px); 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, 460px); } }
.post-intro { display: grid; gap: 22px; justify-items: start; }
.post-intro h1 { font-size: clamp(40px, 5vw, 72px); line-height: .98; }
.post-intro .lede { max-width: 32em; }
.post-chip { font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; padding: 8px 11px; border-radius: 8px;
  border: 1px solid rgba(61, 220, 151, .45); color: var(--mint); text-decoration: none; transition: background-color .2s; }
.post-chip:hover { background: rgba(61, 220, 151, .1); }
/* The separators are dots in the flex gap, not text: each item carries its dot 13 px to its left, and the row is
   pulled 26 px left (and padded back) and clipped there, so an item that starts a line (when the byline wraps on a phone) has its dot
   cut off instead of leading the line. */
.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); }
.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(--muted); opacity: .6; }
.post-art-figure { margin: 0; aspect-ratio: 1; border-radius: 28px; overflow: hidden; background: var(--ink-2); border: 1px solid var(--line);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .45); }
.post-art-figure img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 899.98px) {
  /* On a phone the square art would push the text a screen down: a wide crop instead, the guide's middle kept. */
  .post-art-figure { aspect-ratio: 4 / 3; border-radius: 22px; }
}

/* ── 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(--amber); transition: transform .3s; }
.toc details[open] summary::after { transform: rotate(45deg); }
.toc summary .eng { 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 { color: var(--text); }
.toc a[aria-current] { color: var(--text); }
.toc a[aria-current]::before { color: var(--mint); }
@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(--mint);
    box-shadow: 0 0 10px rgba(61, 220, 151, .7); }
}

/* The long-form text. */
.post-body { font-size: 18px; line-height: 1.75; color: rgba(238, 241, 246, .9); }
.post-body > * { margin: 0; }
.post-body > * + * { margin-top: 1.15em; }
.post-body > p:first-child { font-size: clamp(19px, 1.6vw, 21px); line-height: 1.65; color: var(--text); }
.post-body h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.05; margin-top: 2.1em; scroll-margin-top: 96px; }
.post-body h3 { font-size: clamp(21px, 2vw, 24px); margin-top: 1.9em; 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(--mint); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em;
  text-decoration-color: rgba(61, 220, 151, .5); transition: text-decoration-color .2s; }
.post-body a:hover { text-decoration-color: var(--mint); }
.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: .8em; width: 12px; height: 2px; background: var(--mint); }
.post-body ol { counter-reset: li; }
.post-body ol > li { counter-increment: li; padding-left: 40px; }
.post-body ol > li::before { content: counter(li, decimal-leading-zero); position: absolute; left: 0; top: .28em; 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(--text); }
.post-body blockquote { padding: 4px 0 4px 22px; border-left: 2px solid var(--mint); font: 600 clamp(20px, 2vw, 24px)/1.35 var(--display);
  letter-spacing: -.01em; color: var(--text); }
.post-body blockquote p { margin: 0; }
.post-body figure { margin-inline: 0; }
.post-body img { border-radius: 18px; }
.post-body figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }
.post-body hr { border: 0; border-top: 1px dashed var(--line-2); margin-block: 2.4em; }
.post-body code { font: 500 .85em var(--mono); background: var(--ink-3); padding: 2px 6px; border-radius: 6px; }
.post-body table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; display: block; overflow-x: auto; }
.post-body th, .post-body td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.post-body th { font: 500 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ── 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 > .eng { 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(--body); transition: border-color .2s, color .2s; }
.share-btn[hidden] { display: none; }
.share-btn:hover { border-color: rgba(61, 220, 151, .6); color: var(--mint); }
.share-btn.is-done { border-color: var(--mint); color: var(--mint); }
.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(--mint); }

/* ── The App Store card ──────────────────────────────────── */
.post-cta { display: grid; grid-template-columns: auto 1fr; gap: 20px 24px; align-items: center; margin-top: clamp(40px, 5vw, 56px);
  padding: clamp(22px, 3vw, 32px); border-radius: 26px; border: 1px solid rgba(61, 220, 151, .32);
  background: radial-gradient(120% 140% at 0% 0%, rgba(61, 220, 151, .10), transparent 55%), var(--ink-2); }
.post-cta-icon { width: 88px; height: 88px; filter: drop-shadow(0 18px 30px rgba(233, 165, 107, .25)); }
.post-cta-text { display: grid; gap: 8px; }
.post-cta-text .eng { color: var(--mint); }
.post-cta-title { margin: 0; font: 800 clamp(24px, 2.4vw, 30px)/1.05 var(--display); letter-spacing: -.03em; text-wrap: balance; }
.post-cta-text p:not(.post-cta-title) { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.post-cta .badge { grid-column: 2; justify-self: start; }
@media (max-width: 560px) {
  .post-cta { grid-template-columns: 1fr; }
  .post-cta-icon { width: 64px; height: 64px; }
  .post-cta .badge { grid-column: 1; }
}

/* ── Related ─────────────────────────────────────────────── */
.post-related { padding-block: clamp(72px, 9vw, 120px) 0; }
.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; }
