/* ============================================================
   Blog page — specific styles
   Extends styles.css + features.css
   ============================================================ */

/* ── Search ──────────────────────────────────────────────────── */
.blog-search-wrap {
  position: relative;
  max-width: 420px;
  margin: 32px auto 0;
}

.blog-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

.blog-search {
  width: 100%;
  padding: 10px 14px 10px 40px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.blog-search::placeholder {
  color: var(--text-3);
}

.blog-search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
}

.blog-no-results {
  font-size: 14px;
  color: var(--text-3);
  padding: 48px 0;
  text-align: center;
}

/* ── Featured post ───────────────────────────────────────────── */
.blog-post-featured {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  margin-bottom: 32px;
  text-decoration: none;
  transition: border-color 0.18s, background 0.18s;
}

.blog-post-featured:hover {
  border-color: rgba(0, 212, 126, 0.25);
  background: linear-gradient(160deg, rgba(0,212,126,0.04) 0%, var(--surface) 60%);
}

.blog-post-featured-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.blog-post-featured-title {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-1);
  margin-bottom: 14px;
}

.blog-post-featured-excerpt {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.75;
  max-width: 800px;
  margin-bottom: 20px;
}

.blog-post-featured-footer {
  display: flex;
  align-items: center;
  gap: 16px;
}

.blog-read-more {
  font-size: 14px;
  font-weight: 500;
  color: var(--brand);
}

/* ── Post grid ───────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.blog-card:hover {
  border-color: rgba(0, 212, 126, 0.2);
  background: rgba(255,255,255,0.02);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.blog-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.45;
  flex: 1;
}

.blog-card-excerpt {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
  flex: 1;
}

/* ── Shared ──────────────────────────────────────────────────── */
.blog-tag {
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-dim);
  padding: 2px 8px;
  border-radius: 100px;
}

.blog-date {
  font-size: 12px;
  color: var(--text-3);
}

.blog-read-time {
  font-size: 12px;
  color: var(--text-3);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .blog-post-featured { padding: 24px; }
  .blog-grid { grid-template-columns: 1fr; }
}

/* ── Article page ─────────────────────────────────────────────── */
.blog-article-wrap {
  max-width: var(--container, 1160px);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 60px) 24px 80px;
}

.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.15s;
}
.blog-back:hover { color: var(--text-1); }

.blog-article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.blog-article-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text-1);
  margin-bottom: 20px;
}

.blog-article-lede {
  font-size: 18px;
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.blog-article-body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-2);
}

.blog-article-body h2 {
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  margin: 48px 0 16px;
}

.blog-article-body h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
  margin: 32px 0 12px;
}

.blog-article-body p { margin-bottom: 24px; }

.blog-article-body a { color: var(--brand); text-decoration: none; }
.blog-article-body a:hover { text-decoration: underline; }

.blog-article-body strong { color: var(--text-1); font-weight: 600; }

.blog-article-body ul, .blog-article-body ol {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.blog-article-body ul li {
  /* 28px matches the ol indent. The em dash glyph is ~16px wide, so a 20px
     indent left only 4px of gap and bold-leading items sat against the dash. */
  padding-left: 28px;
  position: relative;
  color: var(--text-2);
}
.blog-article-body ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

.blog-article-body ol {
  counter-reset: ol-counter;
}
.blog-article-body ol li {
  padding-left: 28px;
  position: relative;
  counter-increment: ol-counter;
}
.blog-article-body ol li::before {
  content: counter(ol-counter) '.';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 600;
  font-size: 13px;
}

.blog-article-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-1);
}

.blog-article-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 24px;
}
.blog-article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.7;
}

.blog-article-callout {
  background: var(--brand-dim);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--text-2);
}

.blog-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 28px;
  font-size: 14px;
}
.blog-article-body table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-2);
}
.blog-article-body table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.blog-article-body table tr:last-child td { border-bottom: none; }

.blog-article-end {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.blog-article-end h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 20px;
}

.blog-more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .blog-article-wrap { padding-top: calc(var(--nav-h) + 32px); }
  .blog-article-lede { font-size: 16px; }
  .blog-more-grid { grid-template-columns: 1fr; }
}
