/* Шаблон статьи: hero, оглавление, разделы, врезки, автор, промо. */

/* ---------- Hero ---------- */

.hero { padding: 56px 0 72px; }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.back-link:hover { color: var(--text); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 99px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}
.pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal);
}
.pill--plain::before { display: none; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

.hero__title {
  font-size: clamp(38px, 5.4vw, 68px);
  line-height: 1.03;
  letter-spacing: -.035em;
  margin-bottom: 24px;
}
.hero__lead {
  max-width: 560px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
  margin-bottom: 32px;
}
.hero__lead b { color: var(--text); font-weight: 500; }

.byline { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--muted); }
.byline__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text);
}
.byline__name { color: var(--text); font-weight: 500; }
.byline__sep { opacity: .4; }

.hero__visual {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--hero-grad);
  padding: 40px 32px;
  min-height: 360px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

/* ---------- Раскладка: оглавление + текст ---------- */

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, var(--content));
  gap: 72px;
  justify-content: center;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 56px);
  overflow-y: auto;
  scrollbar-width: none;
  font-size: 14px;
}
.toc::-webkit-scrollbar { display: none; }
.toc__title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 14px;
}
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc__part {
  margin: 18px 0 6px;
  font-size: 12px;
  color: var(--muted);
  opacity: .8;
}
.toc__part:first-child { margin-top: 0; }
.toc a {
  display: flex;
  gap: 10px;
  padding: 6px 10px;
  margin-left: -10px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.3;
  transition: background var(--transition), color var(--transition);
}
.toc a:hover { color: var(--text); }
.toc a.is-active { background: var(--surface); color: var(--text); }
.toc__num { font-family: var(--font-mono); font-size: 11px; padding-top: 2px; opacity: .7; min-width: 18px; }
.toc a.is-active .toc__num { color: var(--primary-fg); opacity: 1; }

.toc__progress { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.toc__progress-value { font-family: var(--font-heading); font-size: 22px; font-weight: 500; }
.toc__progress-label { color: var(--muted); font-size: 13px; margin-left: 4px; }
.toc__progress-track { height: 3px; border-radius: 3px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.toc__progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .15s linear; }

/* ---------- Текст статьи ---------- */

.prose > * + * { margin-top: 0; }
.prose p strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li + li { margin-top: .35em; }

.intro { font-size: 20px; line-height: 1.6; }

.term { padding-top: 72px; }
.term__head { margin-bottom: 24px; }
.term__num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--primary-fg);
  margin-bottom: 10px;
}
.term__title { font-size: clamp(30px, 3.6vw, 42px); }
.term__en {
  display: inline-block;
  margin-left: 12px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  vertical-align: middle;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
}

.part {
  margin-top: 96px;
  padding: 36px 36px 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.part:first-of-type { margin-top: 56px; }
.part__label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 12px;
}
.part__title { font-size: clamp(26px, 3vw, 34px); margin-bottom: 14px; }
.part p:last-child { margin-bottom: 0; }

/* Врезка: метка-«пилюля» с цветной точкой над текстом (вариант A из design/callouts.html) */
.callout {
  margin: 28px 0;
  padding: 22px 26px;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 17px;
}
.callout p:last-child { margin-bottom: 0; }
.callout__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 12px 6px 10px;
  border-radius: 99px;
  background: var(--bg);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}
.callout__tag::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint-fg);
}
.callout--note { color: var(--muted); font-size: 15px; }
.callout--note .callout__tag { color: var(--text); }
.callout--note .callout__tag::before { background: var(--signal); }

/* Вариант C «Тонированная карточка» (design/callouts.html). Включается классом .callouts-tinted
   на <article>: фон всей врезки тонирован, метка — моноширинная, заглавными, без «пилюли». */
.callouts-tinted .callout { padding: 24px 28px; background: var(--mint-soft); }
.callouts-tinted .callout__tag {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  border-radius: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mint-fg);
}
.callouts-tinted .callout__tag::before { content: none; }
.callouts-tinted .callout--note {
  background: color-mix(in srgb, var(--signal) 12%, transparent);
  color: var(--text);
  font-size: 15px;
}
.callouts-tinted .callout--note .callout__tag { color: var(--signal-fg); }

.demo-caption {
  margin: 14px auto 32px;
  max-width: 560px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Финальные блоки ---------- */

.reading { margin-top: 96px; }
.reading h2 { font-size: 32px; margin-bottom: 20px; }
.prose .reading__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prose .reading__list li + li { margin-top: 0; }
.reading__list a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition);
}
.reading__list a:hover { background: var(--surface-2); }
.reading__list span { color: var(--muted); font-size: 15px; }

.promo {
  margin-top: 56px;
  padding: 44px;
  border-radius: var(--radius-lg);
  background: var(--promo-grad);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 40px;
  align-items: end;
}
.promo .pill { background: rgba(255, 255, 255, .1); color: #fff; }
.promo h2 { font-size: clamp(28px, 3.4vw, 40px); margin: 18px 0 12px; }
.promo p { color: rgba(255, 255, 255, .72); margin: 0; max-width: 460px; }
.promo .btn { background: #fff; color: #111215; }

.author {
  margin-top: 56px;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 28px;
  align-items: start;
}
.author__photo {
  width: 112px;
  height: 112px;
  border-radius: 20px;
  background: var(--surface);
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 500;
  object-fit: cover;
}
.author__name { font-size: 26px; margin-bottom: 4px; }
.author__role { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.author__bio { font-size: 16px; margin-bottom: 18px; }
.author__stats { display: flex; flex-wrap: wrap; gap: 8px; }
.author__stat { padding: 14px 18px; border-radius: var(--radius-sm); background: var(--surface); min-width: 120px; }
.author__stat b { display: block; font-family: var(--font-heading); font-size: 26px; font-weight: 500; line-height: 1.1; }
.author__stat span { font-size: 12px; color: var(--muted); }

/* ---------- Адаптив ---------- */

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, var(--content)); gap: 0; }
  .toc { display: none; }
}

@media (max-width: 900px) {
  .hero { padding: 32px 0 48px; }
  .hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .hero__visual { min-height: 280px; }
}

@media (max-width: 640px) {
  .term { padding-top: 56px; }
  .term__en { display: table; margin: 10px 0 0; }
  .part { padding: 26px 22px; }
  .promo { padding: 30px 24px; grid-template-columns: 1fr; }
  .author { grid-template-columns: 1fr; gap: 18px; }
  .intro, .hero__lead { font-size: 18px; }
}
