/* =========================================================================
   Lingua Bona — дополнения к вёрстке для работы на MODX

   Основные стили — style.css (вёрстка без изменений). Здесь только то,
   что нужно для динамического контента: произвольное количество карточек,
   текст из визуального редактора, карта-виджет, видео, поиск, пагинация.
   ========================================================================= */

/* ------------- «Что беспокоит»: любое количество карточек -------------
   В style.css порядок и скрытие карточек на планшете и мобиле заданы
   под ровно 9 штук. Для списка из админки порядок — как в админке,
   на мобиле видны первые 4 карточки, остальные раскрываются кнопкой. */

/* !important — чтобы перебить правила style.css с :nth-child под 9 карточек */
@media (max-width: 1199.98px) {
  .diagnostics__cards--dynamic {
    grid-template-rows: none;
    grid-auto-flow: row;
  }

  .diagnostics__cards--dynamic .diagnosis-card {
    display: block !important;
    order: 0 !important;
  }
}

@media (max-width: 759.98px) {
  .diagnostics__cards--dynamic .diagnosis-card.diagnosis-card--more {
    display: none !important;
  }

  .diagnostics__cards--dynamic.is-expanded .diagnosis-card.diagnosis-card--more {
    display: block !important;
  }
}

/* ------------------------- Карта из Яндекс Карт ------------------------- */

.map-bar__img--embed {
  position: relative;
}

.map-bar__img--embed > *,
.map-bar__img--embed iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

/* ------------------------------ Видео ------------------------------ */

.video-modal .modal-content {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: var(--lb-radius-md);
  background: #000;
}

.video-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  opacity: 0.9;
}

.video-modal__frame iframe,
.video-modal__frame video {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

/* --------------- Текст из визуального редактора (статьи) --------------- */

.article__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  font-family: var(--lb-font-text);
  font-size: 16px;
  font-weight: 300;
  line-height: 22px;
  color: var(--lb-graphite);
}

.article__content > * {
  max-width: 100%;
  margin: 0;
}

.article__content h2 {
  width: 100%;
  margin-top: 10px;
  font-family: var(--lb-font-title);
  font-size: 30px;
  font-weight: 700;
  line-height: 30px;
  color: var(--lb-graphite);
}

.article__content > h2:first-child {
  margin-top: 0;
}

.article__content h3,
.article__content h4 {
  width: 100%;
  font-family: var(--lb-font-title);
  font-size: 24px;
  font-weight: 500;
  line-height: 29px;
  color: var(--lb-graphite);
}

.article__content p {
  width: 100%;
  margin: 0;
}

.article__content a:not(.btn-50) {
  color: var(--lb-orange);
  text-decoration: underline;
}

.article__content strong,
.article__content b {
  font-weight: 600;
}

.article__content ul:not([class]),
.article__content ol:not([class]) {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 958px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article__content ul:not([class]) > li,
.article__content ol:not([class]) > li {
  position: relative;
  padding-left: 12px;
}

.article__content ul:not([class]) > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 10px;
  background: var(--lb-orange);
}

.article__content ol:not([class]) {
  counter-reset: lb-ol;
}

.article__content ol:not([class]) > li {
  padding-left: 22px;
  counter-increment: lb-ol;
}

.article__content ol:not([class]) > li::before {
  content: counter(lb-ol) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 600;
  color: var(--lb-orange);
}

.article__content blockquote:not([class]) {
  width: 100%;
  margin: 0;
  padding-left: 22px;
  border-left: 2px solid var(--lb-orange);
  font-family: var(--lb-font-title);
  font-size: 20px;
  font-weight: 400;
  line-height: 28px;
}

.article__content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--lb-radius-sm);
}

/* Таблица в тексте статьи оформлена как карточка прайса из макета:
   первая строка (заголовок таблицы) — название, дальше «услуга — цена» */
.article__content table {
  display: block;
  width: 100%;
  padding: 30px;
  border-collapse: collapse;
  border-radius: var(--lb-radius-lg);
  background: var(--lb-white);
}

.article__content table thead,
.article__content table tbody {
  display: block;
  width: 100%;
}

.article__content table tr {
  display: flex;
  gap: 14px;
  width: 100%;
  padding: 16px 0;
  border-bottom: 2px solid var(--lb-sand-border);
}

.article__content table thead tr {
  padding-top: 0;
  border-bottom: 0;
}

.article__content table td,
.article__content table th {
  flex: 1 0 0;
  min-width: 0;
  padding: 0;
  border: 0;
  text-align: left;
  font-family: var(--lb-font-title);
  font-size: 20px;
  font-weight: 300;
  line-height: 28px;
  color: #000;
}

.article__content table th {
  font-size: 24px;
  font-weight: 500;
  line-height: 29px;
}

.article__content table thead th + th {
  visibility: hidden;
}

.article__content table td + td {
  font-weight: 400;
  color: var(--lb-orange);
}

@media (max-width: 759.98px) {
  .article__content table {
    padding: 20px;
  }

  .article__content table td,
  .article__content table th {
    font-size: 16px;
    line-height: 22px;
  }
}

.article__content iframe,
.article__content video {
  max-width: 100%;
  border: 0;
  border-radius: var(--lb-radius-sm);
}

/* Якоря разделов не прячутся под шапку */
.article__content [id],
.article [id] {
  scroll-margin-top: 110px;
}

/* Статья без картинки в шапке: меню статьи занимает строку целиком */
.article-hero__row--no-image .article-toc {
  flex: 0 1 958px;
}

/* Простая страница (новость, документы) */
.page-simple .article {
  max-width: 958px;
}

/* ------------------------------ Пагинация ------------------------------ */

.lb-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 40px;
}

.lb-pager__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--lb-sand-border);
  border-radius: 1000px;
  background: var(--lb-white);
  font-family: var(--lb-font-text);
  font-size: 16px;
  font-weight: 600;
  color: var(--lb-graphite);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.lb-pager__item:hover,
.lb-pager__item.is-active {
  border-color: var(--lb-orange);
  color: var(--lb-orange);
}

/* --------------------------- Результаты поиска --------------------------- */

.search-results {
  gap: 30px;
}

.search-results .search-bar {
  width: 100%;
  max-width: 958px;
}

.search-results__main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.search-results__type {
  font-family: var(--lb-font-text);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  color: var(--lb-muted);
}

.search-results__text {
  font-family: var(--lb-font-text);
  font-size: 14px;
  font-weight: 300;
  line-height: 20px;
  color: var(--lb-muted);
}

.search-results__price {
  flex: 0 0 auto;
  margin: 0 16px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--lb-graphite);
}

.search-results .related__link {
  gap: 10px;
  text-decoration: none;
}

.search-results__empty,
.promos__empty {
  font-family: var(--lb-font-text);
  font-size: 16px;
  font-weight: 300;
  line-height: 22px;
  color: var(--lb-muted);
}

/* Поле поиска на странице цен — форма (переход к результатам по Enter) */
form.search-bar {
  margin: 0;
}

/* Скрытые отзывы до нажатия «Показать больше» */
.reviews-page__item[hidden] {
  display: none !important;
}

.reviews-page__item {
  display: contents;
}

/* Отзывы в ряду: подпись автора выравнивается по нижнему краю,
   даже если тексты разной длины (в вёрстке подгонялось пустой строкой) */
.reviews__row .review-card__body {
  flex: 1 1 auto;
}

.reviews__row .review-card__text {
  flex: 1 1 auto;
}
