/* =========================================================================
   Статьи: список и рубрики, карточка статьи, статья (шапка, обложка, текст,
   оглавление, вопросы, препараты, другие статьи), блок «Статьи о препарате».
   ========================================================================= */

/* ── Навигация по рубрикам (как вкладки на главной) ── */
.blog { padding-top: clamp(32px, 4vw, 48px); }
.blog-nav { margin-bottom: clamp(24px, 3vw, 36px); }
.blog-nav__list { display: flex; flex-wrap: wrap; gap: 8px; }
.blog-nav__link { display: inline-flex; align-items: center; min-height: 44px; padding: 10px 20px; border: 1.5px solid var(--c-line-strong); border-radius: 999px; background: #fff; color: var(--c-ink); font: 600 14px/1.2 var(--font-body); white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s; }
.blog-nav__link:hover { border-color: var(--c-ink); }
.blog-nav__link.is-active { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }

/* ── Карточки статей ── */
.pst-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.pst { position: relative; display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--c-line); border-radius: var(--r-card); background: #fff; overflow: hidden; transition: border-color .18s; }
.pst:hover { border-color: var(--c-ink); }
.pst__media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--c-bg-alt); }
.pst__img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.pst:hover .pst__img { transform: scale(1.04); }
.pst__ph { display: grid; place-items: center; width: 100%; height: 100%; color: var(--c-green); }
.pst__ph .ico { width: 40px; height: 40px; }
.pst__body { display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; padding: 22px 24px 24px; }
.pst__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--c-muted); }
.pst__rubric { position: relative; z-index: 2; font-weight: 600; color: var(--c-green-ink); }
.pst__rubric:hover { color: var(--c-green-hover); text-decoration: underline; text-underline-offset: 3px; }
.pst__title { font-size: 19px; line-height: 1.3; color: var(--c-ink); }
.pst__title a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.pst:hover .pst__title a { color: var(--c-green-ink); }
.pst__excerpt { margin: 0; font-size: 15px; line-height: 1.55; color: var(--c-muted); }
.pst__time { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--c-muted); }
.pst__time .ico { width: 13px; height: 13px; }
/* Первая статья списка - широкой карточкой */
.pst--wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: none; }
.pst--wide .pst__media { aspect-ratio: auto; min-height: 360px; }
.pst--wide .pst__img { position: absolute; inset: 0; }
.pst--wide .pst__body { align-content: center; gap: 14px; padding: clamp(28px, 3.4vw, 48px); }
.pst--wide .pst__title { font-size: clamp(24px, 2.4vw, 34px); line-height: 1.3; }
.pst--wide .pst__excerpt { font-size: 17px; }

/* Страницы списка */
.blog-pages { margin-top: 40px; }
.blog-pages .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.blog-pages .page-numbers { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border: 1.5px solid var(--c-line-strong); border-radius: 12px; font-weight: 600; color: var(--c-ink); transition: border-color .15s; }
.blog-pages a.page-numbers:hover { border-color: var(--c-ink); }
.blog-pages .page-numbers.current { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.blog-pages .page-numbers.dots { border: 0; min-width: 24px; }
.blog-pages .ico { width: 14px; height: 14px; }

.blog-empty { display: grid; justify-items: start; gap: 12px; padding: 40px; border: 1px solid var(--c-line); border-radius: var(--r-card); background: var(--c-bg-alt); }
.blog-empty__title { margin: 0; font: 600 22px/1.25 var(--font-head); color: var(--c-ink); }
.blog-empty p { margin: 0; color: var(--c-muted); }
.blog-empty__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.blog-about { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--c-line); }

/* ── Статья ── */
.art-progress { position: fixed; top: var(--hdr-h); left: 0; right: 0; z-index: 90; height: 3px; pointer-events: none; }
.art-progress span { display: block; width: 100%; height: 100%; background: var(--c-green); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
.art-head { padding: 28px 0 clamp(28px, 3vw, 40px); background: var(--c-bg-alt); }
.art-head__title { max-width: 22ch; font-size: clamp(30px, 3.4vw, 50px); line-height: 1.1; letter-spacing: -.025em; color: var(--c-ink); }
.art-head__lead { margin: 18px 0 0; max-width: 46em; font-size: clamp(17px, 1.4vw, 19px); line-height: 1.6; color: var(--c-muted); }
.art-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 22px; font-size: 14px; color: var(--c-muted); }
.art-head__meta > * { display: inline-flex; align-items: center; gap: 8px; }
.art-head__meta .ico { width: 14px; height: 14px; color: var(--c-green); }
.art-head__rubric { font-weight: 600; color: var(--c-green-ink); }
.art-head__rubric:hover { color: var(--c-green-hover); text-decoration: underline; text-underline-offset: 3px; }

.art-cover { margin-top: clamp(24px, 3vw, 36px); margin-bottom: 0; }
.art-cover__img { width: 100%; height: auto; max-height: 620px; object-fit: cover; border-radius: var(--r-big); }
.art-cover figcaption { margin-top: 10px; font-size: 14px; color: var(--c-muted); }

/* Текст занимает всю колонку до сайдбара, зазор один на всех ширинах */
.art-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px clamp(32px, 3.4vw, 48px); align-items: start; padding-block: clamp(32px, 4vw, 56px) clamp(48px, 6vw, 80px); }
.art-main { min-width: 0; }
/* Сайдбар всегда помещается в экран под шапкой: длинное содержание прокручивается внутри себя, карточка агронома видна целиком */
.art-aside { position: sticky; top: calc(var(--hdr-h) + 28px); display: flex; flex-direction: column; gap: 20px; max-height: calc(100vh - var(--hdr-h) - 52px); }

/* Оглавление */
.art-toc { padding: 22px 22px 18px; border: 1px solid var(--c-line); border-radius: var(--r-card); }
.art-aside .art-toc { display: flex; flex-direction: column; flex: 0 1 auto; min-height: 0; padding-right: 12px; }
.art-aside .art-toc ol { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--c-line-strong) transparent; }
.art-aside .art-toc ol.is-clip-end { -webkit-mask-image: linear-gradient(#000 calc(100% - 40px), transparent); mask-image: linear-gradient(#000 calc(100% - 40px), transparent); }
.art-aside .art-toc ol.is-clip-start { -webkit-mask-image: linear-gradient(transparent, #000 40px); mask-image: linear-gradient(transparent, #000 40px); }
.art-aside .art-toc ol.is-clip-start.is-clip-end { -webkit-mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.art-toc__title { margin: 0 0 12px; font: 600 15px/1.3 var(--font-head); color: var(--c-ink); }
.art-toc ol { display: grid; gap: 2px; counter-reset: toc; }
.art-toc li { counter-increment: toc; }
.art-toc a { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; padding: 7px 8px; border-radius: 10px; font-size: 14px; line-height: 1.4; color: var(--c-muted); transition: background-color .15s, color .15s; }
.art-toc a::before { content: counter(toc); font-weight: 600; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.art-toc a:hover { color: var(--c-ink); background: var(--c-bg-alt); }
.art-toc a.is-active { color: var(--c-ink); background: rgba(23, 155, 56, .1); }
.art-toc a.is-active::before { color: var(--c-green-ink); }
.art-toc--inline { display: none; }

/* Карточка «Вопрос по обработке?»: фото сада сверху видно, к тексту плавно уходит в тёмный фон */
.art-help { position: relative; isolation: isolate; display: grid; flex: 0 0 auto; align-content: end; min-height: clamp(340px, 46vh, 460px); overflow: hidden; border-radius: var(--r-card); background: var(--c-deep); color: #c9d6e0; font-size: 14px; }
.art-help::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 26, 39, .18) 0%, rgba(10, 26, 39, .04) 20%, rgba(10, 26, 39, .1) 34%, rgba(10, 26, 39, .82) 47%, rgba(10, 26, 39, .95) 58%, var(--c-deep) 100%); }
.art-help__bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; }
.art-help__body { display: grid; gap: 10px; padding: 22px; }
.art-help__title { margin: 0; font: 600 18px/1.3 var(--font-head); color: #fff; }
.art-help p { margin: 0; }
.art-help .btn { margin-top: 6px; }
.art-help__phone { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 15px; color: #fff; }
.art-help__phone .ico { width: 14px; height: 14px; color: var(--c-green-lite); }
.art-help__phone:hover { color: var(--c-green-lite); }

/* ── Текст статьи ── */
.art-body { font-size: 18px; line-height: 1.75; color: var(--c-text); }
.art-body > * + * { margin-top: 0; }
.art-body p { margin: 0 0 1.15em; }
.art-body h2 { margin: 2em 0 .7em; font-size: clamp(24px, 2.2vw, 30px); line-height: 1.2; color: var(--c-ink); }
.art-body h3 { margin: 1.7em 0 .55em; font-size: clamp(19px, 1.6vw, 21px); line-height: 1.3; color: var(--c-ink); }
.art-body h4 { margin: 1.5em 0 .5em; font: 600 18px/1.35 var(--font-body); color: var(--c-ink); }
.art-body > h2:first-child, .art-body > h3:first-child { margin-top: 0; }
.art-body .mtr-lead, .art-body > p:first-child { font-size: clamp(19px, 1.6vw, 21px); line-height: 1.6; color: var(--c-ink); }
.art-body ul, .art-body ol { margin: 0 0 1.3em; padding-left: 0; list-style: none; }
.art-body ul > li { position: relative; margin-bottom: .55em; padding-left: 26px; }
.art-body ul > li::before { content: ''; position: absolute; left: 4px; top: .68em; width: 8px; height: 8px; border-radius: 50%; background: var(--c-green); }
.art-body ol { counter-reset: art-ol; }
.art-body ol > li { position: relative; margin-bottom: .6em; padding-left: 34px; counter-increment: art-ol; }
.art-body ol > li::before { content: counter(art-ol) '.'; position: absolute; left: 0; top: 0; min-width: 26px; font-weight: 700; color: var(--c-green-ink); font-variant-numeric: tabular-nums; }
.art-body li > ul, .art-body li > ol { margin: .5em 0 0; }
.art-body a { color: var(--c-green-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.art-body a:hover { color: var(--c-green-hover); text-decoration-thickness: 2px; }
.art-body strong, .art-body b { font-weight: 600; color: var(--c-ink); }
.art-body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--c-line); }
.art-body img { height: auto; border-radius: 16px; }
.art-body figure { margin: 2em 0; }
.art-body figure img { width: 100%; }
.art-body figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--c-muted); }
.art-body .aligncenter { margin-inline: auto; }
.art-body .alignleft { float: left; max-width: 46%; margin: .3em 24px 1em 0; }
.art-body .alignright { float: right; max-width: 46%; margin: .3em 0 1em 24px; }
.art-body blockquote { margin: 2em 0; padding: 24px 28px; border-radius: var(--r-card); background: var(--c-bg-alt); font-size: 19px; line-height: 1.6; color: var(--c-ink); }
.art-body blockquote p:last-child { margin-bottom: 0; }
.art-body blockquote cite { display: block; margin-top: 12px; font-size: 14px; font-style: normal; color: var(--c-muted); }
/* Врезка: одна на статью, где правда нужна */
.art-body .mtr-note { position: relative; margin: 2em 0; padding: 22px 26px 22px 62px; border-radius: var(--r-card); background: rgba(23, 155, 56, .08); color: var(--c-ink); }
.art-body .mtr-note::before { content: ''; position: absolute; left: 24px; top: 25px; width: 22px; height: 22px; background: var(--c-green-ink); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336h24V272H216c-13.3 0-24-10.7-24-24s10.7-24 24-24h48c13.3 0 24 10.7 24 24v88h8c13.3 0 24 10.7 24 24s-10.7 24-24 24H216c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z'/%3E%3C/svg%3E") center / contain no-repeat; }
.art-body .mtr-note p:last-child, .art-body .mtr-note ul:last-child { margin-bottom: 0; }
/* Шаги по порядку */
.art-body ol.mtr-steps > li { padding-left: 52px; margin-bottom: 1em; }
.art-body ol.mtr-steps > li::before { content: counter(art-ol); top: -1px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c-ink); color: #fff; font: 600 14px/1 var(--font-head); }
/* Таблицы */
.art-body .table-wrap { margin: 1.8em 0; padding: 0; overflow-x: auto; border: 0; border-radius: 0; background: none; scrollbar-width: thin; }
.art-body table { width: 100%; border: 1px solid var(--c-line-strong); border-radius: 16px; border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: 15px; line-height: 1.45; }
.art-body th, .art-body td { padding: 12px 16px; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }
.art-body th + th, .art-body td + td, .art-body th + td { border-left: 1px solid var(--c-line); }
.art-body thead th { background: var(--c-bg-alt); font-weight: 600; color: var(--c-ink); white-space: nowrap; }
.art-body tbody tr:last-child td { border-bottom: 0; }
.art-body tbody tr:nth-child(even) td { background: #f8faf9; }
.art-body table:has(thead th:nth-child(4)) { min-width: 640px; }
/* Вопросы в конце статьи */
.art-body .art-faq { margin-top: 2.6em; }
.art-body .faq__a-inner > * { margin: 0 40px 0 0; padding-bottom: 12px; font-size: 16px; color: var(--c-muted); }
.art-body .faq__a-inner > :last-child { padding-bottom: 22px; }
.art-body .faq__q { margin: 8px 0; }
.art-body .faq__btn { padding-block: 12px; }
.art-body .faq__q::before { display: none; }

.art-author { display: flex; align-items: center; gap: 16px; margin-top: 40px; padding: 20px 24px; border: 1px solid var(--c-line); border-radius: var(--r-card); }
.art-author__ico { width: 22px; height: 22px; flex: 0 0 auto; color: var(--c-green); }
.art-author > div { display: grid; gap: 2px; }
.art-author__label { font-size: 13px; color: var(--c-muted); }
.art-author__name { font-weight: 600; color: var(--c-ink); }
.art-author__role { font-size: 14px; color: var(--c-muted); }

.art-prods { margin-top: 48px; }
.art-prods__title { margin-bottom: 16px; font-size: clamp(22px, 2vw, 26px); color: var(--c-ink); }
.art-prods__list { display: grid; border-top: 1px solid var(--c-line); }
.aprod { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--c-line); }
.aprod__img { display: block; width: 88px; height: 88px; padding: 6px; border: 1px solid var(--c-line); border-radius: 14px; background: #fff; }
.aprod__img img { width: 100%; height: 100%; object-fit: contain; }
.aprod__info { display: grid; gap: 3px; min-width: 0; }
.aprod__cat { font-size: 13px; color: var(--c-muted); }
.aprod__name { font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--c-ink); }
.aprod__name:hover { color: var(--c-green-ink); }
.aprod__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--c-muted); }
.aprod__buy { display: grid; justify-items: end; gap: 8px; }
.aprod__price { font: 600 17px/1.2 var(--font-head); color: var(--c-ink); white-space: nowrap; }
.aprod__price .stock { display: none; }
.art-more { background: var(--c-bg-alt); }
.pst-grid--3 .pst { border-color: transparent; }
.pst-grid--3 .pst:hover { border-color: var(--c-ink); }

/* ── Карточка товара: статьи о препарате - горизонтальные карточки на ширину ряда ── */
.prod-articles .pst-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 20px; }
.prod-articles .pst { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); grid-template-rows: none; }
.prod-articles .pst__media { aspect-ratio: auto; min-height: 240px; }
.prod-articles .pst__img { position: absolute; inset: 0; }
.prod-articles .pst__body { align-content: center; padding: 26px 28px; }

/* ── Адаптив ── */
@media (max-width: 1100px) {
	.pst-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pst--wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
	.art-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; }
}
/* Низкий экран: содержанию не остаётся места - прокручивается весь сайдбар целиком */
@media (min-width: 901px) and (max-height: 700px) {
	.art-aside { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--c-line-strong) transparent; }
	.art-aside .art-toc { flex-shrink: 0; }
	.art-aside .art-toc ol { overflow: visible; -webkit-mask-image: none; mask-image: none; }
}
@media (max-width: 900px) {
	.art-layout { grid-template-columns: 1fr; }
	/* Сбоку больше нет места: содержание уходит в начало текста, карточку агронома заменяет призыв сразу под статьёй */
	.art-aside { display: none; }
	.art-toc--inline { display: block; margin-bottom: 28px; padding: 0; }
	.art-toc--inline summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; font: 600 16px/1.3 var(--font-head); color: var(--c-ink); cursor: pointer; list-style: none; }
	.art-toc--inline summary::-webkit-details-marker { display: none; }
	.art-toc--inline summary .ico { width: 13px; height: 13px; transition: transform .2s var(--ease); }
	.art-toc--inline[open] summary .ico { transform: rotate(180deg); }
	.art-toc--inline ol { padding: 0 12px 14px; }
	.pst--wide { grid-template-columns: 1fr; }
	.pst--wide .pst__media { min-height: 0; aspect-ratio: 16 / 10; }
	.art .crumbs__item:last-child { display: none; }
}
@media (max-width: 600px) {
	.pst-grid, .prod-articles .pst-grid { grid-template-columns: 1fr; gap: 16px; }
	.prod-articles .pst { grid-template-columns: 1fr; }
	.prod-articles .pst__media { min-height: 0; aspect-ratio: 16 / 10; }
	.prod-articles .pst__img { position: static; }
	.pst__body { padding: 18px 18px 20px; }
	.pst--wide .pst__body { padding: 20px 18px 22px; }
	.blog-nav { margin-inline: calc(-1 * var(--gut)); }
	.blog-nav__list { flex-wrap: nowrap; overflow-x: auto; padding: 2px var(--gut); scrollbar-width: none; }
	.blog-nav__list::-webkit-scrollbar { display: none; }
	.blog-empty { padding: 28px 20px; }
	.art-body { font-size: 17px; }
	.art-body .alignleft, .art-body .alignright { float: none; max-width: 100%; margin: 1.5em 0; }
	.art-body .mtr-note { padding: 18px 18px 18px 52px; }
	.art-body .mtr-note::before { left: 18px; top: 21px; width: 20px; height: 20px; }
	.art-cover__img { border-radius: var(--r-card); }
	.aprod { grid-template-columns: 72px minmax(0, 1fr); gap: 12px 14px; }
	.aprod__img { width: 72px; height: 72px; }
	.aprod__buy { grid-column: 1 / -1; grid-template-columns: auto auto; justify-content: space-between; align-items: center; }
	.aprod__name { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .art-progress { display: none; } }
