/* Страница статьи: как Docusaurus BlogLayout — main col--10 + toc col--2 внутри той же ширины, что подвал */
.single-with-toc {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  max-width: none;
  margin: 0;
}

.single-with-toc:has(> .article-toc) {
  grid-template-columns: minmax(0, 10fr) minmax(0, 2fr);
}

.article-toc {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding-left: 0.5rem;
  min-width: 0;
  font-size: 0.875rem;
}

.article-toc__title {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c6370;
  margin: 0 0 0.75rem;
}

/* Hugo отдаёт #TableOfContents > ul */
.article-toc nav#TableOfContents,
.article-toc nav {
  display: block;
}

.article-toc nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-toc nav ul ul {
  margin-top: 0.35rem;
  padding-left: 0.75rem;
  border-left: 2px solid #e8eaed;
}

.article-toc nav li {
  margin: 0 0 0.5rem;
  line-height: 1.35;
}

.article-toc nav a {
  color: #5c6370;
  text-decoration: none;
  display: block;
  padding: 0.2rem 0;
  transition: color 0.15s ease;
}

.article-toc nav a:hover {
  color: #0083b0;
}

.article-toc nav a.active {
  color: #0083b0;
  font-weight: 500;
}

.article--with-toc {
  min-width: 0;
}

/* Как BlogBreadcrumbs в Docusaurus: отступ под цепочкой перед заголовком */
.article-breadcrumbs {
  margin-bottom: 1.5rem;
}

.article--with-toc header {
  margin-bottom: 1.5rem;
}

.article--with-toc header h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.article__date {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: #5c6370;
}

/* Автор статьи (Docusaurus BlogPostItem author) */
.article-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  margin: 0 0 1rem;
}

.article-authors__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 100%;
}

.article-authors__photo {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f2f5;
}

.article-authors__meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.article-authors__name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1a1a2e;
  text-decoration: none;
}

a.article-authors__name:hover {
  color: #0083b0;
}

.article-authors__role {
  font-size: 0.8125rem;
  color: #5c6370;
  line-height: 1.35;
}

.article--with-toc .content {
  font-size: 1.05rem;
  line-height: 1.65;
}

/* RelatedPostsSection (Docusaurus): «Статьи по схожей тематике» */
.article-related {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e8eaed;
}

.article-related__title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 1.5rem;
  color: #1a1a2e;
}

.article-related__grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.article-related__item {
  margin: 0;
}

.article-related__link {
  display: block;
  border: 1px solid #e8eaed;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.article-related__link:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  color: inherit;
}

.article-related__image-wrap {
  aspect-ratio: var(--cleverence-preview-aspect-ratio);
  overflow: hidden;
  background: #f0f2f5;
}

.article-related__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.article-related__link:hover .article-related__image {
  transform: scale(1.02);
}

.article-related__card-title {
  display: block;
  padding: 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  min-height: calc(1.35em * 3 + 0.2rem);
}

.article-related__card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

@media (max-width: 996px) {
  .article-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .single-with-toc:has(> .article-toc) {
    grid-template-columns: 1fr;
  }

  .article-toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding-left: 0;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e8eaed;
  }
}

@media (max-width: 576px) {
  .article-related__grid {
    grid-template-columns: 1fr;
  }
}
