/* 开口坐标与车窗原图对应，封面和标题以开口为布局容器。 */
.hero.jo-window-hero {
  position: relative;
  isolation: isolate;
  /* Group 3：2648×1810，开口从 (219,453) 到 (2429,1590)。 */
  --window-opening: 25.028% 8.271% 12.155%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: #101b17;
  overflow-x: clip;
}
.jo-window-hero::before,
.jo-window-hero::after { display: none; }
body:has(.jo-window-hero) #header { height: 0; }
.jo-window-stage {
  position: relative;
  aspect-ratio: 2648 / 1810;
  margin-inline: auto;
}
.jo-window-wing { display: none; }
@media (width > 900px) {
  .jo-window-stage {
    /* 三框原宽 2648 + 2 × 1814，两条接缝各叠约 4px。
       1280px 起按拼接总宽等比铺满，紧凑桌面沿用 52vw 上限。 */
    width: min(52vw, calc(max(100%, 1280px) * 2648 / 6268));
  }
  .jo-window-wing {
    position: absolute;
    display: block;
    isolation: isolate;
    z-index: -3;
    inset-block: 0;
    /* Group 5 与中央原图等高，两翼使用同一开口 (406,453)–(1406,1588)。 */
    width: calc(100% * 1814 / 2648);
    --window-opening: 25.028% 22.492% 12.265% 22.381%;
    pointer-events: none;
  }
  .jo-window-wing::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('assets/journione/train-window-side.webp') center / contain no-repeat;
  }
  /* 原图直接拼接，仅覆盖侧框最外缘的透明列。 */
  .jo-window-wing-left { inset-inline-end: 99.85%; }
  .jo-window-wing-right { inset-inline-start: 99.85%; }
}
@media (min-width: 1280px) {
  /* 桌面导航下留出 88px；素材自带的窗框上沿留白约为整排宽度的 5%。 */
  .hero.jo-window-hero {
    padding-block-start: max(0px, calc(88px - 5vw));
    background-color: #18221e;
  }
}
.jo-window-backdrops {
  position: absolute;
  z-index: -2;
  inset: var(--window-opening);
  overflow: hidden;
  background: #211c16;
}
.jo-window-backdrops::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #20171015, #2017105c 55%, #211710a3);
  pointer-events: none;
}
.jo-window-backdrops .jo-window-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0;
  transition: opacity .65s ease;
}
.jo-window-slide.is-active { opacity: 1; }
.jo-window-slide[hidden] { display: none; }
.jo-window-frame { position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.jo-window-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.jo-window-interior { position: absolute; inset: var(--window-opening); container: train-window / inline-size; }
.jo-window-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  position: relative;
  pointer-events: none;
  gap: clamp(8px, 1.2cqi, 18px);
  height: 100%;
  padding: clamp(10px, 1.7cqi, 25px) clamp(11px, 3cqi, 42px) clamp(6px, .65cqi, 9px);
}
.jo-window-copy { align-self: center; text-align: center; }
.jo-window-copy h1,
html[lang=en] .jo-window-copy h1 {
  margin: 0;
  font: 400 clamp(24px, 4.5cqi, 66px)/1.13 var(--jo-serif);
  letter-spacing: -.025em;
  color: #fff8ef;
  text-shadow: 0 2px 18px #23170f88;
}
.jo-window-copy .jo-hero-tags { justify-content: center; margin: 7px 0 0; }
.jo-window-trip-link { position: absolute; inset: 0; border-radius: 8% / 20%; }
.jo-window-trip-link:focus-visible { outline: 2px solid #fff8ef; outline-offset: -6px; }
.jo-window-controls {
  width: min(98%, 1200px);
  justify-self: center;
}
.jo-window-controls:has(.jo-window-caption[hidden]) { display: none; }
.jo-window-caption {
  min-width: 0;
  color: #fff8ef;
  text-shadow: 0 1px 6px #1d130ee0;
  font: 600 clamp(11px, 1.1cqi, 14px)/1.3 var(--jo-sans);
}
.jo-window-trip-title, .jo-window-trip-place > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jo-window-trip-place {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  color: #fff3e6e0;
  font-size: .9em;
  font-weight: 500;
}
.jo-window-trip-place .icon { flex: 0 0 auto; width: 12px; height: 12px; }
.jo-window-dots {
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
}
.jo-window-dots:empty { display: none; }
.jo-window-dot {
  display: grid;
  place-items: center;
  width: clamp(22px, 1.8vw, 34px);
  height: clamp(16px, 1.5vw, 24px);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
}
.jo-window-dot::before {
  content: '';
  width: 70%;
  height: 3px;
  border-radius: 999px;
  background: #fff8ef;
  opacity: .38;
  box-shadow: 0 0 5px #211710aa;
}
.jo-window-dot:hover::before { opacity: .7; }
.jo-window-dot[aria-pressed="true"]::before { opacity: 1; }
.jo-window-dot:focus-visible { outline: 2px solid #fff8ef; outline-offset: -2px; }
body:has(#main > .jo-search-band) { --curated-home-paper: #fffdf9; }
#main:has(> .jo-search-band) { background-color: var(--curated-home-paper); }
.jo-search-band {
  container: home-search / inline-size;
  padding: clamp(6px, .65vw, 10px) clamp(16px, 4vw, 48px);
  background: #18221e;
}
.jo-search-band .jo-discovery-panel {
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 999px;
  background: #fffdf9;
}
.jo-search-band .search-box {
  grid-template-columns: minmax(0,1.5fr) minmax(0,1fr) minmax(0,.65fr) auto;
  align-items: stretch;
  gap: 0;
  padding: clamp(4px, .55cqi, 8px) clamp(13px, 2.35cqi, 34px);
}
.jo-search-band .search-field {
  grid-column: auto;
  min-height: clamp(38px, 4.6cqi, 54px);
  position: relative;
  isolation: isolate;
  --search-field-padding: clamp(12px, 1.5cqi, 21px);
  padding: 0 var(--search-field-padding);
  border: 0;
  cursor: pointer;
}
/* 统一覆盖旧搜索表单在断点下留下的底边和内距。 */
.jo-search-band .search-field:first-child { grid-column: auto; border: 0; padding: 0 var(--search-field-padding); }
.jo-search-band .search-field:not(:nth-child(3))::after {
  content: '';
  position: absolute;
  inset-block: 8px;
  inset-inline-end: 0;
  width: 1px;
  background: #e9e4de;
  pointer-events: none;
}
.jo-search-band .home-picker-toggle { text-align: start; background: transparent; }
.jo-search-band .search-field::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 4px 6px;
  border-radius: 12px;
  pointer-events: none;
}
.jo-search-band .search-field:is(:focus-within, [aria-expanded="true"])::before { background: #f3e8db; }
.jo-search-band .jo-search-label { display: grid; gap: 0; min-width: 0; flex: 1; }
.jo-search-band .search-field small {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(11px, 1.05cqi, 14px);
  font-weight: 600;
}
/* 输入时视觉隐藏标题，保留输入框的可访问名称。 */
.jo-search-band .search-field:has(#search-q[aria-expanded="true"]) small {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
}
.jo-search-band .search-field :is(input,[data-home-value]) {
  width: 100%;
  min-height: 24px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #342b24;
  font: 500 clamp(12px, 1.25cqi, 16px)/1.5 var(--jo-sans);
}
.jo-search-band .search-field:not([data-filled], :has(input:focus)) input {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.jo-search-band .search-field:not([data-filled]) [data-home-value] { display: none; }
.jo-search-band [data-home-value] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jo-search-band .search-field:is([data-filled], :has(input:focus)) small {
  font-size: clamp(10px, 1.05cqi, 12px);
  font-weight: 500;
}
.jo-search-band :is(.home-picker-toggle, .search-field input):focus-visible {
  outline: none !important;
  box-shadow: none;
}
.jo-search-band .search-box > .btn {
  grid-column: auto;
  align-self: center;
  height: clamp(36px, 4.3cqi, 48px);
  min-height: 36px;
  margin-inline-start: 0;
  padding: 0 clamp(12px, 1.9cqi, 27px);
  border-radius: 999px;
  white-space: nowrap;
  font-size: clamp(11px, 1.23cqi, 15px);
}
@media (width > 640px) {
  /* 标题与位置留在开口底部的圆角以内。 */
  .jo-window-layout { padding-inline: 6.5cqi; padding-block-end: 2cqi; }
}
@container train-window (max-width: 680px) {
  .jo-window-controls { width: 100%; }
  .jo-window-caption { max-width: 100%; text-align: center; }
  .jo-window-trip-place { justify-content: center; }
}
@container home-search (max-width: 680px) {
  .jo-search-band .jo-discovery-panel { border-radius: clamp(22px, 7cqi, 46px); }
  .jo-search-band .search-box {
    grid-template-columns: minmax(0, 1fr) minmax(64px, .66fr) auto;
    gap: 3px;
    padding: 5px clamp(11px, 3.7cqi, 25px);
  }
  .jo-search-band .search-field { --search-field-padding: 8px; gap: 4px; min-height: 34px; }
  .jo-search-band .search-field::before { inset: 2px 3px; border-radius: 8px; }
  .jo-search-band .search-field:first-child::before { inset-block-end: 4px; }
  .jo-search-band .search-field:first-child { grid-column: 1 / -1; }
  .jo-search-band .search-field:first-child::after { display: none; }
  .jo-search-band .search-field > .icon { display: none; }
  .jo-search-band .search-box > .btn { width: auto; min-width: 0; height: 36px; min-height: 34px; }
  .jo-search-band .search-box > .btn .icon { display: none; }
}
@container train-window (max-width: 440px) {
  .jo-window-copy .jo-hero-tags li { padding: 4px 7px; font-size: 10px; }
}
@container train-window (max-width: 300px) {
  .jo-window-copy h1,
  html[lang=en] .jo-window-copy h1 { font-size: clamp(20px, 7.6cqi, 24px); }
  .jo-window-copy .jo-hero-tags { gap: 4px; }
  .jo-window-copy .jo-hero-tags li { padding: 3px 5px; font-size: 9px; }
}
@container home-search (max-width: 300px) {
  .jo-search-band .search-box > .btn { padding-inline: 8px; }
}
@media (max-width: 640px) {
  .jo-window-frame img { object-fit: fill; }
  .jo-window-stage {
    aspect-ratio: auto;
    height: clamp(432.4px, 104.8288vw, 526.4px);
    inset-inline: 50% auto;
    width: max(100%, 412px);
    transform: translateX(-50%);
  }
  /* 窄屏照片横向铺到窗框背后，由透明开口裁边；底部避开素材的透明末行。 */
  .jo-window-backdrops { inset: 24.6% 0 1px; }
  .jo-window-interior { inset: 25.8% 15.7% 13.5%; }
  .jo-window-layout { padding-block-end: clamp(8px, 2.8cqi, 13px); }
}
@media (prefers-reduced-motion: reduce) {
  .jo-window-backdrops .jo-window-slide { transition: none; }
}
