/* ═══ Юридические страницы: читаемый документ вместо стены текста ═══
   Подключается только там, где плагин поставил телу класс istudy-legal
   (раздел /legal/ и одиночные страницы вроде /contacts/).
   Страницы не трогаем — всё решается стилями. */

/* — синяя полоса темы с капслоком: убираем совсем — */
body.istudy-legal .entry-header{
  background:none!important;padding:0!important;min-height:0!important;height:auto!important;
}
body.istudy-legal .entry-header::before,
body.istudy-legal .entry-header::after{display:none!important}

/* — заголовок: Lora строчными на белом, как на «Ценах» и «Книгах» — */
body.istudy-legal .entry-header h1,
body.istudy-legal .entry-title h1{
  font-family:'Lora',Georgia,serif!important;
  text-transform:none!important;
  color:#111318!important;
  font-size:clamp(30px,3.4vw,44px)!important;
  line-height:1.16!important;
  font-weight:600!important;
  max-width:840px;margin:56px auto 0!important;padding:0 24px!important;
  text-align:left!important;
}

/* — хлебные крошки: тихая строка, без капслока — */
body.istudy-legal .stm_lms_breadcrumbs{
  max-width:840px;margin:10px auto 0!important;padding:0 24px!important;background:none!important;
}
body.istudy-legal .stm_lms_breadcrumbs *{
  text-transform:none!important;font-size:13px!important;color:#8b91a1!important;letter-spacing:0!important;
}

/* — колонка текста: 720 px, кегль 17, воздух — */
body.istudy-legal .container{max-width:none!important;width:auto!important;padding-left:0!important;padding-right:0!important}
body.istudy-legal .container .row,
body.istudy-legal .container [class^="col-"]{
  max-width:none!important;width:auto!important;float:none!important;
  margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important;
}
body.istudy-legal .post_type_exist{
  max-width:840px;margin:0 auto;padding:8px 24px 72px;
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  font-size:17px;line-height:1.72;color:#3d4252;
  /* По умолчанию — по левому краю. Выключку по ширине включает legal.js и только
     тем абзацам, которым есть что растягивать (от трёх строк). Порядок именно такой,
     а не наоборот: если скрипт не отработает, страница останется ровной по левому
     краю, а не расползётся в разрядку. */
  text-align:left;
  text-wrap:pretty;
}
body.istudy-legal .post_type_exist p{margin:0 0 18px}
/* Выключка по ширине — для договора она уместнее, чем для статьи: документ
   выглядит документом. Метку ставит legal.js: он включает выключку всем абзацам
   сразу, а потом снимает её у тех, где строку пришлось растянуть слишком сильно.
   Переносы обязательны и идут в одном правиле с выключкой: без них в русском
   тексте между словами вырастают «реки», и рваный край был бы меньшим злом. */
body.istudy-legal .post_type_exist .istudy-just{
  text-align:justify;
  -webkit-hyphens:auto;hyphens:auto;
  /* Ограничиваем растяжение пробелов, иначе строка с длинным неразрывным куском
     (адрес, реквизиты) расползается: слова стоят как по линейке. */
  word-spacing:-.02em;
  text-justify:inter-word;
}
body.istudy-legal .post_type_exist strong{color:#2B3044;font-weight:600}

/* — разделы: отбивка сверху, тонкая линия, номер тише текста — */
body.istudy-legal .post_type_exist h2,
body.istudy-legal .post_type_exist h3{text-align:left;hyphens:manual}
body.istudy-legal .post_type_exist h2{
  font-family:'Lora',Georgia,serif;font-size:26px;line-height:1.25;color:#111318;
  margin:52px 0 14px;padding-top:26px;border-top:1px solid #e4e4e8;font-weight:600;
}
body.istudy-legal .post_type_exist h2:first-of-type{border-top:0;padding-top:0;margin-top:34px}
body.istudy-legal .post_type_exist h3{
  font-family:'Inter',sans-serif;font-size:18px;color:#2B3044;margin:30px 0 10px;font-weight:600;
}

/* — списки: ровный ритм, маркер малиновый — */
body.istudy-legal .post_type_exist ul{list-style:none;padding-left:0;margin:0 0 20px}
body.istudy-legal .post_type_exist ul li{position:relative;padding-left:22px;margin:0 0 10px}
body.istudy-legal .post_type_exist ul li::before{
  content:"";position:absolute;left:2px;top:11px;width:6px;height:6px;border-radius:50%;background:#EF2577;opacity:.75;
}
body.istudy-legal .post_type_exist ol{padding-left:22px;margin:0 0 20px}
body.istudy-legal .post_type_exist ol li{margin:0 0 10px}
body.istudy-legal .post_type_exist a{color:#EF2577;text-decoration:none;border-bottom:1px solid rgba(239,37,119,.3)}
body.istudy-legal .post_type_exist a:hover{border-bottom-color:#EF2577}

/* — таблицы реквизитов и тарифов — */
body.istudy-legal .post_type_exist table{width:100%;border-collapse:collapse;margin:0 0 24px;font-size:15.5px}
body.istudy-legal .post_type_exist th,
body.istudy-legal .post_type_exist td{border-bottom:1px solid #e4e4e8;padding:11px 10px;text-align:left;vertical-align:top}
body.istudy-legal .post_type_exist th{color:#2B3044;font-weight:600;background:#FAFAFB}

/* — плашка «черновик»: её нельзя пропустить — */
body.istudy-legal .istudy-draft{
  max-width:840px;margin:22px auto 0;padding:14px 18px;border-radius:12px;
  background:#FFF7D6;border:1px solid #f0e3ae;color:#6b5a17;font-size:14.5px;line-height:1.6;
}

/* — оглавление документа, собирается скриптом — */
body.istudy-legal .istudy-toc{
  max-width:840px;margin:26px auto 0;padding:20px 22px;border-radius:14px;
  background:#FAFAFB;border:1px solid #e4e4e8;
}
body.istudy-legal .istudy-toc p{
  margin:0 0 12px;font-size:12.5px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:#8b91a1;
}
body.istudy-legal .istudy-toc ol{margin:0;padding-left:20px;columns:2;column-gap:28px}
body.istudy-legal .istudy-toc li{margin:0 0 8px;font-size:14.5px;break-inside:avoid}
body.istudy-legal .istudy-toc a{color:#3d4252;text-decoration:none;border-bottom:1px solid transparent}
body.istudy-legal .istudy-toc a:hover{color:#EF2577;border-bottom-color:rgba(239,37,119,.35)}

/* — якорь не должен уезжать под липкую шапку — */
body.istudy-legal .post_type_exist h2{scroll-margin-top:120px}

@media(max-width:760px){
  /* На узком экране строка короткая, выключка почти всегда даёт разрядку — гасим. */
  body.istudy-legal .post_type_exist .istudy-just{text-align:left;hyphens:manual}
  body.istudy-legal .entry-header h1{margin-top:32px!important;padding:0 18px!important}
  body.istudy-legal .post_type_exist{padding:8px 18px 56px;font-size:16.5px}
  body.istudy-legal .istudy-toc ol{columns:1}
  body.istudy-legal .istudy-toc,
  body.istudy-legal .istudy-draft{margin-left:18px;margin-right:18px}
}

/* — служебные пометки в тексте: приглушены, но не скрыты — */
body.istudy-legal .post_type_exist mark,
body.istudy-legal .post_type_exist .marker{
  background:#F2F3F7;color:#8b91a1;padding:1px 5px;border-radius:4px;font-size:.88em;
}
