/*
 * EGE-School single post (design B-article): hero, content column with the
 * side column (table of contents, subject promo), "Читайте также".
 * The hero base (.es-page-hero) is in page.css, the content styles
 * (.es-prose) in components.css. Colours only from base.css tokens.
 */

/* ---------- hero ---------- */
.es-article-hero__inner {
  max-width: calc(1000px + 2 * var(--es-gutter));
  gap: 22px;
  padding-bottom: clamp(26px, 4vw, 56px);
}

.es-article-hero__chip {
  margin-bottom: -4px;
}

a.es-article-hero__chip:hover {
  color: var(--es-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.es-article-hero__title {
  font-size: clamp(28px, 4.2vw, 52px);
}

.es-article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0;
  color: var(--es-on-dark);
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 600;
}

/* ---------- layout: content + side column ---------- */
.es-article-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 40px;
  padding-top: clamp(24px, 4vw, 48px);
  padding-bottom: clamp(40px, 5vw, 72px);
}

.es-article {
  flex: 999 1 600px;
  min-width: 0;
  max-width: 760px;
}

/* content images and tables never push the page wider */
.es-article__body {
  overflow-wrap: break-word;
}

.es-article__body h2 {
  scroll-margin-top: 24px;
}

.es-article-aside {
  display: flex;
  flex: 1 1 280px;
  flex-direction: column;
  gap: var(--es-s-4);
  min-width: 0;
}

/* sticky only when the columns surely sit side by side: the flex-wrap point is
   600 + 40 + 280 px + gutters ≈ 984px, so 1024px (the header breakpoint of
   layout.css) is the next project breakpoint above it; a tall aside scrolls
   inside itself instead of being cut */
@media (min-width: 1024px) {
  .es-article-aside {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
}

/* ---------- table of contents ---------- */
.es-toc {
  padding: 22px 24px;
  border-radius: var(--es-r-lg);
  background: var(--es-white);
}

.es-toc__title {
  margin: 0 0 6px;
  font-family: var(--es-font-display);
  font-size: 15px;
  font-weight: 800;
}

.es-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.es-toc__list a {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  color: var(--es-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.es-toc__list a:hover {
  color: var(--es-link-h);
}

.es-toc__num {
  flex: none;
  color: var(--es-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- subject promo ---------- */
.es-aside-promo {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  border-radius: var(--es-r-lg);
  background: var(--es-ink);
  color: var(--es-white);
}

.es-aside-promo__title {
  margin: 0;
  font-family: var(--es-font-display);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}

.es-aside-promo .es-btn {
  align-self: flex-start;
}

/* ---------- read also ---------- */
.es-related {
  display: flex;
  flex-direction: column;
  gap: var(--es-s-6);
  padding-bottom: clamp(48px, 6vw, 88px);
}

.es-related__title {
  margin: 0;
  font-family: var(--es-font-display);
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.es-related .es-post {
  min-height: 170px;
}
