/* База знаний — расположение четырёх направлений */

body[data-source-code="site_articles"] #directions .problem-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

body[data-source-code="site_articles"] #directions .info-card:nth-child(4) {
  grid-column: 2;
}

@media (max-width: 900px) {
  body[data-source-code="site_articles"] #directions .problem-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-source-code="site_articles"] #directions .info-card:nth-child(4) {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  body[data-source-code="site_articles"] #directions .problem-grid {
    grid-template-columns: 1fr;
  }
}

/* Category article cards */
.article-category-grid .article-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.article-category-grid .article-card .text-link {
  display: inline-block;
  margin-top: 18px;
}

.article-category-grid .article-card:hover {
  transform: translateY(-2px);
}

/* Clickable category cards */
body[data-source-code="site_articles"] #directions .direction-card {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body[data-source-code="site_articles"] #directions .direction-card .text-link {
  display: inline-block;
  margin-top: 18px;
}

body[data-source-code="site_articles"] #directions .direction-card:hover {
  transform: translateY(-3px);
}

/* Article page */
.article-hero{background:#101d23;color:#fff;padding:72px 0 64px}
.article-shell{max-width:1080px}
.article-hero .breadcrumb{margin-bottom:34px}
.article-hero .breadcrumb,.article-hero .breadcrumb a{color:#c5ced2}
.article-hero h1{max-width:920px;margin:18px 0 24px;font-size:clamp(44px,6vw,82px);line-height:.96}
.article-lead{max-width:820px;color:#cbd3d6;font-size:19px;line-height:1.65}
.article-meta{display:flex;flex-wrap:wrap;gap:12px 24px;margin-top:28px;padding-top:22px;border-top:1px solid rgba(255,255,255,.16);color:#aebbc0;font-size:14px}
.article-layout{display:grid;grid-template-columns:minmax(0,760px) minmax(220px,300px);gap:64px;align-items:start}
.article-content{font-size:18px;line-height:1.75}
.article-content p{margin:0 0 24px}
.article-content h2{margin:54px 0 20px}
.article-note{margin-bottom:34px;padding:22px 24px;border-left:3px solid #c96f47;background:#f3eee6}
.article-toc{margin:0 0 40px;padding-left:24px}
.article-toc li{margin-bottom:10px}
.article-toc a,.article-back a{color:inherit}
.article-placeholder{margin:42px 0;padding:32px;border:1px dashed #c7bbaa;border-radius:12px;color:#667078}
.article-sidebar{position:sticky;top:110px}
.article-sidebar-card{padding:28px;border:1px solid #d8cec1;border-radius:14px;background:#fff}
.article-sidebar-card h2{margin:8px 0 14px}
@media(max-width:900px){.article-layout{grid-template-columns:1fr}.article-sidebar{position:static}}
@media(max-width:640px){.article-hero{padding:48px 0}.article-hero h1{font-size:44px}.article-content{font-size:17px}}

/* Article hero — contrast and readability */
.article-hero h1 {
  color: #ffffff !important;
}

.article-hero .article-lead {
  color: #d2dadd;
}

.article-hero .article-meta {
  color: #bcc8cd;
}

.article-hero .breadcrumb,
.article-hero .breadcrumb a,
.article-hero .breadcrumb span {
  color: #c1cbcf;
}

/* =========================================================
   ARTICLE TEMPLATE — layout correction
   Applies only to individual article pages
   ========================================================= */

.article-section {
  padding: 72px 0 88px;
}

.article-section .article-layout {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 720px) 280px;
  gap: 56px;
  align-items: start;
}

/* Main reading column */

.article-content {
  width: 100%;
  max-width: 720px;
  min-width: 0;
  font-size: 17px;
  line-height: 1.72;
  color: #273238;
}

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

.article-content p {
  max-width: 68ch;
  margin: 0 0 24px;
}

.article-content h2 {
  max-width: 680px;
  margin: 48px 0 22px;
  font-size: clamp(36px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.article-content h3 {
  margin: 38px 0 16px;
  font-size: 27px;
  line-height: 1.12;
}

/* Information note */

.article-note {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 34px;
  padding: 20px 22px;
  border-left: 3px solid #c96f47;
  background: #f1ece4;
  line-height: 1.65;
}

.article-note strong {
  color: #17262d;
}

/* Table of contents */

.article-toc {
  max-width: 660px;
  margin: 0 0 42px;
  padding-left: 24px;
}

.article-toc li {
  margin: 0 0 11px;
  padding-left: 4px;
}

.article-toc a {
  color: #273238;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Temporary placeholder */

.article-placeholder {
  width: 100%;
  box-sizing: border-box;
  margin: 42px 0;
  padding: 24px 26px;
  border: 1px dashed #c8bcac;
  border-radius: 10px;
  color: #69757b;
  line-height: 1.6;
}

/* Sidebar */

.article-sidebar {
  width: 280px;
  min-width: 0;
  position: sticky;
  top: 108px;
}

.article-sidebar-card {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 26px 24px 28px;
  border: 1px solid #d6ccbf;
  border-radius: 12px;
  background: #fff;
}

.article-sidebar-card .eyebrow {
  margin: 0 0 14px;
}

.article-sidebar-card h2 {
  width: 100%;
  max-width: 100%;
  margin: 0 0 16px;
  font-size: 38px !important;
  line-height: 1;
  letter-spacing: -0.025em;
  overflow-wrap: normal;
  word-break: normal;
}

.article-sidebar-card p {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.55;
  color: #637078;
}

.article-sidebar-card .text-link {
  display: inline-block;
  font-size: 14px;
  line-height: 1.4;
}

/* Back link */

.article-back {
  margin-top: 42px !important;
  padding-top: 24px;
  border-top: 1px solid #ddd3c7;
  font-size: 15px;
}

/* Hero correction */

.article-hero .article-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.article-hero h1 {
  max-width: 850px;
}

.article-hero .article-lead {
  max-width: 760px;
}

.article-hero .article-meta {
  max-width: 850px;
}

/* Tablet */

@media (max-width: 980px) {
  .article-section .article-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 36px;
  }

  .article-sidebar {
    width: 240px;
  }

  .article-sidebar-card h2 {
    font-size: 32px !important;
  }
}

/* Mobile */

@media (max-width: 760px) {
  .article-section {
    padding: 50px 0 64px;
  }

  .article-section .article-layout {
    display: block;
  }

  .article-content {
    max-width: none;
    font-size: 16px;
  }

  .article-content h2 {
    margin-top: 42px;
    font-size: 36px;
  }

  .article-sidebar {
    position: static;
    width: 100%;
    margin-top: 48px;
  }

  .article-sidebar-card h2 {
    font-size: 36px !important;
  }

  .article-hero h1 {
    font-size: 44px;
    line-height: .98;
  }
}

/* Article body components — approved article template */
.article-body > h2[id] {
  scroll-margin-top: 110px;
}

.article-callout,
.article-checklist {
  width: 100%;
  box-sizing: border-box;
  margin: 30px 0 36px;
  padding: 22px 24px;
  border: 1px solid #ddd2c4;
  border-radius: 10px;
  background: #f7f2eb;
}

.article-callout-title {
  margin: 0 0 12px !important;
  font-weight: 700;
  color: #17262d;
}

.article-callout p:last-child,
.article-callout ul:last-child,
.article-checklist ul:last-child {
  margin-bottom: 0;
}

.article-callout ul,
.article-checklist ul {
  margin: 0;
  padding-left: 22px;
}

.article-callout li,
.article-checklist li {
  margin-bottom: 10px;
}

.article-cta {
  margin: 64px 0 52px;
  padding: 34px 36px;
  background: #101d23;
  color: #fff;
  border-radius: 12px;
}

.article-cta .eyebrow {
  color: #d77a50;
}

.article-cta h2 {
  margin: 10px 0 18px;
  color: #fff;
  font-size: 42px;
}

.article-cta p {
  color: #ced6d9;
}

.article-related {
  margin: 54px 0 0;
  padding-top: 38px;
  border-top: 1px solid #ddd3c7;
}

.article-related h2,
.article-author h2 {
  margin-top: 10px;
}

.article-related-grid {
  display: grid;
  gap: 12px;
}

.article-related-grid a {
  display: block;
  padding: 16px 18px;
  border: 1px solid #ddd2c4;
  border-radius: 9px;
  background: #fff;
  color: #17262d;
  text-decoration: none;
  line-height: 1.45;
}

.article-author {
  margin-top: 54px;
  padding: 30px 32px;
  border-left: 3px solid #c96f47;
  background: #f3eee6;
}

.article-source-note {
  margin-top: 36px !important;
  padding-top: 22px;
  border-top: 1px solid #ddd3c7;
  color: #6b757a;
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .article-cta {
    padding: 28px 24px;
  }

  .article-cta h2 {
    font-size: 34px;
  }

  .article-author {
    padding: 24px;
  }
}

/* Article CTA buttons — readable on dark background */
.article-content .cta-panel .button-secondary,
.article-content .article-cta .button-secondary,
.article-content .article-cta a.button-secondary {
  color: #ffffff !important;
  border-color: rgba(255,255,255,.65) !important;
  background: transparent !important;
}

.article-content .cta-panel .button-secondary:hover,
.article-content .article-cta .button-secondary:hover,
.article-content .article-cta a.button-secondary:hover {
  color: #17262d !important;
  background: #ffffff !important;
  border-color: #ffffff !important;
}
