/* ===== Article Page ===== */

/* Hero */
.article-hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.article-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  transition: transform 8s ease;
}
.article-hero:hover .article-hero-bg { transform: scale(1); }
.article-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.12) 0%,
    rgba(0,0,0,.35) 40%,
    rgba(0,0,0,.82) 100%
  );
}
.article-hero-content {
  position: relative;
  z-index: 2;
  padding-top: 80px;
  padding-bottom: 48px;
  color: #fff;
  max-width: 860px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255,255,255,.65);
  margin-bottom: 16px;
}
.breadcrumb a { color: rgba(255,255,255,.65); transition: color .15s; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb span:last-child { color: rgba(255,255,255,.45); }

.article-category-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 50px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  max-width: 820px;
}

.article-lead {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: rgba(255,255,255,.85);
  max-width: 680px;
  margin: 0 0 28px;
}

.article-meta-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar-lg {
  width: 44px; height: 44px;
  font-size: 14px;
  font-weight: 700;
}
.avatar-xl {
  width: 60px; height: 60px;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.author-name {
  font-weight: 600;
  font-size: 15px;
}
.author-role {
  font-size: 13px;
  color: rgba(255,255,255,.65);
}
.article-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: rgba(255,255,255,.65);
}
.sep { opacity: .5; }

/* Layout */
.article-page { background: var(--bg); }

.article-layout {
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: 72px;
}

/* ToC */
.toc-sticky {
  position: sticky;
  top: 160px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: 119px;
}
.toc-sticky::-webkit-scrollbar { display: none; }
.toc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 14px;
}
.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}
.toc-link {
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
  line-height: 1.35;
}
.toc-link:hover { color: var(--text); background: var(--bg-soft); }
.toc-link.active { color: var(--accent); border-left-color: var(--accent); background: rgba(255,77,46,.06); font-weight: 600; }

.toc-progress {
  height: 3px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.toc-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .1s linear;
}

.toc-divider { height: 1px; background: var(--border); margin: 20px 0; }

.toc-subscribe-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.toc-subscribe-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 12px;
}
.toc-input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 13px;
  outline: none;
  margin-bottom: 7px;
  transition: border-color .15s;
  font-family: var(--font-sans);
}
.toc-input:focus { border-color: var(--accent); }
.toc-subscribe-btn {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: opacity .15s;
}
.toc-subscribe-btn:hover { opacity: .82; }

/* Article Body */
.article-body {
  min-width: 0;
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.75;
  color: var(--text);
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 48px 0 20px;
  color: var(--text);
  padding-top: 4px;
  scroll-margin-top: 100px;
}
.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 32px 0 14px;
}

.article-body p {
  margin: 0 0 22px;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article-body a:hover { opacity: .8; }

.article-body strong { font-weight: 700; color: var(--text); }
.article-body em { font-style: italic; }

.article-body ul, .article-body ol {
  margin: 0 0 22px;
  padding-left: 24px;
}
.article-body li { margin-bottom: 8px; }

/* Pull quote */
.pullquote {
  margin: 40px 0;
  padding: 28px 32px;
  border-left: 4px solid var(--accent);
  background: var(--bg-soft);
  border-radius: 0 14px 14px 0;
  font-family: var(--font-display);
  font-style: normal;
}
.pullquote p {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  color: var(--text);
}
.pullquote cite {
  font-size: 14px;
  color: var(--text-muted);
  font-style: normal;
  font-weight: 500;
}
.pullquote-sm p { font-size: 19px; }

/* Infobox */
.infobox {
  display: flex;
  gap: 16px;
  padding: 22px 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 28px 0;
  font-family: var(--font-sans);
  font-size: 15px;
}
.infobox-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.infobox-title {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
  color: var(--text);
}
.infobox-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.infobox-list li {
  color: var(--text-muted);
  margin: 0;
  font-size: 14.5px;
}
.infobox-list b { color: var(--text); font-weight: 600; }

/* Figure */
.article-figure {
  margin: 32px 0;
}
.figure-img {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: rgba(255,255,255,.9);
  letter-spacing: -0.01em;
  overflow: hidden;
}
figcaption {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 10px;
  line-height: 1.45;
  padding: 0 4px;
}

/* Comparison table */
.comparison-table {
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 14.5px;
}
.comparison-table table {
  width: 100%;
  border-collapse: collapse;
}
.comparison-table thead tr {
  background: var(--bg-soft);
}
.comparison-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.comparison-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
}
.comparison-table tr:last-child td { border-bottom: 0; }
.comparison-table tr:first-child td { background: rgba(255,77,46,.04); }
.comparison-table tr:first-child td:first-child { color: var(--text); }
.check { color: var(--green); font-weight: 700; }
.cross { color: var(--red); font-weight: 700; }
.neutral { color: var(--text-muted); }

/* Tags */
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 40px 0 32px;
}
.tag-chip {
  padding: 7px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.tag-chip:hover { background: var(--bg-card); border-color: var(--border-strong); color: var(--text); }

/* Share */
.article-share {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.share-label {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-soft);
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.share-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-card); }
.share-btn:active { transform: scale(.97); }
.share-tg:hover { color: #2aabee; border-color: #2aabee; background: rgba(42,171,238,.08); }
.share-vk:hover { color: #0077ff; border-color: #0077ff; background: rgba(0,119,255,.08); }

/* Author card */
.author-card {
  display: flex;
  gap: 20px;
  padding: 28px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 8px;
  font-family: var(--font-sans);
}
.author-card-body { display: flex; flex-direction: column; gap: 4px; }
.author-card-name { font-weight: 700; font-size: 17px; color: var(--text); }
.author-card-role { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.author-card-bio { font-size: 14.5px; color: var(--text-muted); line-height: 1.55; margin: 0 0 12px; }
.author-card-link { font-size: 14px; color: var(--accent); font-weight: 600; }
.author-card-link:hover { opacity: .75; }

/* Right sidebar */
.article-sidebar-right { position: relative; }
.sidebar-sticky {
  position: sticky;
  top: 160px;
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: 2px;
}
.sidebar-sticky::-webkit-scrollbar { display: none; }

.reading-progress-widget {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 0 20px;
}
.rpw-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.rpw-pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.rpw-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rpw-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.rpw-progress-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  transition: color .2s;
}

.sidebar-divider { height: 1px; background: var(--border); margin: 16px 0; }

.sidebar-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 16px;
}

.related-list { display: flex; flex-direction: column; gap: 14px; }
.related-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: opacity .15s;
}
.related-item:hover { opacity: .78; }
.related-img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  flex-shrink: 0;
  overflow: hidden;
}
.related-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.related-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--accent);
}
.related-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.sidebar-subscribe {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar-subscribe-title {
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 6px;
}
.sidebar-subscribe-text {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.sidebar-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-bottom: 8px;
  transition: border-color .15s;
  font-family: var(--font-sans);
}
.sidebar-input:focus { border-color: var(--accent); }
.sidebar-subscribe-btn {
  width: 100%;
  height: 40px;
  border-radius: 9px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: opacity .15s;
}
.sidebar-subscribe-btn:hover { opacity: .85; }

/* Related bottom (desktop hidden) */
.related-bottom {
  padding-bottom: 56px;
  display: none;
}

/* Responsive */
@media (max-width: 1200px) {
  .article-layout {
    grid-template-columns: 180px 1fr 240px;
    gap: 36px;
  }
}
@media (max-width: 1000px) {
  .article-layout {
    grid-template-columns: 1fr 240px;
    gap: 36px;
  }
  .toc-sidebar { display: none; }
}
@media (max-width: 760px) {
  .article-layout {
    grid-template-columns: 1fr;
    padding-top: 32px;
    gap: 0;
  }
  .article-sidebar-right { display: none; }
  .related-bottom { display: block; }
  .article-hero { min-height: 360px; }
  .article-hero-content { padding-bottom: 36px; }
  .pullquote { padding: 20px 22px; }
  .pullquote p { font-size: 19px; }
  .article-body { font-size: 17px; }
  .article-body h2 { font-size: 22px; }
  .author-card { flex-direction: column; gap: 14px; }
  .comparison-table { font-size: 13px; }
  .comparison-table td, .comparison-table th { padding: 10px 12px; }
}
@media (max-width: 520px) {
  .article-meta-hero { flex-direction: column; gap: 14px; align-items: flex-start; }
  .article-body { font-size: 16px; }
  .article-body h2 { font-size: 20px; }
  .share-btn span { display: none; }
}
