/*
Theme Name: Свод — ИИ-Юрист
Theme URI: https://new.ailawyer.su
Author: ГК «Связь» / ООО «Русвязь»
Description: Тема сайта «ИИ-Юрист» на дизайн-системе «Свод». Те же токены, что в приложении app.ailawyer.su: петроль-бренд с изолированной семантикой, засечные заголовки, моно с tabular-nums для номеров дел и сумм. Каноны: GOV.UK Design System, Microsoft HAX, WCAG 2.2 AA.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
License: Proprietary
Text Domain: svod
*/

/* ============================================================
   Токены «Свода» — зеркало apps/web/src/css/svod.scss приложения.
   ⚠️ Меняются вместе: сайт и приложение обязаны выглядеть одним продуктом.
   Часть значений WP отдаёт сам через theme.json (--wp--preset--*),
   здесь — то, чего в theme.json нет.
   ============================================================ */
:root {
  --paper: #f4f5f3;
  --surface: #ffffff;
  --surface-2: #edefee;
  --ink: #12181b;
  --ink-2: #3d4a4e;
  --ink-3: #5f6c70;
  --rule: #dce1df;
  --rule-2: #c3cbc8;

  --accent: #0e5e6f;
  --accent-deep: #093f4a;
  --accent-soft: #e3eff1;
  --on-accent: #ffffff;

  --brass: #9c7b2e;
  --brass-soft: #f4eddc;

  --ok: #1e6b45;
  --ok-soft: #e4f0e9;
  --warn: #9a6400;
  --warn-soft: #fbf0dc;
  --crit: #a32a21;
  --crit-soft: #fae7e5;

  --font-serif: Georgia, 'PT Serif', 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, 'Liberation Mono', monospace;

  --r: 10px;
  --r-s: 6px;
  --r-l: 14px;
  --shadow-sm: 0 1px 2px rgba(18, 24, 27, 0.06);
  --shadow: 0 1px 2px rgba(18, 24, 27, 0.06), 0 8px 24px -12px rgba(18, 24, 27, 0.18);
  --tap: 44px;
}

/* ---------- База ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 12px;
}
h1 { font-size: clamp(30px, 5vw, 46px); }
h2 { font-size: clamp(22px, 3vw, 30px); margin-top: 32px; }
h3 { font-size: 20px; margin-top: 24px; }
p, li { font-size: 16px; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-deep); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.svod-data { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent); padding: 10px 16px;
}
.skip-link:focus { left: 8px; top: 8px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.prose { max-width: 44rem; }

/* ---------- Шапка ---------- */
.site-header {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--accent); color: #fff;
  font-family: var(--font-serif); font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.brand__name { color: #fff; font-weight: 700; font-size: 15px; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: #cfd8d9;
  text-decoration: none;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--r-s);
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
.nav a:hover, .nav a:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav .current-menu-item > a { color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.nav__cta {
  background: var(--accent) !important;
  color: #fff !important;
  font-weight: 600;
}
.nav__cta:hover { background: var(--accent-deep) !important; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none; border: 1px solid rgba(255,255,255,.25); color: #fff;
  border-radius: var(--r-s); min-height: 40px; padding: 0 12px; cursor: pointer;
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav {
    display: none; width: 100%; flex-direction: column; align-items: stretch;
    padding-bottom: 10px;
  }
  .site-header__inner { flex-wrap: wrap; }
  .site-header.is-open .nav { display: flex; }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 12px 22px;
  border-radius: var(--r-s); border: 1px solid transparent;
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-deep); color: #fff; }
.btn--ghost { border-color: var(--rule-2); color: var(--accent); background: transparent; }

/* ---------- Главная ---------- */
.hero { padding: 64px 0 48px; border-bottom: 1px solid var(--rule); }
.hero__eyebrow {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-3);
}
.hero h1 { margin: 12px 0 0; max-width: 20ch; }
.hero__lede { font-size: 18px; color: var(--ink-2); max-width: 54ch; margin: 16px 0 26px; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__note { margin-top: 16px; font-size: 13px; color: var(--ink-3); }

.section { padding: 52px 0; }
.section__title { margin-bottom: 6px; }
.section__lede { color: var(--ink-2); max-width: 56ch; margin: 0 0 26px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 20px; text-decoration: none; color: inherit; display: block;
  box-shadow: var(--shadow-sm);
}
a.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card__title { font-family: var(--font-serif); font-size: 18px; color: var(--ink); margin-bottom: 6px; }
.card__text { font-size: 14px; color: var(--ink-2); margin: 0; }

/* Доверие: то же правило, что в приложении — латунь только «подтверждено». */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px;
}
.pill--brass { background: var(--brass-soft); color: var(--brass); }
.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--crit { background: var(--crit-soft); color: var(--crit); }

/* ---------- Контент (записи, страницы) ---------- */
.entry { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 32px; }
.entry__meta { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
.entry__content > * { max-width: 44rem; }
.entry__content ul, .entry__content ol { padding-left: 22px; }
.entry__content blockquote {
  border-left: 3px solid var(--accent); margin: 18px 0; padding: 4px 0 4px 16px;
  color: var(--ink-2);
}
.entry__content table { border-collapse: collapse; width: 100%; font-size: 14px; }
.entry__content th, .entry__content td { border-bottom: 1px solid var(--rule); padding: 10px 12px; text-align: left; }
.table-scroll { overflow-x: auto; }

.post-list { display: grid; gap: 14px; }
.post-item {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  padding: 18px 20px; text-decoration: none; color: inherit; display: block;
}
.post-item:hover { border-color: var(--accent); }
.post-item__title { font-family: var(--font-serif); font-size: 19px; color: var(--ink); margin-bottom: 4px; }
.post-item__excerpt { font-size: 14px; color: var(--ink-2); margin: 0; }

/* ---------- Подвал ---------- */
.site-footer {
  margin-top: 64px; border-top: 1px solid var(--rule);
  background: var(--surface); padding: 28px 0;
  font-size: 13px; color: var(--ink-3);
}
.site-footer__cols { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }
.site-footer a { color: var(--ink-2); }
.site-footer__legal { max-width: 60ch; line-height: 1.6; }
.disclaimer { margin-top: 12px; font-size: 12px; color: var(--ink-3); }

/* ---------- Тёмная тема ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1214; --surface: #161c1f; --surface-2: #1e2629;
    --ink: #e9eeee; --ink-2: #b3bfc1; --ink-3: #859396;
    --rule: #2a3437; --rule-2: #3b484c;
    --accent: #4fa7b8; --accent-deep: #7cc3d1; --accent-soft: #122f36; --on-accent: #06181c;
    --brass: #c9a356; --brass-soft: #2b2415;
    --ok: #5dbe8c; --ok-soft: #12291f;
    --warn: #d9a441; --warn-soft: #2c2314;
    --crit: #e8776c; --crit-soft: #2e1917;
  }
  .site-header { background: #070b0c; }
  .btn--primary:hover { color: #06181c; }
}
