/* =========================================================
   Главная — верх по макету 2027 (design_handoff_glavnaya):
   заголовок, поиск, «Актуальное», «Направления».
   Разметка — front-page.php, данные — inc/home-2027.php.
   Mobile-first: 600 / 900 / 1200. Контейнер — .container темы.
   ========================================================= */

.hm-hero-wrap,
.hm-dirs,
.hm-pop {
  color: #16140f;
  font-family: 'Onest', system-ui, sans-serif;
  line-height: normal;
}

.hm-hero-wrap {
  background: linear-gradient(180deg, #fff 0%, #f4f4f4 25%, #efefef 50%, #f4f4f4 75%, #fff 100%);
}

.hm-hero {
  padding-top: 32px;
  padding-bottom: 56px;
  text-align: center;
}

.hm-hero .hm-h1 {
  max-width: 1000px;
  margin: 0 auto;
  color: #16140f;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.035em;
  text-wrap: balance;
}

.hm-hero .hm-lead {
  max-width: 600px;
  margin: 18px auto 32px;
  color: #16140f;
  font-size: 16px;
  line-height: 1.55;
}

/* ---- Поиск: белый блок, поля одним рядом от 900px ---- */
.hm-srch {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 18, 12, .04), 0 8px 24px rgba(20, 18, 12, .06);
  text-align: left;
}

.hm-srch__f {
  position: relative;
  display: flex;
  margin: 0;
  border-bottom: 1px solid #e7e7e1;
  color: #16140f;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

/* Оранжевая галочка справа; поле под ней тоже нажимается */
.hm-srch__f::after {
  content: '';
  position: absolute;
  top: calc(50% - 4.5px);
  right: 18px;
  box-sizing: border-box;
  width: 9px;
  height: 9px;
  border-right: 2px solid #E86B18;
  border-bottom: 2px solid #E86B18;
  transform: translateY(-3px) rotate(45deg);
  pointer-events: none;
}

/* Список и поле даты занимают всё поле: нажатие в любом месте открывает их */
.hm-srch__f select,
.hm-srch__f input[type="text"] {
  flex: 1;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 16px 48px 16px 18px;
  border: 0;
  border-radius: 0;
  outline: none;
  background: transparent;
  box-shadow: none;
  color: #16140f;
  font: inherit;
  line-height: normal;
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.hm-srch__f input[type="text"]::placeholder {
  color: #16140f;
  opacity: 1;
}

.hm-srch__f select:focus-visible,
.hm-srch__f input[type="text"]:focus-visible {
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px #E86B18;
}

.hm-srch .hm-srch__go {
  margin: 8px 0 0;
  padding: 17px 36px;
  border: 0;
  border-radius: 14px;
  background: #E86B18;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
  cursor: pointer;
}

/* ---- «Актуальное:» — те же капсулы, что в меню ---- */
.hm-hot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
  margin-top: 26px;
  color: #6b6f67;
  font-size: 15px;
}

.hm-hot__label {
  margin-right: 4px;
  color: #16140f;
}

.hm-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid #d9d9d3;
  border-radius: 999px;
  background: #fff;
  color: #16140f;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}

a.hm-pill:hover {
  border-color: #E86B18;
  color: #E86B18;
  text-decoration: none;
}

.hm-pill .hm-pill__img {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* ---- Направления ---- */
.hm-dirs {
  padding-bottom: 96px;
}

.hm-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.hm-dirs .hm-h2,
.hm-pop .hm-h2 {
  margin: 0;
  color: #16140f;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.hm-head .hm-head__all {
  color: #E86B18;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

/* На телефоне все карточки в 2 колонки одной сеткой (Иван, 04.11) */
.hm-dir-big,
.hm-dir-sm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 16px;
}

.hm-dir-sm {
  margin-top: 24px;
}

/* Видно 6 карточек (на компьютере — 8), остальные — по «Ещё» */
.hm-dirs:not(.is-all) .hm-dir.is-m-hide {
  display: none;
}

.hm-more {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin: 32px auto 0;
  padding: 0 24px;
  border: 1px solid #16140f;
  border-radius: 999px;
  background: #fff;
  color: #16140f;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.hm-more.has-m {
  display: flex;
}

.hm-dirs .hm-more:hover {
  border-color: #E86B18;
  background: #E86B18;
  color: #fff;
}

.hm-dirs.is-all .hm-more {
  display: none;
}

.hm-dirs .hm-dir {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: #16140f;
  text-decoration: none;
}

.hm-dir__img {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 24px;
  background: #f3f4ef;
}

.hm-dir__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}

.hm-dir:hover .hm-dir__img img {
  transform: scale(1.04);
}

.hm-dir__t {
  display: block;
  color: #16140f;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.015em;
}


.hm-dir__s {
  display: block;
  margin-top: 2px;
  color: #6b6f67;
  font-size: 15px;
}

/* ---- Популярные туры: вкладки и лента до края экрана ---- */

/* Лента выходит за контейнер до краёв окна (как фотоальбомы в макете);
   на Windows 100vw шире окна на полосу прокрутки — лишнее срезается здесь,
   без горизонтальной прокрутки страницы. */
.home-page {
  overflow-x: clip;
}

.hm-pop {
  padding-bottom: 96px;
}

.hm-pop .hm-head {
  margin-bottom: 20px;
}

.hm-sl {
  display: none;
  gap: 10px;
}

.hm-pop .hm-sl__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid #16140f;
  border-radius: 999px;
  background: #fff;
  color: #16140f;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}

.hm-pop .hm-sl__btn:hover:not(:disabled) {
  background: #16140f;
  color: #fff;
}

.hm-pop .hm-sl__btn:disabled,
.hm-pop .hm-sl__btn:disabled:hover {
  border-color: #d9d9d3;
  background: #fff;
  color: #c4c6bf;
  cursor: default;
}

.hm-tabs {
  display: flex;
  gap: 28px;
  margin: 0 -20px 24px;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.hm-tabs::-webkit-scrollbar {
  display: none;
}

.hm-pop .hm-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: auto;
  padding: 6px 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: #6b6f67;
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: normal;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.hm-pop .hm-tab:hover {
  background: none;
  color: #16140f;
}

.hm-pop .hm-tab.is-on {
  border-bottom-color: #E86B18;
  color: #16140f;
  font-weight: 600;
}

/* --gut — от края контейнера до края окна; карточки считаются от ширины
   контейнера, первая стоит ровно по его левому краю. */
.hm-ts {
  --gut: 20px;
  display: flex;
  gap: 16px;
  margin: 0 calc(-1 * var(--gut));
  padding: 4px var(--gut) 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-padding-inline: var(--gut);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.hm-ts[hidden] {
  display: none;
}

.hm-ts::-webkit-scrollbar {
  display: none;
}

.hm-ts__it {
  display: flex;
  flex: 0 0 82%;
  scroll-snap-align: start;
}

.hm-ts__it > .tour-card {
  width: 100%;
}

.hm-pop .hm-ts-all {
  display: flex;
  flex: 0 0 82%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 360px;
  padding: 24px;
  border-radius: 20px;
  background: #f5f5f6;
  color: #16140f;
  text-align: center;
  text-decoration: none;
  scroll-snap-align: start;
}

.hm-ts-all b {
  font-size: 20px;
  font-weight: 600;
}

.hm-ts-all span {
  color: #6b6f67;
  font-size: 14px;
}

.hm-ts-all i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: 1px solid #16140f;
  border-radius: 50%;
  font-size: 24px;
  font-style: normal;
  transition: all .2s;
}

.hm-ts-all:hover i {
  border-color: #E86B18;
  background: #E86B18;
  color: #fff;
}

/* =========================================================
   Планшет
   ========================================================= */
@media (min-width: 600px) {
  .hm-hero .hm-h1 {
    font-size: 44px;
  }

  .hm-hero .hm-lead {
    font-size: 18px;
  }

  .hm-dirs .hm-h2,
  .hm-pop .hm-h2 {
    font-size: 38px;
  }

  .hm-dir-big,
  .hm-dir-sm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 20px;
  }

  .hm-dir-sm {
    margin-top: 32px;
  }

  .hm-ts {
    --gut: max(20px, calc((100vw - 899px) / 2 + 20px));
  }

  .hm-ts__it,
  .hm-pop .hm-ts-all {
    flex-basis: calc((100% - 16px) / 2.15);
  }

  /* С планшета первые четыре — с крупным названием, как в макете */
  .hm-dir-big .hm-dir__t {
    font-size: 24px;
  }
}

/* =========================================================
   Десктоп мини
   ========================================================= */
@media (min-width: 900px) {
  .hm-hero {
    padding-top: 56px;
    padding-bottom: 96px;
  }

  .hm-srch {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    align-items: stretch;
  }

  .hm-srch__f {
    min-height: 64px;
    border-bottom: 0;
    border-right: 1px solid #e2e2dc;
  }

  .hm-srch__f:nth-child(3) {
    border-right: 0;
  }

  .hm-srch__f::after {
    right: 22px;
  }

  .hm-srch__f select,
  .hm-srch__f input[type="text"] {
    padding: 10px 52px 10px 22px;
  }

  .hm-srch .hm-srch__go {
    margin-top: 0;
  }

  .hm-dir-big,
  .hm-dir-sm {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hm-sl {
    display: flex;
  }

  .hm-ts {
    --gut: max(20px, calc((100vw - 1190px) / 2 + 20px));
  }

  .hm-ts__it,
  .hm-pop .hm-ts-all {
    flex-basis: calc((100% - 32px) / 3);
  }

  /* На компьютере видно 8: седьмая и восьмая возвращаются, дальше — по «Ещё» */
  .hm-dirs:not(.is-all) .hm-dir.is-m-hide {
    display: flex;
  }

  .hm-dirs:not(.is-all) .hm-dir.is-d-hide {
    display: none;
  }

  .hm-more,
  .hm-more.has-m {
    display: none;
  }

  .hm-more.has-d {
    display: flex;
  }

  .hm-dirs.is-all .hm-more {
    display: none;
  }
}

/* =========================================================
   Десктоп макс
   ========================================================= */
@media (min-width: 1200px) {
  .hm-hero .hm-h1 {
    font-size: 56px;
  }

  .hm-ts {
    --gut: max(20px, calc((100vw - 1340px) / 2 + 20px));
  }

  .hm-ts__it,
  .hm-pop .hm-ts-all {
    flex-basis: calc((100% - 48px) / 4);
  }

  .hm-dirs .hm-h2,
  .hm-pop .hm-h2 {
    font-size: 48px;
  }
}
