/* сайт viterio.ru: общая шапка и подвал, статьи, списки, база знаний. Свои стили — в админке сайта → «Оформление» → CSS */
:root { --navy: #14285a; --text: #1e293b; --mute: #64748b; --line: #e2e8f0; --acc: #0369a1; --bg: #f8fafc; --yellow: #ffd000; --green: #10b981; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 17px/1.7 var(--font); -webkit-font-smoothing: antialiased;
       min-height: 100vh; display: flex; flex-direction: column; }  /* подвал — внизу экрана и на короткой странице */
body > * { flex: none; } .box, .lst, .dw { width: 100%; }
.mute { color: var(--mute); }
a { color: var(--acc); }
img { max-width: 100%; height: auto; }

/* шапка */
.sh { background: var(--navy); color: #fff; }
.sh-in { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.sh-logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; display: inline-flex; align-items: center; gap: 10px; }
.sh-logo img { width: 32px; height: 32px; background: #fff; border-radius: 8px; padding: 4px; }
.sh-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.sh-nav a { color: #dbeafe; text-decoration: none; font-size: 15px; font-weight: 500; } .sh-nav a:hover, .sh-nav a.on { color: #fff; }
.sh-btns { margin-left: auto; display: flex; gap: 8px; }
.sh-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 10px; font-size: 15px; font-weight: 600; text-decoration: none; }
.sh-yellow { background: var(--yellow); color: #333; } .sh-ghost { color: #fff; border: 1px solid rgba(255,255,255,.4); }
.sh-btn:hover { opacity: .9; }
@media (max-width: 760px) {
  .sh-in { gap: 10px 16px; padding: 10px 16px; } .sh-nav { order: 3; width: 100%; gap: 16px; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; scrollbar-width: none; }
  .sh-btn { height: 36px; padding: 0 12px; font-size: 14px; white-space: nowrap; } .sh-btns { gap: 6px; }
}
@media (max-width: 420px) {  /* логотип и обе кнопки — в одну строку и на узком телефоне */
  .sh-in { column-gap: 8px; padding: 10px 12px; } .sh-logo { font-size: 18px; gap: 6px; } .sh-logo img { width: 28px; height: 28px; }
  .sh-btn { padding: 0 9px; font-size: 13px; }
}

/* подвал */
.sf { background: #0f172a; color: #94a3b8; font-size: 14px; margin-top: auto; }
body > .sf { margin-top: auto; } .box, .lst { margin-bottom: 60px !important; } .dw { margin-bottom: 40px; }
.sf-in { max-width: 1200px; margin: 0 auto; padding: 28px 20px; display: flex; gap: 12px 30px; flex-wrap: wrap; align-items: center; }
.sf nav { display: flex; gap: 10px 22px; flex-wrap: wrap; margin-left: auto; } .sf a { color: #cbd5e1; text-decoration: none; } .sf a:hover { color: #fff; }
.sf-req { flex-basis: 100%; font-size: 12px; color: #64748b; } .sf-req a { color: #94a3b8; }

/* текст статьи */
.doc h1 { font-size: 40px; line-height: 1.2; font-weight: 700; margin: 0 0 16px; color: var(--navy); letter-spacing: -.01em; }
.doc h2 { font-size: 26px; font-weight: 700; line-height: 1.3; margin: 36px 0 12px; color: #0f172a; }
.doc h3 { font-size: 20px; font-weight: 600; margin: 24px 0 8px; color: #0f172a; }
.doc p, .doc li { margin: 0 0 14px; } .doc ul, .doc ol { padding-left: 26px; } .doc b, .doc strong { font-weight: 600; color: #0f172a; }
.doc img { border-radius: 12px; margin: 8px 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.doc blockquote { margin: 14px 0; padding: 4px 18px; border-left: 4px solid #cbd5e1; color: #475569; }
.doc code { font-family: ui-monospace, Consolas, monospace; font-size: 15px; background: #f1f5f9; padding: 1px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.doc pre { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 14px 16px; overflow-x: auto; font: 14px/1.55 ui-monospace, Consolas, monospace; }
.doc pre code { background: none; padding: 0; color: inherit; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 8px 0 16px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; } .doc th { color: var(--mute); font-weight: 500; }
.doc .tip, .doc .warn { border-radius: 10px; padding: 10px 14px; margin: 14px 0; font-size: 16px; }
.doc .tip { background: #ecfeff; border-left: 4px solid #06b6d4; } .doc .warn { background: #fef9c3; border-left: 4px solid #eab308; }

/* страница и статья блога */
.box { max-width: 860px; margin: 32px auto; padding: 0 20px; }
.card-w { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 36px 44px; }
.crumb { font-size: 14px; color: var(--mute); margin-bottom: 10px; } .crumb a { color: var(--mute); text-decoration: none; } .crumb a:hover { color: var(--acc); }
.crumb > * + *::before { content: "›"; margin: 0 7px; color: #cbd5e1; }
.pmeta { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--mute); margin: -4px 0 22px; }
.pmeta a { color: var(--mute); } .pmeta img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 6px; }
.cover { width: 100%; border-radius: 14px; margin: 0 0 24px; display: block; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.tags a { font-size: 14px; background: #eff6ff; color: #1d4ed8; border-radius: 999px; padding: 4px 12px; text-decoration: none; } .tags a:hover { background: #dbeafe; }
.abox { display: flex; gap: 16px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.abox img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; } .abox b { color: var(--navy); } .abox small { color: var(--mute); display: block; }
.abox .t { font-size: 15px; } .abox .t p { margin: 4px 0; }
@media (max-width: 760px) { .box { margin: 0 auto; padding: 0; } .card-w { border-radius: 0; border-width: 0 0 1px; padding: 22px 16px; } .doc h1 { font-size: 28px; } .doc h2 { font-size: 22px; } body { font-size: 16px; } }

/* списки статей */
.lst { max-width: 1200px; margin: 32px auto; padding: 0 20px; }
.lst-h { margin-bottom: 24px; } .lst-h h1 { font-size: 40px; line-height: 1.2; margin: 0 0 8px; color: var(--navy); } .lst-h .intro { color: #475569; max-width: 760px; }
.lst-t { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 8px; } .lst-h .lst-t h1 { margin: 0; }
.lst-s { display: flex; width: 340px; max-width: 100%; background: #fff; border: 1px solid #cbd5e1; border-radius: 12px; overflow: hidden; }
.lst-s:focus-within { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14, 165, 233, .15); }
.lst-s input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 11px 14px; font: inherit; font-size: 16px; background: transparent; color: #0f172a; }
.lst-s button { flex: none; width: 46px; border: 0; background: #0ea5e9; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lst-s button:hover { background: #0284c7; } .lst-s svg { width: 20px; height: 20px; }
.lst-f { color: var(--mute); font-size: 15px; margin-top: 4px; } .lst-f a { color: var(--acc); }
@media (max-width: 760px) { .lst-s { width: 100%; } }
.lst-h .who { display: flex; gap: 18px; align-items: center; } .lst-h .who img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.subs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 22px; }
.subs a { font-size: 15px; background: #fff; border: 1px solid var(--line); color: #334155; border-radius: 999px; padding: 6px 14px; text-decoration: none; }
.subs a:hover, .subs a.on { border-color: var(--acc); color: var(--acc); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.pc { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.pc:hover { box-shadow: 0 10px 30px rgba(15,23,42,.08); transform: translateY(-2px); }
.pc .im { aspect-ratio: 16 / 9; background: #e2e8f0 center / cover no-repeat; }
.pc .in { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pc .c { font-size: 13px; font-weight: 600; color: var(--acc); text-transform: uppercase; letter-spacing: 1px; }
.pc b { font-size: 20px; line-height: 1.3; color: #0f172a; } .pc p { margin: 0; font-size: 15px; color: #475569; } .pc small { margin-top: auto; color: var(--mute); font-size: 13px; }
.empty { color: var(--mute); background: #fff; border: 1px dashed #cbd5e1; border-radius: 16px; padding: 40px; text-align: center; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 30px 0 0; flex-wrap: wrap; }
.pager a, .pager span { min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; background: #fff;
  border: 1px solid var(--line); text-decoration: none; color: #334155; font-size: 15px; padding: 0 12px; }
.pager span.on { background: var(--navy); color: #fff; border-color: var(--navy); }
@media (max-width: 760px) { .lst { margin: 20px auto; padding: 0 16px; } .lst-h h1 { font-size: 28px; } .grid { grid-template-columns: 1fr; } }

/* база знаний: меню разделов слева и поиск */
.dw { max-width: 1200px; margin: 24px auto 0; display: grid; grid-template-columns: 280px 1fr; gap: 20px; padding: 0 20px; }
.dnav { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 10px; }
.dnav .srch { position: relative; margin: 0 0 8px; }
.dnav .srch input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 8px 34px; font: inherit; font-size: 15px; background: #f8fafc; }
.dnav .srch svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #64748b; }
.dnav details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; border-radius: 8px; user-select: none; }
.dnav details > summary::-webkit-details-marker { display: none; }
.dnav details > summary::before { content: ""; width: 7px; height: 7px; border: solid #94a3b8; border-width: 0 2px 2px 0; transform: rotate(-45deg); transition: transform .15s; flex: none; margin: 0 3px; }
.dnav details[open] > summary::before { transform: rotate(45deg); }
.dnav summary:hover { background: #f1f5f9; }
.dnav .cat > summary { font-size: 15px; font-weight: 600; color: var(--navy); padding: 7px 8px; margin-top: 2px; }
.dnav .sub { margin-left: 14px; } .dnav .sub > summary { font-size: 14px; font-weight: 500; color: #334155; padding: 5px 8px; }
.dnav .arts { margin: 1px 0 6px 21px; border-left: 2px solid #e2e8f0; padding-left: 6px; } .dnav .cat > .arts { margin-left: 18px; }
.dnav a { display: block; padding: 4px 9px; border-radius: 7px; color: #475569; text-decoration: none; font-size: 14px; line-height: 1.4; }
.dnav a:hover { background: #f1f5f9; color: #0f172a; } .dnav a.on { background: #e0f2fe; color: #075985; font-weight: 600; }
.dnav .cl { font-size: 13px; color: var(--mute); padding: 2px 9px; }
.dmain { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 30px 36px; min-width: 0; }
.dmain .doc h1 { font-size: 32px; } .dmain .doc h2 { font-size: 22px; }
.pn { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pn a { text-decoration: none; font-size: 15px; } .pn small { display: block; color: var(--mute); font-size: 12px; }
.ov { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 10px; }
.ov section { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; } .ov h3 { margin: 0 0 6px; font-size: 17px; } .ov h3 a { color: var(--navy); text-decoration: none; }
.ov ul { margin: 0; padding-left: 18px; font-size: 15px; } .ov li { margin: 0 0 4px; }
#results { display: none; } body.searching #results { display: block; } body.searching #art { display: none; }
.res { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: inherit; border: 1px solid var(--line); margin-bottom: 8px; }
.res:hover { border-color: #7dd3fc; background: #f0f9ff; } .res b { color: var(--navy); } .res small { color: #0e7490; margin-left: 6px; }
.res div { font-size: 14px; color: #475569; margin-top: 2px; } mark { background: #fde68a; border-radius: 3px; padding: 0 1px; }
.dmenu { display: none; }
@media (max-width: 860px) {
  .dw { grid-template-columns: 1fr; padding: 0; margin: 0; gap: 0; }
  .dnav { position: static; max-height: none; border-radius: 0; border-width: 0 0 1px; display: none; } body.menu .dnav { display: block; }
  .dmain { border-radius: 0; border-width: 0; padding: 20px 16px; } .dmain .doc h1 { font-size: 26px; }
  .dmenu { display: flex; align-items: center; gap: 8px; width: 100%; background: #fff; border: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; font: inherit; font-size: 15px; font-weight: 600; color: var(--navy); cursor: pointer; }
  .dmenu svg { width: 20px; height: 20px; }
  .sf { margin-top: 0; }
}

/* полоска «Править» — видят только сотрудники с правом на сайт */
.editbar { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; gap: 6px; }
.editbar a { display: inline-flex; align-items: center; gap: 6px; background: #8b5cf6; color: #fff; text-decoration: none; font: 600 14px/1 system-ui, sans-serif;
  padding: 10px 14px; border-radius: 10px; box-shadow: 0 6px 20px rgba(15,23,42,.25); }
.editbar a.dr { background: #f59e0b; } .editbar svg { width: 16px; height: 16px; }
