/* Карлсон, база знаний: хаб /baza-znanij/ и статья /baza-znanij/<slug>/.
   Дополняет home.css и page.css, те же токены, сетка, шапка, формы и подвал. */

/* ---------- полоса прочтения статьи под шапкой ---------- */
.kb-prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: transparent; pointer-events: none; }
.kb-prog i { display: block; height: 100%; background: var(--red); transition: width .12s linear; }

/* ---------- хаб: первый экран ---------- */
.kb-hero .lh-grid { align-items: end; }
.kb-hero .h1l { font-size: min(7.4cqi, 112px); }
.kb-feat { display: block; position: relative; background: var(--white); text-decoration: none; box-shadow: 0 40px 90px -50px rgba(11,35,45,.45); }
.kb-feat .ph { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ti); }
.kb-feat .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.kb-feat:hover .ph img { transform: scale(1.04); }
.kb-feat .tagr { position: absolute; left: 16px; top: 16px; padding: 7px 11px; background: var(--white); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--corten); }
.kb-feat .bd { display: flex; flex-direction: column; gap: 12px; padding: 24px 26px 26px; }
.kb-feat .t { font-size: 28px; line-height: 1.12; font-weight: 600; letter-spacing: -.015em; }
.kb-feat .d { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.kb-feat .go { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.kb-feat .go .u { color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.kb-feat .go .r { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.kb-feat .go .ico { transition: transform .3s; }
.kb-feat:hover .go .ico { transform: translateX(4px); }

/* ---------- хаб: фильтр и карточки ---------- */
.kb-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; margin-bottom: 48px; }
.kb-head .disp { grid-column: 1 / 8; }
.kb-tabs { grid-column: 8 / 13; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.kw .kb-tab { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); cursor: pointer; font-size: 15px; transition: background .2s, color .2s, border-color .2s; }
.kw .kb-tab small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.kw .kb-tab:hover { border-color: var(--steel); }
.kw .kb-tab.on { background: var(--steel); border-color: var(--steel); color: var(--white); }
.kw .kb-tab.on small { color: #B9C6CC; }

.kb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 24px; }
.kb-card { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
.kb-card .ph { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ti); }
.kb-card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.kb-card:hover .ph img { transform: scale(1.04); }
.kb-card .ph .lbl { position: absolute; left: 12px; top: 12px; padding: 6px 10px; background: var(--white); color: var(--corten); font-weight: 600; letter-spacing: .14em; }
.kb-card .bd { display: flex; flex-direction: column; gap: 10px; padding-top: 20px; flex: 1; }
.kb-card .t { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.kb-card .d { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.kb-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.kb-card .meta b { color: var(--ink); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; }
.kb-card .meta .ico { width: 18px; height: 18px; transition: transform .3s; }
.kb-card:hover .meta .ico { transform: translateX(4px); }
.kb-card .meta.only { margin-top: 0; }
.kw .kb-ask { color: var(--white); }
.kb-ask { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 32px 30px; background: var(--steel); color: var(--white); text-decoration: none; min-height: 100%; }
.kb-ask .lbl { color: #B9C6CC; }
.kb-ask .lbl b { color: #FF8A7D; }
.kb-ask .t { font-size: 30px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; margin-top: auto; }
.kb-ask p { margin: 0; color: #C3CED3; font-size: 15px; line-height: 1.5; max-width: 340px; }
.kb-ask .btn { margin-top: 8px; }
.kb-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kb-grid.c4 .kb-card .t { font-size: 19px; }
.kb-grid.c4 .kb-card .d { display: none; }

/* ---------- статья: первый экран ---------- */
.ah .lh-grid { align-items: end; }
.ah .lh-l { grid-column: 1 / 8; }
.ah .lh-r { grid-column: 8 / 13; }
.ah .h1a { font-size: min(5.2cqi, 74px); line-height: .95; }
.ah .hero-sub { max-width: 600px; }
.ameta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); max-width: 640px; font-size: 14px; color: var(--muted); }
.ameta b { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--corten); margin-bottom: 4px; }
.ameta span { color: var(--ink); }
.acover { margin: 0; position: relative; }
.acover .ph { aspect-ratio: 4 / 5; overflow: hidden; background: var(--ti); box-shadow: 0 40px 90px -50px rgba(11,35,45,.45); }
.acover img { width: 100%; height: 100%; object-fit: cover; }
.acover figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); line-height: 1.4; }

/* ---------- статья: тело с оглавлением ---------- */
.art { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.toc { grid-column: 1 / 4; position: sticky; top: 104px; display: flex; flex-direction: column; gap: 28px; }
.toc nav { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.toc nav .lbl { padding: 14px 0 6px; color: var(--muted); }
.toc nav a { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 15px; line-height: 1.35; color: var(--muted); transition: color .2s; }
.toc nav a .n { font-size: 12px; letter-spacing: .08em; padding-top: 2px; font-variant-numeric: tabular-nums; }
.toc nav a:hover { color: var(--ink); }
.toc nav a.on { color: var(--ink); font-weight: 500; }
.toc nav a.on .n { color: var(--red); font-weight: 600; }
.toc-cta { display: flex; flex-direction: column; gap: 14px; padding: 22px; background: var(--steel); color: var(--white); }
.toc-cta .t { font-size: 18px; line-height: 1.3; font-weight: 600; }
.toc-cta p { margin: 0; font-size: 14px; line-height: 1.5; color: #C3CED3; }
.toc-cta .btn { min-height: 48px; padding: 0 18px; }

.abody { grid-column: 5 / 12; min-width: 0; font-size: 18px; line-height: 1.65; }
.abody p { margin: 0; }
.abody > * + p { margin-top: 26px; }
.abody > p + p { margin-top: 18px; }
.abody h2 { margin: 64px 0 0; scroll-margin-top: 96px; display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: baseline; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -.018em; }
.abody h2:first-child { margin-top: 0; }
.abody h2 > .n { font-size: 13px; letter-spacing: .12em; color: var(--corten); font-weight: 600; transform: translateY(-6px); }
.abody > h2 + p { margin-top: 18px; }
.abody .chkl { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--ink); }
.abody .chkl li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 17px; line-height: 1.55; }
.abody .chkl li i { width: 22px; height: 22px; margin-top: 3px; border: 1.5px solid var(--steel); display: grid; place-items: center; }
.abody .chkl li i::after { content: ''; width: 9px; height: 9px; background: var(--red); }
.abody .chkl b, .abody .stp b { font-weight: 600; }
.abody .stp { list-style: none; margin: 26px 0 0; padding: 0; counter-reset: s; }
.abody .stp li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 0 0 22px; font-size: 17px; line-height: 1.55; }
.abody .stp li::before { counter-increment: s; content: counter(s, decimal-leading-zero); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: var(--white); border: 1px solid var(--line); font-size: 13px; font-weight: 600; letter-spacing: .04em; position: relative; z-index: 1; }
.abody .stp li::after { content: ''; position: absolute; left: 22px; top: 44px; bottom: 0; width: 1px; background: var(--line); }
.abody .stp li:last-child::after { display: none; }
.abody .stp li span { padding-top: 9px; }

.afig { margin: 40px 0 0; }
.afig .ph { overflow: hidden; background: var(--ti); aspect-ratio: 16 / 9; }
.afig.tall .ph { aspect-ratio: 4 / 3; }
.afig img { width: 100%; height: 100%; object-fit: cover; }
.afig figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); line-height: 1.4; display: flex; gap: 10px; }
.afig figcaption::before { content: ''; flex: none; width: 4px; height: 4px; margin-top: 7px; background: var(--red); }

.atbl-w { margin-top: 40px; }
.atbl-w .lbl { display: block; margin-bottom: 12px; color: var(--muted); }
.atbl-scroll { overflow-x: auto; }
.atbl-w .capt { font-size: 16px; min-width: 480px; }
.atbl-w .capt td:first-child { width: 36%; }

/* «Наш опыт»: случай из цеха */
.acase { margin-top: 48px; background: var(--steel); color: var(--white); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); scroll-margin-top: 96px; }
.acase .ph2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3px; min-height: 100%; background: #081A21; }
.acase .ph2 img { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.acase .bd { padding: 32px 32px 30px; display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.55; }
.acase .lbl { color: #B9C6CC; }
.acase .lbl b { color: #FF8A7D; }
.acase .t { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.acase .pl { font-size: 13px; color: #9FB1B9; margin-top: -8px; }
.acase p { margin: 0; color: #D5DEE2; }
.acase ul { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid rgba(255,255,255,.16); }
.acase ul li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 14px; }
.acase ul li .k1 { color: #9FB1B9; flex: none; }
.acase ul li .v1 { text-align: right; }
.acase .ulink { align-self: flex-start; margin-top: 6px; color: var(--white); font-size: 15px; }
.acase .ulink .ico { width: 18px; height: 18px; }

/* ссылка на услугу внутри статьи */
.ahook { margin-top: 48px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 28px 30px; background: var(--pink); border-top: 3px solid var(--red); }
.ahook .t { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
.ahook p { margin: 8px 0 0; font-size: 16px; line-height: 1.5; color: var(--muted); }

/* ---------- контейнер средней ширины ---------- */
@container k (min-width: 821px) and (max-width: 1200px) {
  .toc { grid-column: 1 / 5; }
  .abody { grid-column: 5 / 13; }
  .ah .lh-l { grid-column: 1 / 8; }
  .ah .lh-r { grid-column: 8 / 13; }
  .kb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kb-grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acase { grid-template-columns: 1fr; }
  .acase .ph2 img { min-height: 260px; }
}

/* ---------- телефон ---------- */
@container k (max-width: 820px) {
  .kb-hero .h1l { font-size: 56px; }
  .kb-hero .lh-r { display: none; }
  .kb-feat .t { font-size: 22px; }
  .kb-feat .bd { padding: 18px 18px 20px; }
  .kb-head { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; margin-bottom: 28px; }
  .kb-tabs { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding-bottom: 2px; }
  .kb-tabs::-webkit-scrollbar { display: none; }
  .kw .kb-tab { flex: none; min-height: 44px; padding: 0 16px; font-size: 14px; }
  .kb-grid, .kb-grid.c4 { grid-template-columns: 1fr; gap: 28px; }
  .kb-grid.c4 .kb-card { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: start; }
  .kb-grid.c4 .kb-card .bd { padding-top: 0; gap: 6px; }
  .kb-grid.c4 .kb-card .ph .lbl { display: none; }
  .kb-grid.c4 .kb-card .t { font-size: 16px; }
  .kb-grid.c4 .kb-card .meta { padding-top: 8px; border-top: 0; }
  .kb-card .t { font-size: 20px; }
  .kb-ask { padding: 26px 20px; }
  .kb-ask .t { font-size: 24px; margin-top: 0; }
  .kb-ask .btn { align-self: stretch; }

  .ah .lh-grid, .kb-hero .lh-grid { align-items: stretch; }
  .ah .h1a { font-size: 34px; line-height: 1; hyphens: auto; overflow-wrap: break-word; }
  .ameta { margin-top: 24px; gap: 10px 22px; }
  .acover .ph { aspect-ratio: 4 / 3; }
  .art { display: block; }
  .toc { position: static; margin-bottom: 36px; gap: 0; }
  .toc-cta { display: none; }
  .toc nav a { font-size: 15px; padding: 10px 0; }
  .abody { font-size: 17px; line-height: 1.6; }
  .abody h2 { margin-top: 48px; font-size: 25px; grid-template-columns: 36px 1fr; gap: 8px; }
  .abody h2 > .n { transform: translateY(-3px); }
  .abody .chkl li, .abody .stp li { font-size: 16px; }
  .abody .stp li { grid-template-columns: 48px 1fr; gap: 12px; }
  .afig { margin-top: 28px; }
  .afig .ph, .afig.tall .ph { aspect-ratio: 4 / 3; }
  .atbl-w .capt { font-size: 15px; min-width: 0; }
  .atbl-w .capt td, .atbl-w .capt th { padding: 12px 14px; }
  .acase { grid-template-columns: 1fr; margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--pad)); }
  .acase .ph2 img { min-height: 220px; }
  .acase .bd { padding: 24px 20px 26px; }
  .acase .t { font-size: 21px; }
  .ahook { grid-template-columns: 1fr; padding: 22px 20px; gap: 16px; }
  .ahook .btn { width: 100%; }
  .ahook .t { font-size: 20px; }
}
