/* Правки по замечаниям владельца, 08.11.2026. Отдельный лист, потому что
   deco-selected-head.css — собранный бандл; здесь видно, что именно изменено. */

/* 1. Между «О доме» и «Мнение эксперта» не было воздуха: карточка эксперта
   начиналась в 27 px от края экрана при заголовке в 45 px. Колонка текста
   внутри и так скроллится, поэтому отступ ничего не обрезает. */
/* Селектор повторяет тот, что сейчас выигрывает в бандле
   (body[data-detail-selected] #expert .exv-card, 18–38 px).
   45 px — ровно столько было в исходной вёрстке владельца: воздух есть,
   а заголовок остаётся у начала блока, а не уезжает вниз. */
body[data-detail-selected] #expert .exv-card {
  padding-block: clamp(26px, 5svh, 45px);
}

/* 2. Рубрика материала («Форматы», «Районы») на странице проекта не нужна —
   то же правило, что в витрине домов: рубрика и номер не выводятся. */
#articles .arx-cat {
  display: none;
}

/* 3. «Похожие проекты» занимали 990 px при экране 900 и срезали кнопку под
   лентой. Блок — ровно один экран, но фотография остаётся видной: высоту
   собирают поля блока (70 → 28 px) и строки цен (40 → 32 px), а не снимок.
   Только десктопная лента: на телефоне раскладка карточек другая. */
@media (min-width: 761px) {
  #related {
    /* 297 px — закреплённая шапка страницы, шапка блока, фильтры и строка
       кнопок под лентой: ровно то, что занимает экран помимо карточек.
       460 px — карточка целиком (фото 220 + текст 249); ниже этого на коротких
       экранах блок выходит за экран, но ничего не срезает. */
    --related-rail: max(460px, min(715px, 100svh - 297px));
  }

  /* Поля блока отданы фотографии; селектор и !important — чтобы перебить
     body[data-card-variant] #related { padding: 70px !important } из бандла. */
  body[data-card-variant] #related {
    padding-top: 28px !important;
    padding-bottom: 28px !important;
  }

  #related .sh,
  #related .filters-row {
    margin-bottom: 12px;
  }

  #related .projects {
    height: auto;
    min-height: var(--related-rail);
  }

  /* Reserve room for the facts, starting price and action below the photo. */
  body[data-card-choice][data-card-directions][data-card-overlay] #related .rcard .cc-media {
    height: max(200px, calc(var(--related-rail) - 200px)) !important;
  }

  #related .rcard .cc-media img {
    height: 100%;
    object-fit: cover;
  }

  /* Карточка сужается вместе с фотографией, иначе снимок становится полосой. */
  #related .rcard {
    width: clamp(280px, calc(var(--related-rail) * .68), 421px);
  }
}

/* All cards share the natural height of the tallest card in the rail. */
body[data-detail-selected] #related .projects {
  align-items: stretch;
  overflow-y: hidden;
}

body[data-detail-selected] #related .cc-copy {
  flex: 1 0 auto;
}

body[data-detail-selected][data-card-directions][data-card-overlay] #related .cc-media::after {
  background: linear-gradient(180deg, transparent 55%, #080808d9 100%);
}

body[data-detail-selected] #related .co-caption {
  padding: 20px 18px 14px;
}

body[data-detail-selected][data-card-directions][data-card-overlay] #related .cc-copy > .cc-location {
  margin-bottom: 6px;
}

body[data-detail-selected][data-card-directions][data-card-overlay] #related .cc-copy > .cc-metro {
  margin-bottom: 12px !important;
}

body[data-detail-selected] #related .cc-price-line {
  margin: 4px 0 18px;
}

html[data-deco-theme="light"] body[data-detail-selected] #related .cc-price {
  color: var(--deco-ink) !important;
}

html[data-deco-theme="light"] body[data-detail-selected] #related .cc-price small {
  color: var(--deco-muted);
}

body[data-detail-selected] #related .cc-offers > span {
  min-width: 0;
  padding-block: 4px;
  line-height: 1.2;
}

body[data-detail-selected] #related .cc-offers:focus-visible {
  outline-offset: -2px;
}

body[data-detail-selected][data-card-choice] #related .cc-offers > svg {
  align-self: stretch;
  height: auto !important;
}

/* The name is the only copy over the photograph. */
body[data-card-choice][data-card-directions][data-card-overlay] #related .cc-card h3,
body[data-card-choice][data-card-directions][data-card-overlay] #related .cc-card h3 a {
  font-size: clamp(24px, 2vw, 34px) !important;
  line-height: 1.2 !important;
}

body[data-card-choice][data-card-directions][data-card-overlay] #related .co-caption h3 {
  margin: 0 !important;
}

/* Плашка класса («Бизнес+», «Премиум») на странице проекта лишняя. */
body[data-card-choice][data-card-directions][data-card-overlay] #related .cc-class {
  display: none !important;
}

/* Keep reading and photography in their shared row. Low landscape windows use document flow. */
@media (min-width: 1000px) {
  body[data-detail-selected] .about-v {
    height: auto;
    min-height: var(--deco-panel-height);
    grid-template-rows: auto auto minmax(min-content, 1fr) auto;
  }
  body[data-detail-selected] .about-v .av-photo { min-height: clamp(220px, 38svh, 360px); }
  body[data-detail-selected] .about-v .av-open { height: 100%; }
  body[data-detail-selected] .about-v :is(.av-open, .av-thumb) > img {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    object-fit: cover;
  }
}

@media (min-width: 1000px) and (min-height: 680px) {
  body[data-detail-selected] .about-v {
    max-height: var(--deco-panel-height);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  body[data-detail-selected] .about-v .av-photo { min-height: 0; }
  body[data-detail-selected] .about-v .av-panels { overflow-y: auto; }
}

/* Keep the reference sizes through 1440px, with bounded growth on larger windows. */
:root {
  --deco-wide: max(0px, calc(100vw - 1440px));
  --lab-font-px: clamp(1px, calc(1px + (100vw - 1440px) / 4800), 1.18px);
  --lab-type-grow: clamp(0px, calc((100vw - 1440px) / 1000), 1px);
}

body[data-detail-selected] {
  --deco-panel-height: min(1000px, calc(100svh - var(--lab-head, 0px)));
}

body[data-detail-selected] #about .av-passport {
  row-gap: 18px;
  padding-top: 20px;
}

body[data-detail-selected] #about .av-passport dd {
  font-size: clamp(18px, 5vw, 24px) !important;
  overflow-wrap: anywhere;
}

body[data-detail-selected] #about .av-passport dt {
  font-size: clamp(14px, .82vw, 18px);
}

@media (min-width: 761px) {
  body[data-detail-selected] #about .av-passport dd {
    font-size: min(34px, calc(24px + var(--deco-wide) / 112)) !important;
  }
}

@media (min-width: 761px) and (max-width: 1199px) {
  body[data-detail-selected] #about .av-passport {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-detail-selected] #about .av-passport div + div {
    border-inline-start: 0;
    padding-inline-start: 0;
  }
}

@media (min-width: 1000px) {
  :root {
    --type-copy: min(24px, calc(18px + var(--deco-wide) / 217));
  }

  body[data-detail-selected] #expert .exv-stage,
  body[data-detail-selected] #articles.arx {
    height: var(--deco-panel-height);
  }

  body[data-detail-selected] #articles.arx {
    min-height: min(640px, var(--deco-panel-height));
  }
}

@media (min-width: 761px) {
  body[data-detail-selected] #expert :is(.exv-lead, .exv-body p) {
    font-size: min(24px, calc(var(--type-copy) + 1px));
    line-height: 1.55;
  }
}

@media (min-width: 1440px) {
  body[data-detail-selected] .lab-header .lhd-sections a,
  body[data-detail-selected] #genplan .house-pin {
    font-size: clamp(15px, .74vw, 18px);
  }

  body[data-detail-selected] #location .location-heading p {
    font-size: clamp(16px, .8vw, 19px);
  }
}

/* 8. Генплан был во всё окно (900 px), а шапка закреплена поверх — нижние
   116 px кадра не было видно. Снимок с object-fit: cover, поэтому ничего
   не теряется. */
/* Только десктоп: на телефоне (<=760 px) блок — обычная колонка
   «заголовок + снимок 520 px», и высота в экран ломала её. */
@media (min-width: 761px) {
  body[data-detail-selected] #genplan.master-section {
    height: calc(100svh - var(--lab-head, 0px));
    min-height: 0;
  }
}

/* The compact actions share a baseline. Only the section jump keeps an icon. */
body[data-detail-selected] #hero .v7-actions {
  --hero-action-height: 46px;
  grid-template-columns: auto auto;
  gap: 12px;
  justify-content: end;
}
body[data-detail-selected] #hero .v7-actions > :is(.v7-pdf, .v7-cta) {
  box-sizing: border-box;
  min-height: var(--hero-action-height) !important;
  height: var(--hero-action-height);
  line-height: 1.2;
}
body[data-detail-selected] #hero .v7-actions .v7-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 242, 237, .06);
  border: 1px solid rgba(245, 242, 237, .4);
}
body[data-detail-selected] #hero .v7-actions .v7-pdf > svg { display: none; }
body[data-detail-selected] #hero .v7-actions .v7-cta.ds-split-action {
  --split-size: var(--hero-action-height);
}
body[data-detail-selected] #hero .v7-actions .v7-cta > span {
  justify-content: center;
  padding: 0 12px;
  text-align: center;
}

/* 10. Генплан: сам блок уже был в экран, но снимок внутри оставался 100svh
   и вылезал на 116 px под следующий блок — это и выглядело как «экран
   с хвостом». object-fit: cover, кадр подрезается сверху и снизу поровну;
   надпись «Генплан» уменьшена с 45 до 34 px. */
/* На телефоне заголовок лежит в потоке над снимком, поэтому снимок в экран
   вылезал из блока на «Расположение на карте» — правила только для десктопа. */
@media (min-width: 761px) {
  body[data-detail-selected] #genplan.master-section :is(.master-image, .master-image img) {
    height: calc(100svh - var(--lab-head, 0px));
  }
  body[data-detail-selected] #genplan.master-section .master-heading h2 { font-size: 34px; }

  /* Генплан стоял вплотную к «Мнению эксперта» — единственный стык на странице
     без воздуха. 72 px — тот же зазор, что уже стоит между генпланом
     и «Расположением» и между «Расположением» и планировками. */
  body[data-detail-selected] #genplan.master-section { margin-top: 72px; }
}

/* 11. «Расположение»: на карту оставалось 595 px из 900 — остальное съедали
   поля блока, отступ под заголовком и боковые поля 4,45vw. Блок и так ровно
   в один экран, поэтому высоту карте отдаёт обвязка: поля 44 → 20 px,
   зазор 24 → 16 px, отступ под заголовком убран (карта 595 → 679 px).
   Ширина не меняется — боковые поля 4,45vw у блока как были. */
@media (min-width: 1000px) {
  body[data-detail-selected] #location {
    padding-block: 20px;
    gap: 16px;
  }
  body[data-detail-selected] #location .location-heading { margin-bottom: 0; }
}

/* Selected viewing artwork already has a dark center for the copy. */
body[data-detail-selected] #viewing.buy5-visit::before { content: none; }
body[data-detail-selected] #viewing .bordeaux-viewing-photo { object-position: center; }
body[data-detail-selected] #viewing .bordeaux-viewing-photo-right { display: none; }
body[data-detail-selected] #viewing .bordeaux-viewing-copy { text-align: center; }

@media (max-width: 760px) {
  body[data-detail-selected] #viewing.buy5-visit { display: grid; min-height: 300px; }
  body[data-detail-selected] #viewing .bordeaux-viewing-photo {
    position: absolute;
    inset: 0 auto 0 0;
    z-index: -1;
    width: 42%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
    mask-image: linear-gradient(to right, #000, transparent 68%);
    opacity: .75;
  }
  body[data-detail-selected] #viewing .bordeaux-viewing-photo-right {
    display: block;
    inset: 0 0 0 auto;
    object-position: right center;
    mask-image: linear-gradient(to left, #000, transparent 68%);
  }
  body[data-detail-selected] #viewing .bordeaux-viewing-copy { width: min(88%, 520px); padding-inline: 6px; }
}

/* Keep the photos lazy through the existing section observer. */
#purchase .buy5-tile {
  background-color: #141310;
  border: 1px solid #38352f;
  color: #f5f2ed;
}

#purchase .buy5-tile:nth-child(1 of .buy5-tile) { --offer-image: url("assets/consultation-daylight/installment-payment-schedule.png"); }
#purchase .buy5-tile:nth-child(2 of .buy5-tile) { --offer-image: url("assets/consultation-daylight/mortgage.png"); }
#purchase .buy5-tile:nth-child(3 of .buy5-tile) { --offer-image: url("assets/neutral-20261109/form-3.webp"); }
#purchase .buy5-tile:nth-child(4 of .buy5-tile) { --offer-image: url("assets/consultation-daylight/full-payment.png"); }

#purchase[data-media-ready] .buy5-tile {
  background-image: linear-gradient(180deg, #100d0bd9, #100d0b82 60%, #100d0bd6), var(--offer-image);
  background-position: center 62%;
  background-size: cover;
}

#purchase .ds-buy-foot .cta { justify-content: space-between; gap: 20px; background: var(--atlas-red) !important; color: #fff !important; }
#purchase .ds-buy-foot .cta > svg { display: block; width: 24px; height: 24px; flex: none; background: none; padding: 0; }

#purchase .buy5-tile:is(:hover, :focus-visible) { border-color: var(--atlas-sand); }

/* 13. Статьи: заголовок главной карточки стоял в 12 px под фотографией
   и читался как подпись к ней. Отступ 30 px, кегль 25,6 → 32 px.
   Селектор тот же, которым бандл отличает главную карточку от трёх
   маленьких ([style*="--v:1"]); высоту отдаёт сама фотография (minmax(0,1fr)
   в первой строке сетки), поэтому блок остаётся ровно в один экран. */
#articles .arx-card[style*="--v:1"] h3 {
  margin-top: 30px;
  /* !important — кегль карточки задан через шкалу lab-typography с !important. */
  font-size: 32px !important;
}

body[data-detail-selected] #hero .lab-hero[data-v="7"] .lh-photo[data-primary-photo] {
  object-position: 36% top;
  filter: brightness(.88) contrast(.94) saturate(.94);
}



.deco-gold-rule {
  height: 1px;
  margin: clamp(20px, 3svh, 40px) clamp(12px, 2.5vw, 48px);
  background: linear-gradient(90deg, transparent, var(--atlas-sand, #c9ad7c) 12% 88%, transparent);
  opacity: .72;
}

@media (min-width: 761px) and (min-height: 601px) and (max-height: 880px) {
  #location[data-map-installed] .location-categories { padding: 10px; }
  #location[data-map-installed] .location-categories > button { min-height: 34px; }
  #location[data-map-installed] .location-categories .lab-place { padding-block: 5px; }
  #location[data-map-installed] .location-categories .lab-places { padding-bottom: 4px; }
  #location[data-map-installed] .location-yandex { padding-top: 8px; }
}



@media (min-width: 761px) and (min-height: 601px) and (max-height: 750px) {
  #location[data-map-installed] .location-categories { padding-block: 8px; }
  #location[data-map-installed] .location-categories > button { min-height: 31px; }
  #location[data-map-installed] .location-categories [data-map-category="all"] { margin-bottom: 4px; }
  #location[data-map-installed] .location-yandex { padding-top: 5px; }
}

/* About fills the available screen and grows with its text. */
@media (min-width: 1000px) {
  body[data-detail-selected] #about .about-v {
    height: auto;
    min-height: calc(100svh - var(--lab-head, 0px));
    max-height: none;
  }

  body[data-detail-selected] #about .about-v {
    grid-template-rows: auto auto minmax(min-content, 1fr) auto;
  }

  body[data-detail-selected] #about .av-panels {
    overflow: visible;
    max-height: none;
    mask-image: none;
    scrollbar-gutter: auto;
  }
}

@media (min-width: 761px) and (max-height: 679px) {
  body[data-detail-selected] #about .about-v { min-height: 0; }
}

/* Deco: the portrait and card stay in one screen; only the opinion scrolls. */
@media (min-width: 761px) and (min-height: 601px) {
  body[data-detail-selected] #expert .exv-stage {
    height: calc(100svh - var(--lab-head, 0px));
    min-height: 0;
  }

  body[data-detail-selected] #expert .exv-photo {
    height: 100%;
    min-height: 0;
  }

  body[data-detail-selected] #expert .exv-scroll {
    flex: 1;
    min-height: 0;
    overflow: hidden auto;
    scrollbar-gutter: stable;
    scrollbar-color: var(--atlas-sand, #c9ad7c) transparent;
  }
}

@media (min-width: 761px) and (max-height: 600px) {
  body[data-detail-selected] #expert .exv-stage {
    height: auto;
    min-height: 0;
  }

  body[data-detail-selected] #expert .exv-scroll {
    overflow: visible;
    scrollbar-gutter: auto;
  }
}
