/* ==========================================================================
   TheCBD.ru — Страницы «Эксперты» (/experts/) и «Страница эксперта» (/experts/expert/)
   Figma: 7516:7277 (Эксперты), 7518:8060 (Эксперт персональная страница)
   ========================================================================== */

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

/* --------------------------------------------------------------------------
   Хлебные крошки
   -------------------------------------------------------------------------- */
.cbd-experts-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-experts-crumbs a {
  color: rgba(25, 25, 25, 0.65);
  text-decoration: none;
  transition: color 0.18s ease;
}

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

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

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

/* ==========================================================================
   СТРАНИЦА «ЭКСПЕРТЫ» (/experts/)
   ========================================================================== */
.cbd-experts-section {
  padding: 24px 0 40px;
}

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

.cbd-experts-desc {
  margin: 0 0 28px;
  max-width: 780px;
  font-size: 15px;
  line-height: 1.6;
  color: #4b5750;
}

/* Табы направлений */
.cbd-experts-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.cbd-experts-tag {
  height: 40px;
  padding: 0 20px;
  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-experts-tag:hover {
  border-color: #317627;
  color: #317627;
}

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

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

.cbd-expert-card {
  background: #ffffff;
  border: 1px solid #dce4d9;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

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

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

.cbd-expert-card__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  background: #eef4ec;
  flex-shrink: 0;
}

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

.cbd-expert-card__name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: #202c25;
}

.cbd-expert-card__spec {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #5b685f;
}

.cbd-expert-card__btn {
  margin-top: auto;
  width: 100%;
  height: 40px;
  border-radius: 8px;
  background: #317627;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease;
}

.cbd-expert-card__btn:hover {
  background: #275f1f;
  color: #ffffff;
}

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

.cbd-experts-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-experts-more-btn:hover {
  background: #dcebd7;
}

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

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

.cbd-experts-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-experts-page-btn:hover {
  background: #f1f5f0;
  color: #202c25;
}

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

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

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

/* ==========================================================================
   СТРАНИЦА ЭКСПЕРТА (/experts/expert/)
   ========================================================================== */
.cbd-expert-top {
  padding: 24px 0 8px;
}

.cbd-expert-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 40px;
  align-items: start;
  padding: 12px 0 48px;
}

.cbd-expert-main {
  display: flex;
  flex-direction: column;
  gap: 36px;
  min-width: 0;
}

/* Шапка профиля эксперта */
.cbd-expert-hero {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.cbd-expert-hero__photo {
  width: 200px;
  height: 220px;
  border-radius: 16px;
  overflow: hidden;
  background: #f1f4f0;
}

.cbd-expert-hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.cbd-expert-hero__info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cbd-expert-hero__name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: #202c25;
}

.cbd-expert-hero__spec {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #4b5750;
}

.cbd-expert-hero__phone {
  font-size: 18px;
  font-weight: 700;
  color: #202c25;
  text-decoration: none;
}

.cbd-expert-hero__phone:hover {
  color: #317627;
}

.cbd-expert-hero__phone[hidden],
.cbd-expert-hero__site[hidden] {
  display: none;
}

.cbd-expert-hero__site {
  font-size: 13px;
  font-weight: 500;
  color: #317627;
  text-decoration: underline;
  text-underline-offset: 3px;
  width: fit-content;
}

.cbd-expert-hero__site:hover {
  color: #23581b;
}

/* Секции «Образование» и «Заслуги» */
.cbd-expert-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cbd-expert-block__title {
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5ece3;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  color: #202c25;
}

.cbd-expert-timeline {
  display: flex;
  flex-direction: column;
}

.cbd-expert-timeline__item {
  padding: 16px 0;
  border-bottom: 1px solid #ecf1ea;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cbd-expert-timeline__date {
  font-size: 12px;
  font-weight: 500;
  color: #8b968e;
}

.cbd-expert-timeline__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #202c25;
}

/* Карточка «Мнение эксперта» */
.cbd-expert-opinion-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-expert-opinion-card__person {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

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

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

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

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

.cbd-expert-opinion-card__quote {
  margin: 0 0 8px;
  font-size: 14px;
  font-style: italic;
  line-height: 1.65;
  color: #343635;
}

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

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

.cbd-expert-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-expert-promo:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(25, 61, 44, 0.1);
}

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

.cbd-expert-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-expert-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-expert-related {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
}

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

.cbd-expert-related__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cbd-expert-related__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-expert-related__link:hover {
  color: #317627;
}

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

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

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

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

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

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

  .cbd-experts-grid,
  .cbd-expert-sidebar {
    grid-template-columns: 1fr;
  }

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

  .cbd-expert-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .cbd-expert-hero__photo {
    width: 150px;
    height: 168px;
  }

  .cbd-expert-hero__name {
    font-size: 20px;
  }

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

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