/* ============================================================
   BLOG — benchmark-quality styles
   Uses: CSS custom properties, reading progress, reading time,
         author bio, share buttons, dark mode, smooth scroll.
   ============================================================ */

/* Reading progress bar */
.blog-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #4D9EE3, #0F3B62);
  z-index: 200;
  width: 0%;
  transition: width 0.1s linear;
}

/* ── Page Hero ─────────────────────────────────────────── */
.blog-hero {
  background: linear-gradient(160deg, #061928 0%, #0F3B62 55%, #1a5c8a 100%);
  padding: 96px 0 80px;
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 80% 50%, rgba(77,158,227,0.12), transparent 70%);
  pointer-events: none;
}
.blog-hero .container { position: relative; z-index: 1; }
.blog-hero-eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 14px;
  font-weight: 600;
}
.blog-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 16px;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.blog-hero-lead {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.72);
  max-width: 520px;
  margin: 0;
  line-height: 1.65;
}

/* ── Blog Layout (index) ───────────────────────────────── */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 56px;
  padding: 72px 0 100px;
  align-items: start;
}

/* ── Featured Post ─────────────────────────────────────── */
.post-featured {
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-md);
  margin-bottom: 52px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-featured:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.post-featured-cover {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}
.post-featured-body { padding: 36px 40px 40px; }
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.post-meta time {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}
.post-tag {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}
.post-tag--launch { background: #0F3B62; }
.post-tag--update { background: #4D9EE3; }
.post-tag--story  { background: #2BA88E; }
.post-reading-time {
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: auto;
}
.post-featured h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 14px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.post-featured h2 a { color: inherit; }
.post-featured h2 a:hover { color: var(--accent); text-decoration: none; }
.post-excerpt {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  margin: 0 0 24px;
}
.post-author-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.post-author-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0F3B62, #4D9EE3);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.post-author-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}
.post-author-label {
  font-size: 0.75rem;
  color: var(--muted);
}
.post-featured-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.post-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: gap 0.15s ease;
}
.post-cta-link:hover { gap: 10px; text-decoration: none; color: var(--navy); }

/* ── Post List (older posts) ───────────────────────────── */
.post-list-header {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.post-list-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
.post-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
  transition: opacity 0.15s ease;
}
.post-card:hover { opacity: 0.82; }
.post-card-thumb {
  width: 200px;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  flex-shrink: 0;
  background: var(--surface-tint);
}
.post-card-body { padding: 4px 0 0; }
.post-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.post-card h3 a { color: inherit; }
.post-card h3 a:hover { color: var(--accent); text-decoration: none; }
.post-card .post-excerpt { font-size: 0.92rem; margin-bottom: 12px; }
.post-card .post-meta { margin-bottom: 0; }

/* ── Sidebar ───────────────────────────────────────────── */
.blog-sidebar { position: sticky; top: 90px; }

.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 28px 26px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.sidebar-widget h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.sidebar-widget p {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.6;
}
.sidebar-newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.sidebar-newsletter-form input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--hairline);
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-tint);
  outline: none;
  transition: border-color 0.15s;
}
.sidebar-newsletter-form input:focus { border-color: var(--accent); }
.btn-primary {
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}
.sidebar-share { display: flex; flex-direction: column; gap: 10px; }
.sidebar-share a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.sidebar-share a:hover { background: var(--surface-tint); color: var(--navy); text-decoration: none; }
.sidebar-share svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Individual Post View ──────────────────────────────── */
.post-single {
  max-width: 740px;
  margin: 0 auto;
  padding: 64px 32px 100px;
}
.post-single-header { margin-bottom: 40px; }
.post-single-header .post-meta { margin-bottom: 20px; }
.post-single h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
}
.post-single-cover {
  width: 100%;
  border-radius: 16px;
  margin: 32px 0;
  display: block;
  box-shadow: var(--shadow-md);
}
.post-body {
  color: var(--ink);
  font-size: 1.07rem;
  line-height: 1.8;
}
.post-body p { margin: 0 0 20px; }
.post-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 40px 0 14px;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.post-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--ink);
}
.post-body strong { font-weight: 700; color: var(--navy); }
.post-body a { color: var(--accent); }
.post-body a:hover { text-decoration: underline; }
.post-body blockquote {
  border-left: 4px solid var(--accent);
  margin: 28px 0;
  padding: 14px 22px;
  background: var(--surface-tint);
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: var(--muted);
}
.post-body ul, .post-body ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.post-body li { margin-bottom: 8px; }
.post-body code {
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: monospace;
}
.post-divider {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 44px 0;
}

/* Author bio */
.post-author-bio {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface-tint);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 28px 28px;
  margin-top: 48px;
}
.post-author-bio-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0F3B62, #4D9EE3);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.post-author-bio h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.post-author-bio span {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  display: block;
  margin-bottom: 10px;
}
.post-author-bio p {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.65;
}

/* Share buttons */
.post-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.post-share-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
  border: 1.5px solid var(--hairline);
  color: var(--muted);
  background: var(--surface);
}
.share-btn:hover { transform: translateY(-2px); opacity: 0.85; text-decoration: none; }
.share-btn svg { width: 16px; height: 16px; }
.share-btn--twitter:hover { color: #1DA1F2; border-color: #1DA1F2; }
.share-btn--facebook:hover { color: #1877F2; border-color: #1877F2; }
.share-btn--linkedin:hover { color: #0A66C2; border-color: #0A66C2; }
.share-btn--copy:hover { color: var(--navy); border-color: var(--navy); }

/* ── Back to Blog ──────────────────────────────────────── */
.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.15s;
}
.back-to-blog:hover { color: var(--navy); text-decoration: none; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .blog-layout { grid-template-columns: 1fr; gap: 0; }
  .blog-sidebar { position: static; margin-top: 60px; }
  .sidebar-widget { max-width: 500px; }
}
@media (max-width: 640px) {
  .blog-hero { padding: 64px 0 52px; }
  .post-featured-cover { height: 200px; }
  .post-featured-body { padding: 24px 22px 28px; }
  .post-card { grid-template-columns: 1fr; }
  .post-card-thumb { width: 100%; height: 180px; }
  .post-single { padding: 40px 20px 72px; }
  .blog-layout { padding: 48px 0 72px; }
}

/* ============================================
   POST FULL (single-page blog layout)
   ============================================ */

.post-full {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 56px 56px 48px;
  margin-bottom: 56px;
  scroll-margin-top: 100px;
}
.post-full-header {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--hairline);
}
.post-full-header .post-meta { margin-bottom: 20px; }
.post-full-header h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}
.post-full-cover {
  width: 100%;
  border-radius: 14px;
  margin: 0 0 40px;
  display: block;
  box-shadow: var(--shadow-sm);
}

.post-full .post-body {
  color: var(--ink);
  font-size: 1.07rem;
  line-height: 1.8;
}
.post-full .post-body p { margin: 0 0 20px; }
.post-full .post-body h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 36px 0 14px;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.post-full .post-body strong { font-weight: 700; color: var(--navy); }
.post-full .post-body a { color: var(--accent); }
.post-full .post-body a:hover { text-decoration: underline; }
.post-full .post-body blockquote {
  border-left: 4px solid var(--accent);
  margin: 28px 0;
  padding: 14px 22px;
  background: var(--surface-tint);
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: var(--muted);
}
.post-full .post-body em { color: var(--muted); }
.post-divider {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 44px 0;
}

/* Sidebar table-of-contents */
.sidebar-toc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-toc a {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-toc a:hover {
  background: var(--surface-tint);
  color: var(--navy);
  text-decoration: none;
  border-left-color: var(--accent);
}

@media (max-width: 768px) {
  .post-full { padding: 36px 28px 32px; margin-bottom: 40px; }
}
@media (max-width: 560px) {
  .post-full { padding: 28px 22px 28px; border-radius: 16px; }
  .post-full-cover { margin-bottom: 28px; }
}

/* Compact metrics list (0.9× regular body font) */
.post-body ul.metrics-list {
  font-size: 0.9em;
  line-height: 1.7;
  padding-left: 18px;
  margin: 0 0 20px;
}
.post-body ul.metrics-list li {
  margin-bottom: 4px;
}
