/* Article page */
.article-page {
  --article-ink: #1e1f24;
  --article-muted: #667587;
  --article-line: #dce6f0;
  --article-blue: #1a5488;
  --article-blue-dark: #123f68;
  --article-soft: #f4f8fc;
  background: #f5f7f9;
}

.article-progress {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  pointer-events: none;
}

.article-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #1687d9;
  box-shadow: 0 0 10px rgba(22, 135, 217, 0.35);
}

.article-layout {
  padding: 22px 0 clamp(64px, 8vw, 104px);
}

.article-layout > .container {
  width: auto;
  max-width: none;
  margin-right: max(16px, calc((100% - 1270px) / 2));
  margin-left: max(16px, calc((100% - 1270px) / 2));
  padding: 0;
}

.article-breadcrumbs {
  margin-bottom: 18px;
}

.article-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  color: var(--article-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  list-style: none;
}

.article-breadcrumbs li,
.article-breadcrumbs li::before {
  margin: 0;
  padding: 0;
  background: none;
}

.article-breadcrumbs a {
  color: var(--article-blue);
  text-decoration: none;
}

.article-breadcrumbs .current {
  overflow: hidden;
  max-width: min(520px, 50vw);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-breadcrumbs__separator {
  color: #a8b4c1;
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 900px) minmax(220px, 280px);
  gap: clamp(24px, 4vw, 48px);
  justify-content: center;
  align-items: start;
}

.article-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--article-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 16px 48px rgba(23, 53, 82, 0.08);
}

.article-header {
  padding: clamp(28px, 5vw, 58px) clamp(22px, 6vw, 70px) clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--article-line);
  background:
    radial-gradient(circle at 100% 0, rgba(35, 135, 205, 0.13), transparent 34%),
    linear-gradient(145deg, #fff 0%, #f7fbff 100%);
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(28px, 5vw, 52px);
  color: var(--article-blue);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.article-back span {
  font-size: 19px;
  transition: transform 0.2s ease;
}

.article-kicker {
  margin: 0 0 14px;
  color: var(--article-blue);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-header h1 {
  max-width: 790px;
  margin: 0;
  padding: 0;
  color: var(--article-ink);
  font-size: clamp(32px, 4.2vw, 54px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-align: left;
  text-wrap: balance;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  color: var(--article-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.article-meta > span[aria-hidden] {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #9aabbc;
}

.article-page .article-content {
  overflow: visible;
  padding: clamp(30px, 5.5vw, 70px);
  border-radius: 0;
  color: #343940;
  background: #fff;
}

.article-page .article-content > :first-child {
  margin-top: 0;
}

.article-page .article-content p {
  max-width: 760px;
  margin: 0 0 22px;
  padding: 0;
  color: #343940;
  font-size: clamp(16px, 1.4vw, 18px);
  font-weight: 450;
  line-height: 1.78;
  text-align: left;
}

.article-page .article-content h2 {
  max-width: 760px;
  margin: clamp(44px, 7vw, 72px) 0 20px;
  padding: 0 0 0 20px;
  color: var(--article-ink);
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-align: left;
  scroll-margin-top: 90px;
  position: relative;
}

.article-page .article-content h2::before {
  position: absolute;
  top: 0.12em;
  bottom: 0.12em;
  left: 0;
  width: 4px;
  border-radius: 4px;
  background: #1687d9;
  content: "";
}

.article-page .article-content h3 {
  max-width: 760px;
  margin: 32px 0 12px;
  color: var(--article-ink);
  font-size: clamp(19px, 2vw, 23px);
  font-weight: 750;
  line-height: 1.35;
}

.article-page .article-content a {
  color: var(--article-blue);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(26, 84, 136, 0.32);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-page .article-content img {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  max-height: 540px;
  margin: 30px 0 38px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 12px 34px rgba(20, 45, 75, 0.13);
}

.article-page .article-content p:first-child {
  color: #3e4b58;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.72;
}

.article-page .article-content ul,
.article-page .article-content ol {
  max-width: 760px;
  margin: 0 0 24px;
  padding-left: 24px;
}

.article-page .article-content li {
  margin: 8px 0;
  padding: 0 0 0 5px;
  font-size: 17px;
  line-height: 1.65;
}

.article-page .article-content li::before {
  display: none;
}

.article-table-scroll {
  overflow-x: auto;
  width: 100%;
  margin: 28px 0 44px;
  border: 1px solid var(--article-line);
  border-radius: 16px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

.article-page .article-content table {
  min-width: 720px;
  margin: 0;
  border: 0 !important;
  border-collapse: collapse;
}

.article-page .article-content table th {
  padding: 15px 16px;
  border: 0;
  border-bottom: 1px solid var(--article-line);
  color: #fff;
  background: var(--article-blue);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
  text-align: left;
}

.article-page .article-content table td {
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid #e8eef4;
  color: #3d4650;
  font-size: 14px;
  line-height: 1.5;
  vertical-align: top;
}

.article-page .article-content table tbody tr:nth-child(even) {
  background: var(--article-soft);
}

.article-page .article-content table tbody tr:last-child td {
  border-bottom: 0;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 clamp(22px, 5.5vw, 70px) clamp(28px, 5.5vw, 64px);
  padding: 26px 28px;
  border-radius: 18px;
  background: var(--article-blue-dark);
}

.article-footer p {
  max-width: 440px;
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 700;
  line-height: 1.3;
}

.article-footer__button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: 10px;
  color: var(--article-blue-dark);
  background: #fff;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-aside {
  position: sticky;
  top: 92px;
}

.article-aside__card {
  padding: 22px;
  border: 1px solid var(--article-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(23, 53, 82, 0.06);
}

.article-aside__title {
  margin: 0 0 15px;
  color: var(--article-ink);
  font-size: 15px;
  font-weight: 800;
}

.article-toc {
  display: grid;
  gap: 3px;
}

.article-toc a {
  display: block;
  padding: 7px 9px;
  border-left: 2px solid #dce6f0;
  color: #687789;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.article-toc a.is-active {
  border-color: #1687d9;
  color: var(--article-blue);
  background: #f2f8fd;
}

.article-toc:empty::after {
  color: var(--article-muted);
  font-size: 13px;
  content: "Разделы загружаются…";
}

.article-back:focus-visible,
.article-footer__button:focus-visible,
.article-toc a:focus-visible,
.article-breadcrumbs a:focus-visible {
  outline: 3px solid rgba(22, 135, 217, 0.32);
  outline-offset: 3px;
}

@media (hover: hover) {
  .article-back:hover span {
    transform: translateX(-4px);
  }

  .article-footer__button:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
  }

  .article-toc a:hover {
    border-color: #1687d9;
    color: var(--article-blue);
    background: #f7fbff;
  }
}

@media (max-width: 1050px) {
  .article-grid {
    grid-template-columns: minmax(0, 860px);
  }

  .article-aside {
    display: none;
  }
}

@media (max-width: 640px) {
  .article-layout {
    padding-top: 14px;
    padding-bottom: 56px;
  }

  .article-layout > .container {
    margin-right: 12px;
    margin-left: 12px;
  }

  .article-breadcrumbs {
    margin: 0 4px 12px;
  }

  .article-breadcrumbs .current {
    max-width: 54vw;
  }

  .article-card {
    border-radius: 18px;
  }

  .article-header {
    padding: 24px 20px 28px;
  }

  .article-back {
    margin-bottom: 28px;
  }

  .article-header h1 {
    font-size: clamp(29px, 9vw, 40px);
    line-height: 1.1;
  }

  .article-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    margin-top: 18px;
  }

  .article-meta > span[aria-hidden] {
    display: none;
  }

  .article-page .article-content {
    padding: 28px 20px 36px;
  }

  .article-page .article-content p {
    font-size: 16px;
    line-height: 1.7;
  }

  .article-page .article-content p:first-child {
    font-size: 17px;
  }

  .article-page .article-content h2 {
    margin-top: 44px;
    padding-left: 15px;
    font-size: 26px;
  }

  .article-page .article-content h3 {
    font-size: 20px;
  }

  .article-page .article-content img {
    width: calc(100% + 40px);
    max-width: none;
    margin: 25px -20px 32px;
    border-radius: 0;
    box-shadow: none;
  }

  .article-table-scroll {
    width: calc(100% + 40px);
    margin-right: -20px;
    margin-left: -20px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .article-footer {
    align-items: stretch;
    flex-direction: column;
    margin: 0 20px 28px;
    padding: 22px;
  }

  .article-footer__button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-back span,
  .article-footer__button,
  .article-toc a {
    transition: none;
  }
}
