/* ==========================================================================
   TheCBD.ru — Страницы «Блог» (/blog/) и «Статья» (/blog/article/)
   Figma: 7483:5253 (Блог), 7487:5760 (Статья)
   ========================================================================== */

.cbd-blog-page,
.cbd-article-page {
  background: var(--cbd-bg, #ffffff);
  color: var(--cbd-ink, #202c25);
  overflow-x: clip;
}

/* --------------------------------------------------------------------------
   Хлебные крошки (общие для Блога и Статьи)
   -------------------------------------------------------------------------- */
.cbd-blog-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 18px;
}

.cbd-blog-crumbs a {
  color: rgba(25, 25, 25, 0.65);
  text-decoration: none;
  transition: color 0.18s ease;
}

.cbd-blog-crumbs a:hover {
  color: #317627;
}

.cbd-blog-crumbs__sep {
  color: rgba(25, 25, 25, 0.35);
}

.cbd-blog-crumbs__current {
  color: #191919;
  font-weight: 600;
}

/* ==========================================================================
   СТРАНИЦА «БЛОГ» (/blog/)
   ========================================================================== */
.cbd-blog-section {
  padding: 24px 0 40px;
}

.cbd-blog-title {
  margin: 0 0 24px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  color: #202c25;
}

/* Табы категорий */
.cbd-blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.cbd-blog-tag {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid #dce4d9;
  background: #ffffff;
  color: #343635;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.cbd-blog-tag:hover {
  border-color: #317627;
  color: #317627;
}

.cbd-blog-tag.is-active {
  background: #317627;
  border-color: #317627;
  color: #ffffff;
  font-weight: 600;
}

/* Сетка карточек блога (3×3 на десктопе, 2 колонки на планшете, 1 на мобилке) */
.cbd-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.cbd-blog-card {
  background: #ffffff;
  border: 1px solid #dce4d9;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.cbd-blog-card[hidden] {
  display: none;
}

.cbd-blog-card:hover {
  transform: translateY(-2px);
  border-color: #b7ceb2;
  box-shadow: 0 8px 24px rgba(25, 61, 44, 0.08);
}

.cbd-blog-card__media {
  width: 100%;
  height: 224px;
  overflow: hidden;
  background: #f3f6f2;
  flex-shrink: 0;
}

.cbd-blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.cbd-blog-card:hover .cbd-blog-card__media img {
  transform: scale(1.03);
}

.cbd-blog-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
}

.cbd-blog-card__badge {
  font-size: 12px;
  font-weight: 600;
  color: #317627;
}

.cbd-blog-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: #202c25;
}

.cbd-blog-card__excerpt {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #5b685f;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cbd-blog-card__date {
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
  color: #8b968e;
}

/* Показать больше + пагинация */
.cbd-blog-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
}

.cbd-blog-more-btn {
  min-width: 360px;
  max-width: 100%;
  height: 46px;
  padding: 0 28px;
  border-radius: 10px;
  border: 1px solid #d7e5d4;
  background: #eaf3e7;
  color: #317627;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.cbd-blog-more-btn:hover {
  background: #dcebd7;
}

.cbd-blog-more-btn[hidden] {
  display: none;
}

.cbd-blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cbd-blog-page-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #5b685f;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.cbd-blog-page-btn:hover {
  background: #f1f5f0;
  color: #202c25;
}

.cbd-blog-page-btn.is-active {
  color: #191919;
  font-weight: 700;
}

.cbd-blog-page-btn--next {
  background: #317627;
  color: #ffffff;
  margin-left: 6px;
}

.cbd-blog-page-btn--next:hover {
  background: #275f1f;
  color: #ffffff;
}

/* ==========================================================================
   СТРАНИЦА «СТАТЬЯ» (/blog/article/)
   ========================================================================== */
.cbd-article-top {
  padding: 24px 0 20px;
}

.cbd-article-h1 {
  margin: 0 0 18px;
  max-width: 820px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  color: #202c25;
}

/* Строка мета-информации статьи + кнопка Поделиться */
.cbd-article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ecf1ea;
}

.cbd-article-meta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  color: #7c877f;
}

.cbd-article-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cbd-article-meta-item img {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.cbd-article-share-top {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: none;
  background: #317627;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.18s ease;
}

.cbd-article-share-top:hover {
  background: #275f1f;
}

/* Двухколоночная сетка статьи (Контент + Сайдбар) */
.cbd-article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 40px;
  align-items: start;
  padding: 28px 0 48px;
}

.cbd-article-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}

.cbd-article-prose {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 15px;
  line-height: 1.7;
  color: #343635;
}

.cbd-article-prose p {
  margin: 0;
}

.cbd-article-prose h2 {
  margin: 12px 0 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  color: #202c25;
}

.cbd-article-prose a {
  color: #317627;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cbd-article-prose a:hover {
  color: #23581b;
}

.cbd-article-ref-sup {
  font-size: 11px;
  font-weight: 700;
  color: #317627;
  text-decoration: none !important;
  margin-left: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  background: #eaf3e7;
}

.cbd-article-ref-sup:hover {
  background: #d5e7d0;
}

.cbd-article-prose ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cbd-article-alert {
  padding: 16px 18px;
  border-radius: 12px;
  background: #f5f9f4;
  border-left: 4px solid #317627;
  font-size: 14px;
  line-height: 1.6;
  color: #202c25;
}

.cbd-article-disclaimer-box {
  background: #f8faf8;
  border: 1px solid #e1e8df;
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cbd-article-disclaimer-box__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #202c25;
}

.cbd-article-disclaimer-box__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #5b685f;
}

.cbd-article-hero-img {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #f3f6f2;
}

.cbd-article-hero-img img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

/* Блок «Мнение эксперта» */
.cbd-article-expert {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cbd-article-block-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  color: #202c25;
}

.cbd-article-expert-card {
  background: #ffffff;
  border: 1px solid #dce4d9;
  border-radius: 16px;
  padding: 24px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.cbd-article-expert-card__person {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.cbd-article-expert-card__avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  background: #ecf3ea;
}

.cbd-article-expert-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cbd-article-expert-card__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: #202c25;
}

.cbd-article-expert-card__role {
  font-size: 11px;
  color: #6b7280;
}

.cbd-article-expert-card__quote {
  margin: 0 0 10px;
  font-size: 14px;
  font-style: italic;
  line-height: 1.6;
  color: #343635;
}

.cbd-article-expert-card__note {
  margin: 0;
  font-size: 12px;
  color: #8b968e;
}

.cbd-article-expert-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #317627;
  text-decoration: none;
}

.cbd-article-expert-card__link:hover {
  text-decoration: underline;
}

/* Популярные товары внутри статьи (3 колонки) */
.cbd-article-products {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cbd-article-products__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.cbd-article-prod-card {
  background: #ffffff;
  border: 1px solid #dce4d9;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cbd-article-prod-card__media {
  position: relative;
  height: 180px;
  border-radius: 12px;
  background: #f7faf6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.cbd-article-prod-card__media img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.cbd-article-prod-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border-radius: 6px;
  background: #e9f5e6;
  color: #317627;
  font-size: 11px;
  font-weight: 700;
}

.cbd-article-prod-card__brand {
  font-size: 11px;
  color: #7c877f;
}

.cbd-article-prod-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #202c25;
  min-height: 40px;
}

.cbd-article-prod-card__meta {
  font-size: 12px;
  color: #5b685f;
}

.cbd-article-prod-card__rating {
  font-size: 12px;
  font-weight: 600;
  color: #202c25;
  margin-top: auto;
}

.cbd-article-prod-card__rating span {
  color: #f59e0b;
  margin-right: 4px;
}

.cbd-article-prod-card__price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.cbd-article-prod-card__price {
  font-size: 18px;
  font-weight: 700;
  color: #202c25;
}

.cbd-article-prod-card__old {
  font-size: 12px;
  color: #9ca3af;
  text-decoration: line-through;
  margin-left: 4px;
}

.cbd-article-prod-card__btn {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: none;
  background: #317627;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.cbd-article-prod-card__btn:hover {
  background: #275f1f;
}

/* Вопрос-ответ и Список литературы */
.cbd-article-qa,
.cbd-article-refs {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cbd-article-qa__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cbd-article-qa__q {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  color: #202c25;
}

.cbd-article-qa__a {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: #343635;
}

.cbd-article-refs__list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: #4b5750;
}

.cbd-article-refs__list li {
  scroll-margin-top: 160px;
}

.cbd-article-refs__link {
  color: #4b5750;
  text-decoration: underline;
  text-decoration-color: rgba(49, 118, 39, 0.35);
  text-underline-offset: 3px;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}

.cbd-article-refs__link:hover {
  color: #317627;
  text-decoration-color: #317627;
}

/* Плашка оценки статьи и шеринга */
.cbd-article-feedback {
  background: #f5f7f4;
  border-radius: 16px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cbd-article-feedback__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cbd-article-feedback__title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: #202c25;
}

.cbd-article-feedback__sub {
  margin: 0;
  font-size: 11px;
  color: #7c877f;
}

.cbd-article-copy-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  border: none;
  background: #317627;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.18s ease;
}

.cbd-article-copy-btn:hover {
  background: #275f1f;
}

.cbd-article-feedback__mid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cbd-article-stars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cbd-article-star-btn {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.cbd-article-star-btn:hover {
  transform: scale(1.14);
}

.cbd-article-feedback__share-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #5b685f;
}

.cbd-article-share-socials {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.cbd-article-share-soc {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.cbd-article-share-soc:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

.cbd-article-share-soc img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Правый сайдбар статьи (top: 160px — ровно под sticky-хедером 137px + 23px отступ, чтобы не обрезался) */
.cbd-article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 160px;
}

.cbd-article-promo {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: #202c25;
  background: #eaf3e7;
  min-height: 156px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cbd-article-promo:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(25, 61, 44, 0.1);
}

.cbd-article-promo__bg {
  width: 100%;
  height: 164px;
  object-fit: cover;
  display: block;
}

.cbd-article-promo__arrow {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cbd-article-promo__title {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  color: #193d2c;
}

.cbd-article-related-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
}

.cbd-article-related-side__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #202c25;
}

.cbd-article-related-side__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cbd-article-related-side__link {
  padding-bottom: 12px;
  border-bottom: 1px solid #ecf1ea;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #343635;
  text-decoration: none;
  transition: color 0.18s ease;
}

.cbd-article-related-side__link:hover {
  color: #317627;
}

/* ==========================================================================
   Планшет (1024px и 768px)
   ========================================================================== */
@media (max-width: 1023px) {
  .cbd-blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cbd-article-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .cbd-article-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .cbd-article-related-side {
    grid-column: 1 / -1;
  }

  .cbd-article-products__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cbd-article-products__grid .cbd-article-prod-card:last-child {
    grid-column: 1 / -1;
  }
}

/* ==========================================================================
   Мобильный (< 768px)
   ========================================================================== */
@media (max-width: 767px) {
  .cbd-blog-title,
  .cbd-article-h1 {
    font-size: 24px;
  }

  .cbd-blog-tags {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .cbd-blog-grid,
  .cbd-article-sidebar,
  .cbd-article-products__grid {
    grid-template-columns: 1fr;
  }

  .cbd-article-products__grid .cbd-article-prod-card:last-child {
    grid-column: auto;
  }

  .cbd-blog-more-btn {
    min-width: 100%;
  }

  .cbd-article-expert-card {
    grid-template-columns: 1fr;
    text-align: left;
    padding: 20px 16px;
  }

  .cbd-article-expert-card__person {
    flex-direction: row;
    text-align: left;
    gap: 14px;
  }
}
