/* PLIS ME — блог и статья (макет design4/Pages/Blog; specs PLIS_ME_Blog_and_Empty_State, PLIS_ME_Article_and_Inline_Cart).
   Сетка: поля 32 px (375: 16 px), gap 16 px. Карточка статьи .bcard — общая для списка, «Статті експерта» и «Більше корисного». */

/* ---------- карточка статьи ---------- */
.bcard { position: relative; display: flex; flex-direction: column; min-width: 0; }
.bcard[hidden] { display: none; }
.bcard__media { overflow: hidden; aspect-ratio: 452 / 280; border-radius: 2px; background: var(--bg-placeholder); }
.bcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-slow) var(--ease); }
.bcard:hover .bcard__media img { transform: scale(1.03); }
.bcard__title { margin-top: 8px; font-size: var(--fs-14); line-height: var(--lh-14); font-weight: var(--fw-regular, 400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard__link { transition: color var(--dur-fast); }
.bcard__link::after { content: ""; position: absolute; inset: 0; }
.bcard:hover .bcard__link { color: var(--text-secondary); }
.bcard__link:focus-visible { outline: none; }
.bcard:has(.bcard__link:focus-visible) { outline: 1px solid var(--focus-ring); outline-offset: 4px; }
.bcard__meta { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: var(--fs-14); line-height: var(--lh-14); }
.bcard__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.bcard__author { font-weight: var(--fw-medium); }
.bcard__date { margin-left: auto; color: var(--text-muted); white-space: nowrap; }

/* ---------- страница блога ---------- */
.blog-page { padding: 40px var(--gutter) 100px; }
.blog-page__title { font-size: var(--fs-24); line-height: var(--lh-24); font-weight: var(--fw-medium); text-align: center; }
.blog-page__controls { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 32px; }
.blog-cats { order: -1; display: flex; gap: 40px; min-width: 0; }
.blog-cats__item { font-size: var(--fs-16); line-height: 22px; color: var(--text-muted); white-space: nowrap; transition: color var(--dur-fast); }
.blog-cats__item:hover, .blog-cats__item[aria-selected="true"] { color: var(--text-primary); }
.blog-search { position: relative; display: block; flex: 0 1 500px; }
.blog-search__icon { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--text-primary); pointer-events: none; }
.blog-search__input { width: 100%; height: 40px; padding: 0 0 0 22px; border: 0; border-bottom: 1px solid var(--border-default); border-radius: 0; background: none; font: inherit; font-size: var(--fs-14); color: var(--text-primary); transition: border-color var(--dur-fast); }
.blog-search__input::placeholder { color: var(--text-secondary); }
.blog-search__input:focus { outline: none; border-bottom-color: var(--text-primary); }
.blog-search__input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.blog-page__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.blog-page__h2 { font-size: var(--fs-20); line-height: 24px; font-weight: var(--fw-medium); }
.blog-arrows { display: flex; gap: 0; }
.blog-arrows__btn:disabled { opacity: .35; cursor: default; }

.blog-expert { margin-top: 56px; }
.blog-expert[hidden] { display: none; }
.blog-expert__row { display: grid; grid-template-columns: minmax(0, 364px) minmax(0, 1fr); gap: 16px; margin-top: 32px; }
.blog-expert__photo { width: 175px; height: 175px; border-radius: 50%; object-fit: cover; }
.blog-expert__name { margin-top: 16px; font-size: var(--fs-16); line-height: 22px; font-weight: var(--fw-medium); }
.blog-expert__bio { margin-top: 12px; color: var(--text-muted); font-size: var(--fs-14); line-height: var(--lh-14); }
.blog-expert__quote { margin-top: 12px; color: var(--text-sale); font-size: var(--fs-14); line-height: var(--lh-14); }
.blog-expert__track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 3); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.blog-expert__track::-webkit-scrollbar { display: none; }
.blog-expert__track > .bcard { scroll-snap-align: start; }

.blog-new { margin-top: 64px; }
.blog-new__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 16px; margin-top: 32px; }
.blog-new__more { display: flex; justify-content: center; margin-top: 32px; }
.blog-new__btn { min-width: 200px; }
.blog-new__btn[hidden] { display: none; }
[data-blog-results][hidden] { display: none; }

.blog-empty { display: flex; flex-direction: column; align-items: center; padding: 50px 0 80px; text-align: center; }
.blog-empty[hidden] { display: none; }
.blog-empty__flower { width: 64px; height: 64px; margin-bottom: 8px; }
.blog-empty__text { max-width: 272px; }

/* ---------- статья ---------- */
.post { padding: 40px var(--gutter) 80px; }
.post-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.post-hero__title { font-size: var(--fs-24); line-height: var(--lh-24); font-weight: var(--fw-medium); }
.post-hero__summary { margin-top: 32px; max-width: 610px; font-size: var(--fs-14); line-height: var(--lh-14); font-weight: var(--fw-light); }
.post-hero__meta { display: flex; align-items: center; gap: 12px; margin-top: 32px; font-size: var(--fs-14); line-height: var(--lh-14); }
.post-hero__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.post-hero__author { font-weight: var(--fw-medium); }
.post-hero__date { margin-left: auto; color: var(--text-muted); }
.post-hero__media { overflow: hidden; aspect-ratio: 672 / 442; border-radius: 2px; background: var(--bg-placeholder); }
.post-hero__media img { width: 100%; height: 100%; object-fit: cover; }

.post-body { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 80px; margin-top: 50px; align-items: start; }
.post-toc { position: sticky; top: 110px; }
.post-toc__head { display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: var(--fs-14); line-height: var(--lh-14); font-weight: var(--fw-medium); text-align: left; cursor: default; }
.post-toc__chev { display: none; transition: transform var(--dur-fast); }
.post-toc__list { display: grid; gap: 12px; margin-top: 16px; padding-left: 20px; list-style: decimal; color: var(--text-muted); font-size: var(--fs-14); line-height: var(--lh-14); }
.post-toc__list li::marker { color: currentColor; }
.post-toc__list li:has([aria-current="true"]) { color: var(--text-primary); }
.post-toc__link { transition: color var(--dur-fast); }
.post-toc__link:hover { color: var(--text-primary); }
.post-toc__link[aria-current="true"] { color: var(--text-primary); }

.post-text { min-width: 0; font-size: var(--fs-14); line-height: var(--lh-14); font-weight: var(--fw-light); }
.post-text > * + * { margin-top: 12px; }
.post-text h2 { margin-top: 40px; font-size: var(--fs-20); line-height: 24px; font-weight: var(--fw-medium); scroll-margin-top: 110px; }
.post-text h3 { margin-top: 24px; font-size: var(--fs-16); line-height: 22px; font-weight: var(--fw-medium); }
.post-text h2 + *, .post-text h3 + * { margin-top: 16px; }
.post-text > :first-child { margin-top: 0; }
.post-text b, .post-text strong { font-weight: var(--fw-medium); }
.post-text ul, .post-text ol { padding-left: 20px; }
.post-text ul { list-style: disc; }
.post-text ol { list-style: decimal; }
.post-text li + li { margin-top: 4px; }
.post-text a { text-decoration: underline; text-underline-offset: 3px; transition: color var(--dur-fast); }
.post-text a:hover { color: var(--text-secondary); }

.post-products { margin-top: 40px; font-weight: var(--fw-regular, 400); }
.post-products__title { font-size: var(--fs-16); line-height: 22px; font-weight: var(--fw-medium); }
.post-products__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 16px; padding: 0 !important; list-style: none !important; }
.post-products__list .rec-row { margin: 0; }
.post-products__list .rec-row a { text-decoration: none; }
.post-products__list .rec-row__name, .post-products__list .rec-row__desc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.post-more { margin-top: 80px; }
.post-more__title { font-size: var(--fs-20); line-height: 24px; font-weight: var(--fw-medium); }
.post-more__track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }

/* ---------- 1024 ---------- */
@media (max-width: 1279px) {
  .blog-cats { gap: 28px; }
  .blog-expert__row { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); }
  .blog-expert__track { grid-auto-columns: calc((100% - 16px) / 2); }
  .blog-new__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .post-body { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 40px; }
  .post-products__list { grid-template-columns: 1fr; }
  .post-more__track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .post-more__track > :nth-child(4) { display: none; }
}

/* ---------- телефон ---------- */
@media (max-width: 767px) {
  .blog-page { padding: 24px 0 64px; }
  .blog-page__title { font-size: var(--fs-16); line-height: 22px; }
  .blog-page__controls { flex-direction: column; align-items: stretch; gap: 16px; margin-top: 24px; padding-inline: 16px; }
  .blog-cats { order: 0; gap: 24px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .blog-cats::-webkit-scrollbar { display: none; }
  .blog-cats__item { font-size: var(--fs-14); line-height: 18px; }
  .blog-search { flex: none; }
  .blog-page__head, .blog-new__grid, .blog-new .blog-page__h2 { padding-inline: 16px; }
  .blog-page__h2 { font-size: var(--fs-16); line-height: 22px; }
  .blog-arrows { display: none; }
  .blog-expert { margin-top: 48px; }
  .blog-expert__row { display: flex; gap: 16px; margin-top: 24px; padding-inline: 16px; scroll-padding-inline: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .blog-expert__row::-webkit-scrollbar { display: none; }
  .blog-expert__person { flex: 0 0 270px; scroll-snap-align: start; }
  .blog-expert__photo { width: 145px; height: 145px; }
  .blog-expert__name { margin-top: 12px; font-size: var(--fs-14); line-height: 18px; }
  .blog-expert__bio, .blog-expert__quote { margin-top: 4px; font-size: var(--fs-12); line-height: var(--lh-12); }
  .blog-expert__track { display: contents; }
  .blog-expert__track > .bcard { flex: 0 0 270px; scroll-snap-align: start; }
  .blog-expert__track > .bcard .bcard__media { aspect-ratio: 270 / 160; }
  .blog-new { margin-top: 48px; }
  .blog-new__grid { grid-template-columns: 1fr; gap: 32px; margin-top: 24px; }
  .bcard__media { aspect-ratio: 343 / 160; }
  .bcard__title { margin-top: 6px; font-size: var(--fs-12); line-height: 16px; }
  .bcard__meta { gap: 8px; margin-top: 10px; font-size: var(--fs-12); line-height: var(--lh-12); }
  .bcard__avatar { width: 32px; height: 32px; }
  .blog-new__more { margin-top: 32px; }
  .blog-empty { padding: 100px 16px 80px; }

  .post { padding: 24px 0 64px; }
  .post-hero { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 24px; padding-inline: 16px; }
  .post-hero__media { aspect-ratio: 343 / 235; }
  .post-hero__title { font-size: var(--fs-16); line-height: 22px; }
  .post-hero__summary { margin-top: 16px; font-size: var(--fs-12); line-height: 16px; }
  .post-hero__meta { margin-top: 16px; gap: 8px; font-size: var(--fs-12); }
  .post-hero__avatar { width: 32px; height: 32px; }
  .post-body { display: block; margin-top: 32px; padding-inline: 16px; }
  .post-toc { position: static; margin-bottom: 32px; }
  .post-toc__head { cursor: pointer; }
  .post-toc__chev { display: block; transform: rotate(180deg); }
  .post-toc__head[aria-expanded="false"] .post-toc__chev { transform: none; }
  .post-toc__head[aria-expanded="false"] + .post-toc__list { display: none; }
  .post-toc__list { font-size: var(--fs-12); line-height: 16px; gap: 8px; color: var(--text-primary); }
  .post-text { font-size: var(--fs-12); line-height: 16px; }
  .post-text h2 { margin-top: 32px; font-size: var(--fs-16); line-height: 22px; }
  .post-text h3 { font-size: var(--fs-14); line-height: 18px; }
  .post-products__title { font-size: var(--fs-14); line-height: 18px; }
  .post-products__list { gap: 8px; }
  .post-more { margin-top: 48px; }
  .post-more__title { padding-inline: 16px; font-size: var(--fs-16); line-height: 22px; }
  .post-more__track { display: flex; gap: 16px; margin-top: 24px; padding-inline: 16px; scroll-padding-inline: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .post-more__track::-webkit-scrollbar { display: none; }
  .post-more__track > .bcard { flex: 0 0 270px; scroll-snap-align: start; display: flex; }
  .post-more__track .bcard__media { aspect-ratio: 270 / 160; }
}
