/* =============================================================================
   БАЗОВЫЕ СТИЛИ: сброс, шапка, кнопки, карточки, подвал.
   Стили отдельных страниц — в start.css, region.css, place.css, coming-soon.css.
   ============================================================================= */

/* --- Сброс --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --- Каркас: ширина контента и боковые поля --- */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

/* --- Типографика --- */
.serif {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
  text-wrap: balance;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.num {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-2);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- Иконки --- */
.icon {
  width: 20px;
  height: 20px;
  flex: none;
}

.icon--s {
  width: 14px;
  height: 14px;
}

/* =============================================================================
   ШАПКА
   ============================================================================= */
.site-header {
  position: relative;
  z-index: 20;
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.logo {
  display: block;
  line-height: 0;
  border-radius: 4px;
}

.logo-svg {
  height: 32px;
  width: auto;
}

.logo-mark { fill: var(--logo-mark); }
.logo-snow,
.logo-word { fill: var(--logo-ink); }

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-header__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}

.site-header__link:hover {
  background: rgb(0 0 0 / 0.05);
}

.fav-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--terra);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}

/* Прозрачная шапка поверх фото: белый логотип и текст */
.site-header--overlay {
  position: absolute;
  inset: 0 0 auto 0;
  color: #fff;
  --logo-mark: #fff;
  --logo-ink: #fff;
}

.site-header--overlay .site-header__link:hover {
  background: rgb(255 255 255 / 0.12);
}

/* --- Переключатель региона --- */
.region-switch {
  position: relative;
}

.region-switch__button {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 600;
  font-size: 14px;
}

.region-switch__button::-webkit-details-marker {
  display: none;
}

.site-header--overlay .region-switch__button {
  background: rgb(255 255 255 / 0.14);
  border-color: rgb(255 255 255 / 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.region-switch__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4FBF98;
  box-shadow: 0 0 0 3px rgb(79 191 152 / 0.25);
}

.region-switch__dot.is-locked {
  background: var(--ink-3);
  box-shadow: none;
}

.region-switch__list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 270px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  box-shadow: 0 20px 40px -20px rgb(20 20 20 / 0.35);
}

.region-switch__list a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.region-switch__list a:hover {
  background: var(--paper);
}

.region-switch__list a[aria-current] {
  font-weight: 700;
  color: var(--terra);
}

.region-switch__list .is-locked {
  color: var(--ink-2);
}

.region-switch__list small {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
}

/* --- Закреплённая шапка (все страницы) ---
   Обычная шапка: position: sticky — стоит на своём месте в странице и
   прилипает к верху при прокрутке; фон светлый сразу.
   Шапка поверх фото (overlay): position: fixed — наверху прозрачная,
   после прокрутки становится светлой.
   Класс is-scrolled ставит sticky-header.js, когда страницу прокрутили:
   появляется линия снизу (и светлый фон у overlay-шапки).
   Логотип везде одинаковый: зелёная M, белые вершины, белая надпись и
   тонкая чёрная обводка (видна и на фото, и на светлом фоне).
   --header-h — высота шапки. Её используют вкладки и новости (region.css)
   и блок брони (place.css), чтобы прилипать под шапкой, а не под неё.
   Переменная задаётся, если на странице есть закреплённая шапка
   (:has — «если внутри есть»). */
body:has(.site-header--sticky) {
  --header-h: 72px;
}

.site-header--sticky {
  position: sticky;
  top: 0;
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

/* Обычная шапка (не поверх фото): светлый фон сразу */
.site-header--sticky:not(.site-header--overlay) {
  background: rgb(246 241 234 / 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Шапка поверх фото: не занимает места, фото начинается от самого верха */
.site-header--sticky.site-header--overlay {
  position: fixed;
  inset: 0 0 auto 0;
}

.site-header--sticky .site-header__row {
  min-height: var(--header-h);
  padding-block: 0;
}

.site-header--sticky.is-scrolled {
  background: rgb(246 241 234 / 0.94);
  border-bottom-color: var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
}

/* Логотип закреплённой шапки */
.site-header--sticky .logo-mark { fill: var(--green); }
.site-header--sticky .logo-snow,
.site-header--sticky .logo-word { fill: #fff; }

.site-header--sticky .logo-svg path {
  stroke: #000;
  stroke-width: 2px;
  stroke-linejoin: round;
  paint-order: stroke;                 /* обводка под заливкой: снаружи видно 1px, буквы не «худеют» */
  vector-effect: non-scaling-stroke;   /* толщина в пикселях экрана, а не в единицах SVG */
}

.site-header--sticky.is-scrolled .site-header__link:hover {
  background: rgb(0 0 0 / 0.05);
}

.site-header--sticky.is-scrolled .region-switch__button {
  background: var(--card);
  border-color: var(--line);
}

/* =============================================================================
   КНОПКИ
   ============================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--terra);
  color: #fff;
}

.btn--primary:hover {
  background: var(--terra-dark);
}

.btn--outline {
  border-color: var(--ink);
  background: transparent;
}

.btn--outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--light {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.btn--s {
  padding: 8px 16px;
  font-size: 14px;
}

.btn--wide {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =============================================================================
   ЧИПЫ (фильтры) И ПЛАШКИ
   ============================================================================= */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.chip[aria-current] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.chip b {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11px;
  opacity: 0.7;
}

.chip .icon {
  width: 16px;
  height: 16px;
  color: var(--terra);
}

.chip[aria-current] .icon {
  color: inherit;
}

.score {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--ink-2);
}

.score b {
  padding: 3px 7px;
  border-radius: 7px 7px 7px 2px;
  background: var(--night);
  color: #fff;
  font-size: 12.5px;
}

/* =============================================================================
   ФОТО И ЗАГЛУШКА
   ============================================================================= */
.photo {
  position: relative;
  overflow: hidden;
  background: var(--tone, #C9BBA8);
}

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

/* Заглушка, пока фото нет: цвет из данных + силуэт гор */
.photo--empty::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 55%;
  background: rgb(255 255 255 / 0.16);
  clip-path: polygon(0 100%, 0 70%, 18% 35%, 30% 55%, 48% 10%, 62% 45%, 74% 30%, 100% 75%, 100% 100%);
}

/* =============================================================================
   КАРТОЧКА ОБЪЕКТА (используется на главной, в «Рядом», в избранном)
   ============================================================================= */
.card {
  position: relative;
  display: block;
}

.card__media {
  aspect-ratio: 4 / 3;
  max-width: 100%;
  border-radius: var(--r-m);
}

.card__media img {
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.card:hover .card__media img {
  transform: scale(1.04);
}

.badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--card);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
}

.badge--dark {
  background: var(--night);
  color: #fff;
}

/* Кнопка «в избранное» на карточке */
.fav {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: rgb(255 255 255 / 0.9);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.fav:hover {
  transform: scale(1.08);
}

.fav .icon {
  width: 19px;
  height: 19px;
}

.fav[aria-pressed="true"] {
  color: var(--terra);
}

.fav[aria-pressed="true"] .icon path {
  fill: currentColor;
}

.card__body {
  padding: 14px 2px 0;
  display: grid;
  gap: 3px;
}

.card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-2);
}

.card__title {
  margin: 2px 0 0;
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.3;
}

/* Звёздность отеля: ★★★★ (карточка и страница отеля) */
.stars {
  color: var(--gold);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.card__title .stars {
  margin-left: 6px;
  font-size: 13px;
  vertical-align: 2px;
}

.card__title a::after {
  /* Вся карточка кликабельна, но ссылка одна — на заголовке */
  content: "";
  position: absolute;
  inset: 0;
}

.amen {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.amen span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.amen .icon {
  width: 15px;
  height: 15px;
}

.card__foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.price {
  font-size: 14px;
  color: var(--ink-2);
}

.price b {
  font-size: 20px;
  color: var(--ink);
  font-weight: 800;
}

.ok {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ok);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 22px;
}

.cards--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* =============================================================================
   ОРНАМЕНТ-НИТЬ: линия — мотив — линия
   ============================================================================= */
.thread {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--gold);
}

.thread::before,
.thread::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
}

.thread svg {
  width: 64px;
  height: 16px;
  flex: none;
}

/* =============================================================================
   ЗАГОЛОВОК РАЗДЕЛА
   ============================================================================= */
.sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.sec-head h2 {
  font-size: clamp(32px, 4vw, 46px);
  margin: 8px 0 0;
}

.sec-head p {
  margin: 6px 0 0;
  color: var(--ink-2);
}

.sec-head .label {
  color: var(--terra);
}

/* =============================================================================
   ПУСТОЕ СОСТОЯНИЕ / 404
   ============================================================================= */
.empty {
  padding: 36px;
  border: 1px dashed var(--line);
  border-radius: var(--r-m);
  text-align: center;
  color: var(--ink-2);
  display: grid;
  gap: 12px;
  justify-items: center;
}

.empty h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.page-404 {
  padding-block: 80px;
  display: grid;
  gap: 16px;
  justify-items: start;
}

.page-404 h1 {
  font-size: clamp(44px, 7vw, 80px);
  margin: 0;
}

/* =============================================================================
   ПОДВАЛ
   ============================================================================= */
.site-footer {
  margin-top: 64px;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
}

.site-footer .wrap {
  padding-block: 34px 28px;
  display: grid;
  gap: 22px;
}

.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.site-footer__row p {
  margin: 0;
  color: var(--ink-2);
  max-width: 52ch;
}

.site-footer .logo-svg {
  height: 28px;
}

.site-footer__note {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-2);
}

.site-footer__note a {
  text-decoration: underline;
}

/* =============================================================================
   АДАПТИВ
   ============================================================================= */
@media (max-width: 900px) {
  .cards--three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header__link-text,
  .region-switch__name {
    display: none;
  }

  .logo-svg {
    height: 26px;
  }

  .cards,
  .cards--three {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* Контейнер фото в карточке: фото заполняет его целиком */
.photo-wrap {
  position: relative;
  overflow: hidden;
}

.card__photo {
  position: absolute;
  inset: 0;
}
