/* ============================================================
   MICHAEL SELCK — Blog layer
   Extends the main design language (styles.css). Premium, dark,
   editorial. Light on animation, strong on readability.
   ============================================================ */

/* ---------- Blog hero / page head ---------- */
.blog-hero {
  position: relative; z-index: 1;
  padding: clamp(96px, 14vh, 168px) 0 clamp(40px, 6vw, 72px);
}
.blog-hero .crumbs {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  color: var(--faint); font-size: 13px; letter-spacing: .02em;
}
.blog-hero .crumbs a { color: var(--muted); transition: color .2s ease; }
.blog-hero .crumbs a:hover { color: var(--accent-soft); }
.blog-hero .crumbs span.sep { color: var(--faint); }
.blog-hero h1 {
  margin: 18px 0 0; font-family: var(--f-display); font-weight: 700;
  font-size: clamp(38px, 6vw, 74px); line-height: 1.04; letter-spacing: -.035em; color: var(--text);
}
.blog-hero h1 em { font-family: var(--f-accent); font-style: italic; font-weight: 600; color: var(--accent); }
.blog-hero .lead { max-width: 620px; margin-top: 20px; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.62; }

/* ---------- Overview grid ---------- */
.blog-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  padding-bottom: clamp(80px, 11vw, 140px);
}
.blog-card {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line-soft); border-radius: 20px;
  background: var(--bg-2);
  transition: transform .35s var(--ease-out), border-color .3s var(--ease-out), box-shadow .35s var(--ease-out);
}
.blog-card:hover {
  transform: translateY(-4px); border-color: rgba(193,106,79,.4);
  box-shadow: 0 40px 90px -54px rgba(0,0,0,.9);
}
.blog-card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.blog-card__media img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.05) saturate(.9) brightness(.9); transition: transform .5s var(--ease-out); }
.blog-card:hover .blog-card__media img { transform: scale(1.05); }
.blog-card__body { display: flex; flex-direction: column; flex: 1; padding: 24px 26px 28px; }
.blog-card__meta { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--accent); font-size: 12px; font-weight: 600; letter-spacing: .05em; }
.blog-card__meta time { color: var(--faint); font-weight: 500; }
.blog-card__cat { display: inline-flex; align-items: center; gap: 7px; }
.blog-card__cat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.blog-card h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(19px, 1.9vw, 23px); line-height: 1.26; letter-spacing: -.02em; color: var(--text); margin-bottom: 12px; }
.blog-card p { color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.blog-card__more { margin-top: auto; padding-top: 18px; display: inline-flex; align-items: center; gap: 8px; color: var(--accent-soft); font-size: 13.5px; font-weight: 600; }
.blog-card__more span { transition: transform .22s var(--ease-out); }
.blog-card:hover .blog-card__more span { transform: translateX(4px); }

/*
  Robustness layer:
  On a few mobile preview/browser combinations the image layer can be painted while
  text styles arrive late or inherited reveal states are not resolved yet. The blog
  must remain readable even in that partial-load state, so all textual layers get
  explicit visibility, z-index and color fallbacks instead of relying only on CSS
  custom properties.
*/
.blog-card,
.post-hero,
.post-body,
.post-cta,
.post-nav,
.post-tags {
  color: var(--text);
}
.blog-card__body,
.post-hero > *,
.post-body,
.post-body > *,
.post-cta > *,
.post-nav,
.post-tags {
  position: relative;
  z-index: 2;
  opacity: 1 !important;
  visibility: visible !important;
}
.blog-card__body,
.blog-card__body *,
.post-hero h1,
.post-hero .subtitle,
.post-meta,
.post-body,
.post-body *,
.post-cta,
.post-cta *,
.post-nav,
.post-tags {
  text-shadow: none;
}
.blog-card h2,
.post-hero h1,
.post-body .lead,
.post-body h2,
.post-body strong,
.post-cta h2 {
  color: var(--text, #f6f2e9);
}
.blog-card p,
.post-hero .subtitle,
.post-body p,
.post-body li,
.post-cta p {
  color: var(--muted, #b7c0ce);
}
.blog-card__meta,
.blog-card__cat,
.post-meta,
.post-body h3,
.blog-card__more,
.post-body a,
.post-nav a {
  color: var(--accent-soft, #e89f86);
}

/* ---------- Single post ---------- */
.post-hero { position: relative; z-index: 1; padding: clamp(94px, 13vh, 150px) 0 0; }
.post-hero .crumbs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--faint); font-size: 13px; }
.post-hero .crumbs a { color: var(--muted); transition: color .2s ease; }
.post-hero .crumbs a:hover { color: var(--accent-soft); }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 22px 0 18px; color: var(--accent); font-size: 12.5px; font-weight: 600; letter-spacing: .05em; }
.post-meta time, .post-meta .rt { color: var(--faint); font-weight: 500; }
.post-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }
.post-hero h1 { max-width: 16ch; font-family: var(--f-display); font-weight: 700; font-size: clamp(33px, 5vw, 60px); line-height: 1.06; letter-spacing: -.035em; color: var(--text); }
.post-hero .subtitle { max-width: 60ch; margin-top: 20px; color: var(--muted); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.55; font-family: var(--f-display); font-style: normal; font-weight: 400; }

.post-cover {
  position: relative; margin: clamp(34px, 5vw, 56px) 0 0; overflow: hidden;
  border-radius: 22px; border: 1px solid var(--line);
  aspect-ratio: 16 / 8; box-shadow: 0 50px 120px -60px rgba(0,0,0,.9);
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; filter: contrast(1.04) saturate(.92) brightness(.92); }
.post-cover::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 60%, rgba(11,18,32,.45)); }

.post-body { max-width: 720px; margin: clamp(44px, 6vw, 72px) auto clamp(40px, 6vw, 64px); }
.post-body .lead { color: var(--text); font-size: clamp(19px, 2vw, 23px); line-height: 1.55; font-family: var(--f-display); font-weight: 500; letter-spacing: -.01em; margin-bottom: 30px; }
.post-body h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.16; letter-spacing: -.025em; color: var(--text); margin: 44px 0 16px; }
.post-body h3 { font-family: var(--f-display); font-weight: 600; font-size: clamp(19px, 2vw, 23px); letter-spacing: -.015em; color: var(--accent-soft); margin: 32px 0 12px; }
.post-body p { color: var(--muted); font-size: 17px; line-height: 1.74; margin-bottom: 18px; }
.post-body strong { color: var(--text); font-weight: 600; }
.post-body a { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(232,159,134,.4); transition: text-decoration-color .2s ease; }
.post-body a:hover { text-decoration-color: var(--accent-soft); }
.post-body ul, .post-body ol { margin: 0 0 22px; padding: 0; display: grid; gap: 12px; }
.post-body ul li, .post-body ol li { position: relative; padding-left: 28px; color: var(--muted); font-size: 16.5px; line-height: 1.62; }
.post-body ul li::before { content: ""; position: absolute; left: 0; top: 12px; width: 14px; height: 2px; border-radius: 2px; background: var(--accent); }
.post-body ol { counter-reset: li; }
.post-body ol li { counter-increment: li; }
.post-body ol li::before { content: counter(li); position: absolute; left: 0; top: 0; color: var(--accent); font-family: var(--f-body); font-size: 13px; font-weight: 700; }
.post-body blockquote {
  margin: 30px 0; padding: 22px 26px;
  border-left: 3px solid var(--accent); border-radius: 0 16px 16px 0;
  background: rgba(193,106,79,.08);
  font-family: var(--f-accent); font-style: italic; font-weight: 600; font-size: clamp(19px, 1.9vw, 24px);
  line-height: 1.45; letter-spacing: -.005em; color: var(--text);
}
.post-body figure { margin: 30px 0; }
.post-body figure img { width: 100%; border-radius: 16px; border: 1px solid var(--line); }
.post-body figcaption { margin-top: 10px; color: var(--faint); font-size: 13px; }

/* ---------- Post CTA + footer nav ---------- */
.post-cta {
  max-width: 720px; margin: 0 auto; padding: clamp(30px, 4vw, 44px);
  border: 1px solid rgba(193,106,79,.3); border-radius: 22px;
  background: linear-gradient(155deg, rgba(193,106,79,.14), rgba(255,255,255,.02));
  text-align: left;
}
.post-cta .scene-kicker { margin-top: 0; }
.post-cta h2 { font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 3vw, 34px); line-height: 1.12; letter-spacing: -.025em; color: var(--text); margin: 6px 0 14px; }
.post-cta p { color: var(--muted); font-size: 16px; line-height: 1.6; margin-bottom: 24px; max-width: 52ch; }

.post-nav { max-width: 720px; margin: clamp(40px, 6vw, 64px) auto clamp(72px, 10vw, 120px); padding-top: clamp(28px, 4vw, 40px); border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.post-nav a { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color .2s ease; }
.post-nav a:hover { color: var(--accent-soft); }

/* ---------- Tags ---------- */
.post-tags { max-width: 720px; margin: 28px auto 0; display: flex; flex-wrap: wrap; gap: 10px; }
.post-tags span { padding: 6px 13px; border: 1px solid var(--line-soft); border-radius: 999px; color: var(--muted); font-size: 12.5px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .blog-grid { grid-template-columns: 1fr; }
  .post-cover { aspect-ratio: 16 / 11; }
  .post-body { margin-top: 36px; }
}
