/* ──────────────────────────────────────────────────────────────
   Prose blog styles: listing + article.
   Built exclusively on the design tokens defined in style.css.
   No hard-coded colours, fonts, sizes or spacing.
   Loaded after style.css so element selectors are safely overridden
   by the scoped .blog-* / .article-* classes.
   ────────────────────────────────────────────────────────────── */

/* ── SHARED HERO ── */
.blog-hero {
  padding: clamp(60px,10vw,120px) 0 clamp(36px,6vw,72px);
  border-bottom: 1px solid var(--border);
}
.blog-hero .section-label { margin-bottom: 16px; }
.blog-hero h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(40px,6vw,72px);
  font-weight: 400; line-height: 1.05;
  letter-spacing: -0.02em; color: var(--text);
  max-width: 760px; margin-bottom: 18px;
}
.blog-hero h1 em { font-style: italic; color: var(--accent); }
.blog-hero p {
  font-size: clamp(16px,1.8vw,18px);
  color: var(--text-2); line-height: 1.7;
  max-width: 560px;
}

/* ── LISTING GRID ── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: clamp(48px,7vw,88px) 0 clamp(24px,4vw,40px);
}
@media(max-width:640px){ .blog-grid { grid-template-columns: 1fr; gap: 20px; } }

/* Card: reuses the site's image-top card pattern (see .prob-card) */
.blog-card {
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03), 0 4px 16px rgba(0,0,0,0.04);
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
/* Same halo as the home .prob-card hover, no vertical shift */
.blog-card:hover {
  border-color: var(--border-hi);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.07);
}

.blog-card-img {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg-2);
  overflow: hidden; flex-shrink: 0;
}
.blog-card-img img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform .4s ease;
}
.blog-card:hover .blog-card-img img { transform: scale(1.03); }

.blog-card-body {
  display: flex; flex-direction: column;
  gap: 10px; padding: 22px 24px 24px;
  flex: 1;
}
.blog-card-cat {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
}
.blog-card-title {
  font-size: 19px; font-weight: 500;
  letter-spacing: -0.015em; line-height: 1.3;
  color: var(--text);
}
.blog-card-excerpt {
  font-size: 14px; color: var(--text-2); line-height: 1.65;
}
.blog-card-meta {
  margin-top: auto; padding-top: 6px;
  display: flex; align-items: center; gap: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: .02em; color: var(--text-3);
}
.blog-card-read { color: var(--text-3); }

/* Load more */
.blog-loadmore {
  display: flex; justify-content: center;
  padding: 24px 0 clamp(48px,7vw,88px);
}
.blog-loadmore[hidden] { display: none; }

.blog-empty {
  padding: 40px 0 clamp(48px,7vw,88px);
  font-size: 15px; color: var(--text-2);
}
.blog-empty a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* ── ARTICLE ── */
.article-hero {
  padding: clamp(56px,9vw,104px) 0 clamp(28px,4vw,44px);
}
.article-back {
  display: flex; width: fit-content;
  align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2);
  text-decoration: none; margin-bottom: 28px;
  transition: color .15s;
}
.article-back:hover { color: var(--text); }
.article-hero .article-cat {
  display: inline-block;
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 16px;
}
.article-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(34px,5vw,60px);
  font-weight: 400; line-height: 1.06;
  letter-spacing: -0.02em; color: var(--text);
  max-width: 800px; margin-bottom: 20px;
}
.article-title em { font-style: italic; color: var(--accent); }
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 12px; letter-spacing: .02em; color: var(--text-3);
}
.article-meta .article-author { color: var(--text-2); }
.article-meta-sep { color: var(--text-3); }
.article-read { color: var(--text-3); }

.article-cover {
  width: 100%; aspect-ratio: 16/8;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  margin-bottom: clamp(40px,6vw,72px);
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Reading column */
.article-body {
  max-width: 680px;
  padding-bottom: clamp(48px,7vw,88px);
}
.article-body > *:first-child { margin-top: 0; }

.article-body p {
  font-size: 16px; color: var(--text-2);
  line-height: 1.8; margin-bottom: 22px;
}
.article-body .article-lead {
  font-size: clamp(17px,2vw,20px);
  color: var(--text); line-height: 1.6;
  margin-bottom: 32px;
}
.article-body h2 {
  font-size: clamp(22px,2.6vw,28px);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.2;
  color: var(--text);
  margin: 48px 0 16px;
}
.article-body h3 {
  font-size: clamp(17px,2vw,20px);
  font-weight: 500; letter-spacing: -0.01em; line-height: 1.3;
  color: var(--text);
  margin: 36px 0 12px;
}
.article-body a {
  color: var(--accent); text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(232,82,10,0.3);
  transition: text-decoration-color .15s;
}
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body em { font-style: italic; }

.article-body ul, .article-body ol {
  margin: 20px 0 24px; padding-left: 0;
  display: flex; flex-direction: column; gap: 10px;
  list-style: none;
}
.article-body li {
  font-size: 16px; color: var(--text-2); line-height: 1.7;
  padding-left: 26px; position: relative;
}
.article-body ul li::before {
  content: ''; position: absolute; left: 4px; top: 10px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}
.article-body ol { counter-reset: item; }
.article-body ol li { counter-increment: item; }
.article-body ol li::before {
  content: counter(item);
  position: absolute; left: 0; top: 0;
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--accent);
  line-height: 1.9;
}

.article-body blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(22px,3vw,30px);
  font-style: italic; line-height: 1.35;
  letter-spacing: -0.01em; color: var(--text);
}
.article-body blockquote p { font: inherit; color: inherit; margin: 0; }
.article-body blockquote cite {
  display: block; margin-top: 12px;
  font-family: 'DM Mono', monospace;
  font-size: 12px; font-style: normal; letter-spacing: .02em;
  color: var(--text-3);
}

.article-body :not(pre) > code {
  font-family: 'DM Mono', monospace;
  font-size: 13px; color: var(--text);
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 5px;
}
.article-body pre {
  margin: 24px 0;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.article-body pre code {
  font-family: 'DM Mono', monospace;
  font-size: 13px; line-height: 1.7; color: var(--text-2);
  white-space: pre;
}

.article-body figure { margin: 32px 0; }
.article-body figure img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg-2);
}
.article-body figcaption {
  margin-top: 10px;
  font-size: 12px; color: var(--text-3); line-height: 1.5;
  text-align: center;
}

.article-body .table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 24px 0;
}
.article-body table {
  width: 100%; min-width: 440px;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden;
}
.article-body thead th {
  padding: 11px 16px; text-align: left;
  font-family: 'DM Mono', monospace;
  font-size: 11px; font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-3);
  background: var(--bg-1);
}
.article-body tbody td {
  padding: 12px 16px; font-size: 14px;
  color: var(--text-2); line-height: 1.6;
  border-top: 1px solid var(--border);
}

.article-body hr {
  border: none; height: 1px;
  background: var(--border);
  margin: 48px 0;
}

/* Author block */
.article-author-card {
  display: flex; align-items: flex-start; gap: 16px;
  max-width: 680px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  margin: clamp(24px,4vw,40px) 0;
}
.article-author-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px; color: var(--accent);
}
.article-author-label {
  font-size: 10px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3);
  margin-bottom: 6px;
}
.article-author-name { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.article-author-bio { font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* End-of-article navigation + related */
.article-more {
  border-top: 1px solid var(--border);
  padding: clamp(48px,7vw,80px) 0;
}
.article-more-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.article-more-head h2 {
  font-size: clamp(20px,2.4vw,26px);
  font-weight: 500; letter-spacing: -0.02em; color: var(--text);
}
.article-more-link {
  font-size: 13px; color: var(--accent);
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: rgba(232,82,10,0.3);
  transition: text-decoration-color .15s;
}
.article-more-link:hover { text-decoration-color: var(--accent); }
.article-more-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 24px;
}
@media(max-width:640px){ .article-more-grid { grid-template-columns: 1fr; } }
