/* Final responsive layer, shared by every WordPress template. */
/* iOS webviews can move fixed layers while animating their browser toolbar.
   Sticky remains in document scrolling; clip avoids a body scroll container. */
@supports (-webkit-touch-callout: none) and (overflow: clip) {
  @media (hover: none) and (pointer: coarse) {
    html, body { overflow-x: clip; overflow-y: visible; }
    .header, .header.is-solid {
      position: -webkit-sticky;
      position: sticky;
      top: 0;
      margin-bottom: calc(-1 * var(--header-h));
      transition: none;
      background: var(--chrome-bg);
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
  }
}
.header, .header.is-solid { height: var(--header-h); transition: background-color .2s, border-color .2s; }
.header__logo, .header__nav a, .header__phone { transition: color .2s; }
.header__logo-image { display: block; width: auto; max-width: min(220px, 45vw); height: auto; max-height: 56px; object-fit: contain; }
.catalog-card__price-note, .tour-cost__price-note { margin: 8px 0 0; font-size: 14px; line-height: 1.5; }
.tour-card__meta .tour-card__price-note { flex-basis: 100%; font-size: 14px; line-height: 1.5; }
@media (min-width: 901px) {
  .tour-card__bottom { align-items: flex-end; }
  .tour-card__actions { align-self: flex-end; }
}
.tour-stats__grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.mega-tours__recommendations { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.mega-tours__recommendations a { text-decoration: underline; text-underline-offset: 4px; }
.media__activate { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: pointer; touch-action: pan-y pinch-zoom; }
.media__activate[hidden] { display: none; }
.media__activate:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.tour-card__top { flex-wrap: wrap; }
.tour-card__meta { flex: 1 1 280px; min-width: 0; }
.tour-card__top .tour-card__seats { position: static; flex: 0 1 auto; max-width: 100%; overflow-wrap: anywhere; }
.catalog-card__media { display: flex; flex-wrap: wrap; align-content: flex-start; align-items: flex-start; gap: 8px; height: auto; aspect-ratio: 4 / 3; padding: 16px; }
.catalog-card__media .catalog-card__date,.catalog-card__media .catalog-card__seats { position: relative; inset: auto; max-width: 100%; overflow-wrap: anywhere; }
:where(section[id],article[id],main[id]) { scroll-margin-top: calc(var(--header-h) + 12px); }
@media (max-width: 980px) {
  .history-single .history--related { width: 100%; max-width: 100%; margin-inline: 0; }
}
@media (max-width: 900px) {
  /* Toolbar visibility must not change section heights during scrolling. */
  .catalog {
      padding: 34px clamp(20px, 5vw, 72px) clamp(88px, 12svh, 140px);
  }
  .tour-cost__board--editorial .tour-cost__highlights:has([data-cost-single-date]) {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
}
.tour-cost__highlights:has([data-cost-single-date]) .tour-cost__dates {
  grid-template-columns: minmax(0, 1fr);
}
  .hero { height: 100svh; }
  .tour-hero { min-height: 100svh; }
  .tour-card__meta { flex: 0 1 auto; }
  .tour-card__top .tour-card__seats { order: -1; }
  .tour-media__mosaic,.tour-tabs__gallery { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tour-media__shot,.tour-media__shot--tall,.tour-media__shot--wide { min-width: 0; min-height: 0; aspect-ratio: 1; }
  .where__story { min-height: 0; }
  .where__story-half { min-width: 0; width: 100%; }
  .where__story-half--photo { min-height: 0; aspect-ratio: 16 / 11; }
  .where__story-half--copy { min-height: 0; }
  .where__story-copy { min-height: 0; }
  .mobile-drawer__view { overscroll-behavior: contain; }
}
@media (max-width: 800px) {
  /* Text-only section headings must not inherit the 320px photo banner. */
  .gift .gift__intro--plain { min-height: 0; padding: 24px 20px; }
  .gift__intro--plain .gift__intro-copy { gap: 12px; }
  .where__divider,.safe__divider,.media__head,.how__head { padding-top: 24px; padding-bottom: 24px; }
  .trips,.how,.coop,.coop-steps,.people,.people-teaser,.explore-hub,.blog-single { padding-top: 32px; padding-bottom: 32px; }
  .how__head { padding-top: 0; }
  .trips__head,.how__head,.people__head,.explore-hub__head { margin-bottom: 24px; }
  .coop__intro { margin-bottom: 0; }
  .explore-hub__section,.explore-hub__section--history { margin-bottom: 32px; }
  .explore-hub__section:last-child { margin-bottom: 0; }
  section.blog { padding-bottom: 32px; }
  .page-hero + section.blog { padding-top: 32px; }
  section.blog .filter-nav { margin-bottom: 24px; }
  .blog-feature { margin-bottom: 28px; }
  .blog-feature__grid { gap: 0; }
  .blog-feature__card { min-height: 0; aspect-ratio: 4 / 3; }
  .blog-feature__copy { padding: 28px 20px; gap: 16px; }
  .blog-single__article { margin-bottom: 32px; }
  .blog-related { padding-top: 28px; }
  .blog-related__title { margin-bottom: 24px; }
  /* Service cards follow their content rather than a desktop photo height. */
  .gift-overlay__grid { gap: 0; }
  .gift-overlay__card { min-height: 200px !important; align-items: center; }
  .gift-overlay__card-body { height: auto; gap: 12px; padding: 36px 20px; }
  .gift-overlay .gift-overlay__copy { padding: 28px 20px; gap: 16px; }
  .gift-split__visual { align-items: end; padding: 36px 20px; }
  .gift-split__panel { padding: 28px 20px; gap: 16px; }
  .trips__filters-bar { align-items: stretch; }
  .trips__filters-bar .trips__filters { align-items: stretch; margin-bottom: 0; }
  .trips__filters-bar .trips__filter { flex: 0 0 auto; width: 100%; min-width: 0; max-width: none; }
  .trips__filters-bar .trips__filters-toggle { width: 100%; max-width: none; align-self: stretch; }
  .tour-reviews__grid { grid-template-columns: minmax(0,1fr); }
  .tour-review { min-width: 0; }
  :root { --header-h: 64px; }
  :where(h1,h2,h3,h4,p,li,a) { overflow-wrap: break-word; }
  :where(.page-hero__inner,.tour-hero__inner,.tour-card__info,.product-single__grid > *, .contacts__board > *) { min-width: 0; }
  :where(input:not([type=checkbox]):not([type=radio]),select,textarea) { max-width: 100%; font-size: 16px; }
  .gift-overlay__name { max-width: 100%; }
  .gift-split__visual { min-height: 360px; }
  .safe__visual { min-height: 320px; }
  .tour-cost__actions { grid-template-columns: minmax(0,1fr); }
  .tour-cost__date-button { min-height: 48px; height: auto; }
  .dates-modal__dialog { max-height: calc(100svh - 32px); overflow-y: auto; overscroll-behavior: contain; }
  .dates-modal__list li { flex-wrap: wrap; }
  .mobile-drawer__panel { padding-bottom: env(safe-area-inset-bottom,0px); }
  .mobile-drawer__link,.mobile-drawer__sublink,.mobile-drawer__back { min-height: 44px; }
  .legal-document { padding: calc(var(--header-h) + 32px) 20px 48px; overflow-wrap: anywhere; }
  :where(.content-page,.legal,.legal-document,.blog-single__content) :where(iframe,video,embed,object) { max-width: 100%; }
  :where(.content-page,.legal,.legal-document,.blog-single__content) table { display: block; max-width: 100%; overflow-x: auto; }
  :where(.content-page,.legal,.legal-document,.blog-single__content) pre { max-width: 100%; overflow-x: auto; }
}
@media (hover: none), (pointer: coarse) {
  html { scroll-behavior: auto; }
}
@media (max-width: 360px) {
  .tour-cost__dates { grid-template-columns: minmax(0,1fr); }
  .header__logo { min-width: 0; }
  .header__logo-ru { font-size: 15px; }
}
@media (orientation: landscape) and (max-height: 600px) and (max-width: 1100px) and (pointer: coarse) {
  /* One spacing scale for phones rotated beyond the portrait breakpoints.
     Include the iPhone safe area without adding a second browser-side gutter. */
  :root {
    --header-h: 56px;
    --header-h-solid: 56px;
    --landscape-left: max(20px, env(safe-area-inset-left, 0px));
    --landscape-right: max(20px, env(safe-area-inset-right, 0px));
  }
  .tour-page { --tp-pad: 20px; }
  .header { grid-template-columns: 1fr auto; }
  .header__nav, .header__contacts,
  .header.is-menu-open .header__nav, .header.is-menu-open .header__contacts { display: none; }
  .header__burger { display: flex; width: 44px; height: 44px; padding: 8px; }
  .header__logo-ru { font-size: 17px; }
  .mobile-drawer.is-open { display: block !important; }
  body.is-mobile-drawer-open .header { z-index: 160; height: var(--header-h); background: var(--chrome-bg); }
  body.is-mobile-drawer-open .header__logo { color: var(--ink); }
  body.is-mobile-drawer-open .header__burger span { background: var(--ink); }
  .mobile-drawer__panel { padding-left: env(safe-area-inset-left, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .mobile-drawer__view { overscroll-behavior: contain; }
  .tour-card { min-height: 0; padding: 24px; gap: 24px; }
  .tour-card__bottom { flex-direction: column; gap: 20px; }
  .tour-card__info { flex: 0 1 auto; width: 100%; max-width: none; }
  .tour-card__excerpt { max-width: none; }
  .tour-card__actions { width: 100%; justify-content: flex-start; gap: 12px; }
  .tour-card__actions .btn { flex: 1 1 200px; min-width: 0; min-height: 44px; text-align: center; }
  .tour-card__meta { flex: 0 1 auto; }
  .tour-cost__board--editorial .tour-cost__highlights:has([data-cost-single-date]) { grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
  .tour-cost__highlights:has([data-cost-single-date]) .tour-cost__dates { grid-template-columns: minmax(0, 1fr); }
  .header, .hero__bottom,
  .trips__head, .trips__filters-bar, .trips__list, .trips__footer, .trips__empty,
  .where__divider, .safe__divider, .media__head, .how__inner,
  .gift__head, .gift__grid, .explore-hub__head--inset,
  .page-hero, .catalog, .exp-intro, .people, .people-teaser,
  section.blog, .blog-single, .history, .history-related__head,
  .coop, .coop-steps, .hub, .product-single, .legal, .content-page, .legal-document,
  .tour-hero, .tour-why, .tour-stats, .tour-program__head, .tour-day__inner,
  .tour-tabs, .tour-faq, .tour-reviews, .tour-social, .tour-media__head,
  body .request, .site-footer {
    padding-left: var(--landscape-left);
    padding-right: var(--landscape-right);
  }
  .trips, .how, .people, .people-teaser, .explore-hub, .coop, .coop-steps,
  .blog-single, .history, .hub, .exp-intro,
  .tour-why, .tour-stats, .tour-tabs, .tour-reviews, .tour-social,
  .tour-story__text, .tour-day__inner, body .request {
    padding-top: 32px;
    padding-bottom: 32px;
  }
  .catalog, section.blog, .product-single, .legal, .content-page, .legal-document {
    padding-top: calc(var(--header-h) + 24px);
    padding-bottom: 32px;
  }
  .page-hero + section.blog { padding-top: 32px; }
  .page-hero, .tour-hero { min-height: 100svh; padding-top: calc(var(--header-h) + 24px); padding-bottom: 24px; }
  .hero { height: 100svh; }
  .tour-program__head, .tour-media__head { padding-top: 24px; padding-bottom: 24px; }
  .tour-page .tour-faq { padding-top: 0; padding-bottom: 32px; }
  .tour-media { padding-top: 32px; }
  .trips__head, .how__head, .people__head, .explore-hub__head,
  .blog-related__title, .tour-heading { margin-bottom: 24px; }
  .coop__intro { margin-bottom: 0; }
  .explore-hub__section, .explore-hub__section--history, .blog-single__article { margin-bottom: 32px; }
  .explore-hub__section:last-child { margin-bottom: 0; }
  .blog-related { padding-top: 32px; }
  .blog-pagination, .navigation.pagination { margin-top: 32px; }
  .how__head { padding-top: 0; }
  .gift .gift__intro--plain, .where__story-copy, .safe__content, .safe__panel,
  .gift-split__panel, .gift-split__visual,
  .gift-overlay .gift-overlay__copy, .gift-overlay__card-body,
  .contacts__call, .contacts__channels, .tour-story__text,
  .blog-feature__copy, .story-chapter__copy, .story-chapter--flip .story-chapter__copy {
    padding: 24px var(--landscape-right) 24px var(--landscape-left);
  }
  .gift-split__visual, .gift-overlay__card { min-height: 260px; }
  .gift-overlay__card-body { height: auto; }
  .where__story, .where__story-half, .where__story-copy { min-height: 0; }
  .where__story-half--photo { aspect-ratio: 16 / 9; }
  .tour-cost__board--editorial { padding: 28px var(--landscape-right) 28px var(--landscape-left); }
  .tour-faq > .tour-heading {
    margin-left: calc(-1 * var(--landscape-left));
    margin-right: calc(-1 * var(--landscape-right));
    padding: 24px var(--landscape-right) 24px var(--landscape-left);
  }
  .gift .gift__intro--plain { min-height: 0; }
  .where__divider, .safe__divider, .media__head, .how__head { padding-top: 24px; padding-bottom: 24px; }
  .site-footer { padding: 28px var(--landscape-right) 24px var(--landscape-left); }
  .site-footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
  .site-footer__brand { grid-column: 1 / -1; }
  .site-footer__grid > * { min-width: 0; overflow-wrap: anywhere; }
  .site-footer__logo { font-size: 16px; }
}
.tour-media__mosaic--natural {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  grid-template-rows: none;
  grid-auto-rows: auto;
}
.tour-media__mosaic--natural .tour-media__shot {
  grid-column: auto;
  grid-row: auto;
  aspect-ratio: 4 / 3;
  min-height: 0;
}

/* Equal previews prevent portrait photos from leaving holes in each row. */
.tour-page .tour-tabs__panel {
  width: 100%;
  max-width: none;
}
.tour-tabs__panel .tour-tabs__gallery {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}
.tour-tabs__panel .tour-tabs__gallery figure {
  aspect-ratio: auto;
  min-width: 0;
}
.tour-tabs__panel .tour-tabs__photo {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: zoom-in;
}
.tour-tabs__panel .tour-tabs__photo:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: -3px;
}
.tour-tabs__panel .tour-tabs__gallery .tour-tabs__photo img {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  object-fit: cover;
}
.tour-tabs__panel .tour-tabs__gallery figure:only-child { grid-column: 1 / -1; }
@media (min-width: 601px) and (max-width: 900px) {
  .tour-tabs__panel .tour-tabs__gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .tour-tabs__panel .tour-tabs__gallery { grid-template-columns: minmax(0, 1fr); }
}
