/* ============================================================
   blog.css — index + post pages
   Built on tokens from styles.css (var(--ink-rgb), --bg, --line, etc.)
============================================================ */

/* ── BLOG HERO ─────────────────────────────────────────── */
.blog-hero{
  padding: 130px 0 60px;
  position: relative;
}
.blog-hero .eyebrow{
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .6);
  margin-bottom: 20px;
  display: inline-flex; align-items: center; gap: 8px;
}
.blog-hero .eyebrow::before{
  content:""; width:6px; height:6px; border-radius:99px;
  background: rgba(var(--ink-rgb), .5);
}
.blog-hero h1{
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(48px, 7.5vw, 96px);
  line-height: .98;
  letter-spacing: -.02em;
  margin: 0 0 22px;
}
.blog-hero h1 em{ font-style: italic; color: rgba(var(--ink-rgb), .55); }
.blog-hero .lead{
  font-size: 19px;
  line-height: 1.55;
  color: rgba(var(--ink-rgb), .72);
  max-width: 60ch;
  margin: 0;
}

/* ── CATEGORY FILTER ─────────────────────────────────────── */
.blog-filter{
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 40px 0 50px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(var(--ink-rgb), .1);
}
.blog-filter button{
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid rgba(var(--ink-rgb), .14);
  background: transparent;
  color: rgba(var(--ink-rgb), .7);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.blog-filter button:hover{ border-color: rgba(var(--ink-rgb), .35); color: rgba(var(--ink-rgb), .95); }
.blog-filter button.is-active{
  background: rgba(var(--ink-rgb), .92);
  color: var(--bg);
  border-color: rgba(var(--ink-rgb), .92);
}

/* ── FEATURED POST ─────────────────────────────────────── */
.blog-featured{
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: 0 0 70px;
  border-bottom: 1px solid rgba(var(--ink-rgb), .08);
  margin-bottom: 60px;
}
@media (max-width: 860px){ .blog-featured{ grid-template-columns: 1fr; } }
.bf-cover{
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(var(--ink-rgb), .06), rgba(var(--ink-rgb), .02));
  border: 1px solid rgba(var(--ink-rgb), .08);
  position: relative;
  overflow: hidden;
}
.bf-cover::after{
  content:"";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(212, 165, 76, .12), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(120, 140, 180, .1), transparent 50%);
}
.bf-cover .bf-mono{
  position: absolute;
  bottom: 18px; left: 22px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .55);
  z-index: 1;
}
.bf-body .tag{
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .55);
  margin-bottom: 14px;
}
.bf-body h2{
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(32px, 4.5vw, 48px);
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0 0 16px;
}
.bf-body h2 a{ color: inherit; text-decoration: none; }
.bf-body h2 a:hover{ text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.bf-body .excerpt{
  color: rgba(var(--ink-rgb), .7);
  line-height: 1.6;
  font-size: 16px;
  margin: 0 0 22px;
  max-width: 50ch;
}
.bf-body .meta{
  font-family: var(--f-mono);
  font-size: 12px;
  color: rgba(var(--ink-rgb), .5);
  letter-spacing: .04em;
}
.bf-body .meta::after{ content: ""; }
.bf-body .read{
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px;
  font-weight: 500;
  color: rgba(var(--ink-rgb), .95);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--ink-rgb), .35);
  padding-bottom: 2px;
}
.bf-body .read:hover{ border-bottom-color: rgba(var(--ink-rgb), .9); }

/* ── POST GRID ─────────────────────────────────────────── */
.blog-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 120px;
}
@media (max-width: 980px){ .blog-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px){ .blog-grid{ grid-template-columns: 1fr; } }

.post-card{
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform .25s ease;
}
.post-card:hover{ transform: translateY(-3px); }
.post-card[hidden]{ display: none !important; }

.pc-cover{
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  border: 1px solid rgba(var(--ink-rgb), .08);
  background: linear-gradient(135deg, rgba(var(--ink-rgb), .04), rgba(var(--ink-rgb), .015));
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  transition: border-color .25s ease;
}
.post-card:hover .pc-cover{ border-color: rgba(var(--ink-rgb), .18); }
.pc-cover[data-tone="amber"]::after{
  content:""; position:absolute; inset:0;
  background: radial-gradient(circle at 30% 35%, rgba(212, 165, 76, .14), transparent 55%);
}
.pc-cover[data-tone="teal"]::after{
  content:""; position:absolute; inset:0;
  background: radial-gradient(circle at 65% 40%, rgba(80, 140, 145, .14), transparent 55%);
}
.pc-cover[data-tone="ink"]::after{
  content:""; position:absolute; inset:0;
  background: radial-gradient(circle at 50% 50%, rgba(var(--ink-rgb), .12), transparent 60%);
}
.pc-cover[data-tone="violet"]::after{
  content:""; position:absolute; inset:0;
  background: radial-gradient(circle at 40% 55%, rgba(120, 100, 170, .14), transparent 55%);
}
.pc-mono{
  position: absolute;
  bottom: 14px; left: 16px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .55);
  z-index: 1;
}

.pc-tag{
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .55);
  margin-bottom: 10px;
}
.pc-title{
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: -.005em;
  margin: 0 0 10px;
  color: rgba(var(--ink-rgb), .95);
}
.pc-excerpt{
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(var(--ink-rgb), .65);
  margin: 0 0 14px;
}
.pc-meta{
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: rgba(var(--ink-rgb), .48);
  margin-top: auto;
}

/* ── POST DETAIL PAGE ─────────────────────────────────── */
.post-hero{
  padding: 120px 0 50px;
  border-bottom: 1px solid rgba(var(--ink-rgb), .08);
}
.post-hero .breadcrumb{
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .5);
  margin-bottom: 22px;
}
.post-hero .breadcrumb a{ color: rgba(var(--ink-rgb), .7); text-decoration: none; }
.post-hero .breadcrumb a:hover{ color: rgba(var(--ink-rgb), .95); }
.post-hero .breadcrumb span{ margin: 0 8px; opacity: .4; }
.post-hero .tag{
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb), .55);
  margin-bottom: 18px;
}
.post-hero h1{
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(36px, 5.5vw, 68px);
  line-height: 1.05;
  letter-spacing: -.018em;
  margin: 0 0 22px;
  max-width: 20ch;
}
.post-hero h1 em{ font-style: italic; color: rgba(var(--ink-rgb), .55); }
.post-hero .lead{
  font-size: 19px;
  line-height: 1.55;
  color: rgba(var(--ink-rgb), .72);
  max-width: 60ch;
  margin: 0 0 32px;
}
.post-hero .post-meta{
  display: flex; flex-wrap: wrap; gap: 18px;
  font-family: var(--f-mono);
  font-size: 12px;
  color: rgba(var(--ink-rgb), .5);
  letter-spacing: .04em;
}
.post-hero .post-meta span + span::before{
  content: "·"; margin-right: 18px; opacity: .5;
}

.post-body{
  padding: 70px 0 60px;
  max-width: 720px;
  margin: 0 auto;
  font-size: 17.5px;
  line-height: 1.7;
  color: rgba(var(--ink-rgb), .85);
}
/* Mobile: tighten typography for readability on phones */
@media (max-width: 640px) {
  .post-body { padding: 40px 4px 40px; font-size: 16px; line-height: 1.65; }
  .post-body > p:first-child::first-letter {
    font-size: 3.4em; padding: 6px 8px 0 0;
  }
  .post-body h2 { font-size: 24px; margin: 36px 0 10px; }
  .post-body h3 { font-size: 17px; margin: 28px 0 10px; }
  .post-body blockquote { font-size: 18px; padding-left: 18px; margin: 24px 0; }
  .post-body pre { font-size: 12.5px; padding: 14px 16px; }
  .post-body .callout { padding: 18px 20px; font-size: 14.5px; }
  .post-body ul, .post-body ol { padding-left: 22px; }
}
.post-body > p:first-child::first-letter{
  font-family: 'Instrument Serif', serif;
  font-size: 4.4em;
  float: left;
  line-height: .85;
  padding: 8px 12px 0 0;
  color: rgba(var(--ink-rgb), .9);
}
.post-body h2{
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.01em;
  margin: 50px 0 14px;
  color: rgba(var(--ink-rgb), .95);
}
.post-body h2 em{ font-style: italic; color: rgba(var(--ink-rgb), .6); }
.post-body h3{
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -.005em;
  margin: 36px 0 12px;
  color: rgba(var(--ink-rgb), .95);
}
.post-body p{ margin: 0 0 22px; }
.post-body ul, .post-body ol{ margin: 0 0 22px; padding-left: 24px; }
.post-body li{ margin: 0 0 10px; }
.post-body strong{ color: rgba(var(--ink-rgb), .95); font-weight: 600; }
.post-body a{
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(var(--ink-rgb), .3);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.post-body a:hover{ text-decoration-color: rgba(var(--ink-rgb), .9); }
.post-body blockquote{
  margin: 32px 0;
  padding: 4px 0 4px 26px;
  border-left: 2px solid rgba(var(--ink-rgb), .35);
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  font-style: italic;
  line-height: 1.45;
  color: rgba(var(--ink-rgb), .85);
}
.post-body code{
  font-family: var(--f-mono);
  font-size: .92em;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(var(--ink-rgb), .07);
  color: rgba(var(--ink-rgb), .95);
}
.post-body pre{
  background: rgba(var(--ink-rgb), .04);
  border: 1px solid rgba(var(--ink-rgb), .08);
  border-radius: 8px;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13.5px;
  margin: 24px 0;
}
.post-body pre code{ padding: 0; background: transparent; }
.post-body hr{
  border: none;
  border-top: 1px solid rgba(var(--ink-rgb), .12);
  margin: 50px auto;
  width: 60px;
}
.post-body .callout{
  margin: 30px 0;
  padding: 22px 26px;
  border-radius: 10px;
  background: rgba(var(--ink-rgb), .03);
  border-left: 3px solid rgba(212, 165, 76, .8);
  font-size: 16px;
  line-height: 1.55;
}
.post-body .callout strong{ display:block; margin-bottom: 4px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(var(--ink-rgb), .65); font-weight: 500; }

/* ── POST FOOTER / NEXT ─────────────────────────────────── */
.post-next{
  padding: 60px 0 120px;
  border-top: 1px solid rgba(var(--ink-rgb), .08);
}
.post-next h3{
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 28px;
  margin: 0 0 28px;
  letter-spacing: -.01em;
}
.post-next h3 em{ font-style: italic; color: rgba(var(--ink-rgb), .55); }
.post-next-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
@media (max-width: 760px){ .post-next-grid{ grid-template-columns: 1fr; } }

/* ── BLOG CTA STRIP ─────────────────────────────────────── */
.blog-cta{
  padding: 80px 0;
  text-align: center;
  border-top: 1px solid rgba(var(--ink-rgb), .08);
}
.blog-cta h2{
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0 0 14px;
}
.blog-cta h2 em{ font-style: italic; color: rgba(var(--ink-rgb), .55); }
.blog-cta p{ color: rgba(var(--ink-rgb), .65); margin: 0 0 24px; }

/* ── Light-mode contrast (WCAG 1.4.3) ─────────────────────────────────────
   The small mono/caption/meta/tag text uses rgba(var(--ink-rgb), .48–.55),
   which on the light (#f7f7fa) background drops to ~3.9:1 — below the 4.5:1
   AA threshold for normal-size text. In light mode use the solid --muted
   token (≈6:1). Dark mode is unaffected (the rgba values pass there). The
   large italic heading `em` accents are exempt (3:1 large-text threshold). */
html[data-theme="light"] .bf-cover .bf-mono,
html[data-theme="light"] .bf-body .tag,
html[data-theme="light"] .bf-body .meta,
html[data-theme="light"] .pc-mono,
html[data-theme="light"] .pc-tag,
html[data-theme="light"] .pc-meta,
html[data-theme="light"] .post-hero .breadcrumb,
html[data-theme="light"] .post-hero .tag,
html[data-theme="light"] .post-hero .post-meta {
  color: var(--muted);
}
