/* =============================================================================
   responsive.css — адаптивность.
   Точки перелома: 1320 (мобильное меню), 1180, 900 (планшет), 640 (телефон), 380.
   Если меняете 1320, поменяйте и desktopMQ в js/main.js.
   ============================================================================= */

/* Широкие экраны: номер телефона в шапке показываем только при достатке места */
@media (max-width: 1500px) {
  .header-phone__num {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
}

/* --- Мобильное меню --- */
@media (max-width: 1320px) {
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .site-header__actions { margin-left: auto; gap: 4px; }

  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
    display: flex; flex-direction: column; gap: 32px;
    padding: 16px var(--gutter) 40px;
    background: var(--c-primary-deep);
    border-top: 1px solid var(--c-line-dark);
    overflow-y: auto; overscroll-behavior: contain;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
  }
  .is-menu-open .site-nav {
    visibility: visible; opacity: 1; transform: none;
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s;
  }
  .site-nav__list { flex-direction: column; gap: 0; }
  .site-nav__link {
    padding: 14px 0 14px 22px;
    font-family: var(--f-display); font-size: 1.75rem; line-height: 1.2;
    color: var(--c-on-dark); border-bottom: 1px solid var(--c-line-dark);
    white-space: normal;
  }
  .site-nav__link.is-active::after { left: 2px; top: 50%; bottom: auto; transform: translateY(-50%) rotate(45deg); }
  .site-nav__extra { display: grid; gap: 16px; max-width: 420px; }
  .site-nav__phone {
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
    color: var(--c-on-dark); font-size: 1.25rem; font-weight: 500; text-decoration: none;
  }
  .site-nav__phone .icon { color: var(--c-ornament-light); }
}

@media (max-width: 1180px) {
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .advantages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Планшет --- */
@media (max-width: 900px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 28px auto;
    grid-template-areas: "media" "band" "panel";
    min-height: 0;
  }
  .hero__media { aspect-ratio: 4 / 3; max-height: 62vh; min-height: 240px; width: 100%; }
  .hero__band { background-size: 28px 28px; border-inline: 0; border-block: 1px solid rgba(217, 188, 130, 0.35); }
  .hero__panel { padding: 40px var(--gutter) 56px; }
  .hero__content { max-width: 40rem; }
  @keyframes band-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

  .about, .apt, .location, .contacts { grid-template-columns: minmax(0, 1fr); }
  .about__media { max-width: 520px; }
  .gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .floorplans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 28px 0; }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__brand { grid-column: 1 / -1; }
  .lightbox__stage { grid-template-columns: 56px minmax(0, 1fr) 56px; padding-inline: 0; }
}

/* --- Телефон --- */
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  body { font-size: 1rem; }
  .brand__logo { width: 38px; height: 38px; }
  .brand__name { font-size: 1.25rem; }
  .brand__descriptor { display: none; }

  .hero__descriptor { font-size: 1.125rem; margin: 14px 0 24px; }
  .hero__points { margin-bottom: 32px; }
  .hero__actions .btn { flex: 1 1 100%; }

  .section__intro { font-size: 1rem; }
  .advantages { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .chips { gap: 6px; margin-bottom: 24px; }
  .chip { padding-inline: 14px; font-size: 0.875rem; }
  .gallery__zoom, .viewer__zoom { opacity: 1; width: 32px; height: 32px; padding: 7px; right: 8px; bottom: 8px; }

  .tabs { margin-bottom: 28px; }
  .tab { padding-right: 0; margin-right: 24px; }
  .tab__label { font-size: 1.375rem; }
  .viewer__thumbs { gap: 6px; }
  .specs { column-gap: 16px; }
  .apt-actions { flex-direction: column; flex-wrap: nowrap; }
  .apt-actions .btn { width: 100%; }

  .plan-grid, .floorplans { grid-template-columns: minmax(0, 1fr); }
  .report__thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .report__title { font-size: 1.5rem; }

  .contacts__form { margin-inline: calc(var(--gutter) * -0.5); }
  .site-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 40px 28px; }

  /* Лайтбокс: кнопки листания внизу, изображение на всю ширину */
  .lightbox__stage { grid-template-columns: minmax(0, 1fr); padding: 0 0 84px; position: relative; }
  .lightbox__nav { position: absolute; bottom: 16px; }
  .lightbox__nav--prev { left: 20px; }
  .lightbox__nav--next { right: 20px; }
  .lightbox__caption { padding-inline: 16px; }

  .to-top { right: 14px; bottom: 14px; width: 44px; height: 44px; }
}

@media (max-width: 380px) {
  .hero__title { font-size: 2.75rem; }
  .btn { padding-inline: 18px; }
  .tab { margin-right: 18px; }
  .facts { column-gap: 20px; }
  .facts dd { font-size: 1.5rem; }
}

/* --- Уменьшение движения --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
html.reduced-motion { scroll-behavior: auto; }

/* --- Печать --- */
@media print {
  .site-header, .to-top, .hero__controls, .hero__band, .site-footer__band, .modal, .lightbox, .contacts__form { display: none !important; }
  main { padding-top: 0; }
  .section, .hero { background: #FFFFFF !important; color: #000000 !important; }
  .js-reveal .reveal { opacity: 1 !important; transform: none !important; }
}
