/* Отдельная запись (новости и статьи) — single.php */
.ar, .ar-related {
  --ar-green: #30af21; --ar-green-dark: #1f7d14; --ar-green-soft: #eaf6e8; --ar-deep: #145422;
  --ar-orange: #ff7a00; --ar-text: #1d2a1f; --ar-muted: #6b776d; --ar-line: #e6ebe6;
}
body.single-post .breadcrumbs { margin-bottom: 10px !important; }

.ar-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; padding-bottom: 20px; }
.ar--full .ar-grid { grid-template-columns: minmax(0, 860px); justify-content: center; }
.ar-main { min-width: 0; }
.ar-side { position: sticky; top: 74px; }

/* ---------- шапка статьи ---------- */
.ar-head { margin: 10px 0 24px; }
.ar-cat {
  display: inline-block; margin-bottom: 14px; padding: 6px 12px; border-radius: 10px; background: var(--ar-green-soft);
  font-size: 13px; font-weight: 700; color: var(--ar-green-dark) !important; text-decoration: none !important;
}
.ar-cat:hover { background: #d9efd5; }
.ar-title { margin: 0 0 14px; font-size: 40px; line-height: 1.15; font-weight: 700; color: var(--ar-text); }
.ar-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--ar-muted); }
.ar-meta__item { display: inline-flex; align-items: center; gap: 7px; }
.ar-meta__item::before { content: ""; width: 16px; height: 16px; background: center / 16px no-repeat; opacity: .75; }
.ar-meta__item--date::before, .ar-meta__item--upd::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b776d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E"); }
.ar-meta__item--upd::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b776d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7L21 8M21 3v5h-5'/%3E%3C/svg%3E"); }
.ar-meta__item--time::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b776d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ar-cover { margin: 0 0 30px; border-radius: 22px; overflow: hidden; background: #f2f5f2; }
.ar-cover img { display: block; width: 100%; height: auto; max-height: 480px; object-fit: cover; }

/* ---------- содержание: плагин Table of Contents Plus (#toc_container) ---------- */
.ar-content #toc_container {
  display: block !important; width: auto !important; max-width: none !important; margin: 6px 0 32px !important; padding: 0 !important;
  border: 1px solid var(--ar-line) !important; border-radius: 18px !important; background: #f7faf6 !important; box-shadow: none !important;
  font-size: 15px !important;
}
.ar-content #toc_container .toc_title {
  display: flex !important; align-items: center; justify-content: space-between; gap: 12px; margin: 0 !important; padding: 16px 20px !important;
  font-size: 17px !important; font-weight: 700 !important; text-align: left !important; color: var(--ar-text) !important;
}
.ar-content #toc_container .toc_title::before {
  content: ""; flex: 0 0 32px; height: 32px; margin-right: -2px; border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231f7d14' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11M4 6h.01M4 12h.01M4 18h.01'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.ar-content #toc_container .toc_toggle { margin-left: auto; font-size: 0 !important; }
.ar-content #toc_container .toc_brackets { display: none !important; }
.ar-content #toc_container .toc_toggle a {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; background: #fff;
  font-size: 13px !important; font-weight: 700; color: var(--ar-green-dark) !important; text-decoration: none !important; border: 0 !important;
}
.ar-content #toc_container .toc_toggle a:hover { background: var(--ar-green-soft); }
.ar-content #toc_container ul.toc_list {
  margin: 0 !important; padding: 2px 20px 18px !important; list-style: none !important;
  columns: 2; column-gap: 32px; counter-reset: toc;
}
.ar .ar-content #toc_container ul.toc_list li {
  position: relative; margin: 0 !important; padding: 7px 0 7px 34px !important; list-style: none !important;
  break-inside: avoid; counter-increment: toc; font-size: 15px; line-height: 1.4; background: none !important;
}
.ar .ar-content #toc_container ul.toc_list li::before {
  content: counter(toc) !important; position: absolute !important; left: 0 !important; top: 6px !important; display: block !important;
  width: 24px !important; height: 24px !important; margin: 0 !important; border: 0 !important; border-radius: 50% !important;
  background: #fff !important; box-shadow: 0 0 0 1px #dfe9dd; font-size: 12px !important; font-weight: 700; line-height: 24px !important;
  text-align: center; color: var(--ar-green-dark) !important;
}
.ar .ar-content #toc_container ul.toc_list ul { margin: 4px 0 0 !important; padding: 0 !important; columns: 1; }
.ar .ar-content #toc_container ul.toc_list ul li { padding-left: 16px !important; font-size: 14px; counter-increment: none; }
.ar .ar-content #toc_container ul.toc_list ul li::before { content: "" !important; top: 15px !important; width: 6px !important; height: 6px !important; box-shadow: none; background: var(--ar-green) !important; }
.ar-content #toc_container a { border: 0 !important; color: var(--ar-text) !important; text-decoration: none !important; }
.ar-content #toc_container a:hover { color: var(--ar-green-dark) !important; }
.ar-content #toc_container .toc_number { display: none; }

/* ---------- текст статьи ---------- */
.ar-content { padding: 0 !important; font-size: 17px; line-height: 1.75; color: #26322a; }
.ar-content .wpb-content-wrapper .vc_column-inner { padding-left: 0 !important; padding-right: 0 !important; }
.ar-content .vc_row { margin-left: 0 !important; margin-right: 0 !important; }  /* иначе отрицательные поля строки WPBakery прижимают текст к краям на телефоне */
.ar-content .wpb_content_element { margin-bottom: 0 !important; }
.ar-content p { margin: 0 0 18px; }
.ar-content h2 { margin: 42px 0 16px !important; font-size: 28px; line-height: 1.25; font-weight: 700; color: var(--ar-text); scroll-margin-top: 90px; }
.ar-content h3 { margin: 30px 0 12px !important; font-size: 21px; line-height: 1.3; font-weight: 700; color: var(--ar-text); scroll-margin-top: 90px; }
.ar-content h2:first-child, .ar-content > .wpb-content-wrapper h2:first-of-type { margin-top: 10px !important; }
.ar-content strong, .ar-content b { font-weight: 700; color: var(--ar-text); }
.ar-content a:not([class]) { color: var(--ar-green-dark) !important; text-decoration: none !important; border-bottom: 1px solid rgba(31, 125, 20, .3); transition: border-color .15s; }
.ar-content a:not([class]):hover { border-bottom-color: var(--ar-green-dark); }

.ar .ar-content ul { margin: 0 0 22px !important; padding: 0 !important; list-style: none !important; }
.ar .ar-content ul li { position: relative; margin: 0 0 10px !important; padding: 0 0 0 28px !important; list-style: none !important; }
.ar .ar-content ul li::before {
  content: "" !important; position: absolute !important; left: 4px !important; top: 11px !important; display: block !important;
  width: 8px !important; height: 8px !important; margin: 0 !important; border: 0 !important; border-radius: 50% !important; background: var(--ar-green) !important;
}
.ar .ar-content ol { margin: 0 0 22px !important; padding: 0 !important; list-style: none !important; counter-reset: arol; }
.ar .ar-content ol li { position: relative; margin: 0 0 12px !important; padding: 0 0 0 40px !important; list-style: none !important; counter-increment: arol; }
.ar .ar-content ol li::before {
  content: counter(arol) !important; position: absolute !important; left: 0 !important; top: 1px !important; display: block !important;
  width: 28px !important; height: 28px !important; margin: 0 !important; border: 0 !important; border-radius: 50% !important;
  background: var(--ar-green) !important; font-size: 14px !important; font-weight: 700; line-height: 28px !important; text-align: center; color: #fff !important;
}
.ar .ar-content li > ul, .ar .ar-content li > ol { margin: 10px 0 0 !important; }

.ar-content figure { margin: 26px 0 !important; max-width: 100%; }
.ar-content img { max-width: 100%; height: auto; border-radius: 16px; }
.ar-content figcaption { margin-top: 8px; font-size: 14px; color: var(--ar-muted); text-align: center; }

.ar .ar-content blockquote {
  position: relative; margin: 26px 0 !important; padding: 20px 24px 20px 68px !important;
  border: 0 !important; border-radius: 16px; background: var(--ar-green-soft); font-size: 16px; line-height: 1.6; font-style: normal; color: var(--ar-text);
}
.ar .ar-content blockquote::before {
  content: "" !important; position: absolute !important; left: 22px !important; right: auto !important; top: 20px !important; margin: 0 !important;
  width: 30px !important; height: 30px !important; border-radius: 50% !important;
  background: var(--ar-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 6.2v4M7 3.6v.1'/%3E%3C/svg%3E") center / 14px no-repeat !important;
}
.ar .ar-content blockquote::after { display: none !important; }
.ar .ar-content blockquote p:last-child { margin-bottom: 0; }

/* таблицы: обёртка с прокруткой добавляется в js/main.js */
.ar-table { margin: 24px 0; overflow-x: auto; border: 1px solid var(--ar-line); border-radius: 16px; -webkit-overflow-scrolling: touch; }
.ar .ar-content table { width: 100%; min-width: 520px; margin: 0 !important; border: 0 !important; border-collapse: collapse; background: #fff !important; font-size: 15px; line-height: 1.5; }
.ar .ar-content th, .ar .ar-content thead td {
  padding: 13px 16px !important; border: 0 !important; background: var(--ar-green-soft) !important;
  font-weight: 700; text-align: left; color: var(--ar-text); vertical-align: bottom;
}
.ar .ar-content td { padding: 12px 16px !important; border: 0 !important; border-top: 1px solid var(--ar-line) !important; background: none !important; vertical-align: top; }
.ar .ar-content tbody tr:nth-child(even) td { background: #fafcfa !important; }
.ar .ar-content table p { margin: 0; }

/* ---------- подвал статьи ---------- */
.ar-foot { display: flex; flex-direction: column; gap: 14px; margin: 34px 0 0; padding: 22px 0 0; border-top: 1px solid var(--ar-line); }
.ar-foot__label { margin-right: 4px; font-size: 14px; font-weight: 700; color: var(--ar-muted); }
.ar-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ar-tags a {
  padding: 7px 12px; border-radius: 16px; background: #f2f5f2; font-size: 13px; color: var(--ar-text) !important; text-decoration: none !important; transition: background-color .15s;
}
.ar-tags a:hover { background: var(--ar-green-soft); color: var(--ar-green-dark) !important; }

.ar-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin: 30px 0 0; padding: 26px 28px; border-radius: 22px; color: #fff; background: linear-gradient(120deg, #1f7d14 0%, var(--ar-deep) 100%); box-shadow: 0 12px 30px rgba(20, 84, 34, .22); }
.ar-cta__title { font-size: 22px; font-weight: 700; color: #fff; }
.ar-cta__text { max-width: 460px; margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .82); }
.ar-cta__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.ar-cta__btn { padding: 14px 22px; border-radius: 14px; background: var(--ar-orange); font-size: 15px; font-weight: 700; color: #fff !important; text-decoration: none !important; box-shadow: 0 8px 20px rgba(255, 122, 0, .35); }
.ar-cta__btn:hover { background: #ff8c1f; }
.ar-cta__link { font-size: 15px; font-weight: 700; color: #fff !important; text-decoration: none !important; border-bottom: 1px dashed rgba(255, 255, 255, .5); }

/* ---------- комментарии ---------- */
.ar-comments { margin-top: 40px; }
.ar-h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 26px; line-height: 1.25; font-weight: 700; color: var(--ar-text); }
.ar-h2 span { padding: 3px 10px; border-radius: 12px; background: #f2f5f2; font-size: 15px; color: var(--ar-muted); }
.ar-comments .container { width: auto !important; max-width: none !important; padding: 0 !important; }
.ar-comments .comment-list { margin: 0 0 24px !important; padding: 0 !important; list-style: none !important; }
.ar-comments .comment-list li { margin: 0 0 12px !important; padding: 0 !important; list-style: none !important; }
.ar-comments .comment-list li::before { display: none !important; }
.ar-comments .comment-list .children { margin: 12px 0 0 28px !important; padding: 0 !important; }
.ar-comments .comment-body { padding: 18px 20px; border: 1px solid var(--ar-line); border-radius: 16px; background: #fff; }
.ar-comments .comment-body .name { display: inline; font-size: 15px; font-weight: 700; color: var(--ar-text); }
.ar-comments .comment-body .date { display: inline; margin-left: 10px; font-size: 13px; color: var(--ar-muted); }
.ar-comments .comment-body .text_block { margin-top: 8px; font-size: 15px; line-height: 1.6; color: #33403a; }
.ar-comments .comment-body .text_block p { margin: 0 0 8px; }
.ar-comments .comment-reply-link { font-size: 13px; font-weight: 700; color: var(--ar-green-dark) !important; text-decoration: none !important; }

.ar-form { padding: 24px; border: 1px solid var(--ar-line); border-radius: 20px; background: #f7faf6; }
.ar-form .comment-respond { margin: 0 !important; padding: 0 !important; background: none !important; }
.ar-form .comment-reply-title { margin: 0 0 16px !important; font-size: 22px !important; font-weight: 700; color: var(--ar-text) !important; }
.ar-form .comment-reply-title small a { margin-left: 10px; font-size: 13px; font-weight: 600; color: var(--ar-muted) !important; }
.ar-form .comment-form { display: block !important; margin: 0 !important; padding: 0 !important; }
.ar-form .comment-form p { float: none !important; width: auto !important; margin: 0 0 12px !important; padding: 0 !important; }
.ar-form .top-wrap { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 12px !important; }
.ar-form .top-wrap p { margin: 0 !important; }
.ar-form input[type="text"], .ar-form input[type="email"], .ar-form textarea {
  display: block !important; width: 100% !important; max-width: none !important; height: 48px !important; margin: 0 !important; padding: 0 14px !important;
  box-sizing: border-box !important; border: 1px solid #dfe5df !important; border-radius: 12px !important; background: #fff !important; box-shadow: none !important;
  font-size: 15px !important; line-height: 1.4 !important; color: var(--ar-text) !important;
}
.ar-form textarea { height: 130px !important; min-height: 0 !important; padding: 12px 14px !important; resize: vertical; }
/* у темы значки полей (человек, конверт, карандаш) стоят слева внутри поля — отодвигаем текст и центрируем значок */
.ar-form .comment-form-author, .ar-form .comment-form-email, .ar-form .comment-form-comment { position: relative !important; }
.ar-form .comment-form-author::before, .ar-form .comment-form-email::before { left: 15px !important; top: 14px !important; z-index: 1; pointer-events: none; }
.ar-form .comment-form-comment::before { left: 15px !important; top: 13px !important; z-index: 1; pointer-events: none; }
.ar-form input[type="text"], .ar-form input[type="email"] { padding-left: 46px !important; }
.ar-form textarea { padding-left: 46px !important; }
.ar-form input::placeholder, .ar-form textarea::placeholder { color: #9aa59c; opacity: 1; }
.ar-form input:focus, .ar-form textarea:focus { outline: none; border-color: var(--ar-green) !important; }
.ar-form .form-submit { margin: 4px 0 0 !important; }
.ar-form input[type="submit"] {
  display: inline-block !important; width: auto !important; min-width: 200px; height: auto !important; line-height: 1.2 !important;
  margin: 0 !important; padding: 15px 28px !important; text-align: center; letter-spacing: 0 !important; border: 0 !important; border-radius: 14px !important;
  background: var(--ar-orange) !important; box-shadow: 0 8px 20px rgba(255, 122, 0, .3) !important; cursor: pointer;
  font-size: 15px !important; font-weight: 700; color: #fff !important; text-transform: none !important;
}
.ar-form input[type="submit"]:hover { background: #ff8c1f !important; }
.ar-form .form-submit::before, .ar-form .form-submit::after, .ar-form input[type="submit"]::before { display: none !important; }

/* ---------- читайте также ---------- */
.ar-related { margin: 40px auto 60px; }
.ar-related__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.ar-related__all { font-size: 15px; font-weight: 700; color: var(--ar-green-dark) !important; text-decoration: none !important; }
.ar-related__grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

/* ---------- адаптив ---------- */
@media (max-width: 1199px) {
  .ar-grid { grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
}
@media (max-width: 991px) {
  .ar-grid { grid-template-columns: 1fr; }
  .ar-side { position: static; }
  .ar-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ar-related__grid > :nth-child(3) { display: none; }
}
@media (max-width: 767px) {
  .ar-title { font-size: 28px; }
  .ar-cover { margin-bottom: 22px; border-radius: 16px; }
  .ar-content { font-size: 16px; }
  .ar-content h2 { margin-top: 32px !important; font-size: 23px; }
  .ar-content h3 { font-size: 19px; }
  .ar .ar-content blockquote { padding: 16px 16px 16px 58px !important; }
  .ar .ar-content blockquote::before { left: 16px !important; top: 16px !important; }
  .ar-cta { padding: 22px 18px; }
  .ar-cta__actions, .ar-cta__btn { width: 100%; text-align: center; }
  .ar-cta__actions { justify-content: center; }
  .ar-form { padding: 18px 16px; }
  .ar-form .top-wrap { grid-template-columns: 1fr; }
  .ar-form input[type="submit"] { width: 100% !important; }
  .ar-content #toc_container ul.toc_list { columns: 1; }
  .ar-related__grid { grid-template-columns: 1fr !important; }
  .ar-related__grid > :nth-child(3) { display: block; }
}
