/* ============================================================
   Single Post — Unified Grid Layout
   ============================================================ */

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--border));
  z-index: 9999;
}
.reading-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--gradient-hero);
  transition: width 0.1s linear;
}

/* ── Outer wrapper — gradient warm background ── */
.post-wrap {
  position: relative;
  background: var(--gradient-warm);
  overflow: hidden;
  padding-bottom: 4rem;
}

/* Decorative orbs */
.post-hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  pointer-events: none;
  z-index: 0;
}
.post-hero__orb--1 {
  top: -4rem; right: -4rem;
  width: 400px; height: 400px;
  background: hsl(var(--primary) / 0.08);
}
.post-hero__orb--2 {
  bottom: 10rem; left: -4rem;
  width: 300px; height: 300px;
  background: hsl(var(--accent) / 0.08);
}

/* ── ONE outer grid — sidebar spans full height ── */
.post-outer-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
  padding-top: 3rem;
}

/* ── Left column ── */
.post-left {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Push sidebar top down to align with H1
   breadcrumb (~1.5rem) + cats (~2rem) + gap (2rem) = ~5.5rem */
.post-sidebar {
  padding-top: 5.5rem;
}

/* Breadcrumb */
.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  flex-wrap: wrap;
}
.post-breadcrumb a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s;
}
.post-breadcrumb a:hover { color: hsl(var(--primary)); }
.post-breadcrumb svg { flex-shrink: 0; opacity: 0.5; }

/* Category badges */
.post-hero__cats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* H1 */
.post-hero__h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: hsl(var(--foreground));
  margin: 0;
  text-align: left;
}

/* Meta row */
.post-hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}
.post-hero__author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.post-hero__author-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: hsl(var(--foreground));
  display: block;
}
.post-hero__author-role {
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  display: block;
}
.post-hero__meta-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
}

/* Featured image — full width of left column */
.post-featured-img { margin: 0; }
.post-featured-img__img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow-xl);
  display: block;
}

/* ── Article content ── */
.post-content { min-width: 0; }

.post-content__inner {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: hsl(var(--foreground));
  text-align: left;
}
.post-content__inner h2,
.post-content__inner h3,
.post-content__inner h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem;
  color: hsl(var(--foreground));
  scroll-margin-top: 5rem;
  text-align: left;
}
.post-content__inner h2 { font-size: 1.75rem; }
.post-content__inner h3 { font-size: 1.375rem; }
.post-content__inner h4 { font-size: 1.125rem; }
.post-content__inner p  { margin-bottom: 1.5rem; text-align: left; }
.post-content__inner a  { color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 3px; }
.post-content__inner ul,
.post-content__inner ol { padding-left: 1.5rem; margin-bottom: 1.5rem; text-align: left; }
.post-content__inner li { margin-bottom: 0.5rem; }
.post-content__inner blockquote {
  border-left: 4px solid hsl(var(--primary));
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: hsl(var(--primary) / 0.05);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}
.post-content__inner img {
  width: 100%;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}
.post-content__inner code {
  background: hsl(var(--secondary));
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
}
.post-content__inner pre {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
}

/* Tags */
.post-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
}
.post-tag {
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  padding: 0.3rem 0.875rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.post-tag:hover { background: hsl(var(--primary)); color: #fff; }

/* Share */
.post-share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.post-share__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}
.post-share__btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.post-share__btn--twitter  { background: #000; color: #fff; }
.post-share__btn--linkedin { background: #0077b5; color: #fff; }
.post-share__btn--copy     { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.post-share__btn:hover     { transform: translateY(-2px); opacity: 0.85; }

/* Author Bio */
.post-author-bio {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: hsl(var(--secondary) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 8px);
  padding: 1.75rem;
}
.post-author-bio__text { flex: 1; }
.post-author-bio__name { font-weight: 700; font-size: 1rem; color: hsl(var(--foreground)); margin: 0 0 0.25rem; }
.post-author-bio__role { font-size: 0.8rem; color: hsl(var(--primary)); font-weight: 500; margin: 0 0 0.75rem; }
.post-author-bio__desc { font-size: 0.9rem; color: hsl(var(--muted-foreground)); line-height: 1.6; margin: 0; }

/* Avatar sizes */
.blog-card__author-avatar--lg { width: 3rem; height: 3rem; font-size: 1.125rem; flex-shrink: 0; }
.blog-card__author-avatar--xl { width: 4rem; height: 4rem; font-size: 1.5rem; flex-shrink: 0; }

/* Prev/Next */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid hsl(var(--border));
}
.post-nav__prev, .post-nav__next { display: flex; flex-direction: column; gap: 0.375rem; }
.post-nav__next { text-align: right; align-items: flex-end; }
.post-nav__label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.post-nav__next .post-nav__label { justify-content: flex-end; }
.post-nav__title a {
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: color 0.2s;
  line-height: 1.4;
}
.post-nav__title a:hover { color: hsl(var(--primary)); }

/* ── RIGHT COLUMN — sticky sidebar ── */
.post-sidebar {
  align-self: start;
}

.post-sidebar__inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-sidebar__widget {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 8px);
  padding: 1.5rem;
}
.post-sidebar__widget-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 1rem;
}

/* TOC */
.post-toc__list { display: flex; flex-direction: column; gap: 0.375rem; }
.post-toc__link {
  font-size: 0.85rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  padding: 0.375rem 0.625rem;
  border-radius: calc(var(--radius) - 4px);
  border-left: 2px solid transparent;
  transition: all 0.2s;
  display: block;
  line-height: 1.4;
}
.post-toc__link:hover,
.post-toc__link.active {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.06);
  border-left-color: hsl(var(--primary));
}
.post-toc__link--h3 { padding-left: 1.25rem; font-size: 0.8rem; }

/* Demo widget */
.blog-sidebar__demo {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.06), hsl(var(--accent) / 0.06));
  border-color: hsl(var(--primary) / 0.2);
}
.blog-sidebar__demo h3 { font-size: 1rem; font-weight: 700; color: hsl(var(--foreground)); margin: 0 0 0.5rem; }
.blog-sidebar__demo p  { font-size: 0.875rem; color: hsl(var(--muted-foreground)); line-height: 1.6; margin: 0; }

/* Related Posts */
.related-posts {
  padding: 3rem 1.5rem;
  background: hsl(var(--secondary) / 0.3);
}
.related-posts__h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 2rem;
  color: hsl(var(--foreground));
}
.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 1024px) {
  .post-outer-grid { grid-template-columns: 1fr; }
  .post-sidebar { padding-top: 0; }
  .post-sidebar__inner { position: static; max-height: none; overflow-y: visible; }
  .related-posts__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-hero__meta { flex-direction: column; align-items: flex-start; }
  .related-posts__grid { grid-template-columns: 1fr; }
  .post-author-bio { flex-direction: column; }
}
