/* Адаптив: доработки для планшетов и небольших ноутбуков */

/* 960–1199px: пункты меню в шапке не помещаются в одну строку («3D Тур» переносился под «Архитектуру») */
@media (min-width: 960px) and (max-width: 1199px) {
  .t228__list_item {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }
  .t228 .t-menu__link-item {
    font-size: 14px !important;
  }
}

/* Подсказка «листайте» (рука со слайдами) в каруселях — скрыта на всех страницах */
[class*="__scroll-icon-wrapper"] {
  display: none !important;
}

/* Адаптив планшета и телефона (по просьбе). Компьютер (от 960px) эти правила не затрагивают. */

/* Главный экран: текст кнопки «Посмотреть 3D тур» — чёрный, как на компьютере (на телефоне Tilda красила его в белый и он пропадал) */
#allrecords #rec1653111801 .tn-elem[data-elem-id="1756109023072"] .tn-atom .tn-atom__button-text,
#allrecords #rec1653110371 .tn-elem[data-elem-id="1756109023072"] .tn-atom .tn-atom__button-text { color: inherit !important; }

@media (max-width: 959px) {
  /* «Виды отделки»: описание в карточке переносится, а не уходит за край */
  #allrecords #rec1236951396 .hh-fin__descr { white-space: normal !important; right: calc(var(--cw, 416px) * 0.08); }
}

@media (max-width: 639px) {
  /* «Функциональные планировочные решения»: слова не рвутся посередине */
  html body #allrecords #rec1240219136 .t-section__title,
  html body #allrecords #rec1240219136 .t-section__title * { font-size: 22px !important; overflow-wrap: normal !important; word-break: normal !important; }
  /* «Два дизайн-проекта»: текст над кнопкой переносится сам, без принудительного переноса строки */
  .hh-d2__note br { display: none; }
}

/* ===== Адаптив как на компьютере (по просьбе) ===== */

/* Главный экран на планшете/телефоне: бежевая иконка локации перед адресом, как на компьютере */
#allrecords #rec1653111801 .tn-elem[data-elem-id="1755071334963"] .tn-atom::before {
  content: ''; display: inline-block; width: 1em; height: 1em; margin-right: 6px; vertical-align: -0.15em;
  background: url('pin-beige.svg') center / contain no-repeat;
}

/* Карусели: на планшете 2 карточки, на телефоне 1; стрелки по бокам, как на компьютере (положение задаёт arrows.js).
   Пропорции карточек — как на компьютере (высота ≈ 1,44 ширины). */
@media (max-width: 959px) {
  #allrecords .hh-adv__controls,
  #allrecords .hh-infra__controls,
  #allrecords .hh-rev__controls,
  #allrecords #rec1240219136 .t1196__controls,
  #allrecords #rec1236951396 .t1148__controls { display: flex !important; }

  /* ширина карточки: планшет — две в ряд + место под стрелку */
  .hh-infra { --cw: calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2) !important; --ch: calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2 * 1.444) !important; }
  .hh-infra__card { flex-basis: var(--cw) !important; height: var(--ch) !important; }
  .hh-adv { --card: calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2) !important; }
  .hh-adv__card { flex-basis: var(--card) !important; width: var(--card) !important; height: calc(var(--card) * 1.444) !important; }
  #allrecords #rec1236951396 .t1148__img-wrapper { width: calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2) !important; --height: calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2 * 1.444) !important; --mob-height: calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2 * 1.444) !important; }
  #allrecords #rec1236951396 .t1148__item { flex: 0 0 calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2) !important; width: calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2) !important; max-width: none !important; }
  #allrecords #rec1240219136 .t1196__item { flex: 0 0 calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2) !important; width: calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2) !important; max-width: none !important; }
  #allrecords #rec1240219136 .t1196__slider { column-gap: 10px !important; gap: 10px !important; }
  .hh-rev__card { flex: 0 0 calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2) !important; width: calc((100vw - 2 * var(--hh-m, 20px) - 70px) / 2) !important; }

  /* текст «Преимуществ» — те же правила, что на компьютере: масштаб от ширины карточки, переносы внутри карточки */
  #allrecords #rec-hh-adv .hh-adv__card { container-type: inline-size; }
  #allrecords #rec-hh-adv .hh-adv__title { font-size: min(32px, 8.9cqw) !important; white-space: normal !important; right: 8%; }
  #allrecords #rec-hh-adv .hh-adv__body, #allrecords #rec-hh-adv .hh-adv__sub { font-size: min(16px, 4.45cqw) !important; white-space: normal !important; }
  #allrecords #rec-hh-adv .hh-adv__note { right: 8%; }
  #allrecords #rec-hh-adv .hh-adv__body br { display: none; }
  #allrecords #rec-hh-adv .hh-adv__note[style*="top:7"], #allrecords #rec-hh-adv .hh-adv__note[style*="top:8"] { top: auto !important; bottom: 7%; }
  /* «Инфраструктура»: текст тоже от ширины карточки, не больше компьютерного */
  .hh-infra__name { font-size: min(32px, calc(var(--cw) * 0.079)) !important; }
  .hh-infra__descr { font-size: min(16px, calc(var(--cw) * 0.040)) !important; }
}
@media (max-width: 639px) {
  .hh-infra { --cw: calc(100vw - 2 * var(--hh-m, 20px) - 60px) !important; --ch: calc((100vw - 2 * var(--hh-m, 20px) - 60px) * 1.444) !important; }
  .hh-adv { --card: calc(100vw - 2 * var(--hh-m, 20px) - 60px) !important; }
  #allrecords #rec1236951396 .t1148__img-wrapper { width: calc(100vw - 2 * var(--hh-m, 20px) - 60px) !important; --height: calc((100vw - 2 * var(--hh-m, 20px) - 60px) * 1.444) !important; --mob-height: calc((100vw - 2 * var(--hh-m, 20px) - 60px) * 1.444) !important; }
  #allrecords #rec1236951396 .t1148__item { flex: 0 0 calc(100vw - 2 * var(--hh-m, 20px) - 60px) !important; width: calc(100vw - 2 * var(--hh-m, 20px) - 60px) !important; }
  #allrecords #rec1240219136 .t1196__item { flex: 0 0 calc(100vw - 2 * var(--hh-m, 20px) - 60px) !important; width: calc(100vw - 2 * var(--hh-m, 20px) - 60px) !important; }
  .hh-rev__card { flex: 0 0 calc(100vw - 2 * var(--hh-m, 20px) - 60px) !important; width: calc(100vw - 2 * var(--hh-m, 20px) - 60px) !important; }
}

/* ===== Заголовки разделов на планшете и телефоне — одного размера (по просьбе) =====
   Планшет: как сейчас у большинства, 45px в масштабе сетки. Телефон: 7% ширины экрана — так влезает самое длинное слово.
   В Zero-блоках элементы масштабируются (zoom), поэтому там размер делится на масштаб блока, чтобы на экране было одинаково. */
@media (max-width: 959px) {
  :root { --hh-h: calc(45px * var(--hh-s, 1)); }
}
@media (max-width: 639px) {
  :root { --hh-h: 7vw; }
}
@media (max-width: 959px) {
  html body #allrecords .hh-quiet__title,
  html body #allrecords .hh-infra__title,
  html body #allrecords .hh-near__title,
  html body #allrecords .hh-rev__title,
  html body #allrecords #rec1240219136 .t-section__title, html body #allrecords #rec1240219136 .t-section__title *,
  html body #allrecords #rec1653114411 .t-section__title, html body #allrecords #rec1653114411 .t-section__title *,
  html body #allrecords #rec1230593211 .t-section__title, html body #allrecords #rec1230593211 .t-section__title * {
    font-size: var(--hh-h) !important;
  }
  html body #allrecords #rec1218645966 .tn-elem[data-elem-id="1755074858348"] .tn-atom,
  html body #allrecords #rec1235109671 .tn-elem[data-elem-id="1643727934319"] .tn-atom,
  html body #allrecords #rec1231730256 .tn-elem[data-elem-id="1747820997952"] .tn-atom,
  html body #allrecords #rec1236951736 .tn-elem[data-elem-id="1731418159987"] .tn-atom,
  html body #allrecords #rec1235009841 .tn-elem[data-elem-id="1643727934319"] .tn-atom,
  html body #allrecords #rec1235061416 .tn-elem[data-elem-id="1731418159987"] .tn-atom,
  html body #allrecords #rec1233949686 .tn-elem[data-elem-id="1645205551787"] .tn-atom,
  html body #allrecords #rec1218439711 .tn-elem[data-elem-id="1643727934319"] .tn-atom,
  html body #allrecords #rec1218439711 .tn-elem[data-elem-id="1645206113950"] .tn-atom,
  html body #allrecords #rec1232805126 .tn-elem[data-elem-id="1731418159987"] .tn-atom,
  html body #allrecords #rec1218447946 .tn-elem[data-elem-id="1612357441978"] .tn-atom {
    font-size: calc(var(--hh-h) / var(--zoom, 1)) !important;
  }
}

/* «Проекты в портфолио» на телефоне при общем размере заголовков не помещается в одну строку — переносится */
@media (max-width: 639px) { html body #allrecords #rec1218439711 .tn-elem[data-elem-id="1645206113950"] .tn-atom { white-space: normal !important; } }

/* «Документация»: пункты крупнее на планшете и телефоне (на компьютере 22px) */
@media (max-width: 959px) {
  html body #allrecords #rec1232782016 .t585__title { font-size: 20px !important; line-height: 1.3 !important; }
}
@media (max-width: 639px) {
  html body #allrecords #rec1232782016 .t585__title { font-size: 18px !important; }
}

/* Финальный блок «Ваша история начинается здесь»: надпись, облака и птицы масштабируются вместе,
   в тех же пропорциях, что на компьютере (на компьютере размеры не меняются: 48px в масштабе сетки) */
.hh-cta { --cta-fs: calc(48px * var(--hh-s, 1)); }
@media (max-width: 959px) {
  .hh-cta { --cta-fs: min(calc(48px * var(--hh-s, 1)), calc((100vw - 2 * var(--hh-m, 20px)) / 7.6)); }
}
html body .hh-cta__slogan { font-size: var(--cta-fs) !important; }
html body .hh-cta__slogan::before {
  left: calc(var(--cta-fs) * -5.125) !important;
  top: calc(var(--cta-fs) * -2.708) !important;
  width: calc(var(--cta-fs) * 14.56) !important;
}
html body .hh-cta__art { padding-top: calc(var(--cta-fs) * 1.458) !important; }
html body .hh-cta__art::before {
  left: calc(var(--cta-fs) * 1.667) !important;
  top: calc(var(--cta-fs) * -1.98) !important;
  width: calc(var(--cta-fs) * 8.33) !important;
}

/* планшет/телефон: облако над формой не обрезается фоном блока */
@media (max-width: 959px) { html body .hh-cta { position: relative; z-index: 1; top: auto; right: auto; bottom: auto; left: auto; width: auto; } }

/* ===== Поля планшета и телефона: общая колонка по центру (--hh-m задаёт grid.js), как на компьютере ===== */
@media (max-width: 959px) {
  html body .hh-quiet__panel { padding-left: var(--hh-m, 20px) !important; padding-right: var(--hh-m, 20px) !important; }
  html body .hh-cta { padding-left: var(--hh-m, 20px) !important; padding-right: var(--hh-m, 20px) !important; }
  /* стандартные блоки Tilda: у колонок свой отступ 20px, поэтому контейнер отодвигаем на (поле − 20px) */
  html body #allrecords .t-rec:not([data-record-type="396"]):not(#rec2414768161):not(#rec-hh-nearby) :is(.t-container, .t-container_flex, .t942__cover.t-cover__wrapper) {
    max-width: none !important; width: auto !important;
    margin-left: calc(var(--hh-m, 20px) - 20px) !important;
    margin-right: calc(var(--hh-m, 20px) - 20px) !important;
  }
}

/* Главный экран: компьютерная версия с 960px (как у остальных блоков), планшетная — до 959px.
   Раньше переключение было на 980px, и в промежутке 960–979px показывалась раздутая планшетная версия. */
@media (min-width: 960px) {
  html body #rec1653110371.t-rec { display: block !important; }
  html body #rec1653111801.t-rec { display: none !important; }
}
@media (max-width: 959px) {
  /* вложенный контейнер уже стоит на поле — без второго отступа */
  html body #allrecords .t-rec:not([data-record-type="396"]):not(#rec2414768161):not(#rec-hh-nearby) :is(.t-container, .t-container_flex) :is(.t-container, .t-container_flex) {
    margin-left: 0 !important; margin-right: 0 !important;
  }
}
/* главный экран планшета/телефона: на широких экранах фото не во всю ширину — края картинки плавно растворяются в фоне */
@media (max-width: 959px) {
  html body #rec1653111801 .tn-elem[data-elem-id="1764678568461"] .tn-atom {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 7%, #000 93%, transparent 100%);
  }
}
