/* ============================================================
   vlnmurthy.tech/blog/ — long-form content styles.
   Layered on top of styles.css (which provides resets + tokens).
   Optimised for: reading speed, scroll depth, no CLS, AEO citation
   eligibility. Each post is its own static HTML page.
   ============================================================ */

:root {
  --blog-bg: #fafafa;
  --blog-fg: #1e1e1e;
  --blog-muted: #6a6a6a;
  --blog-border: rgba(0, 0, 0, 0.08);
  --blog-accent: var(--accent, #d24a3d);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body.blog {
  margin: 0;
  color: var(--blog-fg);
  background: var(--blog-bg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern", "liga";
}

a { color: inherit; text-decoration: none; }
img, picture, video, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; background: transparent; border: 0; color: inherit; }
ul, ol { padding-left: 1.4em; margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }

/* ── Top nav — small fixed bar with the brand back-link. */
.blog-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 250, 250, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--blog-border);
}
.blog-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(64rem, 100%);
  margin: 0 auto;
  padding: 0.75rem clamp(1rem, 5vw, 2rem);
}
.blog-nav__brand {
  font-family: "Arial Black", Impact, Inter, sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.blog-nav__brand span { color: var(--blog-accent); }
.blog-nav__links {
  display: flex;
  gap: 1.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blog-muted);
}
.blog-nav__links a:hover { color: var(--blog-accent); }
@media (max-width: 540px) { .blog-nav__links a:not(:last-child) { display: none; } }

/* ── Article container. */
.blog-wrap {
  width: min(46rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(3rem, 8vw, 5rem);
}

/* Index (blog landing) hero. */
.blog-index__hero {
  width: min(56rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem);
}
.blog-index__hero p.kicker {
  margin: 0 0 1rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--blog-accent);
}
.blog-index__hero h1 {
  margin: 0;
  font-family: "Arial Black", Impact, Inter, sans-serif;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 900;
  text-transform: uppercase;
  max-width: 22ch;
}
.blog-index__hero p.lede {
  margin: 1.2rem 0 0;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.55;
  color: #333;
  max-width: 38rem;
}

/* Post cards grid on the blog index. */
.blog-grid {
  width: min(56rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 clamp(3rem, 8vw, 5rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 720px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
.post-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.4rem 1.5rem 1.5rem;
  border: 1px solid var(--blog-border);
  border-radius: 16px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 1rem 2.5rem -0.6rem rgba(0, 0, 0, 0.1);
  border-color: rgba(210, 74, 61, 0.45);
}
.post-card__tag {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--blog-accent);
}
.post-card__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--blog-fg);
}
.post-card__hook {
  margin: 0;
  font-size: 0.92rem;
  color: #444;
  line-height: 1.5;
}
.post-card__meta {
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.74rem;
  color: var(--blog-muted);
  display: flex;
  gap: 0.6rem;
}

/* ── Post hero. */
.post-hero { margin: 0 0 1.8rem; }
.post-hero__breadcrumbs {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--blog-muted);
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.post-hero__breadcrumbs a:hover { color: var(--blog-accent); }
.post-hero__breadcrumbs .sep { opacity: 0.5; }
.post-hero h1 {
  margin: 0;
  font-family: "Arial Black", Impact, Inter, sans-serif;
  font-size: clamp(2rem, 5vw, 2.85rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
  font-weight: 900;
  text-transform: uppercase;
}
.post-hero__hook {
  margin: 1rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.18rem);
  line-height: 1.55;
  color: #333;
}
.post-hero__meta {
  margin: 1.6rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--blog-border);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.78rem;
  color: var(--blog-muted);
  flex-wrap: wrap;
}
.post-hero__meta strong { color: var(--blog-fg); font-weight: 800; }

/* ── Post body. */
.post-body { font-size: 1.04rem; line-height: 1.72; color: #1e1e1e; }
.post-body p { margin: 0 0 1.1rem; }
.post-body h2 {
  margin: 2.4rem 0 0.7rem;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-transform: none;
}
.post-body h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 800;
  text-transform: none;
}
.post-body a {
  color: var(--blog-accent);
  font-weight: 600;
  border-bottom: 1px solid rgba(210, 74, 61, 0.3);
}
.post-body a:hover { border-bottom-color: var(--blog-accent); }
.post-body strong { font-weight: 800; color: #111; }
.post-body em { font-style: italic; color: #333; }
.post-body blockquote {
  margin: 1.6rem 0;
  padding: 0.4rem 1.2rem;
  border-left: 4px solid var(--blog-accent);
  font-style: italic;
  color: #333;
  font-size: 1.06rem;
}
.post-body ul li, .post-body ol li { margin-bottom: 0.55rem; line-height: 1.65; }
.post-body code {
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  background: #efece8;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-size: 0.92em;
}
.post-body .callout {
  margin: 1.6rem 0;
  padding: 1rem 1.2rem;
  background: rgba(210, 74, 61, 0.06);
  border-left: 3px solid var(--blog-accent);
  border-radius: 8px;
  color: #2a2a2a;
}
.post-body .callout strong { color: var(--blog-accent); }
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4rem 0;
  font-size: 0.92rem;
}
.post-body th, .post-body td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--blog-border);
  text-align: left;
  vertical-align: top;
}
.post-body th {
  background: #f0f0f0;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
}

/* ── Post FAQ accordion. */
.post-faq {
  margin: 3rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--blog-border);
}
.post-faq h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.post-faq details {
  border: 1px solid var(--blog-border);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 0.55rem;
  padding: 0.8rem 1rem 0.95rem;
}
.post-faq details[open] { border-color: rgba(210, 74, 61, 0.4); }
.post-faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.98rem;
  list-style: none;
  padding-right: 1.6rem;
  position: relative;
}
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: -0.05em;
  font-size: 1.3rem;
  color: var(--blog-accent);
  font-weight: 800;
}
.post-faq details[open] summary::after { content: "−"; }
.post-faq p {
  margin: 0.6rem 0 0;
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
}

/* ── Author + share footer. */
.post-author {
  margin: 3rem 0 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--blog-border);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.post-author__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blog-accent), #ff8a64);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  flex-shrink: 0;
}
.post-author__body p { margin: 0; }
.post-author__name {
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 0.15rem !important;
}
.post-author__role {
  font-size: 0.84rem;
  color: var(--blog-muted);
  margin-bottom: 0.5rem !important;
}
.post-author__link {
  color: var(--blog-accent);
  font-weight: 700;
  font-size: 0.86rem;
}

/* ── CTA at end of post. */
.post-cta {
  margin: 2.4rem 0 0;
  padding: 1.6rem 1.8rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
  color: #fff;
  text-align: center;
}
.post-cta h3 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.post-cta p { margin: 0 0 1rem; font-size: 0.94rem; color: rgba(255,255,255,0.78); }
.post-cta__btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--blog-accent);
  color: #fff !important;
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 0;
}
.post-cta__btn:hover { background: #ff7a55; }

/* ── Related posts. */
.post-related {
  margin: 3rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--blog-border);
}
.post-related h3 {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--blog-muted);
}
.post-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}
@media (min-width: 640px) { .post-related__grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Footer. */
.blog-footer {
  border-top: 1px solid var(--blog-border);
  background: #f0f0f0;
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--blog-muted);
}
.blog-footer a { color: var(--blog-accent); font-weight: 700; }
