@font-face {
  font-family: Nunito;
  src: url('/brand/topic-fonts/nunito-variable.ttf') format('truetype');
  font-weight: 200 1000;
  font-display: swap;
}
.topic-page {
  font-family: -apple-system, BlinkMacSystemFont, Nunito, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: #302638;
}
.topic-page header,
.topic-page main,
.topic-page footer {
  max-width: 1040px;
}
.topic-page main {
  padding-top: 24px;
}
.topic-page .breadcrumbs {
  font-size: 16px;
  margin-bottom: 32px;
}
.topic-hero {
  display: grid;
  grid-template-columns: 1fr 300px;
  align-items: center;
  gap: 48px;
  margin-bottom: 48px;
}
.topic-hero:not(:has(figure)) {
  grid-template-columns: 1fr;
  max-width: 720px;
}
.topic-page h1 {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 12px 0 20px;
}
.topic-page .lead {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 24px;
}
.topic-page .topic-kicker {
  color: #786880;
  font-size: 16px;
  margin: 0 0 8px;
}
.topic-page article {
  max-width: 720px;
}
.topic-page section {
  background: transparent;
  padding: 0;
  border: 0;
  border-radius: 0;
  margin: 0 0 36px;
}
.topic-page h2 {
  font-size: 24px;
  line-height: 1.3;
  margin: 0 0 16px;
}
.topic-page p {
  margin: 0 0 16px;
}
.topic-page .cta {
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 16px;
}
.topic-page .topic-example,
.topic-page .topic-takeaway {
  padding: 28px;
  background: white;
  border-radius: 24px;
}
.topic-page .topic-takeaway {
  background: #eee7f5;
}
.topic-page section > :last-child {
  margin-bottom: 0;
}
.topic-page li {
  margin-bottom: 12px;
  padding-left: 4px;
}
.topic-page ol {
  padding-left: 24px;
}
.topic-formula {
  padding: 12px 16px;
  background: #f0ebf6;
  border-radius: 16px;
  overflow-x: auto;
  margin: 20px 0;
}
.topic-formula .katex {
  font-size: 1.3em;
}
.topic-page dl div {
  display: flex;
  gap: 12px;
  margin: 8px 0;
}
.topic-page dt {
  font-weight: 700;
  min-width: 24px;
}
.topic-page dd {
  margin: 0;
}
.density-visual {
  margin: 0;
  padding: 28px 20px;
  border-radius: 28px;
  background: linear-gradient(140deg, #f0e9fa, #fcf0e7);
  text-align: center;
}
.density-cubes {
  display: flex;
  justify-content: center;
  gap: 24px;
}
.density-cubes > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.density-cubes svg {
  width: 100px;
  height: 110px;
  margin-bottom: 12px;
}
.density-cubes strong {
  font-size: 24px;
  line-height: 1.3;
}
.density-cubes span,
.density-visual figcaption {
  color: #74657c;
}
.density-visual figcaption {
  margin-top: 20px;
}
.topic-page .topic-related {
  list-style: none;
  padding: 0;
}
.topic-related a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #e6deed;
  text-decoration: none;
}
.topic-page .topic-related li {
  padding: 0;
  margin: 0;
}
.topic-pagination {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}
.topic-pagination a {
  flex: 1;
  text-decoration: none;
  color: #786880;
}
.topic-pagination strong {
  display: block;
  color: #45215b;
  font-weight: 600;
}
.topic-page a:focus-visible {
  outline: 3px solid #aa86bc;
  outline-offset: 4px;
}
@media (max-width: 700px) {
  .topic-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 32px;
  }
  .topic-page h1 {
    font-size: 32px;
  }
  .topic-page .lead {
    font-size: 16px;
  }
  .topic-page main {
    padding: 16px 20px 32px;
  }
  .topic-page .breadcrumbs {
    margin-bottom: 24px;
  }
  .topic-page .topic-example,
  .topic-page .topic-takeaway {
    padding: 24px 20px;
  }
  .density-visual {
    padding: 24px 20px;
  }
  .density-cubes svg {
    width: 80px;
    height: 90px;
  }
  .topic-pagination {
    flex-direction: column;
    gap: 20px;
  }
}

/* Только открытые иллюстрации тем; размеры и подложки едины на всех ширинах. */
.topic-illustrations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin: 24px 0;
}
.topic-illustration {
  margin: 0;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f1eafa, #fcf0e7);
  min-width: 0;
}
.topic-illustration img {
  max-width: 360px;
  margin-inline: auto;
  display: block;
  width: 100%;
  height: auto;
}
.topic-illustration figcaption {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.5;
  color: #786880;
}
@media (max-width: 700px) {
  .topic-illustration {
    padding: 16px;
    border-radius: 20px;
  }
  .topic-illustrations {
    grid-template-columns: 1fr;
  }
}
