/* ==========================================================================
   TheCBD.ru — Витрина «Полный справочник полезных свойств CBD (КБД) масла»
   (/blog/spravochnik-poleznykh-svoystv-kbd/, Figma 7529:4236)
   и «Статья справочника» (/blog/spravochnik-poleznykh-svoystv-kbd/kbd-pri-rasseyannom-skleroze/, Figma 7529:3712)
   ========================================================================== */

.cbd-handbook-page {
  background-color: #ffffff;
  color: #202c25;
  font-family: var(--font-base, 'Montserrat', sans-serif);
}

/* Хлебные крошки */
.cbd-handbook-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  line-height: 28px;
  margin-bottom: 24px;
}

.cbd-handbook-crumbs a {
  color: #aeaeae;
  text-decoration: none;
  transition: color 0.18s ease;
}

.cbd-handbook-crumbs a:hover {
  color: #3f892c;
}

.cbd-handbook-crumbs__sep {
  color: rgba(25, 25, 25, 0.2);
}

.cbd-handbook-crumbs__current {
  color: #191919;
}

/* 1. Вводный блок витрины Справочника (Figma 7529:4241) */
.cbd-handbook-intro {
  padding: 56px 0 32px;
}

.cbd-handbook-intro__title {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.25;
  color: #202c25;
  max-width: 568px;
  margin: 0 0 24px;
}

.cbd-handbook-intro__text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 17px;
  line-height: 1.6;
  color: #343635;
}

.cbd-handbook-intro__text p {
  margin: 0;
}

.cbd-handbook-intro__lead {
  font-weight: 700;
  color: #343635;
}

/* 2. Витрина статей Справочника + правое оглавление (Figma 7529:4252) */
.cbd-handbook-showcase {
  padding: 20px 0 96px;
}

.cbd-handbook-showcase__layout {
  display: grid;
  grid-template-columns: minmax(0, 955px) 305px;
  gap: 20px;
  align-items: start;
}

/* Сетка карточек 3 колонки (305px каждая) */
.cbd-handbook-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 20px;
}

.cbd-handbook-card {
  display: flex;
  flex-direction: column;
  height: 421px;
  background: #ffffff;
  border: 1px solid #dce4d9;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease;
}

.cbd-handbook-card[hidden] {
  display: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .cbd-handbook-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(25, 61, 44, 0.08);
    border-color: #b8cfb2;
  }
}

.cbd-handbook-card__media {
  width: 100%;
  height: 235px;
  flex-shrink: 0;
  overflow: hidden;
  background: #f4f6f3;
}

.cbd-handbook-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (hover: hover) and (pointer: fine) {
  .cbd-handbook-card:hover .cbd-handbook-card__media img {
    transform: scale(1.03);
  }
}

.cbd-handbook-card__body {
  padding: 24px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.cbd-handbook-card__title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.38;
  color: #202c25;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cbd-handbook-card__excerpt {
  font-size: 13px;
  font-weight: 500;
  line-height: 18.2px;
  color: #000000;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Правый сайдбар-оглавление с вертикальной линией (Figma 7559:3918) */
.cbd-handbook-toc {
  position: sticky;
  top: 160px;
  width: 100%;
}

.cbd-handbook-toc__list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  border-left: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #dce4d9 transparent;
}

.cbd-handbook-toc__item {
  position: relative;
}

.cbd-handbook-toc__link {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 12px 6px 25px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: #000000;
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.cbd-handbook-toc__link:hover {
  color: #3f892c;
}

.cbd-handbook-toc__link.is-active {
  color: #3f892c;
  border-left-color: #000000;
  font-weight: 600;
}

/* Кнопка «Показать больше» и пагинация 1–5 (Figma 7529:4338, 7529:4340) */
.cbd-handbook-more-wrap {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.cbd-handbook-more-btn {
  width: 414px;
  max-width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(63, 137, 44, 0.1);
  color: #3f892c;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.cbd-handbook-more-btn:hover {
  background: rgba(63, 137, 44, 0.18);
}

.cbd-handbook-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  height: 54px;
}

.cbd-handbook-page-btn {
  background: transparent;
  border: none;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #000000;
  cursor: pointer;
  transition: color 0.18s ease;
}

.cbd-handbook-page-btn:hover {
  color: #3f892c;
}

.cbd-handbook-page-btn.is-active {
  color: #aeaeae;
  cursor: default;
}

.cbd-handbook-page-btn--next {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: #3f892c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 0;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.cbd-handbook-page-btn--next:hover {
  background: #317627;
  transform: translateX(2px);
}

/* 3. Статья Справочника (Figma 7529:3712) — дополнения к blog.css */
.cbd-handbook-related-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

/* ==========================================================================
   Адаптивность (1024px, 768px, 390px)
   ========================================================================== */

@media (max-width: 1199px) {
  .cbd-handbook-showcase__layout {
    grid-template-columns: minmax(0, 1fr) 250px;
  }

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

  .cbd-handbook-related-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .cbd-handbook-showcase__layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .cbd-handbook-toc {
    position: static;
    order: -1;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 20px;
  }

  .cbd-handbook-toc__list {
    max-height: 220px;
  }
}

@media (max-width: 767px) {
  .cbd-handbook-intro {
    padding: 28px 0 20px;
  }

  .cbd-handbook-intro__title {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .cbd-handbook-intro__text {
    font-size: 15px;
    gap: 14px;
  }

  .cbd-handbook-showcase {
    padding: 12px 0 56px;
  }

  .cbd-handbook-grid,
  .cbd-handbook-related-4 {
    grid-template-columns: 1fr;
  }

  .cbd-handbook-card {
    height: auto;
    min-height: 390px;
  }
}
