/**
 * Single Blog Post — Editorial Layout
 */

.single-post-body { background: var(--color-bg-white); }
.single-post-body img { border-radius: 0; }

/* ================================================
   1. POST HEADER
   ================================================ */
.post-header {
  background: var(--color-bg-white);
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--color-border);
}

.post-header .breadcrumbs {
  color: var(--color-text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
}
.post-header .breadcrumbs a { color: var(--color-text-secondary); transition: color .2s; }
.post-header .breadcrumbs a:hover { color: var(--color-primary); }
.post-header .breadcrumbs span { color: var(--color-text-primary); font-weight: 500; }
.post-header .breadcrumbs svg { color: var(--color-border); width: 14px; height: 14px; }

.post-header__inner {
  max-width: 820px;
}

.post-cats {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.post-cat {
  display: inline-flex; align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--color-border);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  background: var(--color-bg-white);
  transition: all .2s;
  text-decoration: none;
}
.post-cat:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.post-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.1;
  letter-spacing: -.02em;
  margin: 0 0 20px;
  text-wrap: balance;
  max-width: 22ch;
}

.post-deck {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.125rem, 1.5vw, 1.25rem);
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.5;
  letter-spacing: -.005em;
  margin: 0 0 32px;
  text-wrap: pretty;
  max-width: 60ch;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.byline-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.byline-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  color: var(--color-text-primary);
}
.byline-dot {
  color: var(--color-text-muted);
  user-select: none;
}
.byline-item {
  font-variant-numeric: tabular-nums;
}

/* ================================================
   2. BODY (hero + text in same column, sidebar at same level)
   ================================================ */
.post-body {
  padding: 40px 0 80px;
  background: var(--color-bg-white);
}

.post-hero-figure {
  margin: 0 0 32px;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-dark);
  aspect-ratio: 16/9;
  box-shadow: var(--shadow-md);
}
.post-hero-figure img,
.post-hero-figure .post-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  display: block;
  position: absolute;
  inset: 0;
}
.post-hero-caption {
  position: absolute;
  bottom: 16px; left: 16px;
  padding: 8px 14px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary);
  box-shadow: var(--shadow-sm);
  margin: 0;
}
.post-body__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
@media (min-width: 1024px) {
  .post-body__grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 80px;
    align-items: start;
  }
}
.post-body__main { max-width: 740px; }

.post-prose { color: var(--color-text-secondary); }
.post-prose p,
.post-prose ul,
.post-prose ol {
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 24px;
}
.post-prose h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -.015em;
  line-height: 1.2;
  margin: 48px 0 16px;
}
.post-prose h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 40px 0 14px;
  letter-spacing: -.01em;
}
.post-prose h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 32px 0 12px;
}
.post-prose strong { color: var(--color-text-primary); font-weight: 600; }
.post-prose a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 3px; }
.post-prose a:hover { color: var(--color-primary-dark); }
.post-prose ul, .post-prose ol { padding-left: 1.25em; }
.post-prose ul li, .post-prose ol li { margin-bottom: 8px; }
.post-prose blockquote {
  margin: 32px 0;
  padding: 20px 28px;
  background: var(--color-bg-light);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.125rem;
  font-style: normal;
  color: var(--color-text-primary);
  line-height: 1.5;
  font-weight: 500;
}
.post-prose blockquote p:last-child { margin-bottom: 0; }
.post-prose img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 32px 0;
}
.post-prose pre {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  padding: 20px 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  margin: 24px 0;
}
.post-prose code {
  background: var(--color-bg-light);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .875em;
  font-family: 'SF Mono', Consolas, Menlo, monospace;
}
.post-prose pre code { background: none; padding: 0; color: inherit; }
.post-prose hr {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin: 48px 0;
}

.post-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}
.post-tags__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-right: 4px;
}
.post-tag {
  display: inline-flex;
  padding: 4px 10px;
  font-size: 13px;
  color: var(--color-text-secondary);
  background: var(--color-bg-light);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all .2s;
}
.post-tag:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.post-nav {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}
@media (min-width: 640px) {
  .post-nav { grid-template-columns: 1fr 1fr; gap: 16px; }
}
.post-nav__link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all .2s;
  background: var(--color-bg-white);
}
.post-nav__link:hover {
  border-color: var(--color-text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.post-nav__link--next { text-align: right; }
.post-nav__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.post-nav__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-primary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sidebar */
.post-body__aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (min-width: 1024px) {
  .post-body__aside {
    position: sticky;
    top: 90px;
  }
}
.post-body__aside .aside-card {
  background: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.post-body__aside .aside-card__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 16px;
}

.recent-posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.recent-post { display: flex; gap: 12px; }
.recent-post__img {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg-light);
}
.recent-post__img img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.recent-post__meta { display: flex; flex-direction: column; gap: 4px; justify-content: center; min-width: 0; }
.recent-post__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color .2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-post__title:hover { color: var(--color-primary); }
.recent-post__date { font-size: 12px; color: var(--color-text-muted); }

.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--color-border);
}
.cat-list li:last-child { border-bottom: none; }
.cat-list a {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color .2s;
}
.cat-list a:hover { color: var(--color-primary); }

.post-body__aside .aside-cta {
  background: var(--color-text-primary);
  color: var(--color-text-on-dark);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.post-body__aside .aside-cta::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(220,38,38,.25) 0%, transparent 70%);
  pointer-events: none;
}
.post-body__aside .aside-cta__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--color-text-on-dark);
}
.post-body__aside .aside-cta__text {
  font-size: 14px;
  color: rgba(255,255,255,.7);
  margin: 0 0 16px;
  line-height: 1.5;
}
.btn--full { width: 100%; justify-content: center; }

/* ================================================
   4. RELATED POSTS
   ================================================ */
.post-related {
  padding: 64px 0 96px;
  background: var(--color-bg-light);
  border-top: 1px solid var(--color-border);
}
.post-related__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.post-related__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--color-text-primary);
  letter-spacing: -.02em;
  margin: 0;
}
.post-related__all {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}
.post-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 640px) { .post-related__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .post-related__grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

/* Responsive */
@media (max-width: 640px) {
  .post-header { padding: 20px 0 28px; }
  .post-body { padding: 32px 0 56px; }
  .post-related { padding: 48px 0 72px; }
  .post-byline { font-size: 13px; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .post-nav__link:hover { transform: none; }
}

@media print {
  .post-body__aside, .post-related, .post-nav { display: none; }
  .post-hero-full { padding: 0; margin-bottom: 16px; }
}
