/* Blog layout on top of base.css: an editorial column with generous air.
   Same tokens, both themes. */

/* Keyboard users can jump straight past the nav. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  z-index: 200;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}
.skip-link:focus {
  left: 10px;
}

.post-head {
  max-width: 68ch;
  margin: 0 auto;
}
/* One clean way back to the article list — the point of it is "read more",
   not a Home crumb. Small SF chevron, refined type. Posts only. */
.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink-2);
  text-decoration: none;
  margin-bottom: 26px;
  transition: color 0.15s ease;
}
.back-to-blog:hover {
  color: var(--accent);
}
.back-to-blog svg {
  opacity: 0.7;
  flex-shrink: 0;
}

/* Flexible hero banner: posts that have an image lead with a wide, rounded
   banner (Apple-Newsroom style); posts without one simply omit it and still
   look premium. */
.post-hero {
  position: relative;
  max-width: 980px;
  margin: 40px auto 0;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--fill);
}
.post-hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Portrait heroes get a taller, narrower centred frame instead of the 16:9
   crop, so a tall image shows fully rather than as a thin band. The hero is
   flexible: default = landscape 16:9, add .portrait for tall images. */
.post-hero.portrait {
  aspect-ratio: 3 / 4;
  max-width: 560px;
}
/* Brand mark overlaid in HTML (not baked into the photo) so it always sits
   crisply in the visible corner, no matter how the hero crops responsively. */
.post-hero .post-hero-badge {
  position: absolute;
  top: clamp(14px, 2.4vw, 22px);
  left: clamp(14px, 2.4vw, 22px);
  width: clamp(44px, 5vw, 60px);
  height: auto;
  border-radius: 15px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
}
@media (max-width: 640px) {
  .post-hero {
    border-radius: 16px;
  }
}
.post-head h1 {
  font-size: clamp(34px, 5.4vw, 52px);
  letter-spacing: -0.022em;
  line-height: 1.08;
}
.post-sub {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  margin-top: 18px;
  max-width: 56ch;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-size: 13px;
  color: var(--ink-3);
}
/* Provenance line: where an essay first appeared, said quietly. */
.post-origin {
  margin-top: 10px;
  font-size: 13px;
  font-style: italic;
  color: var(--ink-3);
}
.post-origin a {
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-origin a:hover {
  color: var(--accent-ink);
}
.post-origin svg {
  display: inline-block;
  vertical-align: baseline;
  margin-left: 1px;
}
.post-meta .dot::before {
  content: '·';
  color: var(--ink-3);
}
.tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--fill);
  border-radius: 999px;
  padding: 4px 11px;
}

/* Featured badge — a provenance flag ("First on Indie Hackers"), lifted out
   of the flat topic-tag row with the brand fill so it reads as a badge. */
.tag-featured {
  color: #ffffff;
  background: var(--accent);
  gap: 5px;
}
.tag-featured::before {
  content: '★';
  font-size: 10px;
  line-height: 1;
}

.post {
  max-width: 68ch;
  margin: 56px auto 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}
.post p {
  margin: 0 0 22px;
}
.post ul,
.post ol {
  margin: 0 0 26px;
  padding-left: 26px;
}
.post li {
  margin: 0 0 12px;
  line-height: 1.7;
  padding-left: 4px;
}
.post li::marker {
  color: var(--ink-3);
}
.post h2 {
  font-size: 26px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 56px 0 18px;
}
.post h3 {
  font-size: 18px;
  margin: 34px 0 10px;
}
.post strong {
  font-weight: 650;
}
/* Her short stanza blocks: one thought per line, a hair quieter. */
.post .stanza {
  color: var(--ink-2);
  line-height: 1.85;
}
.post hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 52px auto;
  width: 72px;
}

/* Reading progress: a hairline that fills as you read. */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 300;
}

/* Anchor jumps land clear of the sticky nav, and glide there. */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
.post h2[id] {
  scroll-margin-top: 88px;
}

/* On this page: a quiet, collapsed contents card. Tap to open. */
.toc {
  max-width: 68ch;
  margin: 40px auto 0;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.toc summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  padding: 15px 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.toc summary::-webkit-details-marker {
  display: none;
}
.toc summary::after {
  content: '';
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 1.8px solid var(--ink-3);
  border-bottom: 1.8px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.toc[open] summary::after {
  transform: rotate(225deg);
}
.toc ol {
  list-style: none;
  margin: 0;
  padding: 2px 22px 18px;
}
.toc li {
  margin: 8px 0;
}
.toc a {
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
}
.toc a:hover {
  color: var(--accent-ink);
}

/* Back to top, at the end of the read. */
.back-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}
.back-top:hover {
  color: var(--ink);
}

/* Mid-article shelf figure: the homepage shelf, miniature. */
.fig-shelf {
  margin: 44px auto;
  max-width: 340px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  box-shadow: 0 20px 44px -30px rgba(0, 0, 0, 0.3);
  padding: 14px;
}
.fig-shelf .fs-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 12px;
  border-bottom: 1px solid var(--line);
}
.fig-shelf .fs-head img {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}
.fig-shelf .fs-head span {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.fig-shelf .fs-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
}
.fig-shelf .fs-row + .fs-row {
  border-top: 1px solid var(--line);
}
.fig-shelf .fs-chip {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fig-shelf .fs-chip.color {
  background: #007aff;
}
.fig-shelf .fs-chip.link {
  background: rgba(217, 46, 118, 0.1);
  color: var(--accent);
}
.fig-shelf .fs-chip.img {
  background: var(--fill);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.fig-shelf .fs-t {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.3;
}
.fig-shelf .fs-s {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* A product moment mid-article: mini shelf + one line + button. */
.promo-card {
  max-width: 68ch;
  margin: 44px auto;
  display: flex;
  align-items: center;
  gap: 22px;
  background: var(--fill);
  border-radius: 18px;
  padding: 22px 24px;
  flex-wrap: wrap;
}
.promo-card .t {
  flex: 1;
  min-width: 200px;
}
.promo-card .t strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
}
.promo-card .t span {
  display: block;
  font-size: 13.5px;
  color: var(--ink-2);
  margin-top: 3px;
}

/* One quiet inline promo line, mid-article. */
.promo-line {
  max-width: 68ch;
  margin: 44px auto;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px 10px 18px;
}
.promo-line span {
  flex: 1;
  font-size: 14px;
  color: var(--ink-2);
}
.promo-line a {
  flex-shrink: 0;
}

/* Inline product screenshot, mid-article. Slightly wider than the text
   column so a detailed shot reads, framed like the homepage step images. */
.post-figure {
  max-width: 860px;
  margin: 44px auto;
}
.post-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 44px -30px rgba(0, 0, 0, 0.3);
}
.post-figure figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}

/* Blog index tag filters. */
.tag-filter {
  max-width: 68ch;
  margin: 28px auto 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tag-filter button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--fill);
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
}
.tag-filter button[aria-pressed='true'] {
  background: var(--accent);
  color: #fff;
}
[data-theme='dark'] .tag-filter button[aria-pressed='true'] {
  color: #1d1d1f;
}

/* The promo band at the very end of a post — a full-bleed strip in the Apple
   Newsroom mold. Theme-adaptive (a soft surface, not a black slab on a white
   page), and flush to the footer (the page kills main's bottom padding when a
   promo is present, so there's no dead gap after it). */
.blog-promo {
  width: 100vw;
  margin: 72px 0 0 calc(50% - 50vw);
  background: var(--fill);
  padding: 80px 24px;
}
body:has(.blog-promo) main {
  padding-bottom: 0;
}
.bp-inner {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}
.bp-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.bp-brand img {
  width: 22px;
  height: 22px;
  border-radius: 22%;
  display: block;
}
.bp-brand span {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.bp-head {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 10px;
}
.bp-sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  margin-bottom: 26px;
}
.bp-btn {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
[data-theme='dark'] .bp-btn {
  color: #1d1d1f;
}
.bp-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Blog index cards */
.post-list {
  max-width: 68ch;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.post-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 30px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.post-card:hover {
  border-color: var(--ink-3);
}
.post-card h2 {
  font-size: 22px;
  letter-spacing: -0.015em;
  margin: 10px 0 10px;
}
.post-card p {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 14px;
}
.post-card .read {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
}
/* Flexible: a post with a banner shows a thumbnail beside its text; posts
   without one keep the clean text card. Both look at home in the list. */
.post-card.has-media {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 20px;
}
.post-card .card-media {
  flex: 0 0 230px;
  aspect-ratio: 16 / 10;
  border-radius: 13px;
  overflow: hidden;
  background: var(--fill);
}
.post-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-card .card-body {
  flex: 1;
  min-width: 0;
}
@media (max-width: 640px) {
  .post-card.has-media {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px;
  }
  .post-card .card-media {
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 640px) {
  .post {
    font-size: 16px;
  }
  .blog-promo {
    padding: 48px 24px;
  }
}

/* Share row: Apple's own pattern (see their Newsroom articles) — a quiet row
   of icon-only circles right under the byline, above the body copy. Copy
   link swaps its icon to a checkmark on success; no text labels needed. */
.post-share {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Align the share row to the same centered text column as the title and
     body — otherwise it floats to the full wrap edge and reads misaligned. */
  max-width: 68ch;
  margin: 20px auto 8px;
}
.share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--fill);
  color: var(--ink-2);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.share-icon:hover {
  background: var(--fill-2);
  color: var(--ink);
}
.share-icon .i-check {
  display: none;
}
.share-icon.copied {
  color: var(--accent-ink);
}
.share-icon.copied .i-link {
  display: none;
}
.share-icon.copied .i-check {
  display: block;
}

/* Pullquote: the one blockquote on the blog (the brand ethos). A centered,
   larger italic in the brand ink — an editorial "manifesto" moment, not a
   bordered callout. Legible in both themes (accent-ink clears AA at this size). */
.post blockquote {
  margin: 46px auto;
  max-width: 46ch;
  text-align: center;
  font-size: 23px;
  font-style: italic;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--accent-ink);
}
.post blockquote p {
  margin: 0;
}

/* "Keep reading": two more posts before the end promo. Static links (crawlable
   = real internal linking), styled as compact cards; one column on phones. */
.post-more {
  max-width: 68ch;
  margin: 64px auto 0;
}
.post-more-h {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 16px;
}
.post-more-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.post-more-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.post-more-card:hover {
  border-color: var(--ink-3);
}
.post-more-kicker {
  font-size: 12px;
  color: var(--ink-3);
}
.post-more-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}
.post-more-link {
  margin-top: auto;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-ink);
}
@media (max-width: 640px) {
  .post-more-grid {
    grid-template-columns: 1fr;
  }
}
