/* ============================================================================
   Multi-day tour template — ТЗ §3.3
   ============================================================================

   Loaded only on /tours/ pages. Every selector is new; nothing from style.css
   is redefined, and no site class is reused, so this sheet cannot affect any
   other page. Checked by tools/fidelity_check.py.

   Tokens are the site's: page #3a4257, panel #2b3141, primary #ed1a20, stars
   #ffc107, card radius 20px, button radius 10px, 0.35s ease.

   Ticks and crosses are drawn with borders rather than shipped as icon files —
   contract §2.2 excludes producing new iconography, and the menu caret already
   set this precedent.
   ========================================================================== */

/* ------------------------------------------------------------------ hero -- */
.tour-hero {
  position: relative;
  padding: 3rem 0 2.5rem;
  background-color: #2b3141;
}

.tour-hero--image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 3.5rem 0 2.5rem;
}

.tour-hero__overlay {
  display: none;
}

.tour-hero--image .tour-hero__overlay {
  display: block;
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(43, 49, 65, 0.3) 0%,
    rgba(43, 49, 65, 0.55) 55%,
    rgba(58, 66, 87, 0.92) 100%
  );
}

.tour-hero .container {
  position: relative;
  z-index: 1;
}

.tour-hero__inner {
  max-width: 52rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.tour-hero__title {
  margin: 0;
  font-size: 1.875rem;
  line-height: 1.15;
}

.tour-hero__lead {
  margin: 0;
  color: #e6e9f5;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.tour-hero__cta {
  text-decoration: none;
}

/* ТЗ: "бейджи поверх фона: [N] дней / [M] ночей, от [Цена] UZS" */
.tour-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tour-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 10px;
  background-color: rgba(43, 49, 65, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.875rem;
  font-weight: 600;
}

.tour-badge--price {
  background-color: #ed1a20;
  border-color: #ed1a20;
}

/* --------------------------------------------------------------- sections -- */
.tour-section__title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
}

.tour-intro {
  padding: 2.5rem 0 0;
}

.tour-intro__text {
  max-width: 52rem;
  color: #f4f4f9;
  line-height: 1.7;
}

.tour-intro__text h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.5rem;
  /* The article's leading (.post-content h2), not the 1.7 of the text. */
  line-height: 1.3;
}

.tour-intro__text p {
  margin: 0 0 1rem;
}

/* Headings and lists of the intro — the same rhythm as .loc-content on a stop
   page. style.css removes list markers globally, so they are restored here. */
.tour-intro__text h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.1875rem;
  line-height: 1.35;
}

.tour-intro__text ul,
.tour-intro__text ol,
.tour-day__text ul,
.tour-day__text ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.tour-intro__text ul,
.tour-day__text ul {
  list-style: disc;
}

.tour-intro__text ol,
.tour-day__text ol {
  list-style: decimal;
}

.tour-intro__text li,
.tour-day__text li {
  margin-bottom: 0.5rem;
}

/* ---------------------------------------------------- programme accordion -- */
.tour-programme {
  padding: 2.5rem 0 1rem;
}

.tour-days {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tour-day {
  background-color: #2b3141;
  border-radius: 20px;
  overflow: hidden;
}

.tour-day__summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1.25rem 3rem 1.25rem 1.5rem;
  cursor: pointer;
  position: relative;
  list-style: none;
  transition: background-color 0.35s ease;
}

/* Both spellings are needed: WebKit uses the pseudo-element, the rest honour
   `list-style: none`. Without this the browser's own triangle shows up next to
   our chevron. */
.tour-day__summary::-webkit-details-marker {
  display: none;
}

.tour-day__summary:hover {
  background-color: #323950;
}

.tour-day__summary::after {
  content: "";
  position: absolute;
  right: 1.5rem;
  top: 1.6rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(45deg);
  transition: transform 0.35s ease;
}

.tour-day[open] > .tour-day__summary::after {
  transform: rotate(225deg);
}

.tour-day__num {
  flex: 0 0 auto;
  padding: 0.25rem 0.625rem;
  border-radius: 10px;
  background-color: #ed1a20;
  font-size: 0.8125rem;
  font-weight: 700;
}

.tour-day__title {
  font-size: 1.125rem;
  font-weight: 600;
}

.tour-day__timing {
  color: #cfd5e7;
  font-size: 0.9375rem;
}

.tour-day__body {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tour-day__text {
  color: #f4f4f9;
  line-height: 1.7;
}

.tour-day__text p {
  margin: 0 0 0.75rem;
}

/* ТЗ: 1–2 фото на день. */
.tour-day__photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
  gap: 1rem;
}

.tour-day__photos img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 18px;
}

/* ------------------------------------------------ included / not included -- */
.tour-inc {
  padding: 2.5rem 0 1rem;
}

.tour-inc__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 1.5rem;
}

.tour-inc__col {
  background-color: #2b3141;
  border-radius: 20px;
  padding: 1.5rem;
}

.tour-inc__heading {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

.tour-inc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tour-inc__list li {
  position: relative;
  padding-left: 2rem;
  line-height: 1.5;
  color: #f4f4f9;
}

/* Green tick: two borders rotated into a check. */
.tour-inc__list--yes li::before {
  content: "";
  position: absolute;
  left: 0.375rem;
  top: 0.25rem;
  width: 0.4375rem;
  height: 0.75rem;
  border-right: 2px solid #34c759;
  border-bottom: 2px solid #34c759;
  transform: rotate(45deg);
}

/* Red cross: one square, two rotated bars. */
.tour-inc__list--no li::before,
.tour-inc__list--no li::after {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.6875rem;
  width: 0.875rem;
  height: 2px;
  background-color: #ed1a20;
}

.tour-inc__list--no li::before {
  transform: rotate(45deg);
}

.tour-inc__list--no li::after {
  transform: rotate(-45deg);
}

/* ------------------------------------------------------------- hotels ----- */
.tour-hotels {
  padding: 2.5rem 0 1rem;
}

.tour-hotels__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr));
  gap: 1.25rem;
}

.tour-hotel {
  background-color: #2b3141;
  border-radius: 20px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.tour-hotel__name {
  margin: 0;
  font-size: 1.125rem;
}

.tour-hotel__stars {
  margin: 0;
  font-size: 1.1rem;
  color: #ffc107;
  letter-spacing: 0.05em;
}

.tour-hotel__note {
  margin: 0;
  color: #cfd5e7;
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* ------------------------------------------------------- booking form ----- */
.tour-booking {
  padding: 2.5rem 0 3rem;
}

.tour-booking__inner {
  background-color: #2b3141;
  border-radius: 20px;
  padding: 1.25rem;
}

.tour-booking__lead {
  margin: 0 0 1.5rem;
  color: #e6e9f5;
  line-height: 1.6;
  max-width: 40rem;
}

/* The phones (views/partials/lead-contacts.php) go with the lead above them, and
   keep the form's distance below. */
.tour-booking__intro .lead-contacts {
  margin: -0.75rem 0 1.5rem;
}

.tour-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: 1rem;
  align-items: start;
}

.tour-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.tour-field--wide {
  grid-column: 1 / -1;
}

.tour-field__label {
  font-size: 0.875rem;
  color: #cfd5e7;
}

.tour-field__req {
  color: #ed1a20;
  font-style: normal;
  font-size: 0.8125rem;
}

/* 0.6, not 0.45: the same «необязательно» as on contacts.html, 3.9:1 there. */
.tour-field__opt {
  color: rgba(255, 255, 255, 0.6);
  font-style: normal;
  font-size: 0.8125rem;
}

.tour-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-color: #3a4257;
  color: #ffffff;
  font-family: inherit;
  font-size: 1rem;
  padding: 0.8125rem 0.9375rem;
  /* The browser's own parts of a control are drawn for a light page otherwise: a
     black calendar on this panel at 2:1, a white block of arrows in Firefox. */
  color-scheme: dark;
  transition:
    border-color 0.35s ease,
    background-color 0.35s ease;
}

/* A date field draws its parts 2 px taller than the text inside the others. */
.tour-input:not(.tour-input--area) {
  height: 3rem;
}

.tour-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.tour-input:focus {
  outline: none;
  border-color: #ed1a20;
}

.tour-input--area {
  resize: vertical;
  min-height: 5rem;
}

/* Marked by leadform.js after a failed validation. */
.tour-input.is-invalid {
  border-color: #ed1a20;
  background-color: rgba(237, 26, 32, 0.08);
}

.tour-form__message {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 1.25rem;
  color: #ffb3b5;
  font-size: 0.9375rem;
}

.tour-form__message.is-ok {
  color: #34c759;
}

.tour-form__submit {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 14rem;
  justify-content: center;
}

/* --------------------------------------------------------- cards / rail --- */
.tours-hero {
  padding: 3rem 0 1.5rem;
  background-color: #2b3141;
}

.tours-hero__title {
  margin: 0.5rem 0 0.75rem;
  font-size: 1.875rem;
}

.tours-hero__lead {
  margin: 0;
  max-width: 46rem;
  color: #e6e9f5;
  line-height: 1.6;
}

.tours-list {
  padding: 2.5rem 0 1rem;
}

.tours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
  gap: 1.5rem;
}

/* Six tracks from the width where auto-fill would go to three columns, so the rows
   always fill: three to a row, and a remainder of one or two is shared out over the
   last rows. Four tours read 2+2 and five 3+2, not 3+1. No count is written down:
   the editor publishes and withdraws tours. */
@media (min-width: 63.8125rem) {
  .tours-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .tours-grid > .tour-card {
    grid-column: span 2;
  }

  .tours-grid > .tour-card:nth-child(3n+1):nth-last-child(2),
  .tours-grid > .tour-card:nth-child(3n+1):nth-last-child(2) ~ .tour-card,
  .tours-grid > .tour-card:nth-child(3n+1):nth-last-child(4),
  .tours-grid > .tour-card:nth-child(3n+1):nth-last-child(4) ~ .tour-card {
    grid-column: span 3;
  }
}

.tours-empty {
  margin: 0;
  color: #e6e9f5;
}

.tour-card {
  display: flex;
  flex-direction: column;
  background-color: #2b3141;
  border-radius: 20px;
  overflow: hidden;
}

.tour-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.tour-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.tour-card:hover .tour-card__image {
  transform: scale(1.04);
}

.tour-card__image--placeholder {
  background: linear-gradient(135deg, #3a4257 0%, #2b3141 100%);
}

/* flex: the link at the end has margin-top: auto, which needs height to take up:
   in one row of equal cards it stood right after each one's text. */
.tour-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.5rem;
  padding: 1.25rem;
}

.tour-badges--card .tour-badge {
  background-color: #3a4257;
  border-color: rgba(255, 255, 255, 0.18);
  font-size: 0.8125rem;
}

.tour-card__title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.3;
}

.tour-card__title a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.35s ease;
}

.tour-card__title a:hover,
.tour-card__title a:focus-visible {
  color: #ed1a20;
  text-decoration: underline;
}

.tour-card__excerpt {
  margin: 0;
  color: #e6e9f5;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tour-card__meta {
  margin: 0;
  color: #cfd5e7;
  font-size: 0.9375rem;
}

.tour-card__more {
  margin-top: auto;
  padding-top: 0.5rem;
  color: #ed1a20;
  font-weight: 600;
  font-size: 0.9375rem;
}

a.tour-card__more {
  align-self: flex-start;
  text-decoration: none;
  transition: color 0.35s ease;
}

a.tour-card__more:hover {
  color: #ffffff;
}

/* 44px under a thumb. The negative margin takes it back from the card's own
   padding, so the card stays the height it was. */
@media (max-width: 48rem) {
  a.tour-card__more {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding-top: 0;
    margin-bottom: -0.5rem;
  }
}

.tour-others {
  padding: 1rem 0 3rem;
}

.tour-others__track {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.tour-others__track .tour-card {
  flex: 0 0 min(22rem, 80vw);
  scroll-snap-align: start;
}

/* From a tablet up the rail shares its row out instead of scrolling: three cards of
   22rem do not fit below 1130 px, so the third was cut by the edge. From 738 px
   (iPad portrait is 768) the second card ends inside the rail and the third starts
   past its edge: out of sight, with nothing to say it was there. Below that the
   second card is cut, which says the rail goes on. 46rem is the first rem step
   under 738 px. */
@media (min-width: 46rem) {
  .tour-others__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 22rem);
    overflow-x: visible;
  }
}

/* ----------------------------------------------------------- 768 and down -- */
/* 48.0625rem — точное дополнение к 48rem, которым пользуется
   этот же файл до перестановки: нет ширины, где сработали бы
   оба правила или ни одного. */
@media (min-width: 48.0625rem) {
  .tour-hero--image {
    padding: 5rem 0 3.5rem;
  }

  .tour-hero__title {
    font-size: 2.5rem;
  }

  .tours-hero__title {
    font-size: 2.5rem;
  }

  .tour-section__title {
    font-size: 2rem;
  }

  .tour-booking__inner {
    padding: 2rem;
  }

  /* Five short fields: 3+2 on six tracks. auto-fit gave 4+1, with «Количество
     человек» alone on a row at a quarter of its width. */
  .tour-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .tour-field {
    grid-column: span 2;
  }

  .tour-field:nth-of-type(4),
  .tour-field:nth-of-type(5) {
    grid-column: span 3;
  }

  .tour-field--wide {
    grid-column: 1 / -1;
  }
}

/* Осталось max-width: у этих свойств нет базового значения,
   и «вернуть как было» на широком экране было бы догадкой. */
@media (max-width: 48rem) {
  .tour-day__summary {
    padding-right: 2.5rem;
  }
}


@media (prefers-reduced-motion: reduce) {
  .tour-card__image,
  .tour-day__summary,
  .tour-day__summary::after,
  .tour-input {
    transition: none;
  }
}
