/* ============================================================
   Столовая «Кочеты» — сайт поддомена stolovaya.kochety.ru
   Токены унаследованы от основного сайта kochety.ru
   (см. C:\Projects\kochety-lobby\DESIGN-TOKENS.md): палитра,
   Prata + Montserrat, кнопки, радиусы, контейнер 1200px,
   брейкпоинты 640/1024.
   ============================================================ */

:root {
  --dark: #201E1F;
  --brown: #503822;
  --cream: #EDE6D5;
  --muted: #947D69;
  --accent: #C63126;
  --white: #FFFFFF;

  --font-display: 'Prata', serif;
  --font-text: 'Montserrat', sans-serif;

  --radius-btn: 10px;
  --radius-photo: 4px;
  --radius-sign: 6px;

  --header-h: 64px;
}

/* ---------- База ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; }

a { color: inherit; }

h1, h2, h3, h4, p, ul { margin: 0; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Типографика ---------- */

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 50px);
  line-height: 1.15;
  color: var(--brown);
  margin-bottom: 20px;
}

.section-text {
  max-width: 560px;
  color: var(--dark);
}

.section-text + .section-text { margin-top: 14px; }
.section-text + .btn { margin-top: 28px; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-btn);
  padding: 14px 24px;
  min-height: 48px;
  transition: background-color 0.3s ease, color 0.3s ease,
              border-color 0.3s ease, transform 0.3s ease;
}

.btn:active { transform: scale(0.98); }

/* Якорные ссылки-кнопки браузер считает «посещёнными» и красит
   UA-цветом :visited; в :visited-стилях Chromium игнорирует var()
   (приватность) — поэтому цвета здесь литеральные */
.btn-accent:visited { color: #FFFFFF; }
.btn-ghost:visited { color: #FFFFFF; }
.btn-outline:visited { color: #503822; }

.btn-accent {
  background: var(--accent);
  color: var(--white);
}

.btn-accent:hover { background: #A82820; }

.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255, 255, 255, 0.55);
}

.btn-ghost:hover {
  border-color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.btn-outline {
  background: transparent;
  color: var(--brown);
  border: 1.5px solid rgba(80, 56, 34, 0.5);
}

.btn-outline:hover {
  border-color: var(--brown);
  background: rgba(80, 56, 34, 0.05);
}

.btn-lg { padding: 16px 28px; min-height: 56px; }

/* ---------- Секции ---------- */

.section {
  position: relative;
  padding: 60px 0;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.section-cream { background: var(--cream); }
.section-white { background: var(--white); }

.section-divider {
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  border-top: 1px dashed rgba(148, 125, 105, 0.35);
}

/* Едва заметное зерно на кремовых секциях (CSS, без картинок) */
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.grain > .container { position: relative; }

/* ---------- Фотографии (задел под будущие фото) ---------- */

.photo-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-photo);
  aspect-ratio: 4 / 3;
  background: #D8CFBC;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Шапка ----------
   Hero тёмный (фото зала под оверлеем), поэтому до прокрутки
   логотип и ссылки светлые; после прокрутки шапка получает
   кремовую подложку, текст становится коричневым (как в lobby). */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-h);
  background: transparent;
  transition: background-color 0.35s ease, box-shadow 0.35s ease;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.2;
}

.logo-name {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--white);
  transition: color 0.35s ease;
}

.logo-km {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.35s ease;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.25s ease;
}

.nav-link:hover { color: var(--white); }

/* Ссылка «Отель» — со стрелкой-указателем на основной сайт */
.header-hotel {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.header.is-scrolled {
  background: var(--cream);
  box-shadow: 0 1px 10px rgba(32, 30, 31, 0.12);
}

.header.is-scrolled .logo-name { color: var(--brown); }
.header.is-scrolled .logo-km { color: var(--muted); }
.header.is-scrolled .nav-link { color: var(--brown); }
.header.is-scrolled .nav-link:hover { color: var(--accent); }

/* ---------- Первый экран ----------
   Фото основного зала под тёмным оверлеем (плотнее слева,
   где текст) + медленное приближение Ken Burns, как в lobby. */

.hero {
  position: relative;
  min-height: 86svh;
  max-height: 800px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--dark);
  color: var(--white);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--dark);
  animation: kenburns 26s ease-in-out infinite alternate;
  will-change: transform;
}

.hero-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes kenburns {
  from { transform: scale(1); }
  to   { transform: scale(1.06); }
}

/* Плотнее слева (текст) и у нижнего края (кнопки над светлой плиткой) */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(32, 30, 31, 0.6), rgba(32, 30, 31, 0) 45%),
    linear-gradient(to right, rgba(32, 30, 31, 0.88), rgba(32, 30, 31, 0.55));
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-top: 104px;
  padding-bottom: 72px;
}

/* Две «дорожные таблички»: часы работы и километровый знак */
.hero-signs {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 28px;
}

.hours-sign,
.km-sign {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 18px 9px;
  background: var(--white);
  border: 1.5px solid var(--brown);
  border-radius: var(--radius-sign);
  box-shadow: 0 2px 0 rgba(32, 30, 31, 0.35);
}

.hours-sign-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hours-sign-num {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  color: var(--dark);
}

.km-sign-road {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.km-sign-num {
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  color: var(--dark);
}

.km-sign-unit {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 6.5vw, 68px);
  line-height: 1.12;
  max-width: 16ch;
  margin-bottom: 22px;
}

.hero-sub {
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.6;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  max-width: 420px;
}

/* Пунктирная «разметка» внизу первого экрана */
.hero-roadline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 1;
  border-top: 2px dashed rgba(255, 255, 255, 0.3);
}

/* ---------- Шаги «Как это устроено» ---------- */

.steps {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
  margin-top: 40px;
}

.step {
  position: relative;
  background: var(--cream);
  border-radius: var(--radius-photo);
  padding: 28px;
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(80, 56, 34, 0.14);
}

/* Крупный номер шага — призрачная цифра в углу карточки */
.step-num {
  position: absolute;
  top: 6px;
  right: 16px;
  font-family: var(--font-display);
  font-size: 84px;
  line-height: 1;
  color: rgba(80, 56, 34, 0.08);
  pointer-events: none;
  user-select: none;
}

.feature-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
}

.feature-icon svg { width: 100%; height: 100%; }

.step-title {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 18px;
  color: var(--brown);
  margin-bottom: 8px;
}

.step-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--dark);
}

/* ---------- Меню ---------- */

.menu-board { margin-top: 36px; }

.menu-group { margin-bottom: 36px; }

.menu-group-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 25px;
  color: var(--brown);
  margin-bottom: 14px;
}

/* Бейдж времени у раздела («Завтрак · 07:00–11:00») —
   в стиле дорожных табличек проекта */
.menu-group-time {
  display: inline-block;
  vertical-align: 4px;
  margin-left: 8px;
  padding: 2px 8px;
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.5;
  color: var(--muted);
  background: var(--white);
  border: 1px solid rgba(148, 125, 105, 0.45);
  border-radius: var(--radius-photo);
  white-space: nowrap;
}

.menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 640px;
}

.menu-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
}

.menu-name {
  font-size: 15px;
  font-weight: 500;
}

.menu-note {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

/* Пунктирный лидер — штрихи «дорожной разметки» до цены */
.menu-dots {
  flex: 1;
  min-width: 24px;
  border-bottom: 1px dashed rgba(148, 125, 105, 0.45);
  transform: translateY(-4px);
}

.menu-price {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
  color: var(--brown);
  white-space: nowrap;
}

.menu-takeaway {
  margin-top: 8px;
  max-width: 640px;
  font-size: 15px;
  color: var(--dark);
}

/* ---------- Карточки-удобства ----------
   Как .features в lobby, но секция белая, поэтому карточки кремовые */

.features {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
  margin-top: 40px;
}

.feature {
  background: var(--cream);
  border-radius: var(--radius-photo);
  padding: 28px;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.feature:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(80, 56, 34, 0.14);
}

.feature-title {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 18px;
  color: var(--brown);
  margin-bottom: 8px;
}

.feature-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--dark);
}

/* ---------- Галерея залов ---------- */

.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 22px;
}

.gallery-item { margin: 0; }

/* Пара кадров малого зала + одна подпись на пару */
.gallery-side {
  display: grid;
  gap: 14px;
}

.gallery-caption {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Баннер «На территории комплекса» ----------
   По образцу bridge-баннера lobby: тёмная карточка на ширину
   контейнера, радиус 12px, внутри — пунктирная «дорожная» линия */

.bridge-banner {
  background: var(--dark);
  border-radius: 12px;
  padding: 28px;
  color: var(--cream);
}

/* Красная фокус-обводка на тёмном не видна — заменяем кремовой */
.bridge-banner :focus-visible {
  outline-color: var(--cream);
}

.bridge-roadline {
  border-top: 2px dashed rgba(237, 230, 213, 0.25);
  margin-bottom: 24px;
}

.bridge-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bridge-eyebrow { color: rgba(237, 230, 213, 0.6); }

.bridge-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 28px);
  line-height: 1.25;
  color: var(--white);
  margin-bottom: 8px;
}

.bridge-sub {
  font-size: 15px;
  color: rgba(237, 230, 213, 0.8);
}

/* Кнопки баннера: на мобильном — в столбик на всю ширину */
.bridge-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

/* ---------- Как доехать ---------- */

/* Уменьшенный километровый знак (как на основном сайте) */
.km-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  margin-bottom: 18px;
  background: var(--white);
  border: 1.5px solid var(--brown);
  border-radius: var(--radius-sign);
  box-shadow: 0 2px 0 rgba(80, 56, 34, 0.18);
}

.km-tag-road {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.km-tag-num {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
  color: var(--dark);
}

.km-tag-unit {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

/* ---------- Подвал ---------- */

.footer {
  background: var(--dark);
  color: var(--cream);
  padding: 26px 0 40px;
}

.footer-roadline {
  border-top: 2px dashed rgba(237, 230, 213, 0.25);
  margin-bottom: 36px;
}

.footer-main {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.footer-logo {
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 10px;
}

.footer-line {
  font-size: 14px;
  color: rgba(237, 230, 213, 0.8);
  margin-bottom: 4px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.footer-link {
  font-size: 14px;
  color: rgba(237, 230, 213, 0.8);
  text-decoration: none;
  transition: color 0.25s ease;
}

.footer-link:hover { color: var(--white); }

/* Красная фокус-обводка на тёмном не видна — заменяем кремовой */
.footer :focus-visible { outline-color: var(--cream); }

/* Юридический блок — мелко и приглушённо, отбит пунктирной линией */
.footer-legal {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px dashed rgba(237, 230, 213, 0.3);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(237, 230, 213, 0.45);
}

.footer-legal p + p { margin-top: 6px; }

.footer-copy { margin-top: 14px; }

/* ============================================================
   Планшет: ≥ 640px
   ============================================================ */

@media (min-width: 640px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .features { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  /* Визуально как раньше: три РАВНЫХ кадра в ряд
     (левая колонка — ровно треть за вычетом зазоров) */
  .gallery { grid-template-columns: calc((100% - 36px) / 3) 1fr; gap: 18px; }
  .gallery-side { grid-template-columns: 1fr 1fr; gap: 18px; }
  .gallery-side .gallery-caption { grid-column: 1 / -1; }
  .hero-actions { flex-direction: row; max-width: none; }
  .hero-actions .btn { flex: 0 1 auto; }
  .bridge-actions { flex-direction: row; }
  .bridge-actions .btn { flex: 0 1 auto; }
}

/* ============================================================
   Десктоп: ≥ 1024px
   ============================================================ */

@media (min-width: 1024px) {
  body { font-size: 17px; }

  .container {
    padding-left: 40px;
    padding-right: 40px;
  }

  .header-inner { padding: 0 40px; }

  .section { padding: 96px 0; }

  .steps { gap: 22px; }

  /* 2×2 вместо 1×4: длинная карточка «С детьми» не растягивает
     весь ряд; grid-auto-rows выравнивает оба ряда по высоте */
  .features { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; gap: 22px; }

  /* Мозаика: крупная раздача слева (~2/3, задаёт высоту блока),
     пара кадров малого зала стопкой справа на ту же высоту */
  .gallery {
    grid-template-columns: 2fr 1fr;
    gap: 22px;
    margin-top: 40px;
    align-items: stretch;
  }

  .gallery-main .photo-frame { height: 100%; }

  .gallery-side {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr auto;
    gap: 22px;
    min-height: 0;
  }

  .gallery-side .photo-frame {
    aspect-ratio: auto;
    height: 100%;
    min-height: 0;
  }

  .bridge-banner { padding: 40px; }

  .bridge-main {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
  }

  .bridge-actions { flex-shrink: 0; }

  /* Меню в две колонки; разделы не разрываются */
  .menu-columns {
    columns: 2;
    column-gap: 72px;
  }

  .menu-group { break-inside: avoid; }

  .footer-main {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .footer-nav {
    flex-direction: column;
    gap: 8px;
    text-align: right;
  }
}

/* ============================================================
   prefers-reduced-motion: отключаем анимации
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .hero-bg { animation: none; }

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
