/* ==========================================================================
   Astra — Section / SEO content (посадочная по комнатности)

   Изолированные стили:
   • все классы с префиксом .astra-seo — не пересекаются с классами сайта;
   • собственные CSS-переменные --astra-seo-*, объявлены на корне блока
     (не зависят от :root сайта и ничего в нём не меняют);
   • нет глобальных селекторов (html, body, :root, теги без префикса);
   • локальный сброс внутри блока, чтобы общие стили сайта
     (a, ul, li, button, h2/h3, p) не влияли на вёрстку.

   Брейкпоинты повторяют сайт: 768 / 1280 / 1440.
   Подключение: через kvartiryLanding() в /kvartiry/.landing.php.
   ========================================================================== */

.astra-seo {
  /* Цвета — значения из дизайн-системы Астры */
  --astra-seo-bg: #f4f6fb;
  --astra-seo-accent: #2b6ec4;
  --astra-seo-accent-hover: #4189e6;
  --astra-seo-border: rgba(43, 110, 196, 0.22);
  --astra-seo-text: #181818;
  --astra-seo-text-muted: #636363;
  --astra-seo-text-light: #81808b;
  --astra-seo-white: #fff;

  /* Сетка */
  --astra-seo-gutter: 14px;
  --astra-seo-sticky-top: 72px; /* высота шапки + отступ, для sticky CTA */
  --astra-seo-radius: 24px;
  --astra-seo-pill: 100px;

  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 40px 0 48px;
  background-color: var(--astra-seo-bg);
  color: var(--astra-seo-text);
  font-family: "GolosText", "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Локальный сброс (только внутри блока) ---------- */
.astra-seo *,
.astra-seo *::before,
.astra-seo *::after {
  box-sizing: border-box;
}

.astra-seo :where(h2, h3, p, ul, ol, li, figure, blockquote, details, summary) {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.astra-seo :where(ul, ol) {
  list-style: none;
}

.astra-seo :where(li)::before,
.astra-seo :where(li)::after {
  content: none;
}

.astra-seo :where(a) {
  color: inherit;
  text-decoration: none;
  background: none;
}

.astra-seo :where(button) {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font: inherit;
  color: inherit;
  text-transform: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.astra-seo :where(svg) {
  display: block;
  flex-shrink: 0;
}

/* ---------- Контейнер ---------- */
.astra-seo__container {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  padding-left: var(--astra-seo-gutter);
  padding-right: var(--astra-seo-gutter);
}

/* ---------- Заголовки ---------- */
.astra-seo__title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--astra-seo-text);
}

/* ---------- Текст + CTA ---------- */
.astra-seo__row {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.astra-seo__article {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* Текст из UF_SEO_TEXT. Всегда целиком в DOM — сворачивание только визуальное */
.astra-seo__text {
  position: relative;
  font-size: 14px;
  line-height: 1.5;
  color: var(--astra-seo-text-muted);
}

.astra-seo__text p {
  margin-bottom: 12px;
}

.astra-seo__text > :last-child {
  margin-bottom: 0;
}

.astra-seo__text .astra-seo__lead {
  color: var(--astra-seo-text);
}

.astra-seo__text h3 {
  margin: 24px 0 12px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--astra-seo-text);
}

.astra-seo__text ul {
  margin-bottom: 12px;
}

.astra-seo__text li {
  position: relative;
  padding-left: 20px;
}

.astra-seo__text li + li {
  margin-top: 8px;
}

.astra-seo__text li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--astra-seo-accent);
}

.astra-seo__text a {
  color: var(--astra-seo-accent);
  transition: color 0.3s;
}

.astra-seo__text a:hover {
  color: var(--astra-seo-accent-hover);
}

/* Свёрнутое состояние (класс ставит JS, только если текст выше лимита) */
.astra-seo__text.astra-seo__text--collapsed {
  max-height: 147px; /* ~7 строк по 21px */
  overflow: hidden;
}

.astra-seo__text.astra-seo__text--collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: linear-gradient(to bottom, rgba(244, 246, 251, 0), var(--astra-seo-bg));
  pointer-events: none;
}

.astra-seo .astra-seo__more {
  display: none; /* показывает JS, если текст реально свёрнут */
  align-self: flex-start;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--astra-seo-accent);
  transition: color 0.3s;
}

.astra-seo .astra-seo__more.astra-seo__more--visible {
  display: inline-flex;
}

.astra-seo .astra-seo__more:hover {
  color: var(--astra-seo-accent-hover);
}

.astra-seo__more-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s;
}

.astra-seo__more[aria-expanded="true"] .astra-seo__more-icon {
  transform: rotate(180deg);
}

/* ---------- CTA ---------- */
.astra-seo__cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: var(--astra-seo-radius);
  background-color: var(--astra-seo-accent);
  color: var(--astra-seo-white);
}

.astra-seo__cta-title {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.3;
}

.astra-seo__cta-text {
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.8;
}

.astra-seo .astra-seo__cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  margin-top: 4px;
  padding: 0 28px;
  border-radius: var(--astra-seo-pill);
  background-color: var(--astra-seo-white);
  color: var(--astra-seo-accent);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.3s, color 0.3s;
}

.astra-seo .astra-seo__cta-button:hover {
  background-color: var(--astra-seo-accent-hover);
  color: var(--astra-seo-white);
}

.astra-seo .astra-seo__cta-phone {
  display: none; /* на мобильном телефон есть в шапке */
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--astra-seo-white);
}

/* ---------- Перелинковка по ЖК ---------- */
.astra-seo__links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.astra-seo__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.astra-seo .astra-seo__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--astra-seo-border);
  border-radius: var(--astra-seo-pill);
  background-color: var(--astra-seo-white);
  color: var(--astra-seo-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  transition: border-color 0.3s, color 0.3s;
}

.astra-seo .astra-seo__tag:hover {
  border-color: var(--astra-seo-accent);
  color: var(--astra-seo-accent);
}

.astra-seo .astra-seo__tag--active,
.astra-seo .astra-seo__tag--active:hover {
  border-color: var(--astra-seo-accent);
  background-color: var(--astra-seo-accent);
  color: var(--astra-seo-white);
}

/* ---------- Карточки видов квартир (хаб /kvartiry/) ---------- */
.astra-seo__types {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.astra-seo .astra-seo__type {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 16px;
  border: 1px solid var(--astra-seo-border);
  border-radius: var(--astra-seo-radius);
  background-color: var(--astra-seo-white);
  color: var(--astra-seo-text);
  transition: border-color 0.3s;
}

.astra-seo .astra-seo__type:hover {
  border-color: var(--astra-seo-accent);
}

.astra-seo .astra-seo__type:focus-visible {
  outline: 2px solid var(--astra-seo-accent);
  outline-offset: 3px;
}

.astra-seo__type-title {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
}

.astra-seo .astra-seo__type:hover .astra-seo__type-title {
  color: var(--astra-seo-accent);
}

.astra-seo__type-meta {
  font-size: 13px;
  color: var(--astra-seo-text-muted);
}

.astra-seo__type-price {
  margin-top: auto;
  padding-top: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--astra-seo-accent);
}

@media (min-width: 768px) {
  .astra-seo__types {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }

  .astra-seo .astra-seo__type {
    padding: 20px 24px;
  }

  .astra-seo__type-title {
    font-size: 18px;
  }

  .astra-seo__type-meta {
    font-size: 14px;
  }

  .astra-seo__type-price {
    font-size: 16px;
  }
}

.astra-seo__tag-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--astra-seo-text-light);
}

/* ---------- FAQ ---------- */
.astra-seo__faq {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.astra-seo__faq-item {
  border-bottom: 1px solid var(--astra-seo-border);
}

.astra-seo .astra-seo__faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--astra-seo-text);
  cursor: pointer;
  list-style: none;
}

.astra-seo .astra-seo__faq-question::-webkit-details-marker {
  display: none;
}

.astra-seo .astra-seo__faq-question::marker {
  content: "";
}

/* Кнопка-иконка +/− */
.astra-seo .astra-seo__faq-question::after {
  content: "";
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--astra-seo-white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath d='M3 8h10M8 3v10' stroke='%232B6EC4' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  transition: background-color 0.3s;
}

.astra-seo .astra-seo__faq-item[open] .astra-seo__faq-question::after {
  background-color: var(--astra-seo-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath d='M3 8h10' stroke='%23FFFFFF' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.astra-seo .astra-seo__faq-question:focus-visible,
.astra-seo .astra-seo__more:focus-visible,
.astra-seo .astra-seo__tag:focus-visible,
.astra-seo .astra-seo__cta-button:focus-visible {
  outline: 2px solid var(--astra-seo-accent);
  outline-offset: 3px;
}

.astra-seo .astra-seo__cta-button:focus-visible {
  outline-color: var(--astra-seo-white);
}

.astra-seo__faq-answer {
  max-width: 720px;
  padding-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--astra-seo-text-muted);
}

/* ==========================================================================
   ≥ 768
   ========================================================================== */
@media (min-width: 768px) {
  .astra-seo {
    --astra-seo-gutter: 40px;
    --astra-seo-sticky-top: 104px;
    padding: 64px 0;
  }

  .astra-seo__container {
    gap: 56px;
  }

  .astra-seo__title {
    font-size: 28px;
    line-height: 1.25;
  }

  .astra-seo__cta {
    padding: 32px;
  }

  .astra-seo .astra-seo__cta-button {
    width: auto;
    align-self: flex-start;
  }

  .astra-seo .astra-seo__cta-phone {
    display: block;
  }

  .astra-seo__links {
    gap: 24px;
  }

  .astra-seo__tags {
    gap: 12px;
  }

  .astra-seo .astra-seo__tag {
    padding: 12px 20px;
    font-size: 16px;
  }

  .astra-seo__tag-count {
    font-size: 14px;
  }

  .astra-seo__faq {
    gap: 16px;
  }

  .astra-seo .astra-seo__faq-question {
    gap: 24px;
    padding: 24px 0;
    font-size: 20px;
  }

  .astra-seo__faq-answer {
    padding-bottom: 24px;
    font-size: 16px;
  }
}

/* ==========================================================================
   ≥ 1280 — текст и CTA в две колонки, текст раскрыт полностью
   ========================================================================== */
@media (min-width: 1280px) {
  .astra-seo {
    --astra-seo-gutter: 56px;
    --astra-seo-sticky-top: 116px;
    padding: 80px 0;
  }

  .astra-seo__container {
    gap: 64px;
  }

  .astra-seo__title {
    font-size: 32px;
  }

  .astra-seo__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    align-items: start;
    gap: 80px;
  }

  .astra-seo__article {
    gap: 20px;
  }

  .astra-seo__text {
    font-size: 16px;
  }

  .astra-seo__text .astra-seo__lead {
    font-size: 18px;
    line-height: 1.6;
  }

  .astra-seo__text h3 {
    margin-top: 32px;
    font-size: 20px;
  }

  .astra-seo__text li::before {
    top: 9px;
  }

  .astra-seo__cta {
    position: sticky;
    top: var(--astra-seo-sticky-top);
    gap: 16px;
  }

  .astra-seo__cta-title {
    font-size: 20px;
  }

  .astra-seo__cta-text {
    font-size: 16px;
  }

  .astra-seo .astra-seo__cta-button {
    width: 100%;
    align-self: stretch;
  }
}

/* ≥ 1440 — контент 1328px по центру, как у контейнера сайта */
@media (min-width: 1440px) {
  .astra-seo__container {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
  }
}
