/* Раздел «Новостройки», версия-галерея. Цвета и шрифты из брендбука 17.09.2026 */

/* ── шапка раздела ── */
.gtop { padding-block: 12px 12px; }
.gtop__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 4vw, 56px); align-items: end; margin-top: 8px; }
.gtop .display { font-size: clamp(25px, 2.7vw, 37px); max-width: none; margin: 2px 0 0; }
.gtop__aside { display: grid; gap: 10px; padding-bottom: 4px; }
.gtop .lead { margin: 0; max-width: 62ch; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }

.gstat { display: flex; flex-wrap: wrap; gap: 8px 30px; margin: 0; }
.gstat div { display: grid; gap: 2px; }
.gstat dt { order: 2; font-size: 12.5px; color: var(--muted); }
.gstat dd { order: 1; margin: 0; font: 800 clamp(20px, 2vw, 26px)/1 var(--font-display); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.gstat dd small { font: 500 13px/1 var(--font-body); color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.gstat .is-free dd { color: var(--green); }

/* низкий экран (ноутбуки 720-800): убираем всё, что не даёт галерее влезть */
@media (min-width: 641px) and (max-height: 820px) {
  .gtop { padding-block: 8px 8px; }
  .gtop .crumbs, .gtop .lead { display: none; }
  .gtop__grid { margin-top: 0; align-items: center; }
  .gtop .display { font-size: clamp(23px, 2.1vw, 30px); }
  .gtop .eyebrow { margin-bottom: 2px; }
  .gstat dd { font-size: 22px; }
}

/* ── липкая полоса фильтров ── */
.gbar { position: sticky; top: var(--header-h); z-index: 30; background: rgba(247,246,243,.92); backdrop-filter: blur(10px); border-block: 1px solid var(--line); }
.gbar__in { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-block: 9px; }
.gbar__f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.gbar__r { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.seg--sm button { padding: 9px 13px; min-height: 34px; font-size: 13px; line-height: 1; }

.gsel { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--card); cursor: pointer; }
.gsel:hover { border-color: var(--ink-2); }
.gsel:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18,19,26,.1); }
.gsel > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.gsel select { appearance: none; height: 100%; border: 0; background: transparent; font: 650 14px/1 var(--font-body); color: var(--ink); cursor: pointer; padding-right: 16px; max-width: 170px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: right 6px top 50%, right 1px top 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.gsel select:focus { outline: none; }
.gsel-reset { height: 38px; padding: 0 14px; border: 1px dashed var(--line-2); border-radius: var(--r-pill); background: none; font: 600 13px/1 var(--font-body); color: var(--amber-text); cursor: pointer; }
.gsel-reset:hover { border-color: var(--amber); background: var(--amber-soft); }

@media (max-width: 1160px) {
  .gbar__in { flex-direction: column; align-items: stretch; gap: 8px; }
  .gbar__r { justify-content: space-between; }
  .gbar { position: static; }
}
@media (max-width: 720px) {
  .gbar__f { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 2px; }
  .gbar__f::-webkit-scrollbar { display: none; }
  .gsel { flex: 0 0 auto; }
  .gbar__r { flex-wrap: wrap; gap: 8px; }
  .gbar__r .seg { overflow-x: auto; }
}

/* ── мозаика: на десктопе помещается в экран целиком ── */
.sec--gal { padding-block: 14px clamp(24px, 4vw, 48px); }
.mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: minmax(150px, 1fr); gap: 14px; }

.tile { position: relative; grid-column: span 4; border-radius: var(--r-xl); overflow: hidden; background: var(--ink); isolation: isolate; box-shadow: var(--sh-1); }

/* десктоп: две полосы, высота считается от окна, раскладка зависит от числа карточек */
@media (min-width: 1101px) {
  .mosaic { height: clamp(420px, calc(100vh - 274px), 780px); grid-template-rows: 1.45fr 1fr; }
  .mosaic.is-n1 .tile:nth-child(1) { grid-column: span 12; grid-row: 1 / -1; }
  .mosaic.is-n2 .tile { grid-row: 1 / -1; }
  .mosaic.is-n2 .tile:nth-child(1) { grid-column: span 7; }
  .mosaic.is-n2 .tile:nth-child(2) { grid-column: span 5; }
  .mosaic.is-n3 .tile:nth-child(1) { grid-column: span 7; }
  .mosaic.is-n3 .tile:nth-child(2) { grid-column: span 5; }
  .mosaic.is-n3 .tile:nth-child(3) { grid-column: span 12; }
  .mosaic.is-n4 .tile:nth-child(1) { grid-column: span 7; }
  .mosaic.is-n4 .tile:nth-child(2) { grid-column: span 5; }
  .mosaic.is-n4 .tile:nth-child(3), .mosaic.is-n4 .tile:nth-child(4) { grid-column: span 6; }
  .mosaic.is-n5 .tile:nth-child(1) { grid-column: span 7; }
  .mosaic.is-n5 .tile:nth-child(2) { grid-column: span 5; }
  .mosaic.is-n6 { height: auto; grid-template-rows: none; grid-auto-rows: minmax(150px, 30vh); }
  .mosaic.is-n6 .tile:nth-child(1) { grid-column: span 7; }
  .mosaic.is-n6 .tile:nth-child(2) { grid-column: span 5; }
}

.tile__media { position: absolute; inset: 0; }
.tile__media img, .tile__media video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease), opacity .5s linear; }
.tile__media video { position: absolute; inset: 0; opacity: 0; }
.tile.is-playing .tile__media video { opacity: 1; }
.tile:hover .tile__media img { transform: scale(1.045); }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,19,26,.45) 0%, rgba(18,19,26,0) 28%, rgba(18,19,26,.16) 46%, rgba(18,19,26,.62) 70%, rgba(18,19,26,.93) 100%); pointer-events: none; }

.tile__open { position: absolute; inset: 0; z-index: 3; border: 0; background: none; cursor: pointer; font: inherit; color: transparent; text-decoration: none; }
.tile__open:focus-visible { outline: 3px solid var(--amber); outline-offset: -3px; border-radius: inherit; }

.tile__tags { position: absolute; z-index: 4; top: 14px; left: 14px; max-width: calc(100% - 150px); display: flex; gap: 6px; flex-wrap: wrap; pointer-events: none; }
.tag { font: 700 11.5px/1 var(--font-body); letter-spacing: .04em; text-transform: uppercase; padding: 6px 10px; border-radius: var(--r-pill); background: rgba(255,255,255,.92); color: var(--ink); }
.tag--amber { background: var(--amber); color: var(--on-amber); }
.tag--done { background: rgba(18,19,26,.72); color: #fff; backdrop-filter: blur(6px); }

.tile__note { position: absolute; z-index: 5; top: 14px; right: 14px; font: 600 12px/1 var(--font-body); color: rgba(255,255,255,.88);
  background: rgba(18,19,26,.45); backdrop-filter: blur(6px); padding: 7px 11px; border-radius: var(--r-pill);
  border: 1px solid rgba(255,255,255,.16); cursor: zoom-in; transition: background .2s var(--ease), color .2s var(--ease); }
.tile__note:hover, .tile__note:focus-visible { background: rgba(255,255,255,.94); color: var(--ink); }

.tile__meta { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; padding: 16px 18px 14px; color: #fff; pointer-events: none; display: grid; gap: 5px; transition: transform .3s var(--ease); }
.tile__place { margin: 0; font-size: 12.5px; color: rgba(255,255,255,.78); text-shadow: 0 1px 8px rgba(18,19,26,.5); }
.tile__name { margin: 0; font: 800 clamp(19px, 1.7vw, 26px)/1.05 var(--font-display); letter-spacing: -.035em; text-shadow: 0 2px 18px rgba(18,19,26,.45); }
.mosaic .tile:first-child .tile__name { font-size: clamp(26px, 3vw, 42px); }
.tile__line { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 13.5px; color: rgba(255,255,255,.85); text-shadow: 0 1px 8px rgba(18,19,26,.5); }
.tile__price { font: 700 15.5px/1.2 var(--font-body); color: #fff; font-variant-numeric: tabular-nums; }
.mosaic .tile:first-child .tile__price { font-size: 19px; }
.tile__free { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: #8FE3BF; }
.tile__free i { width: 7px; height: 7px; border-radius: 50%; background: #2ED08C; }

.tile__cta { position: absolute; z-index: 5; left: 18px; right: 18px; bottom: 16px; display: flex; gap: 8px; align-items: center; opacity: 0; transform: translateY(8px); transition: opacity .25s var(--ease), transform .3s var(--ease); }
.tile:hover .tile__meta, .tile:focus-within .tile__meta { transform: translateY(-44px); }
.tile:hover .tile__cta, .tile:focus-within .tile__cta { opacity: 1; transform: translateY(0); }
@media (hover: none) {
  .tile__cta { opacity: 1; transform: none; }
  .tile:hover .tile__meta { transform: none; }
  .tile__meta { padding-bottom: 56px; }
}

/* невысокая плитка: короткая подпись, чтобы осталась картинка */
.tile.is-compact .tile__meta { gap: 3px; padding: 12px 14px 12px; }
.tile.is-compact .tile__place { font-size: 12px; }
.tile.is-compact .tile__name { font-size: clamp(18px, 1.5vw, 22px); }
.tile.is-compact .tile__line { font-size: 13px; gap: 3px 10px; }
.tile.is-compact .t-pay { display: none; }
.tile.is-compact .tile__cta { bottom: 12px; }
.tile.is-compact:hover .tile__meta, .tile.is-compact:focus-within .tile__meta { transform: translateY(-40px); }
.tile.is-tiny .tile__place { display: none; }
.tile.is-tiny .tile__meta { gap: 2px; padding: 10px 14px 10px; }
.tile.is-tiny .tile__name { font-size: 19px; }
.tile.is-tiny .tile__line { font-size: 12.5px; }

/* планшет: первая карточка во всю ширину, дальше по две в ряд */
@media (max-width: 1100px) and (min-width: 641px) {
  .mosaic { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(150px, 1fr); }
  .mosaic .tile { grid-column: span 3; grid-row: auto; }
  .mosaic .tile:nth-child(1) { grid-column: span 6; }
  .mosaic.is-n2 .tile:nth-child(2), .mosaic.is-n4 .tile:nth-child(4), .mosaic.is-n6 .tile:nth-child(6) { grid-column: span 6; }
  .mosaic.is-flow { height: auto; grid-auto-rows: auto; }
  .mosaic.is-flow .tile { aspect-ratio: 4 / 3; }
  .mosaic.is-flow .tile:nth-child(1) { aspect-ratio: 16 / 9; }
}
/* телефон */
@media (max-width: 640px) {
  .gtop__grid { grid-template-columns: 1fr; align-items: start; }
  .mosaic { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 12px; }
  .mosaic .tile { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 4 / 3; }
  .mosaic .tile:nth-child(1) { aspect-ratio: 4 / 5; }
  .tile__meta { padding: 14px 14px 12px; }
  .tag--class { display: none; }
  .tile__tags { max-width: calc(100% - 130px); }
}

/* ── просмотрщик ── */
.viewer { position: fixed; inset: 0; z-index: 90; background: #0D0E13; color: #fff; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer[hidden] { display: none; }
.viewer__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(14px, 3vw, 28px); border-bottom: 1px solid rgba(255,255,255,.1); }
.viewer__title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.viewer__title b { font: 800 clamp(18px, 2vw, 24px)/1.1 var(--font-display); letter-spacing: -.03em; }
.viewer__title span { font-size: 13px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer__tools { display: flex; align-items: center; gap: 14px; }
.viewer__count { font: 600 13px/1 var(--font-body); color: rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.viewer__x { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: none; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.viewer__x:hover { background: rgba(255,255,255,.1); }

.viewer__body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.viewer__stage { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 16px clamp(14px, 3vw, 28px) 10px; min-height: 0; }
.viewer__frame { position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }
.viewer__frame img, .viewer__frame video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r); background: #000; }
.viewer__cap { margin: 10px 0 0; font-size: 13.5px; color: rgba(255,255,255,.66); text-align: center; min-height: 2.6em; }
.viewer__arr { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18); background: rgba(13,14,19,.55); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; backdrop-filter: blur(6px); }
.viewer__arr:hover { background: rgba(255,255,255,.16); }
.viewer__arr--prev { left: 10px; }
.viewer__arr--next { right: 10px; }

.viewer__side { border-left: 1px solid rgba(255,255,255,.1); padding: 18px clamp(14px, 2vw, 22px); overflow-y: auto; display: grid; align-content: start; gap: 16px; }
.vfacts { display: grid; gap: 12px; margin: 0; }
.vfacts div { display: grid; gap: 2px; }
.vfacts dt { font-size: 12px; color: rgba(255,255,255,.55); }
.vfacts dd { margin: 0; font: 700 16px/1.3 var(--font-body); font-variant-numeric: tabular-nums; }
.vfacts .is-free dd { color: #8FE3BF; }
.vfeat { display: flex; flex-wrap: wrap; gap: 6px; }
.vfeat span { font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); }
.vnote { margin: 0; font-size: 12.5px; color: rgba(255,255,255,.5); }
.vcta { display: grid; gap: 8px; }
.vcta .btn--line { background: transparent; border-color: rgba(255,255,255,.34); color: #fff; }
.vcta .btn--line:hover { background: rgba(255,255,255,.12); }

.viewer__strip { display: flex; gap: 8px; padding: 10px clamp(14px, 3vw, 28px) 16px; overflow-x: auto; border-top: 1px solid rgba(255,255,255,.1); }
.viewer__strip button { flex: 0 0 auto; width: 104px; height: 64px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; opacity: .5; transition: opacity .2s linear; background: #000; position: relative; }
.viewer__strip button img { width: 100%; height: 100%; object-fit: cover; }
.viewer__strip button.is-on { opacity: 1; box-shadow: 0 0 0 2px #fff; }
.viewer__strip button:hover { opacity: .85; }
.viewer__strip .is-film::after { content: "\25B6"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; color: #fff; background: rgba(13,14,19,.45); }

@media (max-width: 960px) {
  .viewer__body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .viewer__side { border-left: 0; border-top: 1px solid rgba(255,255,255,.1); max-height: 38vh; }
  .vfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .viewer__strip button { width: 78px; height: 50px; }
  .viewer__arr { width: 38px; height: 38px; font-size: 22px; }
}

/* переключатель языка */
.lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--paper-2); }
.lang button { border: 0; background: none; border-radius: var(--r-pill); padding: 6px 10px; font: 700 12px/1 var(--font-body); color: var(--muted); cursor: pointer; min-height: 30px; }
.lang button:hover { color: var(--ink); }
.lang button.is-on { background: var(--ink); color: #fff; }
@media (max-width: 900px) { .lang { order: 3; } }


/* ── контакты: док, строка действий, шапка, подвал ── */
.dock { position: fixed; right: 18px; bottom: 18px; z-index: 55; display: grid; gap: 8px; }
.dock__b { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 46px; padding: 0 14px; border-radius: var(--r-pill); text-decoration: none;
  font: 700 13px/1 var(--font-body); box-shadow: var(--sh-2); border: 1px solid transparent; transition: transform .2s var(--ease); }
.dock__b:hover { transform: translateY(-2px); }
.dock__b--wa { background: #25D366; color: #08301a; }
.dock__b--tg { background: #229ED9; color: #fff; }
.dock__b--tel { background: var(--card); color: var(--ink); border-color: var(--line-2); }
.dock__b--lead { background: var(--amber); color: var(--on-amber); }
@media (max-width: 860px) {
  .dock { right: 0; left: 0; bottom: 0; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; padding: 8px; background: rgba(247,246,243,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .dock__b { height: 44px; border-radius: var(--r); box-shadow: none; margin: 0 3px; }
  body { padding-bottom: 64px; }
}
.cta-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 20px; padding: 16px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); background: var(--card); }
.cta-row b { display: block; font: 700 16px/1.25 var(--font-display); letter-spacing: -.01em; }
.cta-row span { font-size: 14px; color: var(--muted); }
.cta-row__b { display: flex; gap: 8px; flex-wrap: wrap; }
.c-soon { display: block; margin-top: 6px; font-size: 12.5px; color: var(--amber-text); }
.hdr__contacts { display: inline-flex; align-items: center; gap: 8px; }
.hdr__tel { font: 700 14px/1 var(--font-body); color: var(--ink); text-decoration: none; white-space: nowrap; }
.hdr__ic { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font: 700 11px/1 var(--font-body); text-decoration: none; }
.hdr__ic--wa { background: #25D366; color: #08301a; }
.hdr__ic--tg { background: #229ED9; color: #fff; }
@media (max-width: 900px) { .hdr__contacts .hdr__tel { display: none; } }
.foot__c { display: grid; gap: 6px; margin-bottom: 16px; }
.foot__c b { font: 700 18px/1.2 var(--font-display); color: #fff; }
.foot__c span { font-size: 13.5px; color: var(--on-dark-2); }
.foot__b { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.foot__b .btn--line { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.foot__b .btn--line:hover { background: rgba(255,255,255,.12); }

/* на телефоне в шапке остаётся главное: язык и мессенджеры, заявка — в нижней панели */
@media (max-width: 640px) {
  .hdr__in { flex-wrap: wrap; row-gap: 6px; }
  .hdr__cta { display: none; }
  .lang { order: 2; margin-left: auto; }
  .hdr__contacts { order: 3; }
  .hdr__city { order: 4; }
}
