/* ─────────────────────────────────────────────────────────────────────
   blog.css — overrides specific to /blog/ pages.
   Inherits all design tokens from /styles.css (palette, typo, fonts).
   ───────────────────────────────────────────────────────────────────── */

body.articles .blog-main {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(40px, 7vh, 80px) var(--gutter) 64px;
}

/* ─── Blog section header ─── */
.blog-section .section__head { margin-bottom: 48px; max-width: 760px; }
.blog-section h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0 0 16px;
  color: var(--text);
}
.blog-intro {
  color: var(--text-dim);
  font-size: 17.5px;
  max-width: 640px;
  line-height: 1.65;
}
.blog-intro p { margin: 0; }

/* ─── Post list ─── */
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.post-list__item { padding: 0; }
.post-list__link {
  display: grid; gap: 8px;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.post-list__link:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}
.post-list__date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.post-list__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
  margin: 0;
}
.post-list__desc {
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.55;
  margin: 0;
}

/* ─── Single post ─── */
.post {
  max-width: 720px;
  margin: 0 auto;
}
.post__head { margin-bottom: 36px; }
.post .eyebrow a {
  color: var(--teal);
  text-decoration: none;
}
.post .eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--text);
  margin: 14px 0 12px;
}
.post__meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-mute);
  margin: 0 0 16px;
}
.post__sep { margin: 0 6px; }
.post__tag {
  color: var(--text-dim);
  margin-right: 4px;
}
.post__lead {
  font-size: 18px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid var(--teal);
}

.post__body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
.post__body p { margin: 0 0 1.3em; }
.post__body a {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.post__body a:hover { text-decoration-thickness: 2px; }
.post__body h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 2em 0 0.6em;
  line-height: 1.2;
  color: var(--text);
}
.post__body h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 1.6em 0 0.5em;
  letter-spacing: -0.01em;
  color: var(--text);
}
.post__body ul, .post__body ol {
  padding-left: 1.3em;
  margin: 0 0 1.3em;
}
.post__body li { margin: 0.3em 0; }
.post__body strong { color: var(--text); font-weight: 600; }
.post__body em { color: var(--text-dim); font-style: italic; }
.post__body blockquote {
  margin: 1.4em 0;
  padding: 8px 0 8px 22px;
  border-left: 2px solid var(--border-2);
  color: var(--text-dim);
  font-style: italic;
}
.post__body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text);
}
.post__body pre {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1.4em 0;
  line-height: 1.55;
}
.post__body pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
}
.post__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.2em 0;
}
.post__body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.2em 0;
}

.post__foot {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.post__back {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-dim);
  text-decoration: none;
}
.post__back:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* Mobile */
@media (max-width: 580px) {
  body.articles .blog-main { padding-left: 18px; padding-right: 18px; }
  .post-list__link { padding: 18px 20px; }
}


/* ─── Post list screenshot (right-hand thumbnail) ─── */
.post-list__text { display: grid; gap: 8px; min-width: 0; }
.post-list__link--media {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(18px, 3vw, 32px);
  align-items: center;
}
.post-list__media { flex-shrink: 0; }
.post-list__media img {
  display: block;
  width: 232px;
  max-width: 38vw;
  height: 132px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
@media (max-width: 640px) {
  .post-list__link--media { grid-template-columns: 1fr; }
  .post-list__media img { width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; }
}


/* ─── Lightbox (click-to-zoom) ─── */
.post__body img.zoomable { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 4vmin;
  background: rgba(8, 11, 20, 0.88);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  cursor: zoom-out;
}
.lightbox.is-open { display: flex; }
.lightbox__img {
  max-width: 96vw; max-height: 92vh; width: auto; height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  cursor: default;
}
.lightbox__close {
  position: absolute; top: 16px; right: 20px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 26px; line-height: 1;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.lightbox__close:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.32); }


/* Floating back-to-list pill (article pages) — left edge, vertically centered, follows on scroll */
.post__backfloat{
  position: fixed;
  top: 50%;
  left: 24px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-soft);
  z-index: 60;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.post__backfloat svg{ flex: none; }
.post__backfloat:hover{
  color: var(--teal);
  border-color: var(--teal);
  background: var(--teal-soft);
  transform: translateY(-50%) translateX(-3px);
  text-decoration: none;
}
@media (max-width: 960px){ .post__backfloat{ display: none; } }
@media (prefers-reduced-motion: reduce){ .post__backfloat{ transition: none; } }
