/* Single Post — article header, reading progress, prose, share, author box, related, comments */

/* ============================================
   Reading Progress Bar
   ============================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}
.reading-progress-bar {
  height: 100%;
  background: var(--color-accent);
  width: var(--progress, 0%);
  transition: width 0.05s linear;
}

/* ============================================
   Article Header
   ============================================ */
.article-header {
  padding-block: var(--space-16) var(--space-12);
}
.article-header-inner {
  max-width: var(--container-prose);
  margin-inline: auto;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb-sep { opacity: 0.5; }

.article-category {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  background: var(--color-accent-soft);
  border-radius: 999px;
  margin-bottom: var(--space-6);
}

.article-title {
  font-size: var(--text-display);
  margin-bottom: var(--space-6);
  letter-spacing: -0.025em;
}
.article-deck {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: 1.55;
  max-width: 60ch;
  margin-bottom: var(--space-10);
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-block: 1px solid var(--color-border);
}
.author-mini {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.author-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}
.meta-divider {
  width: 1px;
  height: 24px;
  background: var(--color-border);
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.meta-item svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ============================================
   Featured Image
   ============================================ */
.article-featured {
  margin-block: var(--space-12) var(--space-16);
}
.article-featured-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.featured-image {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--color-accent-soft) 0%, var(--color-bg-alt) 100%);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.featured-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 25% 30%, rgba(232, 100, 42, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 75% 70%, rgba(232, 100, 42, 0.12) 0%, transparent 40%);
}
.featured-caption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
}

/* ============================================
   Article Body — the prose engine
   ============================================ */
.article-body-wrap {
  position: relative;
  padding-bottom: var(--space-24);
}
.article-body-grid {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
}
@media (min-width: 1100px) {
  .article-body-grid {
    grid-template-columns: 220px 1fr 60px;
    gap: var(--space-16);
    align-items: start;
  }
  /* If the post has no H2s, JS adds .has-no-toc — switch to 2-column
     (prose + share rail) so the article is centered, not pushed right. */
  .article-body-grid.has-no-toc {
    grid-template-columns: 1fr 60px;
    max-width: calc(var(--container-prose, 760px) + 60px + var(--space-16));
  }
}

/* ToC Sidebar (desktop only) */
.article-toc {
  display: none;
}
@media (min-width: 1100px) {
  .article-toc {
    display: block;
    position: sticky;
    top: calc(var(--header-h) + var(--space-8));
    align-self: start;
  }
}
.article-toc-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.article-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-left: 1px solid var(--color-border);
}
.article-toc a {
  display: block;
  padding: var(--space-2) var(--space-4);
  margin-left: -1px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-left: 2px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
  line-height: 1.4;
}
.article-toc a:hover { color: var(--color-text); }
.article-toc a.is-active {
  color: var(--color-accent);
  border-left-color: var(--color-accent);
}

/* Share rail (desktop only) */
.article-share-rail {
  display: none;
}
@media (min-width: 1100px) {
  .article-share-rail {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    position: sticky;
    top: calc(var(--header-h) + var(--space-8));
    align-self: start;
  }
}
.article-share-rail-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-inline: auto;
}
.share-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.share-btn:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}
.share-btn svg { width: 18px; height: 18px; }

/* The Prose itself */
.prose {
  max-width: var(--container-prose);
  width: 100%;
  margin-inline: auto;
  font-size: var(--text-prose);
  line-height: 1.75;
  color: var(--color-text);
}
.prose > * + * { margin-top: 1.4em; }
.prose p {
  /* Hanging punctuation feel: comfortable reading */
}
.prose .lead {
  font-size: 1.15em;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.prose h2 {
  font-size: var(--text-2xl);
  margin-top: 2em;
  margin-bottom: 0.6em;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.prose h3 {
  font-size: var(--text-xl);
  margin-top: 1.6em;
  margin-bottom: 0.5em;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.prose h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1em;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 1.6em;
  margin-bottom: 0.5em;
}

.prose a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-text-link, var(--color-accent));
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease);
}
.prose a:hover {
  color: var(--color-text-link-hover, var(--color-accent-hover));
}

.prose strong { font-weight: 600; color: var(--color-text); }
.prose em { font-style: italic; }

.prose mark {
  background: var(--color-mark);
  color: var(--color-text);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

.prose ul, .prose ol {
  padding-left: 1.5em;
}
.prose li {
  margin-top: 0.5em;
}
.prose li::marker { color: var(--color-accent); }

.prose blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5em 0 0.5em 1.5em;
  margin: 1.5em 0;
  font-family: var(--font-display);
  font-size: 1.2em;
  font-style: italic;
  color: var(--color-text);
  line-height: 1.5;
}
.prose blockquote cite {
  display: block;
  margin-top: 0.6em;
  font-family: var(--font-sans);
  font-size: 0.85em;
  font-style: normal;
  color: var(--color-text-muted);
}
.prose blockquote cite::before { content: '— '; }

.prose .pull-quote {
  border: 0;
  padding: 0;
  margin: 2em 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  font-style: normal;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--color-text);
  position: relative;
}
.prose .pull-quote::before,
.prose .pull-quote::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--color-accent);
  margin: 0.6em auto;
}

/* Inline code */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-alt);
  color: var(--color-accent-text);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

/* Code block */
.prose pre {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  padding: var(--space-6);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875em;
  line-height: 1.65;
  margin: 1.5em 0;
}
.prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Inline figure / image */
.prose figure {
  margin: 1.8em 0;
}
.prose figure img,
.prose .figure-placeholder {
  width: 100%;
  border-radius: var(--radius);
  background: var(--color-bg-alt);
  aspect-ratio: 16/9;
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}
.prose .figure-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-accent-soft) 0%, transparent 100%);
}
.prose figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
}

/* Wide / Full-width images break out of prose width */
.prose .figure-wide {
  margin-inline: calc(-1 * (50vw - var(--container-prose) / 2 - var(--space-6)));
  max-width: calc(var(--container-prose) + 200px);
}
@media (max-width: 1100px) {
  .prose .figure-wide { margin-inline: 0; max-width: 100%; }
}

/* Callout box */
.prose .callout {
  background: var(--color-accent-soft);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius);
  margin: 1.8em 0;
}
.prose .callout-title {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.prose .callout p {
  margin-top: 0;
  color: var(--color-text);
  font-size: 0.95em;
  line-height: 1.65;
}
.prose .callout p + p { margin-top: 0.8em; }

/* HR */
.prose hr {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin: 3em auto;
  width: 60%;
}

/* Table */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95em;
}
.prose th, .prose td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.prose th {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85em;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: var(--color-bg-alt);
}

/* ============================================
   Inline Share (Mobile)
   ============================================ */
.article-share-inline {
  max-width: var(--container-prose);
  margin: var(--space-16) auto var(--space-8);
  padding: var(--space-6);
  border-block: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.article-share-inline-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}
.article-share-inline-list {
  display: flex;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
}
@media (min-width: 1100px) {
  .article-share-inline { display: none; }
}

/* ============================================
   Author Box (full, after article)
   ============================================ */
.author-box {
  max-width: var(--container-prose);
  margin: var(--space-16) auto var(--space-8);
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 600px) {
  .author-box {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
}
.author-box-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.author-box-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}
.author-box-role {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.author-box-bio {
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}
.author-box-social {
  display: flex;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
@media (max-width: 600px) {
  .author-box-social { justify-content: center; }
}
.author-box-social-link {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.author-box-social-link:hover {
  background: var(--color-accent);
  color: #fff;
}
.author-box-social-link svg {
  width: 14px;
  height: 14px;
}

/* ============================================
   Related Posts
   ============================================ */
.related-section {
  background: var(--color-bg-alt);
  padding-block: var(--space-24);
  margin-top: var(--space-16);
}
.related-header {
  max-width: var(--container);
  margin: 0 auto var(--space-12);
  padding-inline: var(--space-6);
}
.related-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}
.related-title {
  font-size: var(--text-2xl);
}
.related-grid {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
@media (max-width: 960px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .related-grid { grid-template-columns: 1fr; }
}
.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s var(--ease);
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); }
.post-thumb {
  aspect-ratio: 16/10;
  background: var(--color-bg-alt);
  position: relative;
  overflow: hidden;
  display: block;
}
.post-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-accent-soft) 0%, transparent 100%);
}
.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.post-tag { color: var(--color-accent); font-weight: 500; }
.post-body {
  padding: var(--space-6) var(--space-6) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}
.post-body h3 {
  font-size: var(--text-xl);
  line-height: 1.25;
}
.post-body p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ============================================
   Comments stub
   ============================================ */
.comments-section {
  max-width: var(--container-prose);
  margin: var(--space-16) auto;
  padding-inline: var(--space-6);
}
.comments-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.comments-title {
  font-size: var(--text-xl);
}
.comments-count {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.comment-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 600px) {
  .comment-form-row { grid-template-columns: 1fr; }
}
.comment-form input,
.comment-form textarea {
  padding: var(--space-3) var(--space-4);
  font: inherit;
  font-size: var(--text-base);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  min-height: 44px;
  transition: border-color 0.2s var(--ease);
  font-family: inherit;
  width: 100%;
}
.comment-form textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: 0;
  border-color: var(--color-accent);
}
.comment-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-3);
}

/* Real WordPress featured image (not the placeholder) */
.article-featured-image,
.article-featured-inner img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.article-featured-caption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
}
