/* ============================================================
   style.css — Retro autumn / warm editorial real estate landing
   ============================================================ */

:root {
  --olive:  #585123;
  --sand:   #eec170;
  --apricot:#f2a65a;
  --orange: #f58549;
  --brown:  #772f1a;
  --neon:   #ff3c00;

  --bg:     #fff8ef;
  --text:   #261c15;
  --card:   #ffffff;
  --muted:  #7b6b5b;
  --border: rgba(88, 81, 35, 0.18);
  --shadow: 0 10px 30px rgba(119, 47, 26, 0.10);

  --radius: 16px;
  --maxw: 1120px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
}

[data-theme="dark"] {
  --bg:     #1f1712;
  --text:   #fff3e4;
  --card:   #2b211a;
  --muted:  #d3bfa8;
  --border: rgba(238, 193, 112, 0.18);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

/* Атрибут hidden всегда скрывает элемент, даже если ниже задан display:flex/grid */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--brown); }
[data-theme="dark"] a { color: var(--sand); }

h1, h2, h3 { font-family: var(--serif); line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin: 0 0 .6em; }
h3 { font-size: 1.2rem; margin: 0 0 .4em; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: color-mix(in srgb, var(--sand) 16%, var(--bg)); }
[data-theme="dark"] .section-alt { background: color-mix(in srgb, var(--olive) 22%, var(--bg)); }

.lead { font-size: 1.12rem; color: var(--text); max-width: 62ch; }
.muted { color: var(--muted); }
.highlight { color: var(--orange); font-weight: 700; }
.pdf-photo { display: none; }  /* показывается только в PDF (печати) */
.eyebrow {
  text-transform: uppercase; letter-spacing: .16em; font-size: .72rem;
  font-weight: 700; color: var(--orange); margin: 0 0 .6em;
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 20px; max-width: var(--maxw); margin: 0 auto;
}
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.brand span { display: block; font-size: .72rem; font-family: var(--font); font-weight: 500; color: var(--muted); letter-spacing: .04em; }
.header-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-switch a {
  padding: 6px 12px; font-size: .82rem; font-weight: 700; text-decoration: none;
  color: var(--muted); background: transparent; transition: background .15s, color .15s;
}
.lang-switch a[aria-current="page"] { background: var(--neon); color: #fff; }
.lang-switch a:hover:not([aria-current="page"]) { color: var(--brown); background: color-mix(in srgb, var(--sand) 40%, transparent); }
[data-theme="dark"] .lang-switch a:hover:not([aria-current="page"]) { color: var(--sand); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 34px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--text); cursor: pointer; font-size: 1rem;
}
.theme-toggle:hover { border-color: var(--orange); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: .95rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform .12s ease, background .15s, color .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--neon); color: #fff; }
.btn-primary:hover { background: #e23600; }
.btn-secondary { background: var(--card); color: var(--brown); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--orange); color: var(--orange); }
[data-theme="dark"] .btn-secondary { color: var(--sand); }
.btn-ghost { background: transparent; color: var(--brown); border-color: var(--border); }
[data-theme="dark"] .btn-ghost { color: var(--sand); }
.btn-whatsapp { background: #25d366; color: #06331b; }
.btn-whatsapp:hover { background: #1fbe5a; }

/* ---------------- Hero (полноширинный баннер-фон) ---------------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: clamp(500px, 66vh, 680px);
  display: flex; align-items: center;
  padding: clamp(48px, 7vw, 96px) 0;
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
/* Светлый тон-затемнение для светлой темы (сильнее слева, где текст) */
.hero-overlay {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg,
    rgba(255,248,239,.82) 0%, rgba(255,248,239,.60) 40%,
    rgba(255,248,239,.30) 72%, rgba(255,248,239,.08) 100%);
}
/* Тёмный тон-затемнение для тёмной темы */
[data-theme="dark"] .hero-overlay {
  background: linear-gradient(100deg,
    rgba(22,15,10,.80) 0%, rgba(22,15,10,.58) 40%,
    rgba(22,15,10,.30) 72%, rgba(22,15,10,.08) 100%);
}
.hero-inner { width: 100%; }
.hero-content { position: relative; z-index: 1; max-width: 680px; }
.hero-title {
  font-size: clamp(2rem, 5vw, 3.1rem); margin: .1em 0 .3em;
  text-shadow: 0 1px 2px rgba(255,248,239,.5);
}
[data-theme="dark"] .hero-title { text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.hero-sub { font-size: 1.1rem; color: var(--muted); max-width: 46ch; margin-bottom: 1.6em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-cta .btn { padding: 11px 18px; font-size: .92rem; white-space: nowrap; }

/* ---------------- Facts ---------------- */
.property-facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-top: 28px;
}
.fact-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; box-shadow: var(--shadow);
  min-height: 88px; display: flex; flex-direction: column; justify-content: center;
}
.fact-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 5px; }
.fact-card strong { font-size: clamp(1rem, 1.5vw, 1.2rem); font-family: var(--serif); white-space: nowrap; }

/* ---------------- Description / layout ---------------- */
.prose p { max-width: 68ch; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 48px); align-items: start; }

.rooms-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.rooms-list li {
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--apricot);
  border-radius: 10px; padding: 12px 16px;
}
.rooms-list li strong { color: var(--brown); }
[data-theme="dark"] .rooms-list li strong { color: var(--sand); }

/* ---------------- Advantages (плитки одинакового размера) ---------------- */
/* Больше воздуха над блоками «Преимущества» и «Контакты» */
section[aria-labelledby="features-title"],
#contact { padding-top: clamp(68px, 9vw, 116px); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px; box-shadow: var(--shadow);
  aspect-ratio: 10 / 7; display: flex; flex-direction: column; justify-content: center;
}
.feature-card .ico { font-size: 1.7rem; line-height: 1; margin-bottom: 12px; display: block; }
.feature-card h3 { margin-bottom: .35em; }
.feature-card p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------------- Gallery ---------------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; cursor: zoom-in;
  border: 1px solid var(--border); transition: transform .2s ease, box-shadow .2s ease;
}
.gallery img:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.gallery img:focus-visible { outline: 3px solid var(--neon); outline-offset: 2px; }
/* План квартиры: тот же размер плитки, но показываем целиком (без обрезки) */
.gallery img.contain { object-fit: contain; background: color-mix(in srgb, var(--sand) 20%, var(--card)); }

/* ---------------- Lightbox ---------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(20, 12, 8, 0.92); padding: 20px;
}
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-btn {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25);
  width: 48px; height: 48px; border-radius: 999px; font-size: 1.4rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lb-btn:hover { background: var(--neon); border-color: var(--neon); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------------- Video ---------------- */
.video-wrapper {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow);
  max-width: 900px; margin: 0 auto;
}
.video-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-note { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 12px; }

/* Превью-кадр (facade): клик открывает ролик на YouTube в новой вкладке */
.video-facade { position: absolute; inset: 0; display: block; cursor: pointer; overflow: hidden; }
.video-facade img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-facade::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.18); transition: background .2s; }
.video-facade:hover::after, .video-facade:focus-visible::after { background: rgba(0,0,0,.30); }
.video-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 84px; height: 58px; border-radius: 14px; background: rgba(18,18,18,.82);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.5rem;
  padding-left: 5px; transition: background .2s, transform .2s;
}
.video-facade:hover .video-play, .video-facade:focus-visible .video-play { background: #ff0000; transform: translate(-50%,-50%) scale(1.06); }

/* ---------------- Map ---------------- */
.map-wrapper {
  position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 460px;
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.map-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--sand) 30%, var(--card)); color: var(--muted); text-align: center; padding: 24px;
}
.map-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }

/* ---------------- Contact ---------------- */
.contact-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow); max-width: 640px;
  margin-bottom: clamp(24px, 5vw, 56px);
}
.contact-name { font-family: var(--serif); font-size: 1.5rem; margin: 0 0 4px; }
.contact-lines { margin: 14px 0 22px; display: grid; gap: 8px; }
.contact-lines a { font-size: 1.05rem; font-weight: 600; text-decoration: none; }
.contact-lines a:hover { text-decoration: underline; }
.contact-buttons { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; background: color-mix(in srgb, var(--olive) 8%, var(--bg)); }
[data-theme="dark"] .site-footer { background: color-mix(in srgb, var(--olive) 20%, var(--bg)); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.footer-links a { margin-left: 14px; font-weight: 700; font-size: .85rem; text-decoration: none; }
.footer-note { font-size: .82rem; color: var(--muted); max-width: 60ch; margin-top: 14px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .hero { min-height: auto; padding: clamp(40px, 9vw, 68px) 0; }
  .hero-overlay { background: rgba(255,248,239,.78); }
  [data-theme="dark"] .hero-overlay { background: rgba(22,15,10,.76); }
  .split { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  /* Название и переключатели — в одну компактную строку */
  .header-inner { gap: 10px; padding: 10px 16px; }
  .brand { font-size: .95rem; }
  .brand span { font-size: .66rem; }
  .header-controls { flex-wrap: nowrap; gap: 8px; }
  .lang-switch a { padding: 5px 9px; font-size: .78rem; }
  .theme-toggle { width: 34px; height: 30px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .property-facts { grid-template-columns: repeat(2, 1fr); }
  .fact-card strong { white-space: normal; }
  .feature-card { aspect-ratio: auto; min-height: 150px; }
  .hero-cta .btn, .contact-buttons .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------------- Print / PDF — компактная брошюра на 2 страницы, без фото ---------------- */
@media print {
  @page { size: A4; margin: 13mm 15mm; }
  /* Печать всегда в светлой палитре, даже если сайт открыт в тёмной теме */
  :root, [data-theme="dark"] {
    --bg: #ffffff; --text: #1a1a1a; --card: #ffffff;
    --muted: #555555; --border: #dcdcdc; --brown: #772f1a; --sand: #772f1a;
  }
  html, body {
    background: #fff !important; color: #1a1a1a !important;
    font-size: 10.5pt; line-height: 1.42;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .eyebrow, h1, h2, h3, .contact-name, .rooms-list li strong, .feature-card h3 { color: var(--brown) !important; }
  .fact-label, .hero-sub, .lead, .feature-card p, .footer-note, .map-meta .muted { color: #555 !important; }
  p, li, strong, .contact-lines a, .fact-card strong { color: #1a1a1a; }

  /* Скрыть всё интерактивное, фотографии, видео и карту */
  .site-header, .lightbox, .theme-toggle, .lang-switch,
  .hero-cta, .hero-bg, .hero-overlay,
  #gallery, #video, .map-wrapper, .map-placeholder,
  .contact-buttons, .btn, [data-pdf-button],
  .video-note, .footer-links { display: none !important; }

  main { display: block; }
  section { padding: 0 0 10pt !important; background: none !important; border: 0 !important; }
  .container { max-width: 100%; padding: 0; }
  a { color: inherit; text-decoration: none; }

  .eyebrow { font-size: 7.5pt; letter-spacing: .14em; color: var(--brown); margin: 0 0 3pt; }
  .hero { min-height: 0 !important; display: block !important; padding: 0 !important; }
  .hero-inner { padding: 0; }
  .hero-content { max-width: none; }
  h1.hero-title { font-size: 21pt; margin: 0 0 5pt; color: var(--brown); text-shadow: none; }
  .hero-sub { font-size: 10.5pt; color: #444; max-width: none; margin: 0 0 6pt; }
  h2 { font-size: 13.5pt; color: var(--brown); margin: 10pt 0 5pt; }
  h3 { font-size: 10.5pt; margin: 0 0 1pt; color: #222; }
  p { margin: 0 0 5pt; }
  .lead { font-size: 10.5pt; }

  /* Ключевые параметры — аккуратная таблица */
  .property-facts {
    display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 0;
    border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin: 6pt 0 0;
  }
  .fact-card {
    box-shadow: none !important; border: 0 !important;
    border-right: 1px solid #eee !important; border-bottom: 1px solid #eee !important;
    border-radius: 0 !important; padding: 6pt 10pt !important; background: none !important;
    min-height: 0 !important; display: block !important;
  }
  .fact-label { font-size: 7pt; letter-spacing: .08em; color: #777; margin-bottom: 1pt; }
  .fact-card strong { font-size: 11.5pt; }

  /* Планировка */
  .split { display: block !important; }
  .rooms-list { display: block; margin-top: 2pt; }
  .rooms-list li {
    border: 0 !important; border-left: 2px solid var(--apricot) !important; border-radius: 0 !important;
    padding: 1pt 0 1pt 8pt !important; margin: 0 0 3pt !important; background: none !important;
    break-inside: avoid; font-size: 10pt;
  }

  /* Преимущества — 2 колонки, без иконок и рамок */
  .features { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 6pt 20pt; }
  .feature-card { box-shadow: none !important; border: 0 !important; padding: 0 !important; background: none !important; break-inside: avoid; aspect-ratio: auto !important; display: block !important; }
  .feature-card .ico { display: none !important; }
  .feature-card p { font-size: 9.3pt; color: #555; }

  /* Контент течёт естественно, без принудительного разрыва (меньше пустоты) */
  section { break-inside: auto; }
  h2 { break-after: avoid; }
  .map-meta { margin-top: 4pt; }
  .contact-card, .site-footer { break-inside: avoid; }

  .contact-card {
    box-shadow: none !important; border: 1px solid var(--border) !important; border-radius: 6px !important;
    padding: 10pt 12pt !important; margin: 6pt 0 0 !important; max-width: none;
  }
  .contact-name { font-size: 12.5pt; margin: 0 0 3pt; }
  .contact-lines { margin: 5pt 0 0; gap: 2pt; }
  .contact-lines a { font-size: 10.5pt; font-weight: 600; }

  /* Фото в PDF между таблицей параметров и блоком «О квартире» — серая рамка 1px со скруглением */
  .pdf-photo { display: block !important; margin: 16px 0; break-inside: avoid; }
  .pdf-photo img {
    width: 100%; height: auto; display: block;
    border: 1px solid #cccccc; border-radius: 8px;
  }

  .site-footer { border-top: 1px solid var(--border); padding: 8pt 0 0; background: none !important; margin-top: 8pt; }
  .footer-note { font-size: 8pt; color: #777; margin-top: 4pt; }
}
