/*
Theme Name: Root Child — Инженерный портал
Theme URI: https://mtomd.info/
Description: Дочерняя тема Root: концепция A «Чертёж» — инженерная сетка, крупная типографика, карточки, русская локализация, TOC, рекламные слоты. Родительская тема Root не изменяется.
Author: Инженерный портал
Author URI: https://mtomd.info/
Template: root
Version: 1.0.0
Text Domain: root-child
*/

/* ============================================================
   CONCEPT A — «Чертёж» / Engineering Grid
   Инженерный портал mtomd.info — redesign prototype
   Fonts: Inter + JetBrains Mono (local, OFL)
   ============================================================ */

:root {
  --paper: #f1f0ea;
  --surface: #ffffff;
  --surface-2: #f7f6f1;
  --ink: #10151a;
  --ink-2: #33404d;
  --steel: #56657a;
  --muted: #6d7a88;
  --line: rgba(16, 21, 26, .14);
  --line-strong: rgba(16, 21, 26, .32);
  --accent: #d9480f;
  --accent-ink: #b23a0b;
  --accent-soft: #fbe9df;
  --blue: #1e4d7b;
  --ok: #2f7d5b;
  --radius: 10px;
  --radius-s: 6px;
  --shadow: 0 1px 0 rgba(16, 21, 26, .06), 0 18px 40px -28px rgba(16, 21, 26, .45);
  --wrap: 1320px;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Consolas", monospace;
  --sp: clamp(40px, 6vw, 88px);
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 200; border-radius: var(--radius-s); }
.skip-link:focus { top: 12px; }

.mono { font-family: var(--mono); }
.kicker {
  font: 500 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--steel);
}
.kicker--accent { color: var(--accent); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- top utility bar ---------- */
.topbar { background: var(--ink); color: #cfd6dd; font: 400 11.5px/1 var(--mono); letter-spacing: .04em; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 34px; gap: 20px; }
.topbar a { color: #aeb8c2; }
.topbar a:hover { color: #fff; }
.topbar__left { display: flex; gap: 18px; align-items: center; overflow: hidden; white-space: nowrap; }
.topbar__right { display: flex; gap: 18px; align-items: center; white-space: nowrap; }
.topbar .dot { color: var(--accent); }

/* ---------- masthead ---------- */
.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }
.masthead .wrap { display: flex; align-items: center; gap: 28px; min-height: 88px; }
.brand { display: flex; align-items: center; gap: 13px; flex: none; }
.brand-mark { width: 46px; height: 46px; flex: none; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name { font: 800 19px/1.05 var(--font); letter-spacing: -.02em; display: flex; flex-direction: column; }
.brand-name span { color: var(--accent); }
.brand-sub { font: 400 10px/1 var(--mono); letter-spacing: .16em; color: var(--muted); text-transform: uppercase; margin-top: 5px; }

.search {
  flex: 1 1 420px; max-width: 560px; display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 8px 0 16px; border: 1px solid var(--line-strong);
  background: var(--surface-2); border-radius: var(--radius-s);
}
.search:focus-within { border-color: var(--ink); background: #fff; }
.search svg { flex: none; color: var(--muted); }
.search input { flex: 1; border: 0; background: transparent; font: 400 14.5px var(--font); color: var(--ink); outline: 0; min-width: 0; }
.search input::placeholder { color: var(--muted); }
.search kbd {
  font: 500 10px/1 var(--mono); color: var(--muted); border: 1px solid var(--line);
  border-radius: 4px; padding: 4px 6px; background: #fff; flex: none;
}
.mast-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 20px; border-radius: var(--radius-s);
  border: 1px solid transparent; font: 600 14px/1 var(--font); letter-spacing: .01em;
  transition: background .16s, color .16s, border-color .16s;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); }
.btn--outline { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--outline:hover { border-color: var(--ink); background: var(--surface-2); }
.btn--ghost { color: var(--ink-2); }
.btn--ghost:hover { color: var(--accent-ink); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 13px; }

/* ---------- main navigation ---------- */
.nav { background: var(--ink); color: #e8ecef; position: sticky; top: 0; z-index: 90; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.nav .wrap { display: flex; align-items: stretch; gap: 2px; min-height: 54px; }
.nav a, .nav button.nav-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 15px;
  font: 500 14.5px/1 var(--font); color: #d8dee4; border: 0; background: none;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav a:hover, .nav button.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav .is-active { color: #fff; border-bottom-color: var(--accent); }
.nav__spacer { flex: 1; }
.nav__all { color: var(--accent) !important; }
.nav__all svg { width: 14px; height: 14px; }

.nav-item { position: relative; display: flex; }
.nav-item > a { padding-right: 34px; position: relative; }
.nav-item > a::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 6px; height: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg); opacity: .65;
}
.dropdown {
  position: absolute; top: 100%; left: 0; min-width: 340px; padding: 8px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .14s, transform .14s, visibility .14s; z-index: 95;
}
.nav-item:hover .dropdown, .nav-item:focus-within .dropdown, .nav-item.is-open .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2);
  font: 500 14px/1.35 var(--font); border-radius: 4px;
}
.dropdown a:last-child { border-bottom: 0; }
.dropdown a:hover { background: var(--surface-2); color: var(--ink); }
.dropdown a small { font: 400 11px/1 var(--mono); color: var(--muted); white-space: nowrap; }

.burger { display: none; }
.mobile-panel { display: none; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--surface); border-bottom: 1px solid var(--line); }
.hero__grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(16,21,26,.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16,21,26,.055) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.35) 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0,0,0,.35) 75%, transparent 100%);
}
.hero__drawing { position: absolute; right: -40px; top: -30px; width: 560px; opacity: .5; pointer-events: none; color: var(--line-strong); }
.hero .wrap { position: relative; display: grid; grid-template-columns: 7fr 5fr; gap: 48px; padding-block: 56px 52px; align-items: center; }
.hero__kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.hero__kicker::before { content: ""; width: 34px; height: 1px; background: var(--accent); }
.hero h1 {
  margin: 0 0 20px; font: 800 clamp(38px, 4.4vw, 62px)/1.02 var(--font);
  letter-spacing: -.035em; text-wrap: balance; max-width: 15ch;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero__lead { margin: 0; max-width: 56ch; color: var(--ink-2); font-size: 17px; line-height: 1.62; }
.hero__actions { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero__stats {
  display: flex; gap: 0; margin-top: 38px; border-top: 1px solid var(--line);
  padding-top: 18px; flex-wrap: wrap;
}
.hero__stat { padding-right: 28px; margin-right: 28px; border-right: 1px solid var(--line); }
.hero__stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hero__stat b { display: block; font: 700 22px/1.1 var(--font); letter-spacing: -.02em; }
.hero__stat span { font: 400 11px/1.3 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

.hero-feature { position: relative; display: block; border-radius: var(--radius); overflow: hidden; min-height: 420px; background: #1a1f24; }
.hero-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.9) contrast(1.02); transition: transform .5s ease; }
.hero-feature:hover img { transform: scale(1.03); }
.hero-feature::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(9,12,15,.92) 0%, rgba(9,12,15,.34) 52%, rgba(9,12,15,.08) 100%); }
.hero-feature__body { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-height: 420px; padding: 26px; color: #fff; }
.hero-feature__chip { align-self: flex-start; font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #ffd9c9; background: rgba(217,72,15,.85); padding: 8px 10px; border-radius: 4px; margin-bottom: 14px; }
.hero-feature h2 { margin: 0 0 10px; font: 700 clamp(22px, 2vw, 28px)/1.16 var(--font); letter-spacing: -.02em; text-wrap: balance; }
.hero-feature p { margin: 0 0 14px; color: #c7ced5; font-size: 14px; line-height: 1.5; }
.hero-feature .meta-row { color: #aeb8c2; }

/* ---------- spec ticker ---------- */
.ticker { background: var(--ink); color: #98a4b0; border-top: 1px solid rgba(255,255,255,.06); overflow: hidden; }
.ticker .wrap { display: flex; align-items: center; gap: 26px; min-height: 46px; overflow-x: auto; scrollbar-width: none; }
.ticker .wrap::-webkit-scrollbar { display: none; }
.ticker span { font: 400 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.ticker b { color: #fff; font-weight: 500; }
.ticker .sep { color: var(--accent); }

/* ---------- sections ---------- */
.section { padding-block: var(--sp) 0; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line-strong); margin-bottom: 26px; }
.section__title { display: flex; align-items: baseline; gap: 16px; margin: 0; }
.section__title .idx { font: 400 12px/1 var(--mono); color: var(--accent); letter-spacing: .08em; }
.section__title h2 { margin: 0; font: 700 clamp(24px, 2.4vw, 34px)/1.1 var(--font); letter-spacing: -.03em; }
.section__link { font: 500 13px/1 var(--mono); letter-spacing: .04em; color: var(--steel); white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.section__link:hover { color: var(--accent-ink); }
.section__link::after { content: "→"; }

/* ---------- cards ---------- */
.card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__media img { transform: scale(1.035); }
.card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 16px; flex: 1; }
.card__title { margin: 0; font: 650 20px/1.25 var(--font); letter-spacing: -.015em; text-wrap: balance; }
.card__title a:hover { color: var(--accent-ink); }
.card__excerpt { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card--row { flex-direction: row; align-items: stretch; }
.card--row .card__media { aspect-ratio: auto; width: 240px; flex: none; }
.card--row .card__body { padding: 20px; }
.card--flat { background: transparent; border: 0; border-radius: 0; }
.card--flat:hover { transform: none; box-shadow: none; }
.card--flat .card__media { border-radius: var(--radius); }
.card--big .card__title { font-size: 26px; }
.card--big .card__excerpt { -webkit-line-clamp: 3; font-size: 14.5px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px/1 var(--mono);
  letter-spacing: .1em; text-transform: uppercase; padding: 7px 9px; border-radius: 4px;
  background: rgba(16,21,26,.82); color: #fff; backdrop-filter: blur(4px);
}
.card__media .badge { position: absolute; left: 12px; top: 12px; z-index: 2; }
.meta-row { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; font: 400 11.5px/1.3 var(--mono); color: var(--muted); letter-spacing: .02em; }
.meta-row .dot { width: 3px; height: 3px; background: var(--line-strong); border-radius: 50%; }
.meta-row b { color: var(--ink-2); font-weight: 500; }

/* technical thumbnail (no photo) */
.tech {
  position: relative; display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(to right, rgba(16,21,26,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(16,21,26,.06) 1px, transparent 1px),
    var(--surface-2);
  background-size: 26px 26px, 26px 26px, auto;
}
.tech svg { width: 104px; height: 104px; color: var(--steel); opacity: .8; }
.tech__label { position: absolute; left: 12px; bottom: 10px; font: 500 10px/1 var(--mono); letter-spacing: .12em; color: var(--steel); text-transform: uppercase; }

/* bento */
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.bento > .span-8 { grid-column: span 8; }
.bento > .span-6 { grid-column: span 6; }
.bento > .span-4 { grid-column: span 4; }
.bento > .span-3 { grid-column: span 3; }
.bento__side { display: flex; flex-direction: column; gap: 20px; }

/* numbered list */
.numlist { display: flex; flex-direction: column; }
.numlist a { display: flex; align-items: baseline; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.numlist a:last-child { border-bottom: 0; }
.numlist .n { font: 500 12px/1 var(--mono); color: var(--accent); width: 26px; flex: none; }
.numlist .t { font: 600 15px/1.35 var(--font); letter-spacing: -.01em; }
.numlist .t:hover { color: var(--accent-ink); }
.numlist .m { display: block; margin-top: 4px; font: 400 11px/1.2 var(--mono); color: var(--muted); }

/* rubrics chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; height: 36px; padding: 0 15px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent;
  font: 500 13px/1 var(--font); color: var(--ink-2); transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* split + sidebar */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 44px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 78px; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.widget__title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--steel); }
.widget__title::after { content: ""; flex: 1; height: 1px; background: var(--line); margin-left: 14px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget li a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font: 500 14px/1.3 var(--font); color: var(--ink-2); }
.widget li a:hover { color: var(--accent-ink); }
.widget li a span { font: 400 11px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.widget p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.widget--accent { background: var(--ink); border-color: var(--ink); color: #fff; }
.widget--accent .widget__title { color: #98a4b0; }
.widget--accent .widget__title::after { background: rgba(255,255,255,.14); }
.widget--accent li { border-bottom-color: rgba(255,255,255,.1); }
.widget--accent li a { color: #e6ebef; }
.widget--accent li a:hover { color: #fff; }
.widget--accent li a span { color: #8f9ba6; }

.ad-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 250px; padding: 18px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background:
    repeating-linear-gradient(135deg, transparent 0 10px, rgba(16,21,26,.035) 10px 11px);
}
.ad-slot::before { content: "РЕКЛАМА"; position: absolute; top: 8px; left: 10px; font: 500 9px/1 var(--mono); letter-spacing: .16em; color: var(--muted); }
.ad-slot b { font: 600 15px/1.3 var(--font); color: var(--ink-2); }
.ad-slot span { font: 400 11.5px/1.4 var(--mono); color: var(--muted); }
.ad-slot a { font: 500 12px/1 var(--mono); color: var(--accent-ink); border-bottom: 1px solid currentColor; padding-bottom: 2px; }

/* ---------- footer ---------- */
.footer { margin-top: var(--sp); background: var(--ink); color: #aeb8c2; }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-block: 54px 42px; }
.footer .brand-name { color: #fff; font-size: 18px; }
.footer .brand-sub { color: #7c8894; }
.footer p { margin: 16px 0 0; font-size: 13px; line-height: 1.6; color: #8f9ba6; max-width: 34ch; }
.footer h3 { margin: 0 0 16px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #e6ebef; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer li a { font-size: 13.5px; color: #aeb8c2; }
.footer li a:hover { color: #fff; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 18px; font: 400 11px/1.4 var(--mono); color: #7c8894; flex-wrap: wrap; }
.footer__bottom .dot { color: var(--accent); }
.footer__bottom a { color: #aeb8c2; }
.footer__bottom a:hover { color: #fff; }

/* ---------- article ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); width: 0; z-index: 120; transition: width .1s linear; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 400 11.5px/1.4 var(--mono); color: var(--muted); padding-block: 26px 0; }
.breadcrumbs a:hover { color: var(--accent-ink); }
.breadcrumbs .sep { color: var(--line-strong); }
.article-head { padding-block: 22px 28px; border-bottom: 1px solid var(--line-strong); }
.article-head__cat { display: inline-flex; margin-bottom: 16px; }
.article-head h1 { margin: 0 0 18px; font: 800 clamp(32px, 3.4vw, 48px)/1.08 var(--font); letter-spacing: -.03em; text-wrap: balance; max-width: 22ch; }
.article-head__dek { margin: 0 0 24px; max-width: 68ch; color: var(--ink-2); font-size: 17.5px; line-height: 1.6; }
.article-meta { display: flex; align-items: center; gap: 16px 26px; flex-wrap: wrap; }
.article-meta__author { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 600 13px/1 var(--font); flex: none; }
.article-meta__author b { display: block; font: 600 13.5px/1.2 var(--font); }
.article-meta__author span { font: 400 11px/1.2 var(--mono); color: var(--muted); }
.article-meta__facts { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.share { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.share span { font: 400 11px/1 var(--mono); color: var(--muted); margin-right: 4px; }
.share a {
  width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-strong);
  border-radius: 50%; color: var(--ink-2); transition: background .15s, color .15s, border-color .15s;
}
.share a:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.share svg { width: 14px; height: 14px; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 56px; align-items: start; padding-block: 36px 0; }
.article-layout__main { min-width: 0; max-width: 760px; }

.prose { font-size: 17.5px; line-height: 1.72; color: #1b232b; }
.prose > p:first-of-type { font-size: 19px; line-height: 1.65; color: var(--ink); }
.prose p { margin: 0 0 1.25em; }
.prose h2 {
  display: flex; align-items: baseline; gap: 14px; margin: 2.2em 0 .8em;
  font: 750 27px/1.2 var(--font); letter-spacing: -.02em; scroll-margin-top: 90px;
}
.prose h2 .h2-num { font: 500 12px/1 var(--mono); color: var(--accent); letter-spacing: .04em; }
.prose h3 { margin: 1.8em 0 .6em; font: 650 19.5px/1.3 var(--font); letter-spacing: -.01em; scroll-margin-top: 90px; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.4em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--blue); border-bottom: 1px solid rgba(30,77,123,.35); }
.prose a:hover { background: rgba(30,77,123,.08); }
.prose strong { font-weight: 650; }
.prose blockquote {
  margin: 1.8em 0; padding: 22px 26px; border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 19px; line-height: 1.55; color: var(--ink);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite { display: block; margin-top: 10px; font: 400 12px/1.3 var(--mono); color: var(--muted); font-style: normal; }
.prose figure { margin: 1.8em 0; }
.prose figure img { border-radius: var(--radius); }
.prose figcaption { margin-top: 10px; font: 400 12px/1.4 var(--mono); color: var(--muted); }
.prose .figure-tech { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.prose .figure-tech svg { width: 100%; height: auto; display: block; }

.callout { margin: 1.8em 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; grid-template-columns: 40px 1fr; gap: 16px; }
.callout__ico { width: 40px; height: 40px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.callout__ico svg { width: 20px; height: 20px; }
.callout b { display: block; font: 600 14px/1.3 var(--font); margin-bottom: 4px; }
.callout p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }

.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 14px; line-height: 1.45; background: var(--surface); }
.prose caption { caption-side: top; text-align: left; font: 500 10.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding-bottom: 10px; }
.prose th { text-align: left; font: 600 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--steel); padding: 12px 14px; border-bottom: 1px solid var(--line-strong); background: var(--surface-2); }
.prose td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 600; color: var(--ink); white-space: nowrap; }

.faq { margin-top: 2.4em; border-top: 1px solid var(--line-strong); }
.faq h2 { margin-top: 1.2em; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; cursor: pointer; font: 600 16.5px/1.4 var(--font); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 20px/1 var(--mono); color: var(--accent); flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 34px; }
.tag { font: 400 11px/1 var(--mono); color: var(--steel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; letter-spacing: .02em; }
.tag:hover { border-color: var(--ink); color: var(--ink); }

.author-card { display: flex; gap: 18px; padding: 24px; margin-top: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); align-items: center; }
.author-card .avatar { width: 54px; height: 54px; font-size: 18px; }
.author-card b { font: 600 16px/1.3 var(--font); display: block; }
.author-card p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

.toc { position: sticky; top: 78px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; border-left: 2px solid var(--line); border-bottom: 0 !important; }
.toc a { display: flex; gap: 10px; padding: 9px 12px; font: 500 13px/1.35 var(--font); color: var(--muted); justify-content: flex-start !important; border-bottom: 0 !important; align-items: baseline; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 400 10px/1.6 var(--mono); color: var(--line-strong); }
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left: 2px solid var(--accent); margin-left: -2px; }
.toc a.is-active::before { color: var(--accent); }

.summary-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.summary-card li { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.summary-card li::before { content: "—"; color: var(--accent); flex: none; }

.related { margin-top: 56px; }
.related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* comments */
.comments { margin-top: 56px; border-top: 1px solid var(--line-strong); padding-top: 28px; }
.comments__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.comments__head h2 { margin: 0; font: 700 24px/1.2 var(--font); letter-spacing: -.02em; }
.comments__head span { font: 400 11px/1 var(--mono); color: var(--muted); }
.comment { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment .avatar { width: 44px; height: 44px; background: var(--surface-2); color: var(--steel); border: 1px solid var(--line); font-size: 15px; }
.comment__head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.comment__head b { font: 600 14px/1.3 var(--font); }
.comment__head time { font: 400 11px/1 var(--mono); color: var(--muted); }
.comment p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.comment__reply { margin-top: 8px; font: 500 11px/1 var(--mono); color: var(--steel); }
.comment__reply:hover { color: var(--accent-ink); }
.reply-form { margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.reply-form h3 { margin: 0 0 14px; font: 600 18px/1.3 var(--font); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { display: block; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--steel); margin-bottom: 7px; }
.field input, .field textarea {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface-2);
  border-radius: var(--radius-s); padding: 11px 13px; font: 400 14px/1.4 var(--font); color: var(--ink);
}
.field textarea { min-height: 120px; resize: vertical; }
.field { margin-bottom: 14px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: #fff; }
.form-note { font-size: 12px; color: var(--muted); margin: 0 0 14px; }

/* ---------- category page ---------- */
.cat-hero { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.cat-hero .hero__grid-bg { opacity: .8; }
.cat-hero .wrap { position: relative; padding-block: 40px 36px; }
.cat-hero h1 { margin: 12px 0 12px; font: 800 clamp(32px, 3.6vw, 46px)/1.06 var(--font); letter-spacing: -.03em; }
.cat-hero p { margin: 0; color: var(--ink-2); max-width: 70ch; font-size: 16px; }
.cat-hero__meta { display: flex; gap: 22px; margin-top: 20px; flex-wrap: wrap; }
.cat-hero__meta span { font: 400 11px/1 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.cat-hero__meta b { color: var(--ink); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 22px; border-bottom: 1px solid var(--line-strong); margin-bottom: 26px; flex-wrap: wrap; }
.toolbar__left { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view-switch { display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius-s); overflow: hidden; }
.view-switch button { display: grid; place-items: center; width: 40px; height: 36px; border: 0; background: transparent; color: var(--muted); }
.view-switch button.is-active { background: var(--ink); color: #fff; }
.sort { display: flex; align-items: center; gap: 8px; font: 400 12px/1 var(--mono); color: var(--muted); }
.sort select { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-s); height: 36px; padding: 0 10px; font: 500 12px/1 var(--mono); color: var(--ink); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 44px; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--radius-s); font: 500 12.5px/1 var(--mono); color: var(--ink-2);
}
.pagination a:hover { border-color: var(--ink); }
.pagination .is-current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .gap { border: 0; }

/* in-feed ad */
.feed-ad { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 22px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.feed-ad b { font: 600 14px/1.3 var(--font); }
.feed-ad span { display: block; margin-top: 4px; font: 400 11px/1.4 var(--mono); color: var(--muted); }
.feed-ad .mono { font-size: 10px; letter-spacing: .16em; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .hero .wrap { grid-template-columns: 1fr 1fr; gap: 32px; }
  .hero__drawing { width: 420px; }
  .bento > .span-8, .bento > .span-6, .bento > .span-4, .bento > .span-3 { grid-column: span 6; }
  .bento > .span-8 { grid-column: span 12; }
  .footer__top { grid-template-columns: 1.2fr 1fr 1fr; }
  .footer__top > *:last-child { display: none; }
}
@media (max-width: 980px) {
  .masthead .wrap { min-height: 74px; gap: 16px; }
  .search { display: none; }
  .nav-item .dropdown { display: none; }
  .nav-item > a::after { display: none; }
  .nav { position: relative; }
  .nav .wrap { min-height: 50px; overflow-x: auto; scrollbar-width: none; }
  .nav .wrap::-webkit-scrollbar { display: none; }
  .mast-actions .btn--ghost { display: none; }
  .burger { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); }
  .mobile-panel {
    display: none; position: fixed; inset: 0; z-index: 110; background: var(--surface);
    padding: 22px; overflow-y: auto;
  }
  .mobile-panel.is-open { display: block; }
  .mobile-panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
  .mobile-panel .search { display: flex; max-width: none; margin-bottom: 22px; }
  .mobile-panel nav { display: flex; flex-direction: column; }
  .mobile-panel nav a { padding: 15px 2px; border-bottom: 1px solid var(--line); font: 600 17px/1.2 var(--font); }
  .mobile-panel nav a small { display: block; margin-top: 3px; font: 400 10.5px/1.3 var(--mono); color: var(--muted); letter-spacing: .06em; }
  .mobile-panel .btn { width: 100%; margin-top: 18px; }
  .mobile-close { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: none; }
  .split { grid-template-columns: 1fr; gap: 34px; }
  .sidebar { position: static; }
  .article-layout { grid-template-columns: 1fr; gap: 34px; }
  .toc { position: static; }
  .article-layout__main { max-width: none; }
  .related__grid, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-bottom: 8px; }
  .hero__stats { gap: 18px; }
  .hero__stat { border-right: 0; padding-right: 0; margin-right: 0; }
  .hero__stat b { font-size: 19px; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .topbar__right { display: none; }
  .nav { display: none; }
  .masthead { position: sticky; top: 0; z-index: 90; box-shadow: 0 1px 0 var(--line); }
  .hero .wrap { grid-template-columns: 1fr; padding-block: 34px 30px; gap: 28px; }
  .hero h1 { max-width: none; }
  .hero__drawing { display: none; }
  .hero-feature { min-height: 340px; }
  .hero-feature__body { min-height: 340px; padding: 20px; }
  .hero__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .section__head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .bento > .span-8, .bento > .span-6, .bento > .span-4, .bento > .span-3 { grid-column: span 12; }
  .card--row { flex-direction: column; }
  .card--row .card__media { width: 100%; aspect-ratio: 16/9; }
  .related__grid, .grid-3 { grid-template-columns: 1fr; }
  .footer__top { grid-template-columns: 1fr 1fr; gap: 28px; padding-block: 38px 30px; }
  .footer__top > *:last-child { display: block; }
  .article-head h1 { max-width: none; }
  .share { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .prose { font-size: 16.5px; }
  .prose h2 { font-size: 23px; }
  .prose table { display: block; overflow-x: auto; white-space: nowrap; }
  .form-row { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  .numlist .t { font-size: 14.5px; }
  .article-meta { gap: 14px 18px; }
  .toolbar { align-items: flex-start; }
  .cat-hero .wrap { padding-block: 28px 26px; }
}
@media (max-width: 420px) {
  .hero__actions .btn { width: 100%; }
  .hero__stats { grid-template-columns: 1fr 1fr; }
  .footer__top { grid-template-columns: 1fr; }
}


/* ============================================================
   root-child — WordPress integration layer for concept A
   Appended after the standalone prototype CSS.
   ============================================================ */

/* --- force child palette over Root dynamic customizer CSS --- */
body,
body.custom-background {
	background: var(--paper) !important;
	background-image: none !important;
	color: var(--ink) !important;
	font-family: var(--font) !important;
	font-size: 16px;
	line-height: 1.6;
}
body a { color: inherit; }
h1, h2, h3, h4, h5, h6, .site-title, .site-description { font-family: var(--font); }

/* Root dynamic CSS also paints .btn / links blue; concept A uses signal orange. */
.btn--primary { background: var(--accent) !important; border-color: transparent !important; color: #fff !important; }
.btn--primary:hover { background: var(--accent-ink) !important; }
.btn--outline { background: transparent !important; border-color: var(--line-strong) !important; color: var(--ink) !important; }
.btn--outline:hover { background: var(--surface-2) !important; border-color: var(--ink) !important; }
.btn--ghost { background: transparent !important; border-color: transparent !important; color: var(--ink-2) !important; }

/* --- admin bar offsets --- */
body.admin-bar .nav { top: 32px; }
@media (max-width: 782px) { body.admin-bar .nav { top: 46px; } body.admin-bar .masthead { top: 46px; } }
@media (min-width: 721px) { body.admin-bar .masthead { top: 32px; } }

/* --- article content from WordPress --- */
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose .wp-caption, .prose figure { max-width: 100%; }
.prose .wp-caption-text, .prose figcaption { font: 400 12px/1.4 var(--mono); color: var(--muted); margin-top: 9px; }
.prose .alignleft { float: left; margin: 6px 24px 16px 0; max-width: 50%; }
.prose .alignright { float: right; margin: 6px 0 16px 24px; max-width: 50%; }
.prose .aligncenter { margin-left: auto; margin-right: auto; display: block; }
.prose iframe, .prose video { max-width: 100%; border-radius: var(--radius); }
.prose .wp-block-image img { border-radius: var(--radius); }
.prose ul li::marker { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--line-strong); margin: 2em 0; }
.prose h2 .h2-num { flex: none; }

/* --- CF7 (contact pages) --- */
.prose .wpcf7 { margin-top: 8px; }
.prose .wpcf7 p { margin: 0 0 16px; }
.prose .wpcf7 label { display: block; margin-bottom: 7px; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--steel); }
.prose .wpcf7 input[type="text"],
.prose .wpcf7 input[type="email"],
.prose .wpcf7 input[type="tel"],
.prose .wpcf7 input[type="url"],
.prose .wpcf7 textarea,
.prose .wpcf7 select {
	width: 100%; max-width: 560px; border: 1px solid var(--line-strong); background: var(--surface-2);
	border-radius: var(--radius-s); padding: 12px 13px; font: 400 15px/1.4 var(--font); color: var(--ink);
}
.prose .wpcf7 textarea { min-height: 150px; resize: vertical; }
.prose .wpcf7 input:focus, .prose .wpcf7 textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: #fff; }
.prose .wpcf7 input[type="submit"],
.prose .wpcf7 button[type="submit"] {
	display: inline-flex; align-items: center; justify-content: center; gap: 9px; height: 46px;
	padding: 0 22px; border: 0; border-radius: var(--radius-s); background: var(--accent);
	color: #fff; font: 600 14px/1 var(--font); cursor: pointer;
}
.prose .wpcf7 input[type="submit"]:hover, .prose .wpcf7 button[type="submit"]:hover { background: var(--accent-ink); }
.wpcf7 form .wpcf7-response-output {
	margin: 18px 0 0; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-s);
	font: 400 14px/1.5 var(--font); color: var(--ink-2); background: var(--surface);
}
.wpcf7 form.sent .wpcf7-response-output { border-color: var(--ok); color: var(--ok); }
.wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.failed .wpcf7-response-output { border-color: var(--accent); color: var(--accent-ink); }
.wpcf7-not-valid-tip { font: 400 11px/1.3 var(--mono); color: var(--accent-ink); margin-top: 6px; }

/* --- comments --- */
.comment-list + .comment-respond { margin-top: 26px; }
.comment .children { margin-top: 14px; margin-left: 46px; }
.comment .avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); color: var(--steel); border: 1px solid var(--line); display: grid; place-items: center; font: 600 15px/1 var(--font); overflow: hidden; }
.comment .avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-awaiting { font: 400 10px/1 var(--mono); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.comment__text p { margin: 0 0 .7em; }
.comment .comment-reply-link, .comment__reply a { font: 500 11px/1 var(--mono); color: var(--steel); }
.comment .comment-reply-link:hover, .comment__reply a:hover { color: var(--accent-ink); }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-form p { margin: 0 0 14px; }
.comment-form .form-submit { margin-top: 6px; }
.comment-respond .comment-reply-title { margin: 0 0 6px; font: 600 18px/1.3 var(--font); }
.comment-respond { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-top: 26px; }
.comment-form .logged-in-as { font: 400 12px/1.5 var(--font); color: var(--muted); }
.comment-form .logged-in-as a { color: var(--steel); }

/* --- WP pagination output --- */
.pagination .page-numbers { min-width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-s); font: 500 12.5px/1 var(--mono); color: var(--ink-2); }
.pagination .page-numbers:hover { border-color: var(--ink); }
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination .page-numbers.next, .pagination .page-numbers.prev { padding: 0 14px; }
.comments-pagination { margin-top: 22px; }

/* --- WP forms & misc --- */
.prose .search-form { display: flex; gap: 8px; }
.prose .search-form input[type="search"] { flex: 1; border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: var(--radius-s); padding: 11px 13px; }
.prose .search-form input[type="submit"] { border: 0; background: var(--ink); color: #fff; padding: 0 18px; border-radius: var(--radius-s); }
.tag-cloud-link { font: 400 11px/1 var(--mono); color: var(--steel); border: 1px solid var(--line); padding: 8px 12px; border-radius: 999px; margin: 0 6px 6px 0; display: inline-block; }
.wp-block-table { overflow-x: auto; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }

/* --- single post: ensure no Root leftovers --- */
.single-post .entry-meta, .single-post .post-thumbnail { display: none; }

/* --- footer sticky on short pages --- */
.site { min-height: 100vh; display: flex; flex-direction: column; }
.site > main { flex: 1 0 auto; }
