/* Blanki.online: блог (лента, статья, виджеты). Подключается в main.tpl на страницах блога. */
:root {
	--bl-blue: #5699d9;
	--bl-blue-d: #307bb9;
	--bl-ink: #424652;
	--bl-text: #3f4450;
	--bl-muted: #646b78;
	--bl-line: #cbe1ef;
	--bl-line-soft: #e3edf3;
	--bl-mist: #edf3f6;
	--bl-bg: #f3f7f9;
	--bl-card: #ffffff;
	--bl-shadow: 0 0 21px rgba(200, 222, 231, .43);
	--bl-radius: 24px;
	--bl-radius-sm: 16px;
	--bl-focus: 0 0 0 3px rgba(86, 153, 217, .45);
}

/* Подложка на всю ширину окна без горизонтальной прокрутки */
.bl-page {
	position: relative;
	background: var(--bl-bg);
	box-shadow: 0 0 0 100vmax var(--bl-bg);
	clip-path: inset(0 -100vmax);
	padding: 28px 0 48px;
	color: var(--bl-text);
	font-size: 16px;
	line-height: 1.6;
}
.bl-page *, .bl-page *::before, .bl-page *::after { box-sizing: border-box; }
.bl-page a { color: var(--bl-blue-d); text-decoration: none; }
.bl-page a:hover { color: var(--bl-blue); }
.bl-page a:focus-visible, .bl-page button:focus-visible { outline: none; box-shadow: var(--bl-focus); border-radius: 8px; }

/* Хлебные крошки */
.bl-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: -8px 0 8px; font-size: 14px; color: var(--bl-muted); }
.bl-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.bl-crumbs span[aria-current] { overflow-wrap: anywhere; }
.bl-crumbs__sep { color: #a9b6c2; }
.bl-page .bl-crumbs a { color: #26679d; min-width: 44px; } /* на фоне #f3f7f9 ссылка #307bb9 даёт 4,18:1, нужен 4,5:1; короткое «Блог» — не уже 44px */
.bl-page .bl-toc__list a { min-height: 44px; align-items: center; }
@media (max-width: 1024px) { .bl-page .bl-chip a { min-height: 44px; } }

/* Сетка: колонка статей + колонка виджетов */
.bl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.bl-col, .bl-feed { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.bl-aside { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 1025px) and (min-height: 880px) {
	.bl-aside { position: sticky; top: 24px; }
}

/* Карточка */
.bl-card {
	background: var(--bl-card);
	border: 1px solid var(--bl-line-soft);
	border-radius: var(--bl-radius);
	box-shadow: var(--bl-shadow);
	padding: 24px 28px;
}
.bl-card--fixed { border-color: var(--bl-line); }
.bl-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.bl-card__tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Автор */
.bl-author { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bl-author__ava {
	flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
	background: var(--bl-mist); border: 1px solid var(--bl-line);
	display: grid; place-items: center; overflow: hidden;
}
.bl-author__ava img { width: 26px; height: 26px; object-fit: contain; display: block; }
.bl-author__info { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.bl-author__name { font-size: 15px; color: var(--bl-ink); }
.bl-author__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13px; color: var(--bl-muted); }
.bl-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

/* Чип рубрики и правка */
.bl-chip { display: inline-flex; }
.bl-chip a {
	position: relative; display: inline-flex; align-items: center; min-height: 32px;
	padding: 0 12px; border-radius: 999px;
	background: var(--bl-mist); color: var(--bl-ink); font-size: 13px;
}
.bl-edit { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--bl-line); font-size: 13px; color: var(--bl-ink); }
.bl-card__tools a { position: relative; }
/* Область нажатия не меньше 44px при визуальной высоте 32px */
.bl-chip a::after, .bl-card__tools a::after { content: ""; position: absolute; inset: -6px -2px; }

/* Заголовки */
.bl-card__title { margin: 0 0 14px; font-size: 22px; line-height: 1.3; font-weight: 400; overflow-wrap: anywhere; }
.bl-card__title a { color: var(--bl-ink); }
.bl-card__title a:hover { color: var(--bl-blue-d); }
.bl-article__title { margin: 0 0 16px; font-size: 30px; line-height: 1.25; font-weight: 400; color: var(--bl-ink); overflow-wrap: anywhere; }

/* Анонс: обложка + ввод */
.bl-story > :last-child { margin-bottom: 0; }
.bl-story p { margin: 0 0 12px; overflow-wrap: anywhere; }
.bl-story--lead { font-size: 17px; margin: 0 0 22px; }
.bl-cover, .bl-story > img:first-child {
	margin: 0 0 16px;
	border-radius: var(--bl-radius-sm);
	overflow: hidden;
}
.bl-cover {
	position: relative;
	aspect-ratio: 16 / 8;
	background: var(--bl-mist) url("/assets/hero-lines.svg") center / cover no-repeat;
	border: 1px solid var(--bl-line-soft);
	display: flex; align-items: flex-end; justify-content: center;
	padding: 22px 16px 0;
}
.bl-cover img {
	display: block; height: 100%; width: auto; max-width: 70%;
	object-fit: cover; object-position: top center;
	border-radius: 10px 10px 0 0;
	box-shadow: 0 6px 24px rgba(66, 70, 82, .16);
	background: #fff;
}
.bl-story > img:first-child { display: block; width: 100%; height: auto; }
.bl-card--short .bl-story { cursor: default; }

/* Подвал карточки */
.bl-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--bl-line-soft); }
.bl-more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 15px; }
.bl-more .bl-ico { transition: transform .2s ease; }
.bl-more:hover .bl-ico { transform: translateX(3px); }
.bl-more:hover .bl-ico--back { transform: translateX(-3px); }
.bl-stat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bl-muted); }
.bl-ico { flex: 0 0 auto; }

/* Текст статьи */
.bl-prose { font-size: 16px; line-height: 1.7; color: var(--bl-text); }
.bl-prose > :first-child { margin-top: 0; }
.bl-prose p, .bl-prose li, .bl-prose td, .bl-prose th { overflow-wrap: anywhere; }
.bl-prose p { margin: 0 0 16px; }
.bl-prose h2 { margin: 32px 0 12px; font-size: 23px; line-height: 1.3; font-weight: 400; color: var(--bl-ink); scroll-margin-top: 96px; }
.bl-prose h3 { margin: 24px 0 10px; font-size: 19px; line-height: 1.35; font-weight: 400; color: var(--bl-ink); scroll-margin-top: 96px; }
.bl-prose ul, .bl-prose ol { margin: 0 0 18px; padding: 0; list-style: none; }
.bl-prose li { position: relative; margin: 0 0 8px; }
.bl-prose ul > li { padding-left: 22px; }
.bl-prose ul > li::before {
	content: ""; position: absolute; left: 4px; top: .7em;
	width: 7px; height: 7px; border-radius: 50%; background: var(--bl-blue);
}
.bl-prose ol { counter-reset: bl-ol; }
.bl-prose ol > li { padding-left: 38px; counter-increment: bl-ol; min-height: 26px; }
.bl-prose ol > li::before {
	content: counter(bl-ol); position: absolute; left: 0; top: .1em;
	width: 26px; height: 26px; border-radius: 50%;
	background: var(--bl-mist); border: 1px solid var(--bl-line); color: var(--bl-blue-d);
	font-size: 13px; line-height: 24px; text-align: center;
}
.bl-prose img { max-width: 100%; height: auto; border-radius: var(--bl-radius-sm); }
.bl-prose figure { margin: 0 0 20px; }
.bl-prose figcaption { margin-top: 8px; font-size: 14px; color: var(--bl-muted); }
.bl-prose blockquote { margin: 0 0 18px; padding: 14px 18px; border-left: 3px solid var(--bl-blue); background: var(--bl-mist); border-radius: 0 12px 12px 0; }
.bl-prose table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 15px; display: block; overflow-x: auto; }
.bl-prose th, .bl-prose td { padding: 10px 12px; border: 1px solid var(--bl-line-soft); text-align: left; vertical-align: top; }
.bl-prose th { background: var(--bl-mist); font-weight: 400; color: var(--bl-ink); }
.bl-prose caption { caption-side: bottom; padding-top: 8px; font-size: 14px; color: var(--bl-muted); text-align: left; }

/* Блок «Пример» */
.bl-example { margin: 0 0 18px; padding: 16px 18px; border: 1px dashed var(--bl-line); border-radius: var(--bl-radius-sm); background: #f9fcfc; }
.bl-example__label { display: inline-block; margin: 0 0 8px !important; padding: 2px 10px; border-radius: 999px; background: var(--bl-mist); color: var(--bl-blue-d); font-size: 13px; }
.bl-example > :last-child { margin-bottom: 0; }

/* Пометка тестовой публикации */
.bl-test-note { margin: 24px 0 0 !important; padding: 10px 14px; border-radius: 12px; background: #fff8ec; border: 1px solid #f3dfb8; color: #6b5427; font-size: 14px; }

/* Теги */
.bl-tags { margin-top: 18px; font-size: 14px; color: var(--bl-muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.bl-tags a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--bl-mist); color: var(--bl-ink); }

/* Заголовки служебных блоков */
.bl-block-title, .bl-widget__title { margin: 0 0 14px; font-size: 18px; line-height: 1.35; color: var(--bl-ink); }
.bl-muted { color: var(--bl-muted); }

/* Читайте также */
.bl-related__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bl-rel { margin: 0; }
.bl-rel__link { display: flex; gap: 12px; align-items: center; min-height: 72px; padding: 10px; border-radius: 14px; border: 1px solid var(--bl-line-soft); background: #f9fcfc; color: var(--bl-ink) !important; transition: border-color .2s ease; }
.bl-rel__link:hover { border-color: var(--bl-line); }
.bl-rel__img { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: var(--bl-mist); display: grid; place-items: center; }
.bl-rel__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.bl-rel__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bl-rel__title { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.bl-rel__date { font-size: 13px; color: var(--bl-muted); }

/* Соседние статьи */
.bl-nextprev { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bl-nextprev:empty { display: none; }
.bl-nextprev__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 10px; background: var(--bl-card); border: 1px solid var(--bl-line); font-size: 15px; }
.bl-nextprev__link::before { content: "←"; margin-right: 8px; }
.bl-nextprev__link--next { margin-left: auto; }
.bl-nextprev__link--next::before { content: none; }
.bl-nextprev__link--next::after { content: "→"; margin-left: 8px; }

/* Комментарии DLE (если включены) */
.bl-comments:not(:has(*)) { display: none; }
.bl-comments:has(*) { background: var(--bl-card); border: 1px solid var(--bl-line-soft); border-radius: var(--bl-radius); box-shadow: var(--bl-shadow); padding: 24px 28px; }

/* Виджеты */
.bl-widget { background: var(--bl-card); border: 1px solid var(--bl-line-soft); border-radius: var(--bl-radius); box-shadow: var(--bl-shadow); padding: 20px; }
.bl-widget[hidden] { display: none; }
.bl-cta__art {
	height: 150px; margin: 0 0 16px; border-radius: var(--bl-radius-sm);
	background: var(--bl-mist) url("/assets/hero-lines.svg") center / cover no-repeat;
	display: flex; align-items: flex-end; justify-content: center; overflow: hidden; padding-top: 16px;
}
.bl-cta__art img { height: 100%; width: auto; object-fit: cover; object-position: top; border-radius: 8px 8px 0 0; box-shadow: 0 4px 18px rgba(66, 70, 82, .16); }
.bl-cta__text { margin: 0 0 16px; font-size: 15px; line-height: 1.55; }
.bl-btn {
	display: inline-flex; align-items: center; justify-content: center; width: 100%;
	min-height: 46px; padding: 11px 18px; border-radius: 10px;
	background: var(--bl-blue); color: #fff !important; font-size: 16px; text-align: center;
	transition: background-color .2s ease;
}
.bl-btn:hover { background: var(--bl-blue-d); }

.bl-popular__list { list-style: none; margin: 0; padding: 0; counter-reset: bl-pop; }
.bl-pop { counter-increment: bl-pop; border-top: 1px solid var(--bl-line-soft); }
.bl-pop:first-child { border-top: 0; }
.bl-pop__link { position: relative; display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 10px 0 10px 38px; color: var(--bl-ink) !important; }
.bl-pop__link::before {
	content: counter(bl-pop); position: absolute; left: 0; top: 11px;
	width: 26px; height: 26px; border-radius: 50%;
	background: var(--bl-mist); border: 1px solid var(--bl-line); color: var(--bl-blue-d);
	font-size: 13px; line-height: 24px; text-align: center;
}
.bl-pop__link:hover .bl-pop__title { color: var(--bl-blue-d); }
.bl-pop__title { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.bl-pop__meta { font-size: 13px; color: var(--bl-muted); }

.bl-toc__list { list-style: none; margin: 0; padding: 0; counter-reset: bl-toc; }
.bl-toc__list li { counter-increment: bl-toc; }
.bl-toc__list a { display: flex; gap: 10px; min-height: 40px; padding: 8px 0; font-size: 15px; line-height: 1.4; color: var(--bl-ink); overflow-wrap: anywhere; }
.bl-toc__list a::before { content: counter(bl-toc) "."; color: var(--bl-blue-d); flex: 0 0 auto; }
.bl-toc__list a:hover { color: var(--bl-blue-d); }

/* Пагинация (navigation.tpl используется и в других разделах DLE) */
.bl-pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.bl-pager__pages { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.bl-pager a, .bl-pager__pages > span {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 10px;
	background: var(--bl-card, #fff); border: 1px solid var(--bl-line, #cbe1ef);
	color: var(--bl-blue-d, #307bb9); font-size: 15px; text-decoration: none;
}
.bl-pager a:hover { border-color: var(--bl-blue, #5699d9); }
.bl-pager__pages > span { background: var(--bl-blue, #5699d9); border-color: var(--bl-blue, #5699d9); color: #fff; }
.bl-pager__pages > span.nav_ext { background: none; border-color: transparent; color: var(--bl-muted, #646b78); min-width: 24px; padding: 0; }
.bl-pager__arrow > span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: #a9b6c2; border: 1px solid var(--bl-line-soft, #e3edf3); }

/* Планшет и телефон */
@media (max-width: 1024px) {
	.bl-layout { grid-template-columns: minmax(0, 1fr); }
	.bl-aside { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
	.bl-toc { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
	.bl-page { padding: 16px 0 32px; }
	.bl-card, .bl-comments:has(*) { padding: 18px 16px; border-radius: 20px; }
	.bl-card__head { align-items: flex-start; }
	.bl-card__title { font-size: 19px; }
	.bl-article__title { font-size: 24px; }
	.bl-story--lead { font-size: 16px; }
	.bl-cover { aspect-ratio: 4 / 3; padding: 16px 12px 0; }
	.bl-cover img { max-width: 78%; }
	.bl-prose h2 { font-size: 20px; }
	.bl-related__list { grid-template-columns: minmax(0, 1fr); }
	.bl-aside { grid-template-columns: minmax(0, 1fr); }
	.bl-chip a { font-size: 12px; padding: 0 10px; }
	.bl-pager__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
	.bl-page *, .bl-page *::before, .bl-page *::after { transition: none !important; }
}

/* Серый фон блога сразу под шапкой, без белой полосы */
.bl-main:has(> .bl-page){padding-top:0}
.bl-main > .bl-page{padding-top:40px}
@media (max-width:767px){.bl-main > .bl-page{padding-top:8px}}

/* bl-chip-last: в плашке рубрики только сама рубрика, без родителя «Блог» и разделителя */
.bl-chip{font-size:0}
.bl-chip a{font-size:13px}
.bl-chip a:not(:last-of-type){display:none}
@media (max-width:767px){.bl-chip a{font-size:12px}}

/* bl-main-mobile-top: на телефоне верхний отступ внутренних страниц как у шапки */
@media (max-width:767px){.bl-main{padding-top:8px!important}.bl-main:has(> .bl-page){padding-top:0}}

/* Навигация по H2 и H3: нумерация 1 / 1.1, подсветка текущего раздела, прокрутка длинного списка */
.bl-toc__list{max-height:calc(100vh - 160px);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-right:4px}
.bl-toc__list > li{counter-increment:bl-toc;counter-reset:bl-sub}
.bl-toc__sub{list-style:none;margin:0 0 4px;padding:0 0 0 26px}
.bl-toc__sub > li{counter-increment:bl-sub}
.bl-toc__sub a{min-height:34px;padding:5px 0;font-size:14px;color:var(--bl-text)}
.bl-toc__sub a::before{content:counter(bl-toc) "." counter(bl-sub)}
.bl-toc__list a{position:relative;transition:color .2s,padding-left .2s}
.bl-toc__list a.is-on{color:var(--bl-blue-d);padding-left:6px}
.bl-toc__list a.is-on::after{content:"";position:absolute;left:-10px;top:8px;bottom:8px;width:3px;border-radius:3px;background:var(--bl-blue)}
.bl-toc-m{display:none;margin:0 0 20px;border:1px solid var(--bl-line-soft,#e3edf3);border-radius:14px;background:var(--bl-mist,#f4f9fa)}
.bl-toc-m summary{display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:10px 16px;cursor:pointer;list-style:none;color:var(--bl-ink)}
.bl-toc-m summary::-webkit-details-marker{display:none}
.bl-toc-m summary::after{content:"";width:10px;height:10px;border-right:2px solid var(--bl-blue-d);border-bottom:2px solid var(--bl-blue-d);transform:rotate(45deg);transition:transform .2s}
.bl-toc-m[open] summary::after{transform:rotate(-135deg)}
.bl-toc-m .bl-toc__list{max-height:60vh;padding:0 16px 12px}
@media (max-width:1024px){.bl-toc-m:not([hidden]){display:block}.bl-aside .bl-toc{display:none}}
@media (prefers-reduced-motion:reduce){.bl-toc__list a,.bl-toc-m summary::after{transition:none}}

/* Адаптивный аудит: имя автора в карточке переносится, а не вылезает из блока на 320px */
.bl-author__name{overflow-wrap:anywhere;min-width:0}
