/**
 * Статья блога: оглавление, длинный текст, подборки товаров.
 *
 * Палитра взята из custom.css темы: #2b2b2a — основной тёмный,
 * #efefef — фон блоков, #7f7f7f — второстепенный текст.
 */

.article-page,
.blog-page {
	--article-text: #2b2b2a;
	--article-muted: #7f7f7f;
	--article-line: #e4e4e4;
	--article-bg-soft: #efefef;
	--article-accent-bg: #f5f2ff;
	/* Отступ прокрутки: шапка перекрывает заголовок, если якорь встаёт вплотную. */
	--article-scroll-offset: 100px;

	max-width: 1400px;
	margin: 0 auto;
	padding: 24px 20px 80px;
	color: var(--article-text);
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

/* --- Шапка статьи ------------------------------------------------------ */

.article-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 20px;
	font-size: 14px;
	color: var(--article-muted);
}

.article-crumbs__link {
	color: var(--article-muted);
	text-decoration: none;
}

.article-crumbs__link:hover {
	color: var(--article-text);
	text-decoration: underline;
}

.article-crumbs__sep {
	color: var(--article-line);
}

.article__title {
	max-width: 900px;
	margin: 0 0 16px;
	font-size: clamp(28px, 4vw, 44px);
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.article__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 28px;
	font-size: 14px;
	color: var(--article-muted);
}

.article__meta-sep {
	opacity: 0.6;
}

.article__cover {
	margin: 0 0 40px;
	border-radius: 16px;
	overflow: hidden;
}

.article__cover-image {
	display: block;
	width: 100%;
	height: auto;
}

/* --- Раскладка --------------------------------------------------------- */

.article__layout {
	display: grid;
	grid-template-columns: 280px minmax(0, 1fr);
	gap: 56px;
	align-items: start;
}

.article__layout--no-toc {
	grid-template-columns: minmax(0, 1fr);
	max-width: 800px;
}

.article__aside {
	position: sticky;
	top: var(--article-scroll-offset);
}

.article__body {
	max-width: 780px;
	font-size: 18px;
	line-height: 1.7;
}

/* --- Оглавление -------------------------------------------------------- */

.article-toc {
	padding: 20px;
	border: 1px solid var(--article-line);
	border-radius: 14px;
	background: #fff;
}

.article-toc__toggle {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: default;
}

.article-toc__title {
	font-size: 15px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.article-toc__chevron {
	display: none;
	width: 20px;
	height: 20px;
	transition: transform 0.2s ease;
}

.article-toc__list {
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
	counter-reset: toc;
	max-height: calc(100vh - var(--article-scroll-offset) - 120px);
	overflow-y: auto;
}

.article-toc__item {
	margin-bottom: 2px;
}

.article-toc__item--level3 {
	padding-left: 16px;
}

.article-toc__link {
	display: block;
	padding: 7px 10px;
	border-left: 2px solid transparent;
	border-radius: 0 6px 6px 0;
	color: var(--article-muted);
	font-size: 15px;
	line-height: 1.35;
	text-decoration: none;
	transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.article-toc__link:hover {
	color: var(--article-text);
	background: var(--article-bg-soft);
}

.article-toc__link.is-active {
	color: var(--article-text);
	font-weight: 600;
	border-left-color: var(--article-text);
	background: var(--article-bg-soft);
}

/* --- Типографика текста ------------------------------------------------ */

.article__body > p {
	margin: 0 0 20px;
}

.article__heading {
	scroll-margin-top: var(--article-scroll-offset);
	letter-spacing: -0.01em;
}

.article__heading--h2 {
	margin: 48px 0 16px;
	font-size: clamp(24px, 3vw, 32px);
	line-height: 1.2;
	font-weight: 700;
}

.article__heading--h3 {
	margin: 32px 0 12px;
	font-size: clamp(19px, 2.2vw, 23px);
	line-height: 1.3;
	font-weight: 600;
}

.article__body ul,
.article__body ol {
	margin: 0 0 20px;
	padding-left: 24px;
}

.article__body li {
	margin-bottom: 8px;
}

.article__body a {
	color: var(--article-text);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.article__body a:hover {
	text-decoration-thickness: 2px;
}

.article__body img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
}

.article__body figure {
	margin: 32px 0;
}

.article__body figcaption {
	margin-top: 8px;
	font-size: 14px;
	color: var(--article-muted);
}

.article__body blockquote {
	margin: 32px 0;
	padding: 4px 0 4px 20px;
	border-left: 3px solid var(--article-text);
	font-size: 19px;
	font-style: italic;
}

/* Таблицы сравнения — на узком экране скроллятся сами, а не ломают вёрстку. */
.article__body table {
	width: 100%;
	margin: 0 0 24px;
	border-collapse: collapse;
	font-size: 16px;
}

.article__body .wp-block-table,
.article__body figure.wp-block-table {
	overflow-x: auto;
}

.article__body th,
.article__body td {
	padding: 12px 14px;
	border: 1px solid var(--article-line);
	text-align: left;
	vertical-align: top;
}

.article__body th {
	background: var(--article-bg-soft);
	font-weight: 600;
}

/* --- Врезки ------------------------------------------------------------ */

.article-callout {
	margin: 32px 0;
	padding: 20px 24px;
	border-radius: 14px;
	background: var(--article-accent-bg);
}

.article-callout--note {
	background: var(--article-bg-soft);
	border-left: 3px solid var(--article-text);
	border-radius: 0 14px 14px 0;
}

.article-callout__title {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.article-callout__body > p:last-child {
	margin-bottom: 0;
}

/* --- Подборка товаров -------------------------------------------------- */

.article-products {
	margin: 40px 0;
}

.article-products__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.article-products__title {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
}

.article-products__nav {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

.article-products__arrow {
	display: flex;
	width: 38px;
	height: 38px;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid var(--article-line);
	border-radius: 50%;
	background: #fff;
	color: var(--article-text);
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.article-products__arrow svg {
	width: 20px;
	height: 20px;
}

.article-products__arrow:hover {
	background: var(--article-bg-soft);
}

.article-products__arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

.article-products__track {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 20px;
}

.article-products--slider .article-products__track {
	display: flex;
	grid-template-columns: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.article-products--slider .article-products__track::-webkit-scrollbar {
	display: none;
}

.article-products--slider .article-product {
	flex: 0 0 200px;
	scroll-snap-align: start;
}

.article-product {
	display: flex;
	flex-direction: column;
	gap: 8px;
	color: inherit;
	text-decoration: none;
}

.article-product__image {
	overflow: hidden;
	border-radius: 12px;
	background: var(--article-bg-soft);
	aspect-ratio: 3 / 4;
}

.article-product__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.3s ease;
}

.article-product:hover .article-product__image img {
	transform: scale(1.04);
}

.article-product__name {
	font-size: 15px;
	line-height: 1.3;
}

.article-product__price {
	font-size: 15px;
	font-weight: 600;
}

.article-products__all {
	display: inline-block;
	margin-top: 18px;
	font-size: 16px;
	font-weight: 600;
	color: var(--article-text);
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* --- Читайте также ----------------------------------------------------- */

.article-related {
	margin-top: 72px;
	padding-top: 40px;
	border-top: 1px solid var(--article-line);
}

.article-related__title {
	margin: 0 0 24px;
	font-size: 26px;
	font-weight: 700;
}

.article-related__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 24px;
}

.article-related__card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	color: inherit;
	text-decoration: none;
}

.article-related__image {
	overflow: hidden;
	border-radius: 12px;
	background: var(--article-bg-soft);
	aspect-ratio: 16 / 10;
}

.article-related__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.article-related__name {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.35;
}

/* --- Мобильная версия -------------------------------------------------- */

@media (max-width: 1024px) {
	.article__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}

	.article__aside {
		position: static;
	}

	/* Оглавление сворачивается — иначе на телефоне оно занимает целый экран
	   до начала текста. */
	.article-toc__toggle {
		cursor: pointer;
	}

	.article-toc__chevron {
		display: block;
	}

	.article-toc__toggle[aria-expanded='true'] .article-toc__chevron {
		transform: rotate(180deg);
	}

	.article-toc__list {
		display: none;
		max-height: none;
	}

	.article-toc.is-open .article-toc__list {
		display: block;
	}
}

@media (max-width: 600px) {
	.article-page {
		padding: 16px 16px 56px;
		--article-scroll-offset: 80px;
	}

	.article__body {
		font-size: 17px;
	}

	.article-products--slider .article-product {
		flex: 0 0 150px;
	}

	.article-products__track {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		gap: 14px;
	}
}

/* =======================================================================
   Список статей: страница блога и архивы рубрик
   ==================================================================== */

.article-crumbs__current {
	color: var(--article-muted);
}

.blog-page__header {
	max-width: 760px;
	margin-bottom: 32px;
}

.blog-page__title {
	margin: 0 0 16px;
	font-size: clamp(30px, 4.5vw, 48px);
	line-height: 1.1;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.blog-page__intro {
	font-size: 18px;
	line-height: 1.6;
	color: var(--article-muted);
}

.blog-page__intro p {
	margin: 0 0 12px;
}

.blog-page__intro p:last-child {
	margin-bottom: 0;
}

/* --- Рубрики ----------------------------------------------------------- */

.blog-rubrics {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 40px;
}

.blog-rubrics__item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 9px 18px;
	border: 1px solid var(--article-line);
	border-radius: 999px;
	background: #fff;
	color: var(--article-text);
	font-size: 15px;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.blog-rubrics__item:hover {
	background: var(--article-bg-soft);
}

.blog-rubrics__item.is-active {
	border-color: var(--article-text);
	background: var(--article-text);
	color: #fff;
}

.blog-rubrics__count {
	font-size: 13px;
	color: var(--article-muted);
}

.blog-rubrics__item.is-active .blog-rubrics__count {
	color: rgba(255, 255, 255, 0.65);
}

/* --- Карточки ---------------------------------------------------------- */

.blog-card__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

/*
 * Обложки берём из карточек товаров, а там кадр вертикальный. Широкий
 * ландшафтный кроп срезал бы вещь вместе с вышивкой, поэтому пропорция
 * портретная, а точка кадрирования сдвинута вверх — к надписи на груди.
 */
.blog-card__image {
	overflow: hidden;
	border-radius: 16px;
	background: var(--article-bg-soft);
	aspect-ratio: 4 / 5;
}

.blog-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 25%;
	transition: transform 0.35s ease;
}

.blog-card__link:hover .blog-card__image img {
	transform: scale(1.03);
}

.blog-card__rubric {
	display: inline-block;
	margin-bottom: 10px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--article-muted);
}

.blog-card__title {
	margin: 0 0 10px;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.blog-card__link:hover .blog-card__title {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.blog-card__excerpt {
	margin: 0 0 12px;
	font-size: 16px;
	line-height: 1.55;
	color: var(--article-muted);
}

.blog-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--article-muted);
}

.blog-card__meta-sep {
	opacity: 0.6;
}

/* Крупная карточка: пока статей мало, она держит первый экран. */
.blog-card--featured {
	margin-bottom: 56px;
	padding-bottom: 56px;
	border-bottom: 1px solid var(--article-line);
}

.blog-card--featured .blog-card__link {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 40px;
	align-items: center;
}

/* Рядом с текстом вертикальный кадр вытянул бы карточку на два экрана. */
.blog-card--featured .blog-card__image {
	aspect-ratio: 1 / 1;
}

.blog-card--featured .blog-card__title {
	font-size: clamp(24px, 2.8vw, 34px);
	line-height: 1.2;
}

.blog-card--featured .blog-card__excerpt {
	font-size: 18px;
	line-height: 1.6;
}

/* --- Сетка ------------------------------------------------------------- */

.blog-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 44px 32px;
}

.blog-grid .blog-card__text {
	padding-top: 16px;
}

.blog-empty {
	padding: 48px 0;
	font-size: 18px;
	color: var(--article-muted);
}

/* --- Пагинация --------------------------------------------------------- */

.blog-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 56px;
}

.blog-pagination .page-numbers {
	display: inline-flex;
	min-width: 42px;
	height: 42px;
	align-items: center;
	justify-content: center;
	padding: 0 14px;
	border: 1px solid var(--article-line);
	border-radius: 10px;
	background: #fff;
	color: var(--article-text);
	font-size: 15px;
	text-decoration: none;
	transition: background 0.15s ease;
}

.blog-pagination .page-numbers:hover {
	background: var(--article-bg-soft);
}

.blog-pagination .page-numbers.current {
	border-color: var(--article-text);
	background: var(--article-text);
	color: #fff;
}

.blog-pagination .page-numbers.dots {
	border-color: transparent;
	background: none;
}

/* --- Мобильная версия -------------------------------------------------- */

@media (max-width: 900px) {
	.blog-card--featured .blog-card__link {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.blog-card--featured {
		margin-bottom: 40px;
		padding-bottom: 40px;
	}
}

@media (max-width: 600px) {
	.blog-page {
		padding: 16px 16px 56px;
	}

	/* Чипсы уезжают в горизонтальную прокрутку — иначе они занимают
	   пол-экрана до первой карточки. */
	.blog-rubrics {
		flex-wrap: nowrap;
		margin: 0 -16px 32px;
		padding: 0 16px;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.blog-rubrics::-webkit-scrollbar {
		display: none;
	}

	.blog-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}

	.blog-card__title {
		font-size: 19px;
	}
}
