/* ===================================================================
   DH-Media — статья (post.hbs)
   =================================================================== */

/* reading progress */
.reading-progress {
  position: fixed; left: 0; top: 0; right: 0;
  height: 3px;
  background: transparent;
  z-index: 60;
  pointer-events: none;
}
.reading-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width 80ms linear;
}

/* article layout */
.article {
  padding: 48px 0 80px;
}
.article__hero {
  max-width: 1080px;
  margin: 0 auto 32px;
  padding: 0 var(--gutter);
}
.article__breadcrumbs {
  font-size: var(--type-tiny);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px;
}
.article__breadcrumbs a { color: var(--accent); }
.article__breadcrumbs .sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.4; }

.article__title {
  font-family: var(--serif);
  font-size: var(--type-h1);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--text-strong);
  margin: 0 0 18px;
  max-width: 24ch;
}
.article__dek {
  font-family: var(--serif);
  font-size: 1.375rem;
  line-height: 1.4;
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 0 28px;
}
.article__meta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: var(--type-small);
}
.author-chip {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-strong);
  font-weight: 600;
}
.author-chip__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft);
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 700;
  font-size: 0.875rem;
  flex: none;
}
.author-chip__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-chip__name { font-size: 0.9375rem; }
.author-chip__role { font-size: var(--type-tiny); color: var(--text-faint); font-weight: 500; }
.meta-divider { width: 4px; height: 4px; border-radius: 50%; background: var(--text-faint); opacity: 0.6; }
.meta-item { color: var(--text-muted); }
.share-row { margin-left: auto; display: flex; gap: 6px; }

.feature-image {
  width: 100%;
  max-height: 560px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 32px 0 0;
  background: var(--bg-muted);
  box-shadow: var(--shadow-1);
}
.feature-image img { width: 100%; max-height: 560px; object-fit: cover; }
.feature-image__caption {
  text-align: center;
  font-size: var(--type-small);
  color: var(--text-faint);
  margin-top: 12px;
  padding: 0 var(--gutter);
}

/* body + sidebar layout */
.article__layout {
  display: grid;
  grid-template-columns: minmax(0, var(--reading-max)) 260px;
  gap: 56px;
  max-width: calc(var(--reading-max) + 260px + 56px + 2 * var(--gutter));
  margin: 56px auto 0;
  padding: 0 var(--gutter);
}
@media (max-width: 960px) {
  .article__layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .toc-wrapper { display: none; }
}

/* article body — typographic */
.prose {
  font-family: var(--serif);
  font-size: var(--type-body-lg);
  line-height: 1.7;
  color: var(--text);
  letter-spacing: -0.003em;
}
.prose > * + * { margin-top: 1.2em; }
.prose p { margin: 0; }
.prose p + p { margin-top: 1.2em; }
.prose strong { color: var(--text-strong); font-weight: 700; }
.prose em { color: var(--text-strong); }
.prose a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--easing);
}
.prose a:hover { color: var(--accent); }

.prose h2 {
  font-family: var(--serif);
  font-size: var(--type-h2);
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--text-strong);
  margin: 2.2em 0 0.6em;
  font-weight: 700;
  scroll-margin-top: 100px;
}
.prose h3 {
  font-family: var(--serif);
  font-size: var(--type-h3);
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text-strong);
  margin: 1.8em 0 0.4em;
  font-weight: 700;
  scroll-margin-top: 100px;
}
.prose h4 {
  font-family: var(--sans);
  font-size: 1.0625rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--accent);
  margin: 2em 0 0.4em;
  font-weight: 700;
}

.prose blockquote {
  margin: 1.8em 0;
  padding: 0 0 0 24px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.4;
  color: var(--text-strong);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.prose blockquote p { margin: 0; }
.prose blockquote cite, .prose blockquote footer {
  display: block;
  margin-top: 12px;
  font-size: var(--type-small);
  color: var(--text-muted);
  font-family: var(--sans);
  font-style: normal;
  font-weight: 500;
}

.prose ul, .prose ol {
  margin: 1.2em 0;
  padding-left: 1.4em;
}
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--accent); }

.prose img, .prose figure {
  border-radius: var(--radius-md);
  overflow: hidden;
}
.prose figure { margin: 2em 0; }
.prose figcaption {
  text-align: center;
  font-size: var(--type-small);
  color: var(--text-faint);
  margin-top: 10px;
  font-family: var(--sans);
}

.prose pre {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  overflow-x: auto;
  font-size: 0.9375rem;
  line-height: 1.55;
}
.prose code {
  font-family: var(--mono);
  font-size: 0.95em;
  background: var(--bg-muted);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
}
.prose pre code { background: none; padding: 0; }

.prose hr { margin: 3em 0; border: 0; border-top: 1px solid var(--border); }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.9375rem;
  margin: 1.6em 0;
}
.prose th, .prose td { padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.prose thead th { background: var(--bg-muted); font-weight: 700; color: var(--text-strong); }

/* drop cap on first paragraph (subtle, optional) */
.prose > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 4em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.08em -0.1em 0;
  color: var(--accent);
  font-weight: 700;
}

/* sidebar TOC */
.toc-wrapper { position: relative; }
.toc {
  position: sticky;
  top: 96px;
  font-family: var(--sans);
}
.toc__title {
  font-size: var(--type-tiny);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.toc a {
  display: block;
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem; line-height: 1.4;
  transition: all var(--duration-fast) var(--easing);
}
.toc a:hover { color: var(--text-strong); border-color: var(--border-strong); }
.toc a.is-active { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.toc .level-3 { padding-left: 24px; font-size: 0.8125rem; }

/* read time + share at bottom */
.article__footer {
  max-width: calc(var(--reading-max) + 2 * var(--gutter));
  margin: 48px auto 0;
  padding: 0 var(--gutter);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 36px; }
.tag-row a {
  display: inline-flex; align-items: center;
  height: 30px; padding: 0 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--type-small);
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--duration-fast) var(--easing);
}
.tag-row a:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.author-block {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
}
.author-block__avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent-soft);
  overflow: hidden;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 700; font-size: 1.25rem;
}
.author-block__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-block__name { font-weight: 700; color: var(--text-strong); margin: 0 0 4px; }
.author-block__bio { font-size: 0.9375rem; color: var(--text-muted); margin: 0; }

/* related */
.related {
  background: var(--bg-muted);
  padding: 56px 0;
  border-top: 1px solid var(--border);
  margin-top: 80px;
}
.related__head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 24px;
}
.related__title {
  font-family: var(--serif);
  font-size: var(--type-h3);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.related__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
@media (max-width: 720px) { .related__grid { grid-template-columns: 1fr; gap: 24px; } }
