/* skrutka.ru — тема WordPress. Основа: утверждённый прототип design-preview/style.css (белый Hero). */

:root {
  --page: #F2F4F5;      /* фон страницы ниже Hero */
  --white: #FFFFFF;
  --text: #27313B;
  --graphite: #202833;
  --blue: #17639B;
  --blue-dark: #0F4A75;
  --orange: #D67825;
  --orange-text: #A55A16;
  --border: #DCE2E6;
  --border-strong: #B8C2CA;
  --muted: #5E6973;
  --soft: #F7F8F9;      /* фон калькулятора, шапки таблицы */
  --zebra: #FAFBFB;

  --font: Arial, Helvetica, sans-serif;
  --wrap: 1100px;
  --gutter: 20px;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 15px/1.55 var(--font);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; background: #fff; padding: 6px 10px; z-index: 100; }
.skip:focus { top: 8px; }

/* ───────── Шапка ───────── */
.site-header { background: var(--white); position: relative; z-index: 20; }
.site-header__top { display: flex; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 12px; }

.logo { display: flex; flex-direction: column; gap: 3px; margin-right: auto; color: var(--graphite); }
.logo:hover { text-decoration: none; color: var(--graphite); }
.logo__name { font: 700 27px/1 var(--font); color: var(--graphite); letter-spacing: -.01em; }
.logo__tld { color: var(--orange); }
.logo__sub { font-size: 13px; color: var(--muted); }

.header-search { display: flex; width: 280px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--white); }
.header-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.header-search__input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 7px 10px; font: 14px var(--font); color: var(--text); }
.header-search__input:focus { outline: none; }
.header-search__btn { display: flex; align-items: center; justify-content: center; width: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.header-search__btn:hover { color: var(--blue); }

.nav-toggle { display: none; }

.site-nav { border-top: 1px solid var(--border); border-bottom: 2px solid var(--blue); background: var(--white); }
.site-nav__list { display: flex; list-style: none; gap: 4px; margin-left: -12px; }
.site-nav__item { position: relative; display: flex; align-items: center; }
.site-nav__link { display: block; padding: 11px 12px 10px; color: var(--graphite); font-weight: 700; font-size: 15px; }
.site-nav__link:hover { color: var(--blue); text-decoration: none; }
.site-nav__sub-toggle { display: none; }
.site-nav__drop {
  display: none; position: absolute; top: calc(100% + 2px); left: 0; min-width: 290px;
  background: var(--white); border: 1px solid var(--border); border-top: 0; padding: 6px 0;
}
.site-nav__drop ul { list-style: none; }
.site-nav__drop li a { display: block; padding: 7px 16px; color: var(--text); font-size: 14px; }
.site-nav__drop li a:hover { background: var(--page); color: var(--blue); text-decoration: none; }
.site-nav__all { display: block; margin-top: 4px; padding: 8px 16px 4px; border-top: 1px solid var(--border); font-size: 14px; font-weight: 700; }
.site-nav__item:hover .site-nav__drop,
.site-nav__item:focus-within .site-nav__drop { display: block; }

/* Шапка: вариант «Нормативный» (figma-reference, standard) — одинаковая на всех страницах.
   Цвета заданы для шапки отдельно, поэтому палитра статей и рубрик не меняется. */
.site-header {
  --graphite: #17212B; --text: #17212B; --muted: #64717C;
  --blue: #006B8F; --blue-dark: #00566F; --orange: #D96622;
  --border: #CBD3D8; --border-strong: #8F9CA4; --page: #EEF1F2; --radius: 0;
}
.site-header__top { min-height: 94px; padding-top: 12px; padding-bottom: 12px; gap: 40px; }
.site-header .logo { gap: 2px; }
.site-header .logo__name { font-size: 29px; letter-spacing: -.04em; }
.site-header .logo__sub { font-size: 12px; letter-spacing: .01em; }
.site-header .logo__img { display: block; width: 200px; height: auto; aspect-ratio: 540 / 130; }
/* Логотип крупнее (+32 %): ширина задаётся --logo-w; пустые поля внутри SVG (холст 540×130, рисунок ≈ x 20–466, y 17–103)
   подрезаются отрицательными отступами, поэтому высота шапки не растёт; левый край рисунка остаётся на прежнем месте. */
.site-header .logo__img { --logo-w: 264px; width: var(--logo-w); margin: calc(var(--logo-w) * -0.028) 0 calc(var(--logo-w) * -0.025) calc(7px - var(--logo-w) * 0.037); }
.header-search { border-color: var(--border); }
.header-search__input { height: 36px; font-size: 13px; padding: 0 12px; }
.header-search__btn { width: 40px; color: var(--blue); }
.site-nav { border-top-color: var(--border); }
.site-nav__list { gap: 15px; }
.site-nav__link { padding: 15px 12px 14px; font-size: 14px; }
@media (max-width: 900px) { .site-header .site-header__top { min-height: 80px; } }
@media (max-width: 680px) {
  .site-header .site-header__top { padding-top: 14px; padding-bottom: 14px; }
  .site-header .logo__img { --logo-w: 210px; }
}

/* ───────── Hero ───────── */
.hero { background: var(--white); border-bottom: 1px solid var(--border); }
.hero__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 48px;
  padding-top: 34px; padding-bottom: 38px; align-items: start;
}
.hero__title { font-size: 33px; line-height: 1.2; color: var(--graphite); max-width: 17em; }
.hero__lead { margin-top: 14px; font-size: 16px; line-height: 1.6; max-width: 36em; }

/* :not(body) — WordPress ставит класс search на <body> страницы поиска */
.search:not(body) { margin-top: 24px; max-width: 560px; }
.search__row { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--white); }
.search__row:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.search__input { flex: 1; min-width: 0; border: 0; padding: 11px 12px; font: 15px var(--font); color: var(--text); background: transparent; }
.search__input:focus { outline: none; }
.search__input::placeholder { color: #808A93; }
.search__btn { border: 0; background: var(--blue); color: #fff; font: 700 15px var(--font); padding: 0 24px; cursor: pointer; border-radius: 0 1px 1px 0; }
.search__btn:hover { background: var(--blue-dark); }
.search__note { margin-top: 8px; font-size: 13px; color: var(--orange-text); }

.frequent { margin-top: 14px; font-size: 14px; max-width: 560px; line-height: 1.7; }
.frequent__label { color: var(--muted); margin-right: 6px; }
.frequent__list { display: inline; list-style: none; }
.frequent__list li { display: inline; }
.frequent__list li:not(:last-child)::after { content: ","; color: var(--muted); margin-right: 4px; }

/* Калькулятор закона Ома */
.ohm { background: var(--soft); border: 1px solid var(--border); border-radius: var(--radius); }
.ohm__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 18px 10px; }
.ohm__title { font-size: 17px; color: var(--graphite); }
.ohm__more { font-size: 13px; }
.ohm__form { padding: 0 18px 16px; }
.ohm__pairs { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.ohm__legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; padding: 0; }
.seg { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--white); }
.seg label { position: relative; }
.seg label + label { border-left: 1px solid var(--border); }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 6px 2px; font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.seg input:checked + span { background: var(--graphite); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: -2px; }

.ohm__fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; }
.field { min-width: 0; }
.field[hidden] { display: none; }
.field__label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.sym { font-weight: 700; color: var(--text); margin-right: 3px; }
.field__box { display: flex; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--white); }
.field__box:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.field__box input { flex: 1; width: 100%; min-width: 0; border: 0; background: transparent; padding: 8px 9px; font: 16px var(--font); color: var(--text); font-variant-numeric: tabular-nums; }
.field__box input:focus { outline: none; }
.field__unit { padding: 0 9px; font-size: 14px; color: var(--muted); }
.field.is-error .field__box { border-color: var(--orange); box-shadow: inset 3px 0 0 var(--orange); }
.field__err { font-size: 12px; color: var(--orange-text); margin-top: 3px; line-height: 1.35; }
.field__err:empty { display: none; }

.btn { margin-top: 14px; width: 100%; border: 0; border-radius: var(--radius); background: var(--blue); color: #fff; font: 700 15px var(--font); padding: 10px 16px; cursor: pointer; }
.btn:hover { background: var(--blue-dark); }

/* Результат */
.plate { margin: 0 18px 18px; border: 1px solid var(--border-strong); background: var(--white); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.plate__cell { padding: 8px 12px 10px; }
.plate__cell + .plate__cell { border-left: 1px solid var(--border); }
.plate__k { display: block; font-size: 12px; color: var(--muted); }
.plate__v { display: block; margin-top: 2px; font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--blue); white-space: nowrap; font-variant-numeric: tabular-nums; }
.plate__v small { font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.plate__formula { grid-column: 1 / -1; border-top: 1px solid var(--border); padding: 7px 12px; font-size: 13px; color: var(--muted); }
.plate.is-empty .plate__v { color: var(--border-strong); }

/* ───────── Основная часть ───────── */
.page { padding: 18px 0 28px; }
.page__stack { display: grid; gap: 18px; }
.panel { background: var(--white); border: 1px solid var(--border); padding: 26px 28px 28px; min-width: 0; }
.panel__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.panel__title { font-size: 23px; line-height: 1.25; color: var(--graphite); }
.panel__more { font-size: 14px; white-space: nowrap; }
.panel__more::after { content: " →"; }
.panel__note { margin-top: 14px; font-size: 13px; color: var(--muted); max-width: 52em; }

/* Направления */
.dirs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.dir { border-top: 2px solid var(--border); padding-top: 14px; }
.dir:nth-child(1) { border-top-color: var(--blue); }
.dir:nth-child(3) { border-top-color: var(--orange); }
.dir__title { font-size: 17px; line-height: 1.3; }
.dir__title a { color: var(--graphite); }
.dir__title a:hover { color: var(--blue); }
.dir__text { margin-top: 8px; font-size: 14px; color: var(--muted); line-height: 1.55; }

/* Популярные калькуляторы */
.rows { list-style: none; border-top: 1px solid var(--border); }
.rows li { border-bottom: 1px solid var(--border); }
.row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr) 20px; gap: 20px; align-items: baseline; padding: 12px 6px 12px 0; color: var(--text); }
.row::after { content: "→"; color: var(--blue); font-weight: 700; justify-self: end; }
.row:hover { text-decoration: none; background: var(--zebra); color: var(--text); }
.row:hover .row__name { color: var(--blue); }
.row__name { font-weight: 700; font-size: 15px; color: var(--graphite); }
.row__desc { font-size: 14px; color: var(--muted); }

/* Схемы */
.schemes { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 32px; align-items: start; }
.scheme-main { margin: 0; }
.scheme-main__img { display: block; border: 1px solid var(--border); padding: 14px; background: var(--white); }
.scheme-main__img img { margin: 0 auto; width: 100%; max-width: 509px; }
.scheme-main__cap { margin-top: 14px; }
.scheme-main__title { font-size: 17px; line-height: 1.3; }
.scheme-main__title a { color: var(--graphite); }
.scheme-main__title a:hover { color: var(--blue); }
.scheme-main__sub { margin-top: 4px; font-size: 14px; color: var(--muted); }
.legend { margin-top: 8px; list-style: none; counter-reset: lg; columns: 2; column-gap: 24px; font-size: 14px; }
.legend li { counter-increment: lg; display: flex; gap: 8px; padding: 3px 0; break-inside: avoid; }
.legend li::before {
  content: counter(lg); flex: none; width: 20px; height: 20px; border: 1px solid var(--text); border-radius: 50%;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
}

.scheme-list { list-style: none; border-top: 1px solid var(--border); }
.scheme-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: start; }
.scheme-item__img { display: flex; align-items: center; justify-content: center; height: 92px; border: 1px solid var(--border); padding: 5px; background: var(--white); }
.scheme-item__img img { max-height: 100%; width: auto; object-fit: contain; }
.scheme-item__title { font-size: 15px; line-height: 1.35; }
.scheme-item__title a { color: var(--graphite); }
.scheme-item__title a:hover { color: var(--blue); }
.scheme-item__cap { margin-top: 4px; font-size: 13px; color: var(--muted); }

.subnav { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }

/* Справочник */
.ref { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 36px; align-items: start; }
.ref__h { font-size: 16px; line-height: 1.3; margin-bottom: 10px; color: var(--graphite); }
.ref__h a { color: var(--graphite); }
.ref__h a:hover { color: var(--blue); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); }
.tech-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tech-table th { text-align: left; font-weight: 700; color: var(--graphite); background: #E9EDF0; padding: 9px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.tech-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tech-table th + th, .tech-table td + td { border-left: 1px solid var(--border); }
.tech-table tbody tr:nth-child(even) td { background: var(--zebra); }
.tech-table tbody tr:last-child td { border-bottom: 0; }
.tech-table .num { text-align: right; }
.ref__src { margin-top: 8px; font-size: 13px; color: var(--muted); }

.ref__links { display: grid; gap: 20px; }
.ref__group ul { list-style: none; font-size: 15px; }
.ref__group li { padding: 7px 0; border-top: 1px solid var(--border); }

/* Подборки */
.sets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.set { border-top: 1px solid var(--graphite); padding-top: 14px; }
.set__title { font-size: 16px; line-height: 1.3; color: var(--graphite); }
.set__intro { margin-top: 5px; font-size: 14px; color: var(--muted); }
.set__list { margin-top: 10px; list-style: none; font-size: 15px; }
.set__list li { padding: 5px 0; border-top: 1px solid var(--border); }
.set__list li:first-child { border-top: 0; }

/* Последние статьи */
.feed { list-style: none; border-top: 1px solid var(--border); }
.feed__item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: start; }
.feed__item:last-child { border-bottom: 0; padding-bottom: 0; }
.feed__thumb { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; border: 1px solid var(--border); overflow: hidden; background: var(--white); }
.feed__thumb img { width: 100%; height: 100%; object-fit: cover; }
.feed__title { font-size: 16px; line-height: 1.35; }
.feed__title a { color: var(--graphite); }
.feed__title a:hover { color: var(--blue); }
.feed__text { margin-top: 4px; font-size: 14px; line-height: 1.5; max-width: 60em; }
.feed__meta { margin-top: 5px; font-size: 13px; color: var(--muted); }

/* ───────── Футер ───────── */
.site-footer { background: var(--graphite); color: #C9D0D7; font-size: 14px; }
.site-footer__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 36px; padding-top: 20px; padding-bottom: 14px; }
.site-footer__brand { display: flex; align-items: baseline; gap: 14px; margin-right: auto; }
.logo__name--light { font-size: 20px; color: #FFFFFF; }
.site-footer__copy { font-size: 13px; color: #9AA4AE; }
.site-footer__nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer__nav a { color: #E7EBEF; }
.site-footer__nav a:hover { color: #FFFFFF; }
.site-footer__nav--muted a { color: #B5BEC7; }
.site-footer__proto { padding-top: 10px; padding-bottom: 16px; font-size: 12px; color: #8D97A1; border-top: 1px solid #343D49; }

/* ═════════ Адаптивность ═════════ */

@media (max-width: 1024px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }
  .hero__title { font-size: 30px; }
  .dirs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
  .schemes { gap: 24px; }
  .legend { columns: 1; }
  .header-search { width: 240px; }
}

@media (max-width: 860px) {
  /* Меню — раскрывающийся список */
  .header-search { display: none; }
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 9px;
    background: var(--white); border: 1px solid var(--border-strong); border-radius: var(--radius);
    color: var(--graphite); font: 700 14px var(--font); padding: 8px 12px; cursor: pointer;
  }
  .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 16px; height: 2px; background: currentColor; position: relative; }
  .nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle__bars::before { top: -5px; }
  .nav-toggle__bars::after { top: 5px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

  .site-nav { display: none; }
  .site-nav.is-open { display: block; }
  .site-nav__list { flex-direction: column; gap: 0; margin-left: 0; }
  .site-nav__item { flex-wrap: wrap; border-bottom: 1px solid var(--border); }
  .site-nav__item:last-child { border-bottom: 0; }
  .site-nav__link { flex: 1; padding: 12px 0; font-size: 16px; }
  .site-nav__sub-toggle {
    display: block; width: 44px; height: 44px; background: transparent; border: 0; color: var(--graphite); cursor: pointer; position: relative;
  }
  .site-nav__sub-toggle::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translate(-50%, -70%) rotate(45deg); }
  .site-nav__sub-toggle[aria-expanded="true"]::before { transform: translate(-50%, -30%) rotate(-135deg); }
  .site-nav__item:hover .site-nav__drop, .site-nav__item:focus-within .site-nav__drop { display: none; }
  .site-nav__drop { position: static; width: 100%; min-width: 0; border: 0; padding: 0 0 10px; }
  .site-nav__item.is-open .site-nav__drop { display: block; }
  .site-nav__drop li a { padding: 7px 0 7px 14px; }
  .site-nav__drop li a:hover { background: transparent; }
  .site-nav__all { border-top: 0; padding: 6px 0 4px 14px; }

  .hero__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 26px; padding-bottom: 30px; }
  .hero__title { max-width: none; }
  .ohm { max-width: 520px; }
  .schemes { grid-template-columns: minmax(0, 1fr); }
  .legend { columns: 2; }
  .ref { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .ref__links { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .sets { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .row { grid-template-columns: minmax(0, 1fr) 20px; gap: 3px 14px; }
  .row__name { grid-column: 1; }
  .row::after { grid-column: 2; grid-row: 1; }
  .row__desc { grid-column: 1; }
}

@media (max-width: 600px) {
  :root { --gutter: 14px; }
  .site-header__top { padding-top: 11px; padding-bottom: 10px; gap: 12px; }
  .logo__name { font-size: 23px; }
  .logo__sub { font-size: 12px; }
  .hero__title { font-size: 25px; line-height: 1.22; }
  .hero__lead { font-size: 15px; }
  .search__btn { padding: 0 16px; }
  .ohm__head, .ohm__form { padding-left: 14px; padding-right: 14px; }
  .plate { margin: 0 14px 14px; }
  .seg { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .seg label:nth-child(4) { border-left: 0; }
  .seg label:nth-child(n+4) { border-top: 1px solid var(--border); }
  .plate__v { font-size: 20px; }
  .page { padding-top: 12px; }
  .page__stack { gap: 12px; }
  .panel { padding: 18px 16px 20px; }
  .panel__title { font-size: 20px; }
  .dirs { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .scheme-main__img { padding: 6px; }
  .scheme-item { grid-template-columns: 92px minmax(0, 1fr); gap: 12px; }
  .scheme-item__img { height: 76px; }
  .legend { columns: 1; }
  .ref__links { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .feed__item { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .feed__thumb { width: 56px; height: 56px; }
  .feed__title { font-size: 15px; }
  .site-footer__row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-footer__brand { margin-right: 0; }
}

/* ═════════ Дополнения для WordPress ═════════ */

/* Служебные классы WordPress */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.screen-reader-text:focus { position: static !important; width: auto; height: auto; clip: auto; }
.admin-bar .site-header { top: 0; }

/* Меню: текущий раздел */
.site-nav__item.is-current > .site-nav__link { color: var(--blue); }

/* Материал без ссылки (ещё не импортирован) */
.rows li > div.row::after { content: none; }
.scheme-item__img:not(a), .feed__thumb:not(a) { cursor: default; }

/* Лента без миниатюры */
.feed__item--no-thumb { grid-template-columns: minmax(0, 1fr); }

/* Поиск внутри страницы */
.search--inline { margin: 0 0 18px; max-width: 560px; }
.search__form { margin: 0; }
.archive-description { margin: -6px 0 16px; color: var(--muted); max-width: 52em; }

/* Пагинация */
.navigation.pagination { margin-top: 18px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.page-numbers { display: inline-block; min-width: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); text-align: center; color: var(--text); font-size: 14px; }
a.page-numbers:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.page-numbers.current { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.page-numbers.dots { border: 0; }

/* ───────── Статья (временный шаблон index.php) ───────── */
.entry__head { margin-bottom: 18px; }
.entry__title { font-size: 30px; line-height: 1.22; color: var(--graphite); max-width: 760px; }
.entry__meta { margin-top: 8px; font-size: 13px; color: var(--muted); }
.entry__lead { margin-bottom: 16px; }
.entry__content { max-width: 760px; font-size: 16px; line-height: 1.65; }
.entry__content > * + * { margin-top: 1em; }
.entry__content h2 { font-size: 23px; line-height: 1.25; margin-top: 1.6em; color: var(--graphite); }
.entry__content h3 { font-size: 17px; line-height: 1.3; margin-top: 1.4em; color: var(--graphite); }
.entry__content ul, .entry__content ol { padding-left: 1.4em; }
.entry__content li + li { margin-top: .3em; }
.entry__content img { height: auto; }
.entry__content figure { margin: 1.4em 0; }
.entry__content figcaption { margin-top: 6px; font-size: 13px; color: var(--muted); }
.entry__content blockquote { margin: 1.4em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--blue); color: var(--muted); }
.entry__content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.entry__content th { text-align: left; background: #E9EDF0; font-weight: 700; padding: 8px 10px; border: 1px solid var(--border); }
.entry__content td { padding: 7px 10px; border: 1px solid var(--border); }
.entry__content .wp-block-table { overflow-x: auto; }
.entry__content .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.entry__content .alignleft { float: left; margin: 0 1.2em .8em 0; }
.entry__content .alignright { float: right; margin: 0 0 .8em 1.2em; }
.entry__content::after { content: ""; display: table; clear: both; }
.page-links { margin-top: 18px; font-size: 14px; }

@media (max-width: 600px) {
  .entry__title { font-size: 24px; }
  .entry__content { font-size: 15px; }
  .entry__content .alignleft, .entry__content .alignright { float: none; margin: 1em 0; }
}

/* ───────── Перенесённые материалы (старая вёрстка) ───────── */
.entry__content .legacy-block + .legacy-block { margin-top: 1em; }
.entry__content .has-text-align-center { text-align: center; }
.entry__content img.legacy-img { display: inline-block; vertical-align: top; margin: .4em 0; max-width: 100%; height: auto; }
.entry__content .legacy-table { margin: 1.2em 0; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); }
.entry__content .legacy-table table { margin: 0; min-width: 100%; }
.entry__content .legacy-table table td, .entry__content .legacy-table table th { border: 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.entry__content .legacy-table table tr > * + * { border-left: 1px solid var(--border); }
/* Без «зебры»: у старых GIF-символов непрозрачный белый фон, на сером он выглядит заплаткой */
.entry__content .legacy-table table img { margin: 0; }
.entry__content .legacy-form { padding: 14px 16px; border: 1px solid var(--border); background: var(--soft); }
.entry__content .legacy-calc-note { padding: 10px 14px; border-left: 3px solid var(--orange); background: var(--soft); font-size: 14px; color: var(--text); }

/* Схема, уменьшенная под ширину колонки, открывается в полном размере */
.entry__content a.img-zoom { display: inline-block; max-width: 100%; text-decoration: none; cursor: zoom-in; }
.entry__content a.img-zoom::after { content: "Открыть в полном размере ↗"; display: block; margin-top: 2px; font-size: 12px; color: var(--blue); }
.entry__content a.img-zoom:hover::after { text-decoration: underline; }

/* Анонсы в списках (рубрика, поиск, лента) — не длиннее трёх строк; полный текст остаётся в HTML */
.panel .feed .feed__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }

/* ───────── Старая рубрика: группы и авторский порядок ───────── */
.rubric__group + .rubric__group { margin-top: 26px; }
.rubric__title { font-size: 17px; line-height: 1.3; color: var(--graphite); padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.rubric__list { list-style: none; margin-top: 4px; columns: 2; column-gap: 32px; }
.rubric__item { break-inside: avoid; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 15px; line-height: 1.4; }
.rubric__item.is-pending span { color: var(--muted); }
@media (max-width: 760px) { .rubric__list { columns: 1; } }
/* Карта сайта (/karta/): подраздел внутри группы раздела. */
.karta h3.rubric__title { margin-top: 22px; font-size: 15px; }

/* ───────── Контакты (/kontakty/): блоки способов связи ───────── */
.contacts__intro { max-width: 46em; font-size: 16px; line-height: 1.6; color: var(--text); }
.contact-cards { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 760px; margin-top: 22px; }
.contact-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius); background: var(--ds-card); }
.contact-card__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; background: var(--section-accent-light); color: var(--section-accent-text); }
.contact-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.contact-card__label { font-size: 13px; line-height: 1.3; color: var(--ds-muted); }
.contact-card__link { font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--section-accent-text); overflow-wrap: anywhere; }
.contact-card__link:hover { color: var(--section-accent-dark); }
.contacts__note { margin-top: 22px; font-size: 14px; color: var(--ds-muted); }
@media (max-width: 600px) { .contact-cards { grid-template-columns: 1fr; } }

/* Символы в таблицах не уменьшаются: таблица прокручивается внутри рамки */
.entry__content .legacy-table img { max-width: none; }

/* Раздел-хаб: подразделы над списком материалов */
.subnav--top { margin: 0 0 16px; padding: 0 0 12px; border-top: 0; border-bottom: 1px solid var(--border); }

/* ───────── Калькуляторы в статьях (шорткод [skrutka_calc]) ───────── */
.entry__content .legacy-calc { margin: 1.4em 0; }
.calc-slot .ohm, .calc-slot .calc { max-width: 560px; }
.entry__content .ohm__title { margin-top: 0; font-size: 17px; line-height: 1.3; }
.calc { background: var(--soft); border: 1px solid var(--border); border-radius: var(--radius); line-height: 1.45; }
.calc__form { padding: 16px 18px; }
.calc__hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.calc__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; }
.calc__fields--si { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.calc__fields--si .field { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; column-gap: 12px; }
.calc__fields--si .field__label { margin: 0; }
.calc__fields--si .field__err { grid-column: 2; }
.field.is-source .field__box { box-shadow: inset 3px 0 0 var(--blue); }
.field.is-source.is-error .field__box { box-shadow: inset 3px 0 0 var(--orange); }
.calc__status { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.calc__status:empty { display: none; }
.calc .plate { margin: 0 18px 18px; }
.plate--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calc .plate__formula span { display: inline-block; margin-right: 1.6em; }
.calc__noscript { padding: 0 18px 16px; font-size: 14px; }
.entry__content .legacy-value { font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 600px) {
  .calc__form { padding-left: 14px; padding-right: 14px; }
  .calc .plate { margin: 0 14px 14px; }
  .calc__fields--si .field { grid-template-columns: minmax(0, 1fr); }
  .calc__fields--si .field__label { margin-bottom: 4px; }
  .calc__fields--si .field__err { grid-column: 1; }
  .plate--3 { grid-template-columns: minmax(0, 1fr); }
  .plate--3 .plate__cell + .plate__cell { border-left: 0; border-top: 1px solid var(--border); }
}
/* Калькулятор с длинными подписями полей (заземление): подпись слева, поле справа */
.calc--grounding { text-align: left; }
.calc__fields--rows { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.calc__fields--rows .field { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; column-gap: 12px; }
.calc__fields--rows .field__label { margin: 0; }
.calc__fields--rows .field__err { grid-column: 2; }
.calc__hint--after { margin: 12px 0 0; }
.calc__actions { display: flex; gap: 10px; }
.calc__actions .btn { flex: 1; }
.btn--ghost { background: var(--white); color: var(--blue); border: 1px solid var(--blue); }
.btn--ghost:hover { background: var(--soft); }
.plate--rows .plate__cell { border-top: 1px solid var(--border); }
.plate--rows .plate__cell:nth-child(-n+2) { border-top: 0; }
.plate--rows .plate__cell:nth-child(odd) { border-left: 0; }
.plate--rows .plate__v { white-space: normal; }
@media (max-width: 600px) {
  .calc__fields--rows .field { grid-template-columns: minmax(0, 1fr); }
  .calc__fields--rows .field__label { margin-bottom: 4px; }
  .calc__fields--rows .field__err { grid-column: 1; }
  .plate--rows { grid-template-columns: minmax(0, 1fr); }
  .plate--rows .plate__cell { border-left: 0; }
  .plate--rows .plate__cell:nth-child(2) { border-top: 1px solid var(--border); }
}
/* Конденсатор для двигателя (id=13): заголовок формы, выбор схемы, блокировка и справочная оценка */
.calc--motor { text-align: left; }
.calc__title { margin: 0 0 12px; font-weight: 700; color: var(--blue); }
.choice { margin: 0 0 12px; padding: 0; border: 0; min-width: 0; }
.choice__row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice__item { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--white); font-size: 14px; cursor: pointer; }
.choice__item:has(input:checked) { border-color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }
.choice__item input { margin: 0; accent-color: var(--blue); }
.field__hint { display: block; font-size: 12px; color: var(--muted); }
.calc__alert { margin: 0 18px 14px; padding: 10px 12px; border: 1px solid var(--orange); box-shadow: inset 3px 0 0 var(--orange); background: var(--white); font-size: 14px; line-height: 1.45; color: var(--orange-text); }
.calc__alert[hidden] { display: none; }
.plate--rows .plate__cell:first-child .plate__v { font-size: 26px; }
.plate.is-reference { border-style: dashed; }
.plate.is-reference .plate__v { color: var(--muted); }
.calc .plate__warn { grid-column: 1 / -1; border-top: 1px solid var(--border); padding: 8px 12px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.entry__content .legacy-calc-figure { margin: 1em 0 0; text-align: center; }
.entry__content .legacy-calc-figure + .legacy-calc { margin-top: .6em; }
@media (max-width: 600px) {
  .calc__alert { margin: 0 14px 14px; }
  .choice__row { flex-direction: column; }
  .calc__actions .btn { min-height: 44px; }
}
/* Калькуляторы 19, 58, 60, 62, 69: списки, справка, источник, таблица диодов */
.calc--generic, .calc--diodes { text-align: left; }
.calc--diodes { max-width: none; }
.calc-slot .calc--diodes { max-width: 100%; }
.field--select { margin: 0 0 10px; }
.calc__fields--rows .field--select { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; column-gap: 12px; margin: 0; }
.field__select { width: 100%; min-height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--white); padding: 6px 8px; font: 16px var(--font); color: var(--text); }
.calc__fields--rows .field--select .field__label { margin: 0; }
.field--select > .field__select { max-width: 100%; }
.calc__ref { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.calc__ref summary { cursor: pointer; color: var(--blue); }
.calc__ref ul { margin: 6px 0 0 18px; }
.calc .plate__src { grid-column: 1 / -1; border-top: 1px solid var(--border); padding: 6px 12px; font-size: 12px; color: var(--muted); }
.calc__foot { margin: 0 18px 18px; }
.calc--diodes .calc__status { margin: 0 18px 10px; }
.diodes-wrap { margin: 0 18px 14px; overflow-x: auto; border: 1px solid var(--border-strong); background: var(--white); }
.diodes { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.diodes th, .diodes td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: top; }
.diodes th { background: var(--soft); font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.25; }
.diodes th:first-child, .diodes td:first-child, .diodes th:last-child, .diodes td:last-child { text-align: left; }
.diodes td small { display: block; font-size: 11px; color: var(--muted); }
.diodes td:last-child { font-size: 12px; }
@media (max-width: 600px) {
  .calc__fields--rows .field--select { grid-template-columns: minmax(0, 1fr); }
  .calc__fields--rows .field--select .field__label { margin-bottom: 4px; }
  .diodes-wrap { margin: 0 14px 14px; border: 0; background: transparent; overflow: visible; }
  .calc__foot { margin: 0 14px 14px; }
  .calc--diodes .calc__status { margin: 0 14px 10px; }
  .diodes thead { display: none; }
  .diodes, .diodes tbody, .diodes tr, .diodes td { display: block; width: 100%; }
  .diodes tr { margin: 0 0 8px; border: 1px solid var(--border-strong); background: var(--white); }
  .diodes tr[hidden] { display: none; }
  .diodes td { display: flex; justify-content: space-between; gap: 12px; text-align: right; border-bottom: 1px solid var(--border); }
  .diodes td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  .diodes td:first-child { display: block; text-align: left; background: var(--soft); }
  .diodes td:first-child::before { content: none; }
  .diodes td:last-child { text-align: right; border-bottom: 0; }
}
.calc .plate__note { grid-column: 1 / -1; border-top: 1px solid var(--border); padding: 8px 12px; font-size: 13px; line-height: 1.45; color: var(--text); }
.calc .plate__note:empty { display: none; }

/* Страницы WordPress (/sk/tekst.php?id=1, 2, 21): post_class() добавляет статье класс «page», совпадающий
   с обёрткой .page (padding: … 0 …), из-за чего у панели пропадали боковые отступы. Возвращаем отступы панели. */
.panel.page { padding: 26px 28px 28px; }
@media (max-width: 600px) { .panel.page { padding: 18px 16px 20px; } }
