/* ============================================================
   Инструкции Онлайн — публичная часть
   Стиль: drench-герой (вариант C) + разделы построчно (вариант B)
   Шрифты: Unbounded (заголовки) + Inter (текст)
   Цвет: синий бренд + лаймовый акцент
   ============================================================ */

:root{
  --bg:          oklch(0.98 0.005 250);
  --raised:      oklch(1 0 0);
  --sunk:        oklch(0.965 0.005 250);
  --border:      oklch(0.9 0.008 250);
  --border-strong: oklch(0.83 0.01 250);

  --ink:         oklch(0.2 0.02 260);
  --ink-soft:    oklch(0.42 0.018 260);
  --ink-faint:   oklch(0.54 0.014 260);

  --brand:       oklch(0.52 0.2 258);
  --brand-2:     oklch(0.45 0.21 270);
  --brand-bright:oklch(0.62 0.18 255);
  --brand-ink:   oklch(0.4 0.18 260);
  --brand-soft:  oklch(0.96 0.035 258);

  --lime:        oklch(0.88 0.18 125);
  --lime-ink:    oklch(0.45 0.13 130);

  --ok:   oklch(0.6 0.13 150);
  --warn: oklch(0.7 0.15 70);

  --radius:    16px;
  --radius-lg: 18px;
  --radius-sm: 11px;
  --shadow:    0 1px 2px oklch(0.4 0.05 260 / .06), 0 6px 22px oklch(0.4 0.05 260 / .07);
  --shadow-lg: 0 16px 48px oklch(0.35 0.08 260 / .16);

  --maxw: 1120px;
  --display: "Unbounded", -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

*{box-sizing:border-box;}
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body{
  margin:0; font-family:var(--sans); color:var(--ink); background:var(--bg);
  line-height:1.6; font-size:17px; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  overflow-x:hidden;
}
img{ max-width:100%; height:auto; }
a{ color:var(--brand-ink); text-decoration:none; }
.wrap{ max-width:var(--maxw); margin:0 auto; padding:0 24px; }

/* ---------- Шапка ---------- */
.site-header{ background:var(--bg); }
.site-header .wrap{ display:flex; align-items:center; gap:24px; height:74px; }
.brand{ display:flex; align-items:center; gap:11px; flex-shrink:0; }
.brand-mark{
  width:40px; height:40px; border-radius:11px; display:block; object-fit:contain;
}
.brand-text b{ display:block; font-size:16px; line-height:1.05; color:var(--ink); font-weight:700; }
.brand-text span{ font-size:12px; color:var(--ink-faint); }
.nav{ margin-left:auto; display:flex; gap:8px; align-items:center; }
.nav a{ font-size:15px; font-weight:500; padding:9px 15px; border-radius:10px; color:var(--ink); }
.nav a:hover{ background:oklch(0.93 0.01 250); }
.nav a.cta{ background:var(--ink); color:#fff; }
.nav a.cta:hover{ background:var(--brand); }

/* ---------- Хлебные крошки ---------- */
.crumbs{ font-size:14px; color:var(--ink-faint); padding:20px 0 0; }
.crumbs a{ color:var(--ink-soft); }
.crumbs a:hover{ color:var(--brand-ink); }
.crumbs span{ margin:0 8px; opacity:.5; }

/* ---------- Drench-герой (вариант C) ---------- */
.hero{
  position:relative; overflow:hidden; color:#fff;
  background:linear-gradient(150deg, var(--brand), var(--brand-2));
  border-radius:28px; margin:8px 24px 0; padding:64px 56px 60px;
}
.hero::after{ content:""; position:absolute; right:-80px; top:-80px; width:380px; height:380px; border-radius:50%; background:oklch(1 0 0 / .08); }
.hero::before{ content:""; position:absolute; right:60px; bottom:-120px; width:260px; height:260px; border-radius:50%; background:var(--lime); opacity:.22; }
.hero-in{ position:relative; z-index:1; max-width:var(--maxw); margin:0 auto; }
.eyebrow{
  display:inline-flex; align-items:center; gap:8px; background:oklch(1 0 0 / .15);
  padding:7px 14px; border-radius:999px; font-size:13px; font-weight:600; margin-bottom:22px;
}
.eyebrow b{ color:var(--lime); font-size:11px; }
.hero h1{
  font-family:var(--display); font-weight:800; font-size:clamp(36px, 6vw, 70px);
  line-height:0.99; letter-spacing:-0.03em; margin:0; max-width:16ch; text-wrap:balance;
}
.hero p{ font-size:clamp(18px, 2.4vw, 21px); color:oklch(0.95 0.02 258); max-width:52ch; margin:20px 0 0; }
.hero-search{ margin-top:30px; max-width:560px; display:flex; gap:10px; }
.hero-search form{ display:flex; gap:10px; width:100%; }
.hero-search input{
  flex:1; height:56px; padding:0 22px; border-radius:14px; border:none;
  font-size:16px; font-family:inherit; color:var(--ink); min-width:0;
}
.hero-search input:focus{ outline:3px solid var(--lime); }
.hero-search button{
  height:56px; padding:0 26px; border-radius:14px; border:none; background:var(--ink); color:#fff;
  font-weight:600; font-size:16px; font-family:inherit; cursor:pointer; flex-shrink:0;
}
.hero-search button:hover{ background:oklch(0.12 0.02 260); }

/* ---------- Секции ---------- */
.sec{ padding:54px 0 30px; }
.sec-head h2{ font-family:var(--display); font-weight:700; font-size:clamp(25px, 3.4vw, 38px); letter-spacing:-0.025em; margin:0 0 6px; color:var(--ink); }
.sec-head .sub{ color:var(--ink-soft); font-size:17px; margin:0 0 26px; }

/* ---------- Разделы построчно (вариант B в эстетике C) ---------- */
.cats{
  display:grid; gap:0; border:1px solid var(--border); border-radius:var(--radius-lg);
  overflow:hidden; background:var(--raised); box-shadow:var(--shadow);
}
.cat{
  display:flex; align-items:center; gap:18px; padding:20px 24px;
  border-bottom:1px solid var(--border); transition:background .14s;
}
.cat:last-child{ border-bottom:none; }
.cat:hover{ background:var(--brand-soft); }
.cat-ic{
  flex-shrink:0; width:50px; height:50px; border-radius:13px;
  background:var(--brand-soft); color:var(--brand-ink); display:grid; place-items:center; transition:background .14s, color .14s;
}
.cat:hover .cat-ic{ background:var(--brand); color:#fff; }
.cat-body{ flex:1; min-width:0; }
.cat-body h3{ font-family:var(--display); font-weight:600; font-size:19px; letter-spacing:-0.015em; margin:0; color:var(--ink); }
.cat-body p{ font-size:14.5px; color:var(--ink-soft); margin:3px 0 0; }
.cat-n{
  flex-shrink:0; font-size:14px; font-weight:700; color:var(--brand-ink);
  background:var(--brand-soft); padding:6px 13px; border-radius:999px;
}
.cat-ar{ flex-shrink:0; color:var(--ink-faint); display:grid; place-items:center; }
.cat:hover .cat-ar{ color:var(--brand-ink); }

/* ---------- Список инструкций внутри раздела ---------- */
.instr-list{
  display:grid; gap:12px; margin:22px 0 40px;
}
.instr-row{
  display:flex; align-items:center; gap:16px; padding:18px 22px;
  background:var(--raised); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); transition:background .14s, border-color .14s, transform .14s, box-shadow .14s;
  min-height:80px;
}
.instr-row:hover{ background:var(--brand-soft); border-color:var(--brand-bright); transform:translateY(-1px); box-shadow:var(--shadow-lg); }
.instr-row .num{
  flex-shrink:0; width:38px; height:38px; border-radius:10px; background:var(--sunk);
  color:var(--ink-faint); display:grid; place-items:center; font-size:15px; font-weight:700; font-family:var(--display);
}
.instr-row:hover .num{ background:var(--lime); color:var(--lime-ink); }
.instr-row .body{ flex:1; min-width:0; }
.instr-row h3{
  font-family:var(--sans); margin:0; font-size:16.5px; color:var(--ink); font-weight:600;
  line-height:1.3; overflow-wrap:anywhere;
  display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden; max-height:2.6em;
}
.instr-row .arrow{ color:var(--ink-faint); flex-shrink:0; }
.instr-row:hover .arrow{ color:var(--brand-ink); }

/* ---------- Страница инструкции ---------- */
.article-head{ padding:10px 0 4px; }
.article-head h1{
  font-family:var(--display); font-weight:700; font-size:clamp(27px, 3.8vw, 40px);
  line-height:1.08; margin:12px 0 12px; letter-spacing:-0.025em; text-wrap:balance; color:var(--ink);
}
.article-meta{ font-size:13.5px; color:var(--ink-faint); display:flex; gap:18px; flex-wrap:wrap; }
.article-layout{ display:grid; grid-template-columns:1fr; gap:40px; max-width:820px; }

.prose{ max-width:75ch; font-size:17.5px; }
.prose > *:first-child{ margin-top:0; }
.prose h2{ font-family:var(--display); font-weight:600; font-size:24px; margin:38px 0 14px; letter-spacing:-0.02em; color:var(--ink); line-height:1.22; }
.prose h3{ font-family:var(--display); font-weight:600; font-size:19px; margin:28px 0 10px; color:var(--ink); }
.prose h4{ font-size:17px; margin:22px 0 8px; color:var(--ink); font-weight:700; }
.prose p{ margin:0 0 16px; text-wrap:pretty; }
.prose ul, .prose ol{ margin:0 0 18px; padding-left:26px; }
.prose li{ margin:6px 0; }
.prose a{ color:var(--brand-ink); text-decoration:underline; text-underline-offset:2px; }
.prose a:hover{ color:var(--brand); }
.prose img{ border-radius:var(--radius-sm); border:1px solid var(--border); margin:20px 0; display:block; box-shadow:var(--shadow); }
.prose figure{ margin:22px 0; }
.prose figcaption{ font-size:14px; color:var(--ink-faint); text-align:center; margin-top:8px; }
.prose blockquote{ margin:20px 0; padding:14px 20px; border-left:4px solid var(--lime); background:var(--brand-soft); border-radius:0 var(--radius-sm) var(--radius-sm) 0; color:var(--ink-soft); }
.prose pre{ background:oklch(0.24 0.02 260); color:oklch(0.95 0.01 255); padding:16px 18px; border-radius:var(--radius-sm); overflow-x:auto; font-size:14.5px; }
.prose code{ background:var(--sunk); padding:2px 6px; border-radius:5px; font-size:.9em; }
.prose pre code{ background:none; padding:0; }
.prose table{ border-collapse:collapse; width:100%; margin:20px 0; font-size:15.5px; }
.prose th, .prose td{ border:1px solid var(--border-strong); padding:9px 13px; text-align:left; }
.prose th{ background:var(--sunk); font-weight:600; }
.prose hr{ border:none; border-top:1px solid var(--border); margin:32px 0; }

/* Похожие */
.related{ margin:48px 0 20px; padding-top:30px; border-top:1px solid var(--border); }
.related h2{ font-family:var(--display); font-weight:600; font-size:20px; margin:0 0 16px; color:var(--ink); }

/* ---------- Пустые состояния / поиск ---------- */
.empty{ text-align:center; padding:60px 20px; color:var(--ink-faint); }
.empty svg{ margin-bottom:14px; opacity:.5; }
.search-info{ font-size:15px; color:var(--ink-soft); margin:22px 0 8px; }
mark{ background:var(--lime); color:var(--lime-ink); padding:0 3px; border-radius:3px; }

/* ---------- Кнопка наверх ---------- */
.to-top{
  position:fixed; right:22px; bottom:22px; width:48px; height:48px; border-radius:50%;
  background:var(--brand); color:#fff; border:none; display:grid; place-items:center; cursor:pointer;
  box-shadow:var(--shadow-lg); opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:90;
}
.to-top.show{ opacity:1; pointer-events:auto; }
.to-top:hover{ background:var(--brand-2); transform:translateY(-2px); }

/* ---------- Подвал ---------- */
.site-footer{ margin-top:60px; border-top:1px solid var(--border); background:var(--raised); padding:30px 0; font-size:14px; color:var(--ink-faint); }
.site-footer .wrap{ display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.site-footer b{ color:var(--ink-soft); font-weight:600; }

/* ---------- Адаптив ---------- */
@media (max-width:820px){
  .hero{ padding:48px 30px 44px; margin:8px 16px 0; }
}
@media (max-width:640px){
  body{ font-size:16px; }
  .wrap{ padding:0 16px; }
  .site-header .wrap{ height:auto; padding:14px 16px; }
  .brand-text span{ display:none; }
  .nav a:not(.cta){ display:none; }
  .hero{ padding:38px 22px 36px; margin:8px 12px 0; border-radius:22px; }
  .hero-search form{ flex-direction:column; }
  .hero-search button{ width:100%; }
  .sec{ padding:38px 0 20px; }
  .cat{ padding:16px 18px; gap:14px; }
  .cat-n{ display:none; }
  .cat-ic{ width:44px; height:44px; }
  .instr-row{ padding:15px 16px; gap:12px; min-height:72px; }
  .instr-list{ gap:10px; }
  .prose{ font-size:16.5px; }
  .site-footer .wrap{ flex-direction:column; }
}
@media (max-width:380px){
  .hero h1{ font-size:30px; }
  .brand-text b{ font-size:15px; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation:none !important; transition:none !important; scroll-behavior:auto !important; }
}

/* Отключение лаймового акцента (управляется в админке) */
body.no-lime{
  --lime: var(--brand-bright);
  --lime-ink: #fff;
}
body.no-lime .eyebrow b{ color:#fff; }
