/* ============================================================
   Стоп Приказ — Blog index + Article page
   Reuses tokens + .kbcard from styles.css
   ============================================================ */

/* ---------- shared page header ---------- */
.page-head { padding-top: clamp(36px, 6vh, 80px); padding-bottom: clamp(28px, 4vh, 48px); }
.page-head__eyebrow { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); margin-bottom: 18px; }
.page-head__eyebrow::before { content: ""; width: 24px; height: 3px; border-radius: 3px; background: var(--lime); }
.page-head__title { font-family: var(--font-head); font-weight: 800; font-size: clamp(38px, 6vw, 78px); line-height: 0.98; letter-spacing: -0.04em; max-width: 16ch; }
.page-head__sub { color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.5; margin-top: 18px; max-width: 56ch; }

/* ---------- filter chips ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: clamp(28px, 4vw, 44px); }
.filter button {
  font-family: var(--font-body); font-weight: 700; font-size: 14px; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-pill);
  padding: 11px 18px; cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.filter button:hover { border-color: var(--ink); }
.filter button[aria-pressed="true"] { background: var(--ink); color: var(--lime); border-color: var(--ink); }

/* ---------- featured ---------- */
.feat {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 0; border-radius: var(--radius-lg);
  overflow: hidden; border: 1.5px solid var(--line); background: var(--white); margin-bottom: 18px;
  cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; color: inherit;
}
.feat:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 28px 60px -30px rgba(20,22,11,0.34); }
.feat__body { padding: clamp(28px, 4vw, 46px); display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.feat__tag { align-self: flex-start; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); background: var(--lime-pale); padding: 6px 12px; border-radius: var(--radius-pill); }
.feat__title { font-family: var(--font-head); font-weight: 800; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.04; letter-spacing: -0.03em; }
.feat__excerpt { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 46ch; }
.feat__meta { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.feat__art { background: var(--lime); position: relative; min-height: 240px; overflow: hidden; }
.feat__art::before { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(135deg, transparent 0 30px, color-mix(in srgb, var(--ink) 5%, transparent) 30px 31px); }
.feat__doc { position: absolute; inset: 0; margin: auto; width: 60%; height: 72%; background: var(--white); border-radius: 12px; box-shadow: 0 24px 50px -20px rgba(0,0,0,0.3); padding: 22px; }
.feat__doc .ln { height: 9px; background: var(--line); border-radius: 999px; margin: 9px 0; }
.feat__doc .ln.s { width: 48%; } .feat__doc .ln.m { width: 76%; }
.feat__doc .ln.head { height: 14px; width: 60%; background: var(--ink); margin-bottom: 16px; }
@media (max-width: 760px) { .feat { grid-template-columns: 1fr; } .feat__art { min-height: 180px; order: -1; } }

.kbcard.is-hidden { display: none; }

/* ---------- knowledge-base category list (SSR articles index) ---------- */
.kb-cat { margin: 8px 0 36px; }
.kb-cat__title { font-family: var(--font-head); font-weight: 800; font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.02em; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1.5px solid var(--line); }
.kb-list { display: grid; gap: 10px; }
.kb-item { display: grid; gap: 4px; padding: 16px 18px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--white); color: inherit; transition: border-color .15s, transform .15s; }
.kb-item:hover { border-color: var(--ink); transform: translateY(-2px); }
.kb-item__title { font-family: var(--font-head); font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.kb-item__sub { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.art-wrap { width: min(760px, 100% - 48px); margin-inline: auto; }
.art-back { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.art-back:hover { color: var(--ink); }
.art-back svg { width: 17px; height: 17px; }
.art-head { padding-top: clamp(28px, 5vh, 56px); padding-bottom: 8px; }
.art-tag { display: inline-flex; align-items: center; font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); background: var(--lime-pale); padding: 6px 13px; border-radius: var(--radius-pill); }
.art-title { font-family: var(--font-head); font-weight: 800; font-size: clamp(32px, 5vw, 56px); line-height: 1.0; letter-spacing: -0.035em; margin: 18px 0 16px; }
.art-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--muted); font-size: 14px; font-weight: 600; }
.art-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }
.art-cover { margin: 30px 0 8px; border-radius: var(--radius-lg); background: var(--lime); min-height: 260px; position: relative; overflow: hidden; }
.art-cover::before { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(135deg, transparent 0 34px, color-mix(in srgb, var(--ink) 5%, transparent) 34px 35px); }

/* article body typography */
.art-body { padding: clamp(28px, 4vh, 44px) 0 0; font-size: 18px; line-height: 1.7; color: var(--ink-2); }
.art-body > * { max-width: 68ch; }
.art-body h2 { font-family: var(--font-head); font-weight: 800; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.025em; line-height: 1.12; margin: 40px 0 16px; }
.art-body h3 { font-family: var(--font-head); font-weight: 800; font-size: 21px; letter-spacing: -0.02em; margin: 28px 0 12px; }
.art-body p { margin: 0 0 20px; }
.art-body ul, .art-body ol { margin: 0 0 22px; padding-left: 0; list-style: none; display: grid; gap: 11px; }
.art-body ul li { display: flex; gap: 12px; }
.art-body ul li::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 4px; border-radius: 50%; background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2314160B' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 12px no-repeat; }
.art-body ol { counter-reset: n; }
.art-body ol li { display: flex; gap: 12px; counter-increment: n; }
.art-body ol li::before { content: counter(n); flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--lime); font-family: var(--font-head); font-weight: 800; font-size: 13px; display: grid; place-items: center; margin-top: 2px; }
.art-body strong { font-weight: 700; color: var(--ink); }
.art-body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--lime); text-decoration-thickness: 2px; font-weight: 600; }
.art-callout { background: #fff5e6; border: 1.5px solid #f0d49f; border-radius: var(--radius); padding: 20px 22px; margin: 0 0 24px; font-size: 16px; line-height: 1.6; color: #7a5417; }
.art-callout strong { color: #5a3d10; }
.art-key { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 26px; margin: 8px 0 24px; }
.art-key__t { font-family: var(--font-head); font-weight: 800; font-size: 18px; margin-bottom: 14px; }

/* in-article CTA */
.art-cta { background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: clamp(28px, 4vw, 44px); margin: 36px 0; display: grid; gap: 18px; max-width: none; }
.art-cta__t { font-family: var(--font-head); font-weight: 800; font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.03em; line-height: 1.05; }
.art-cta__t .lime { color: var(--lime); }
.art-cta__d { color: rgba(255,255,255,0.78); font-size: 16px; line-height: 1.5; max-width: 50ch; }
.art-cta__row { display: flex; gap: 12px; flex-wrap: wrap; }

/* table of contents */
.art-toc { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin: 0 0 8px; }
.art-toc__t { font-weight: 700; font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.art-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; display: grid; gap: 9px; }
.art-toc li { counter-increment: toc; }
.art-toc a { display: flex; gap: 11px; font-size: 15px; font-weight: 600; color: var(--ink); }
.art-toc a::before { content: counter(toc, decimal-leading-zero); color: var(--muted); font-variant-numeric: tabular-nums; }
.art-toc a:hover { color: var(--olive, var(--ink)); text-decoration: underline; text-underline-offset: 3px; }

/* related */
.art-related { border-top: 1.5px solid var(--line); margin-top: 12px; }
.art-share { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }

/* ---------- разделы на странице /articles (группы Основы/Сроки/…) ---------- */
.kbsec { margin-bottom: clamp(40px, 6vw, 72px); }
.kbsec__head { display: flex; align-items: baseline; gap: 14px; margin-bottom: clamp(20px, 3vw, 30px); padding-bottom: 16px; border-bottom: 1.5px solid var(--line); }
.kbsec__title { font-family: var(--font-head); font-weight: 800; font-size: clamp(24px, 3vw, 36px); letter-spacing: -0.03em; line-height: 1; }
.kbsec__count { font-size: 14px; font-weight: 700; color: var(--ink); background: var(--lime-pale); border-radius: var(--radius-pill); padding: 5px 12px; }

/* featured «готовый документ» — лаймовая галочка поверх карточки-документа */
.feat__doc { display: block; }
.feat__doc .stamp { position: absolute; right: -14px; bottom: -14px; width: 52px; height: 52px; border-radius: 50%; background: var(--ink); display: grid; place-items: center; box-shadow: 0 12px 28px -10px rgba(20,22,11,0.5); }
.feat__doc .stamp svg { width: 26px; height: 26px; stroke: var(--lime); }

/* ---------- перелинковка «Читайте также» в конце статьи ---------- */
/* зазор до футера, чтобы карточки не прилипали */
.art-wrap { padding-bottom: clamp(56px, 8vh, 96px); }
.related { margin-top: clamp(40px, 6vw, 72px); padding-top: clamp(28px, 4vw, 44px); border-top: 1.5px solid var(--line); }
.related__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: clamp(20px, 3vw, 28px); flex-wrap: wrap; }
.related__t { font-family: var(--font-head); font-weight: 800; font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.03em; line-height: 1; }
.related__all { font-weight: 700; font-size: 14px; color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.related__all svg { width: 16px; height: 16px; stroke: var(--ink); transition: transform .18s; }
.related__all:hover svg { transform: translateX(3px); }
.related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .related__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .related__grid { grid-template-columns: 1fr; } }

/* шорткод [widget_upload_order] → лайм-CTA внутри статьи */
.art-body .art-widget__btn { display: inline-flex; margin-top: 8px; }

/* шорткод [widget_court_search] → мини-виджет «узнайте свой участок» */
.sp-courtw { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: clamp(18px, 3vw, 24px); margin: 28px 0; }
.sp-courtw__q { font-family: var(--font-head); font-weight: 800; font-size: clamp(17px, 2.2vw, 20px); letter-spacing: -0.02em; margin-bottom: 14px; }
.sp-courtw__row { display: flex; gap: 10px; flex-wrap: wrap; }
.sp-courtw__input { flex: 1 1 200px; font: inherit; font-size: 16px; color: var(--ink); background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 11px 16px; }
.sp-courtw__input:focus { outline: none; border-color: var(--ink); }
.sp-courtw .btn { flex: 0 0 auto; }

/* ---------- фильтр/поиск на /articles ---------- */
.kbfilter { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: clamp(24px, 4vw, 40px); }
.kbfilter__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kbchip { font: inherit; font-weight: 700; font-size: 14px; color: var(--ink); background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-pill); padding: 8px 16px; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.kbchip:hover { border-color: var(--ink); }
.kbchip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.kbfilter__search { font: inherit; font-size: 15px; color: var(--ink); background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-pill); padding: 9px 18px; min-width: 240px; flex: 0 1 320px; }
.kbfilter__search:focus { outline: none; border-color: var(--ink); }
.kbfilter-empty { color: var(--muted); font-size: 16px; padding: 8px 0 40px; }
.kbcard__tag, .feat__tag { transition: background .15s, color .15s; }

/* ---------- UX-триггеры: toast копирования + скролл-ловушка ---------- */
.sp-toast, .sp-trap { position: fixed; z-index: 60; background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: 0 24px 60px -18px rgba(0,0,0,0.5); max-width: 340px; }
.sp-toast { right: 24px; bottom: 24px; transform: translateY(140%); opacity: 0; transition: transform .35s ease, opacity .35s ease; }
.sp-toast.is-on { transform: none; opacity: 1; }
.sp-trap { right: 24px; bottom: 24px; transform: translateX(140%); opacity: 0; transition: transform .4s ease, opacity .4s ease; }
.sp-trap.is-on { transform: none; opacity: 1; }
.sp-toast__t, .sp-trap__t { font-family: var(--font-head); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; margin-bottom: 8px; }
.sp-toast__d, .sp-trap__d { color: rgba(255,255,255,0.8); font-size: 14px; line-height: 1.5; margin-bottom: 14px; }
.sp-toast__btn, .sp-trap__btn { display: inline-flex; }
.sp-toast__x, .sp-trap__x { position: absolute; top: 10px; right: 12px; background: transparent; border: none; color: rgba(255,255,255,0.6); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.sp-toast__x:hover, .sp-trap__x:hover { color: #fff; }
@media (max-width: 560px) { .sp-toast, .sp-trap { left: 16px; right: 16px; bottom: 16px; max-width: none; } }
