/* =============================================================================
   ГЛАВНАЯ РЕГИОНА: первый экран, поиск, вкладки, карточки, новости,
   профиль высот, афиша. Шапка региона (.hero) также используется
   на заглушке закрытого региона.
   ============================================================================= */

/* --- Первый экран --- */
.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(580px, 86vh, 760px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  background: #2B3A3E;
}

.hero__photo {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}

/* Затемнение: слева сильнее, чтобы заголовок читался поверх снега */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(10 16 18 / 0.66) 0%, rgb(10 16 18 / 0.32) 42%, rgb(10 16 18 / 0) 68%),
    linear-gradient(180deg, rgb(10 16 18 / 0.55) 0%, rgb(10 16 18 / 0.05) 26%, rgb(10 16 18 / 0.1) 50%, rgb(10 16 18 / 0.78) 100%);
}

/* Без фото: тёмный фон с орнаментом */
.hero--no-photo {
  background:
    radial-gradient(1200px 500px at 80% 0%, #2E4A47 0%, transparent 60%),
    var(--night);
}

.hero__body {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: end;
  gap: 32px;
  padding-bottom: 132px;
}

.hero__kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgb(255 255 255 / 0.85);
}

.hero__kicker svg {
  width: 42px;
  height: 10px;
  color: var(--gold-light);
}

.hero__title {
  font-size: clamp(54px, 9vw, 124px);
  margin: 14px 0 18px;
}

.hero__title em {
  font-style: italic;
  color: var(--gold-light);
}

.hero__lead {
  max-width: 46ch;
  margin: 0;
  font-size: 17px;
  color: rgb(255 255 255 / 0.88);
}

/* Блок «Сейчас» */
.now {
  padding: 16px 16px 14px;
  border-radius: var(--r-m);
  background: rgb(14 22 24 / 0.42);
  border: 1px solid rgb(255 255 255 / 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.now__head {
  margin-bottom: 8px;
  color: rgb(255 255 255 / 0.7);
}

.now__temp {
  font-family: var(--serif);
  font-size: 54px;
  line-height: 0.9;
}

.now__place {
  margin: 4px 0 12px;
  font-weight: 600;
}

.now dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0;
  font-size: 13px;
}

.now dt {
  color: rgb(255 255 255 / 0.65);
}

.now dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

/* --- Поиск: карточка наезжает на край фото --- */
.search {
  position: relative;
  z-index: 3;
  margin-top: -92px;
}

.search__card {
  padding: 10px;
  border-radius: var(--r-l);
  background: var(--card);
  border: 1px solid rgb(0 0 0 / 0.04);
  box-shadow: 0 30px 60px -30px rgb(20 25 25 / 0.45);
}

/* Переключатель «Жильё / Развлечения / Кухня» на радиокнопках */
.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 6px 6px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--paper);
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg span {
  display: block;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}

.seg input:checked + span {
  background: var(--ink);
  color: #fff;
}

.seg input:focus-visible + span {
  outline: 2px solid var(--terra);
  outline-offset: 2px;
}

.fields {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.9fr auto;
  align-items: stretch;
}

.field {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 18px;
  border-right: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}

.field:hover {
  background: var(--paper);
}

.field:nth-child(4) {
  border-right: 0;
}

.field small {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.field select,
.field input {
  width: 100%;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.field select:focus,
.field input:focus {
  outline: none;
}

.field:focus-within {
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--terra);
}

.go {
  margin: 4px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 16px;
  background: var(--terra);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
}

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

/* --- Вкладки --- */
/* --header-h — высота закреплённой шапки (base.css); где её нет — 0 */
.tabs-bar {
  position: sticky;
  top: var(--header-h, 0px);
  scroll-margin-top: var(--header-h, 0px); /* переход по #tabs: не прятать вкладки под шапку */
  z-index: 10;
  margin-top: 44px;
  background: rgb(246 241 234 / 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

/* Главная региона: те же колонки, что у .region-main (контент + 320px новостей).
   Вкладки стоят в левой колонке и делят её ширину поровну. */
.tabs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
}

.tabs-grid .tab {
  flex: 1;                 /* равная доля ширины */
  justify-content: center;
}

.tab {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px 18px;
  font-weight: 700;
  color: var(--ink-2);
}

.tab .icon {
  width: 22px;
  height: 22px;
}

.tab sup {
  margin-left: -4px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
}

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

.tab[aria-current] {
  color: var(--ink);
}

.tab[aria-current] .icon {
  color: var(--terra);
}

.tab[aria-current]::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--terra);
}

/* --- Две колонки: содержимое + новости --- */
.region-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
  padding-block: 32px 0;
}

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

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

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

/* Сортировка */
.sort label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
}

.sort .icon {
  width: 16px;
  height: 16px;
}

.sort select {
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}

/* Что применено из поиска */
.applied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--r-s);
  background: var(--paper-2);
  font-size: 13.5px;
}

.applied a {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--terra);
}

/* Короткий рассказ над карточками (например, о кухне региона) */
.intro {
  margin: 0 0 22px;
  padding: 18px 22px;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-m) var(--r-m) 0;
  background: var(--paper-2);
}

.intro h3 {
  margin: 0 0 6px;
  font-size: 26px;
}

.intro p {
  margin: 0;
  max-width: 68ch;
  color: var(--ink-2);
  line-height: 1.6;
}

.kinds {
  margin-bottom: 22px;
}

.notice {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: var(--r-s);
  border: 1px dashed var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
}

/* --- Плитки локаций --- */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tile {
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  border-radius: var(--r-m);
  overflow: hidden;
  color: #fff;
}

.tile:first-child {
  grid-column: 1 / -1;
  min-height: 340px;
}

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

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

.tile:hover .tile__photo img {
  transform: scale(1.05);
}

.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / 0) 40%, rgb(0 0 0 / 0.72) 100%);
  pointer-events: none;
}

.tile__text {
  position: relative;
  z-index: 1;
  padding: 18px 20px;
}

.tile__text .label {
  color: var(--gold-light);
}

.tile h3 {
  margin: 4px 0 0;
  font-weight: 600;
  font-size: 32px;
}

.tile h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.tile small {
  display: block;
  margin-top: 6px;
  color: rgb(255 255 255 / 0.82);
}

.tile .fav {
  z-index: 3;
}

/* --- Профиль высот --- */
.ascent {
  margin-bottom: 28px;
  padding: 28px 28px 20px;
  border-radius: var(--r-l);
  background: var(--night);
  color: #EDE6DA;
}

.ascent .label {
  color: var(--gold);
}

.ascent h3 {
  margin: 10px 0 8px;
  font-size: clamp(30px, 3.6vw, 44px);
  color: #fff;
}

.ascent h3 em {
  color: var(--gold-light);
}

.ascent p {
  margin: 0 0 8px;
  color: #B9B1A4;
  max-width: 60ch;
}

.ascent__scroll {
  overflow-x: auto;
  margin-inline: -8px;
  padding-inline: 8px;
}

.ascent__chart {
  display: block;
  width: 100%;
  min-width: 720px;
  height: auto;
}

/* Классы ниже назначает ascent.js */
.ascent__grid line { stroke: rgb(237 230 218 / 0.1); }
.ascent__axis { font-family: var(--mono); font-size: 11px; fill: #8F887E; }
.ascent__name { font-family: var(--sans); font-size: 13px; font-weight: 700; fill: #fff; }
.ascent__alt { font-family: var(--mono); font-size: 11.5px; fill: #D8B577; }

/* --- Афиша --- */
.events {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ev {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border-radius: var(--r-m);
  background: var(--card);
  border: 1px solid var(--line);
  transition: border-color 0.2s ease;
}

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

.ev__date {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ev__date .serif {
  font-size: 56px;
  color: var(--terra);
}

.ev__date > span:last-child {
  font-weight: 700;
  line-height: 1.2;
}

.ev__date small {
  display: block;
  font-weight: 500;
  color: var(--ink-2);
}

.ev h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.ev h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.ev p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-2);
}

.ev__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  font-weight: 700;
}

/* --- Новости --- */
.news {
  position: sticky;
  top: calc(var(--header-h, 0px) + 84px);
}

.news__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
}

.news__head h2 {
  margin: 0;
  font-size: 30px;
}

.demo {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
}

.news__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.news__item {
  display: grid;
  gap: 6px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.news__item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-s);
  margin-bottom: 4px;
}

.news__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-2);
}

.news__tag {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--terra);
}

.news__title {
  font-weight: 700;
  line-height: 1.35;
}

.news__title:hover {
  color: var(--terra);
}

.news__item--lead .news__title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

/* =============================================================================
   АДАПТИВ
   ============================================================================= */
@media (max-width: 1080px) {
  .hero__body {
    grid-template-columns: 1fr;
  }

  .now {
    max-width: 340px;
  }

  .fields {
    grid-template-columns: 1fr 1fr;
  }

  .field {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .go {
    grid-column: 1 / -1;
    justify-content: center;
    padding: 16px;
  }

  .region-main,
  .tabs-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .news {
    position: static;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 600px;
  }

  .hero__body {
    padding-bottom: 112px;
  }

  .now {
    display: none;
  }

  .seg {
    display: flex;
    overflow-x: auto;
  }

  .fields {
    grid-template-columns: 1fr;
  }

  .tiles,
  .events {
    grid-template-columns: 1fr;
  }

  .ascent {
    padding: 22px 18px 14px;
  }
}
