/* ============================================================================
   shaya.ink — blog editorial stylesheet
   Mobile-first reading design for the prerendered /blog, /blog/:slug, and
   /blog/tag/:tag pages. Standalone (these documents load no other site CSS),
   so design tokens are redeclared here, kept in sync with index.html :root.

   Aesthetic: warm hand-made editorial — a printed-zine feel. On-brand with the
   main site (Assistant body, Carizma Book display, warm neutral + gold accent,
   the ✦ star lockup). Direction-agnostic via CSS logical properties so Hebrew
   (RTL) and English (LTR) posts both read correctly; the masthead lockup is
   pinned LTR so the Latin brand reads the same in either document language.
   ============================================================================ */

/* ---- Self-hosted brand faces, identical to the main site ------------------- */
/* Grand Baron — the "Shaya" logo face (masthead + footer brand). */
@font-face {
  font-family: 'Grand Baron';
  src: url('/assets/fonts/Grand-Baron.woff2') format('woff2'),
       url('/assets/fonts/Grand-Baron.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Grand Baron';
  src: url('/assets/fonts/Grand-Baron-Italic.woff2') format('woff2'),
       url('/assets/fonts/Grand-Baron-Italic.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
/* Carizma Book — the editorial display face (titles + headings). */
@font-face {
  font-family: 'Carizma Book';
  src: url('/assets/fonts/FbCarizmaBook-Regular.woff2') format('woff2'),
       url('/assets/fonts/FbCarizmaBook-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Carizma Book';
  src: url('/assets/fonts/FbCarizmaBook-Light.woff2') format('woff2'),
       url('/assets/fonts/FbCarizmaBook-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --surface: #faf7f2;
  --text: #000000;            /* Figma body + headings are pure black */
  --text-soft: #4f5052;       /* Figma caption grey */
  --muted: #8b8178;
  --line: #e4ded4;
  --line-strong: #d8cfc2;
  --accent: #c9a86c;
  --accent-ink: #9d7f44;

  --font-body: 'Assistant', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Carizma Book', 'Assistant', Georgia, serif;
  --font-brand: 'Grand Baron', 'Carizma Book', Georgia, serif;

  --gutter: clamp(1.4rem, 7vw, 2.25rem);
  --reading: 30rem;           /* ~480px reading measure (border-box + gutters) */

  --step-0: 1rem;             /* body (Assistant 14 → ~1rem) */
  --step-1: 1.0625rem;
  --step-2: 1.2rem;           /* h3 */
  --step-3: 1.32rem;          /* post-title / h2 (Carizma ~20px) */
  --step-title: clamp(1.55rem, 7vw, 1.9rem);  /* centered blog tagline (Carizma ~24px) */

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- Cross-document view transitions (seamless homepage ↔ blog nav) -------- */
@view-transition { navigation: auto; }

/* ---- Reset / base ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; max-inline-size: 100%; }
main { inline-size: 100%; max-inline-size: 100vw; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

::selection { background: rgba(201, 168, 108, 0.28); }

/* ============================================================================
   MASTHEAD — ✦ Shaya / Tattoos & Visuals + home + social rail
   Pinned LTR so the Latin lockup reads identically in he/en documents; sits
   above a hairline rule like the printed header.
   ============================================================================ */
.blog-masthead {
  direction: ltr;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.5rem, 2.5vw, 1.5rem);
  flex-wrap: nowrap;            /* always a single row */
  max-width: 64rem;
  margin-inline: auto;
  padding: 1rem var(--gutter);
  border-block-end: 1px solid var(--line);
}

.blog-masthead__brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.35rem, 1.5vw, 0.6rem);
  min-inline-size: 0;          /* allow the lockup to shrink before overflow */
  text-decoration: none;
  color: var(--text);
}
.blog-masthead__star {
  inline-size: clamp(16px, 4vw, 22px);
  block-size: auto;
  flex: none;
}
.blog-masthead__name {
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  line-height: 1;
  letter-spacing: 0.005em;
  color: #000;
}
.blog-masthead__sub {
  font-family: var(--font-brand);
  font-weight: 400;
  font-size: clamp(0.66rem, 2.4vw, 0.82rem);
  letter-spacing: 0.01em;
  color: #000;
  padding-inline-start: clamp(0.4rem, 1.6vw, 0.7rem);
  margin-inline-start: 0.1rem;
  border-inline-start: 1px solid var(--line-strong);
  white-space: nowrap;
}

.blog-masthead__nav {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 0.95rem);
  flex: none;                  /* nav keeps its size; brand shrinks instead */
}
.blog-masthead__home {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  letter-spacing: 0.01em;
  text-decoration: none;
  color: #000;
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.blog-masthead__home:hover { color: var(--accent-ink); }

.blog-masthead__rail {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.25rem, 1.2vw, 0.55rem);
}
.blog-masthead__social {
  display: inline-grid;
  place-items: center;
  inline-size: clamp(1.4rem, 5.5vw, 1.7rem);
  block-size: clamp(1.4rem, 5.5vw, 1.7rem);
  border-radius: 50%;
  color: var(--text);
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.blog-masthead__social img {
  inline-size: clamp(14px, 4vw, 17px);
  block-size: clamp(14px, 4vw, 17px);
  /* Icon SVGs ship white — recolor to brand ink so they read on the page
     (same filter the main site uses for its social rail). */
  filter: brightness(0) saturate(100%) invert(13%) sepia(8%) saturate(700%) hue-rotate(343deg) brightness(96%) contrast(88%);
  opacity: 0.82;
  transition: opacity 0.25s var(--ease);
}
.blog-masthead__social:hover {
  background: rgba(201, 168, 108, 0.14);
  transform: translateY(-1px);
}
.blog-masthead__social:hover img { opacity: 1; }

/* ---- Reading-progress bar (added by <blog-post> enhancement) --------------- */
.reading-progress,
[class*="reading-progress"] {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  block-size: 3px;
  background: var(--accent);
  z-index: 40;
  transform-origin: left center;
}

/* ============================================================================
   BLOG TAGLINE banner — centered Carizma title + hand-drawn flourish.
   This is the blog's identity line ("בלוג על יצירה, קעקועים, ומה שמסביב"),
   shown centered on the index (as the h1) and atop each post.
   ============================================================================ */
.post-head,
.index-head {
  max-width: var(--reading);
  margin-inline: auto;
  padding: clamp(1.9rem, 8vw, 3rem) var(--gutter) 0;
}

.blog-tagline,
.index-head h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-title);
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: #000;
  text-align: center;
  text-wrap: balance;
  max-inline-size: 18rem;     /* wrap to ~2 lines like the Figma frame */
  margin-inline: auto;
  margin-block: 0;
}

/* The trailing ink line: a flourish under the tagline that sweeps out with a
   small loop, mirrored under RTL so it always trails the text edge. */
.hero-flourish {
  display: block;
  inline-size: min(20rem, 78%);
  block-size: auto;
  margin: 0.7rem auto 0;
  overflow: visible;
}
[dir="rtl"] .hero-flourish { transform: scaleX(-1); }

/* Post title — Carizma, start-aligned, smaller than the tagline (Figma 20px). */
.post-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 0.95;
  letter-spacing: -0.01em;
  color: #000;
  text-align: start;
  margin: clamp(2rem, 7vw, 2.75rem) 0 0;
  text-wrap: balance;
}

.index-sub {
  max-width: var(--reading);
  margin: 1rem auto 0;
  color: var(--text-soft);
  font-size: var(--step-0);
  line-height: 1.5;
  text-align: center;
}

.breadcrumb {
  margin: 0 0 0.6rem;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-ink); }

/* ============================================================================
   POST PAGE
   ============================================================================ */
blog-post { display: block; }

article {
  max-width: var(--reading);
  margin-inline: auto;
  padding: 0 var(--gutter) 4.5rem;
}
article > .post-head { padding-inline: 0; }

/* Quiet provenance footer (author · date · reading time · tags) below the body. */
.post-foot {
  max-width: var(--reading);
  margin: clamp(2rem, 7vw, 2.8rem) auto 0;
  padding: 1.3rem var(--gutter) 0;
  border-block-start: 1px solid var(--line);
}
.post-foot .byline { margin: 0; font-size: 0.92rem; color: var(--text-soft); }
.post-foot .byline .author { color: var(--accent-ink); font-weight: 600; }
.post-foot .tag-chips { margin-block-start: 0.9rem; padding-block-start: 0; border: 0; }

/* Quiet single meta line (author · date · read time) */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 0.9rem 0 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
}
.post-meta .author { color: var(--accent-ink); font-weight: 600; }
.post-meta > * { position: relative; }
.post-meta > * + *::before {
  content: "";
  position: absolute;
  inset-inline-start: -0.5rem;
  inset-block-start: 50%;
  inline-size: 3px;
  block-size: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  transform: translateY(-50%);
}

/* Tag chips — footer placement, separated from the body by a hairline. */
.tag-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2.6rem 0 0;
  padding-block-start: 1.5rem;
  padding-inline: 0;
  border-block-start: 1px solid var(--line);
}
.tag-chips a {
  display: inline-block;
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--text-soft);
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background 0.25s var(--ease);
}
.tag-chips a:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: rgba(201, 168, 108, 0.08);
}

/* Hero + in-body images — flat editorial photos (Figma: no radius, no shadow) */
article picture,
article > p > img,
article > img {
  margin-block: clamp(1.6rem, 6vw, 2.4rem);
  border-radius: 2px;
  overflow: hidden;
}
article picture img { inline-size: 100%; border-radius: inherit; }

/* Figure + editorial caption (image authored as `![alt](src "caption")`) */
.post-figure {
  margin-block: clamp(1.6rem, 6vw, 2.4rem);
  margin-inline: 0;
}
.post-figure img {
  inline-size: 100%;
  border-radius: 2px;
}
.post-figcaption {
  margin-block-start: 0.55rem;
  font-size: 0.76rem;          /* Figma 11px */
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text-soft);     /* #4f5052 */
  text-align: start;
}

/* Prose rhythm */
article > h2,
article > h3 {
  font-family: var(--font-display);
  color: #000;
  line-height: 1;
  letter-spacing: -0.01em;
  scroll-margin-top: 1.5rem;
}
article > h2 { font-size: var(--step-3); font-weight: 400; margin: 2.2rem 0 0.6rem; }
article > h3 { font-size: var(--step-2); font-weight: 400; margin: 1.8rem 0 0.45rem; }
article > h2 a,
article > h3 a { text-decoration: none; color: inherit; }
article > h2 a:hover,
article > h3 a:hover { color: var(--accent-ink); }

article > p { margin: 0 0 1rem; color: #000; }
article > .post-head + p { margin-block-start: 1.4rem; }

article a:not(.tag-chips a):not(.post-nav a):not(h2 a):not(h3 a) {
  color: var(--accent-ink);
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
  transition: text-decoration-color 0.25s var(--ease);
}
article a:not(.tag-chips a):not(.post-nav a):not(h2 a):not(h3 a):hover {
  text-decoration-color: var(--accent);
}

article ul:not(.tag-chips):not(.contains-task-list),
article ol {
  margin: 0 0 1.3rem;
  padding-inline-start: 1.3rem;
}
article li { margin-block: 0.35rem; }
article li::marker { color: var(--accent); }

article blockquote {
  margin: 1.9rem 0;
  padding-inline-start: 1.1rem;
  border-inline-start: 3px solid var(--accent);
  color: var(--text-soft);
  font-style: italic;
  font-size: var(--step-1);
}

article hr {
  border: 0;
  block-size: 1px;
  background: var(--line);
  margin: 2.6rem 0;
}

article :not(pre) > code {
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', monospace;
  font-size: 0.86em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}
article pre {
  margin-block: 1.9rem;
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.6;
  -webkit-overflow-scrolling: touch;
}

/* Task lists */
.contains-task-list { list-style: none; padding-inline-start: 0; margin: 0 0 1.3rem; }
.task-list-item { display: flex; align-items: baseline; gap: 0.55rem; }
.task-list-item input { accent-color: var(--accent); }

/* Prev / next */
.post-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block-start: 3rem;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid var(--line);
}
.post-nav a {
  flex: 1 1 11rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
/* Avoid a double hairline when tags already drew one directly above. */
.tag-chips + .post-nav {
  border-block-start: 0;
  margin-block-start: 1.75rem;
  padding-block-start: 0;
}
.post-nav a[rel="prev"]::before { content: "‹ "; color: var(--muted); }
.post-nav a[rel="next"]::after { content: " ›"; color: var(--muted); }
.post-nav a:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ============================================================================
   ENGAGEMENT — like / view / bookmark / share bar, comments, newsletter.
   Components self-render their innerHTML; these styles give them the on-brand
   editorial look. All buttons are quiet ghost pills with the gold accent.
   ============================================================================ */
.post-engagement {
  max-width: var(--reading);
  margin: clamp(2.4rem, 8vw, 3.4rem) auto 0;
  padding: 0 var(--gutter);
  display: grid;
  gap: 1.75rem;
}

.post-engagement__bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  padding-block: 1.1rem;
  border-block: 1px solid var(--line);
}

/* Shared pill look for the interactive controls. */
.like-button,
.bookmark-button,
.view-count,
.share-bar__native,
.share-bar__intent {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.84rem;
  line-height: 1;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.view-count { cursor: default; }
.like-button:hover,
.bookmark-button:hover,
.share-bar__native:hover,
.share-bar__intent:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  background: rgba(201, 168, 108, 0.08);
}
.like-button[aria-pressed="true"] {
  border-color: var(--accent);
  color: #b4453f;
  background: rgba(201, 168, 108, 0.1);
}
/* Line-icon glyphs (no emojis) — inherit the pill's colour so the heart turns
   red when liked, everything else follows the soft/accent hover state. */
.like-button__icon,
.view-count__icon,
.bookmark-button__icon { display: inline-flex; color: inherit; }
.like-button__icon svg,
.view-count__icon svg,
.bookmark-button__icon svg { width: 16px; height: 16px; display: block; }
.like-button__count,
.view-count__count { font-variant-numeric: tabular-nums; }

/* In a listing card the stats are smaller and borderless. */
.card-stats .like-button,
.card-stats .view-count {
  border: 0;
  padding: 0.2rem 0;
  font-size: 0.78rem;
}
.card-stats .like-button:hover { background: transparent; }

/* Share bar — native button first (when available), then fallback intents. */
.share-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; position: relative; }
.share-bar__fallback { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; }
.share-bar__toast {
  position: absolute;
  inset-block-end: calc(100% + 0.5rem);
  inset-inline-start: 0;
  font-size: 0.78rem;
  color: var(--accent-ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
}

/* Newsletter sign-up panel. */
.newsletter-form {
  display: grid;
  gap: 0.6rem;
  padding: clamp(1.2rem, 4vw, 1.6rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.newsletter-form__label { font-weight: 600; color: #000; }
.newsletter-form__email,
.comment-form__textarea {
  inline-size: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
}
.newsletter-form__email:focus,
.comment-form__textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.newsletter-form__submit,
.comment-form__submit {
  justify-self: start;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: #000;
  border: 0;
  border-radius: 8px;
  padding: 0.65rem 1.4rem;
  cursor: pointer;
  transition: opacity 0.2s var(--ease);
}
.newsletter-form__submit:hover,
.comment-form__submit:hover { opacity: 0.85; }
.newsletter-form__status,
.comment-form__status { font-size: 0.85rem; color: var(--text-soft); }
/* Spam honeypot: hidden without an off-screen offset — a left:-9999px input
   would balloon the scroll width and, under RTL, push the page off-frame. */
.newsletter-form__hp,
.comment-form__hp {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Comments. */
.comments { display: grid; gap: 1.1rem; }
.comments__status { color: var(--muted); font-size: 0.92rem; }
.comments__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.3rem; }
.comments__replies { list-style: none; margin: 0.9rem 0 0; padding-inline-start: 1.1rem; border-inline-start: 2px solid var(--line); display: grid; gap: 1rem; }
.comment__head { display: flex; align-items: baseline; gap: 0.6rem; margin-block-end: 0.25rem; }
.comment__author { font-weight: 600; color: #000; }
.comment__time { font-size: 0.72rem; color: var(--muted); }
.comment__text { margin: 0; color: var(--text); line-height: 1.55; }
.comment-form { display: grid; gap: 0.6rem; }
.comment-form__prompt { color: var(--text-soft); }

/* ============================================================================
   FOOTER — brand lockup + nav + social rail on a warm panel (Figma).
   Pinned LTR so the Latin brand sits at the start, like the masthead.
   ============================================================================ */
.blog-footer {
  direction: ltr;
  margin-block-start: clamp(3rem, 10vw, 5rem);
  border-block-start: 1px solid var(--line);
  background: var(--surface);
}
.blog-footer__row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
  max-width: 64rem;
  margin-inline: auto;
  padding: clamp(1.6rem, 6vw, 2.4rem) var(--gutter);
}
.blog-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: #000;
}
.blog-footer__brand img { inline-size: 20px; block-size: 24px; flex: none; }
.blog-footer__brand-text { display: inline-flex; flex-direction: column; line-height: 1; }
.blog-footer__brand-name {
  font-family: var(--font-brand);
  font-size: 1.3rem;
  letter-spacing: 0.005em;
}
.blog-footer__brand-sub {
  font-family: var(--font-brand);
  font-size: 0.78rem;
  margin-block-start: 0.2rem;
}
.blog-footer__brand-sub .amp { color: var(--accent); }

.blog-footer__end {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.7rem;
}
.blog-footer__nav {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  direction: rtl;
}
.blog-footer__nav a { text-decoration: none; color: #000; transition: color 0.25s var(--ease); }
.blog-footer__nav a:hover { color: var(--accent-ink); }
.blog-footer__nav .sep { color: var(--line-strong); }
.blog-footer__socials { display: inline-flex; align-items: center; gap: 0.5rem; }
.blog-footer__social {
  display: inline-grid;
  place-items: center;
  inline-size: 1.7rem;
  block-size: 1.7rem;
  border-radius: 50%;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.blog-footer__social img {
  inline-size: 17px;
  block-size: 17px;
  filter: brightness(0) saturate(100%) invert(13%) sepia(8%) saturate(700%) hue-rotate(343deg) brightness(96%) contrast(88%);
  opacity: 0.85;
  transition: opacity 0.25s var(--ease);
}
.blog-footer__social:hover { background: rgba(201, 168, 108, 0.16); transform: translateY(-1px); }
.blog-footer__social:hover img { opacity: 1; }

/* ============================================================================
   INDEX + TAG PAGES
   ============================================================================ */
blog-index { display: block; }

/* Magazine listing: a featured lead card, then a responsive grid of cards. */
.post-list {
  list-style: none;
  max-width: 58rem;
  margin: clamp(1.9rem, 7vw, 3rem) auto;
  padding: 0 var(--gutter) 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
  gap: clamp(1.75rem, 5vw, 2.75rem);
}

.post-card { display: flex; flex-direction: column; min-inline-size: 0; }

.post-card__link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  flex: 1;
}
.post-card__media {
  inline-size: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 4px;
  margin-block-end: 0.95rem;
  background: var(--surface);
}
.post-card__media picture,
.post-card__media img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.post-card__link:hover .post-card__media img { transform: scale(1.035); }

.post-card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.3rem, 4.2vw, 1.55rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
  color: #000;
  transition: color 0.25s var(--ease);
}
.post-card__link:hover h2 { color: var(--accent-ink); }
.post-card__excerpt {
  margin: 0.5rem 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__meta {
  margin: 0.7rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.85rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* Engagement stats row beneath each card (outside the anchor). */
.card-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-block-start: 0.7rem;
  padding-block-start: 0.7rem;
  border-block-start: 1px solid var(--line);
}

/* Featured lead card spans the full grid width with a side-by-side layout. */
.post-card--featured { grid-column: 1 / -1; }
@media (min-width: 40rem) {
  .post-card--featured .post-card__link {
    flex-direction: row;
    align-items: stretch;
    gap: clamp(1.25rem, 4vw, 2.25rem);
  }
  .post-card--featured .post-card__media {
    flex: 0 0 46%;
    aspect-ratio: 1 / 1;
    margin-block-end: 0;
  }
  .post-card--featured .post-card__body {
    align-self: center;
    flex: 1;
  }
  .post-card--featured h2 { font-size: clamp(1.7rem, 3.4vw, 2.2rem); }
  .post-card--featured .post-card__excerpt {
    -webkit-line-clamp: 4;
    font-size: 1.0625rem;
  }
  .post-card--featured .card-stats { max-inline-size: 54%; }
}

/* ---- Wider reading frame on larger screens --------------------------------- */
@media (min-width: 720px) {
  :root { --step-0: 1.125rem; }
}

/* ---- Respect reduced motion ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
