/* Статья блога (extension/module/prostore_blog.twig): шапка в стиле страницы бренда, типографика текста, оглавление */
.ba {
	--ba-accent: var(--theme-secondary-color, #ff39a2);
	--ba-card: #f6f6f8;
	--ba-chip: #f1f1f5;
	--ba-text: #242429;
	--ba-muted: #868695;
	color: var(--ba-text);
}

/* У обёртки темы .app overflow:hidden — с ним не работает липкое оглавление. clip режет так же, но не мешает sticky */
.app:has(.ba-layout) {
	overflow: clip;
}

/* Шапка */
.ba-hero {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	align-items: center;
	margin: 8px 0 40px;
	padding: 40px 48px;
	border-radius: 16px;
	background: var(--ba-card);
}
.ba-hero--image {
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	padding: 24px 24px 24px 48px;
}
.ba-hero__title {
	margin: 14px 0 16px;
	font-size: 40px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
	max-width: 820px;
}
.ba-hero__image {
	overflow: hidden;
	border-radius: 12px;
	background: #fff;
	aspect-ratio: 3 / 2;
}
.ba-hero__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Плашки: категория, теги */
.ba-chip {
	display: inline-flex;
	align-items: center;
	padding: 6px 14px;
	border-radius: 999px;
	background: #fff;
	color: var(--ba-text);
	font-size: 14px;
	line-height: 20px;
	text-decoration: none;
	transition: background .2s, color .2s;
}
.ba-chip:hover {
	background: var(--ba-accent);
	color: #fff;
}
.ba-chip--accent {
	background: var(--ba-accent);
	color: #fff;
	font-weight: 500;
}
.ba-chip--accent:hover {
	opacity: .85;
}
.ba-meta,
.ba-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ba-meta {
	color: var(--ba-muted);
	font-size: 14px;
	line-height: 20px;
}
.ba-meta li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.ba-meta svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}
.ba-tags {
	gap: 8px;
	margin-top: 20px;
}

/* Текст + оглавление */
.ba-layout {
	display: grid;
	grid-template-columns: minmax(0, 720px) 280px;
	justify-content: center;
	gap: 64px;
	align-items: start;
}
.ba-layout--column {
	grid-template-columns: minmax(0, 1fr);
}
.ba-layout--column .ba-aside {
	display: none;
}
.ba-aside {
	position: sticky;
	top: 100px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.ba-toc {
	padding: 20px 24px;
	border-radius: 16px;
	background: var(--ba-card);
}
.ba-toc[hidden] {
	display: none;
}
.ba-toc__title {
	display: block;
	margin-bottom: 12px;
	font-size: 16px;
	font-weight: 700;
}
.ba-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: ba-toc;
}
.ba-toc__list li {
	counter-increment: ba-toc;
}
.ba-toc__list a {
	display: flex;
	gap: 10px;
	padding: 6px 0;
	color: var(--ba-muted);
	font-size: 14px;
	line-height: 1.4;
	text-decoration: none;
	transition: color .2s;
}
.ba-toc__list a::before {
	content: counter(ba-toc);
	flex: 0 0 auto;
	min-width: 14px;
	font-weight: 600;
}
.ba-toc__list a:hover,
.ba-toc__list a.is-active {
	color: var(--ba-text);
}
.ba-toc__list a.is-active::before {
	color: var(--ba-accent);
}

/* Типографика текста статьи */
.ba .ba-content {
	font-size: 17px;
	line-height: 1.7;
	color: var(--ba-text);
}
.ba .ba-content > *:first-child,
.ba .ba-content > article > *:first-child {
	margin-top: 0;
}
.ba .ba-content p {
	margin: 0 0 18px;
}
.ba .ba-content > p:first-child,
.ba .ba-content > article > p:first-child {
	font-size: 19px;
	line-height: 1.6;
}
.ba .ba-content h2 {
	margin: 48px 0 16px;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.25;
	scroll-margin-top: 100px;
}
.ba .ba-content h3 {
	margin: 32px 0 12px;
	font-size: 21px;
	font-weight: 600;
	line-height: 1.3;
}
.ba .ba-content strong {
	font-weight: 600;
}
.ba .ba-content a {
	color: var(--ba-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.ba .ba-content ul,
.ba .ba-content ol {
	margin: 0 0 20px;
	padding-left: 0;
	list-style: none;
}
.ba .ba-content ol {
	counter-reset: ba-ol;
}
.ba .ba-content li {
	position: relative;
	margin: 0 0 10px;
	padding-left: 30px;
}
.ba .ba-content ul > li::before {
	content: '';
	position: absolute;
	left: 8px;
	top: .7em;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ba-accent);
}
.ba .ba-content ol > li {
	counter-increment: ba-ol;
}
.ba .ba-content ol > li::before {
	content: counter(ba-ol);
	position: absolute;
	left: 0;
	top: .15em;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--ba-chip);
	font-size: 13px;
	font-weight: 600;
	line-height: 22px;
	text-align: center;
}
.ba .ba-content hr {
	margin: 40px 0;
	border: 0;
	border-top: 1px solid #e3e4ec;
}
.ba .ba-content hr + p > em:only-child,
.ba .ba-content blockquote {
	display: block;
	padding: 20px 24px;
	border-left: 4px solid var(--ba-accent);
	border-radius: 0 12px 12px 0;
	background: var(--ba-card);
	font-style: normal;
}
.ba .ba-content blockquote {
	margin: 0 0 20px;
}
.ba .ba-content img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
}

.ba-foot {
	max-width: 720px;
	margin: 32px auto 0;
	padding-top: 24px;
	border-top: 1px solid #e3e4ec;
}
.ba-foot .ba-tags {
	margin-top: 0;
}
.ba-foot .ba-chip {
	background: var(--ba-chip);
}

@media (max-width: 1199px) {
	.ba-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}
	/* На планшете и телефоне оглавление — карточкой над текстом */
	.ba-aside {
		position: static;
		order: -1;
		margin-bottom: 32px;
	}
	.ba-hero__title {
		font-size: 32px;
	}
}
@media (max-width: 767px) {
	.ba-hero,
	.ba-hero--image {
		grid-template-columns: 1fr;
		gap: 20px;
		margin-bottom: 24px;
		padding: 20px;
	}
	.ba-hero__image {
		order: -1;
	}
	.ba-hero__title {
		font-size: 26px;
	}
	.ba .ba-content {
		font-size: 16px;
	}
	.ba .ba-content > p:first-child,
	.ba .ba-content > article > p:first-child {
		font-size: 17px;
	}
	.ba .ba-content h2 {
		margin-top: 36px;
		font-size: 23px;
	}
	.ba .ba-content h3 {
		font-size: 19px;
	}
}
