/* Reisbou – Vorschau des Reiseverlaufs (vorschau.js): Planer (modal) und geteilter Link (Seite).
   Baut auf reisbou.css und karte.css auf. */

.vs { display: grid; grid-template-columns: minmax(320px, 42%) minmax(0, 1fr); background: #fff; color: var(--ink); }
.vs-modal { height: 100%; min-height: 0; }
.vs-modal .vs-story { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.vs-modal .vs-mapcol { min-height: 0; }
.vs-page .vs-mapcol { position: sticky; top: 0; height: 100vh; height: 100dvh; }

/* Karte links mit Fortschritt */
.vs-mapcol { position: relative; display: flex; flex-direction: column; background: #F4EFE4; border-right: 1px solid var(--line); }
.vs-map { position: relative; flex: 1; min-height: 0; }
.kmap.tmap { border: 0; border-radius: 0; cursor: default; touch-action: auto; height: 100%; min-height: 0; max-height: none; aspect-ratio: auto; }
.tmap .kmark { cursor: default; background: #fff; color: var(--k-dark); border-color: #7C8581; transition: background-color .4s ease, color .4s ease, border-color .4s ease; }
.tmap .kmark.visited { background: var(--k-dark); color: #fff; border-color: #fff; }
.tmap .kmark.current { box-shadow: 0 0 0 4px rgba(242,210,142,.85), 0 2px 8px rgba(28,36,33,.35); }
.tmap .kmark.end { background: #fff; color: var(--k-tra-i); border-color: var(--k-tra-l); }
.tmap .tseg { transition: stroke-opacity .5s ease; }
.tmap .tseg.future { stroke-opacity: .32; }
.tmap .klabel { opacity: .8; }
.tpin { transform: translate(-50%, calc(-100% - 9px)); z-index: 6; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(20,33,31,.3); background: var(--pin, var(--k-dark)); }
.tpin::after { content: ''; position: absolute; left: 50%; top: 100%; transform: translate(-50%, 1px); border: 8px solid transparent; border-top: 10px solid var(--pin, var(--k-dark)); }
.tpin[hidden] { display: none; }
.tpin.tk-stay { --pin: var(--k-stay); } .tpin.tk-exp { --pin: var(--k-exp); } .tpin.tk-food { --pin: var(--k-food); }
.vs-progress { position: absolute; left: 14px; right: 14px; bottom: 30px; z-index: 20; background: #fff; border-radius: 14px; padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; box-shadow: 0 4px 14px rgba(28,36,33,.12); }
.vs-progress-t { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.vs-where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-km { color: var(--muted); font-size: 12.5px; }
.vs-bar { grid-column: 1 / -1; display: block; height: 6px; border-radius: 3px; background: #ECE9E2; overflow: hidden; }
.vs-bar i { display: block; height: 100%; width: 0; background: var(--k-tra); border-radius: 3px; transition: width .6s ease; }
.vs-toggle { grid-row: 1; grid-column: 2; }

/* Erzählung rechts */
.vs-story { padding: 0 clamp(18px, 3vw, 44px) 40px; display: flex; flex-direction: column; gap: 22px; min-width: 0; outline: none; }
.vs-story > * { flex-shrink: 0; }
.vs-kick { font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--k-tra-i); }
.vs-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 28px; }
.vs-hero h2 { margin: 6px 0 8px; font-family: var(--font-display); font-size: clamp(34px, 4.2vw, 54px); line-height: 1; letter-spacing: -0.03em; }
.vs-lead { margin: 0; font-size: 16.5px; line-height: 1.55; color: var(--ink-2); max-width: 60ch; }
.vs-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 16px; }
.vs-stats div { background: var(--bg); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; }
.vs-stats strong { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.vs-stats span { font-size: 12.5px; color: var(--muted); }
.vs-route { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vs-route li { display: flex; align-items: center; gap: 6px; border: 1px solid #E4E0D7; border-radius: 999px; padding: 3px 11px 3px 3px; font-size: 13.5px; }
.vs-route li span:last-child { color: var(--muted); font-size: 12px; }
.vs-num { width: 22px; height: 22px; border-radius: 50%; background: var(--k-dark); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.vs-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.vs-playbtn { background: #E3A55F; border-color: #E3A55F; color: var(--ink); font-weight: 700; min-height: 48px; padding: 0 20px; }
.vs-collage { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 120px; }
.vs-collage.n1 { grid-template-columns: 1fr; grid-auto-rows: 220px; }
.vs-collage.n3 .vs-photo:first-child { grid-row: span 2; }

.vs-daynav { position: sticky; top: 0; z-index: 3; display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; margin: 0 -4px; background: #fff; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.vs-daynav button { font: inherit; flex: none; min-width: 78px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 4px 10px; cursor: pointer; }
.vs-daynav button strong { font-size: 12.5px; }
.vs-daynav button span { font-size: 11.5px; color: var(--muted); }
.vs-daynav button[aria-current="true"] { background: var(--k-dark); border-color: var(--k-dark); color: #fff; }
.vs-daynav button[aria-current="true"] span { color: #CFD6D3; }

.vs-days { display: flex; flex-direction: column; gap: 34px; }
.vs-day { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 72px; }
.vs-day h3 { margin: 2px 0 0; font-family: var(--font-display); font-size: clamp(24px, 2.6vw, 30px); letter-spacing: -0.02em; }
.vs-free { margin: 0; color: var(--ink-2); }

.vs-item { border-radius: 18px; scroll-margin: 90px; transition: box-shadow .3s ease, border-color .3s ease; }
.vs-item.is-cur { box-shadow: 0 0 0 2px var(--k-route); }
.vs-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vs-body h4 { margin: 0; font-family: var(--font-display); font-size: 21px; }
.vs-body p { margin: 0; font-size: 15px; line-height: 1.6; color: #2F3936; max-width: 70ch; white-space: pre-line; }
.vs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-chips span { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: #3B4440; }
.vs-kind { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 4px 10px; }
.vs-kind.k-exp { background: var(--k-exp-l); color: var(--k-exp-i); }
.vs-kind.k-food { background: var(--k-food-l); color: var(--k-food-i); }
.vs-kind.k-stay { background: var(--k-stay-l); color: var(--k-stay-i); }

.vs-card { border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.vs-card .vs-body { padding: 14px 18px 18px; }
.vs-stay { border: 1px solid var(--line); overflow: hidden; display: grid; grid-template-columns: minmax(160px, 36%) minmax(0, 1fr); }
.vs-stay .vs-body { padding: 14px 16px; }
.vs-move { display: flex; gap: 14px; align-items: flex-start; border: 1px solid #EAD6C8; background: #FDF6F1; padding: 14px 16px; }
.vs-move .vs-body strong { font-size: 15.5px; }
.vs-move .vs-body p { font-size: 14px; color: #4A5653; }
.vs-move .vs-chips span { background: #fff; border: 1px solid #EAD6C8; }
.vs-move-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--k-tra); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.vs-move.k-arrive, .vs-move.k-depart { background: #FBF5E6; border-color: #EBD9A8; }
.vs-move.k-arrive .vs-move-ic, .vs-move.k-depart .vs-move-ic { background: #F2D28E; color: var(--k-dark); }

.vs-photo { position: relative; margin: 0; background: #EDE6D8; overflow: hidden; }
.vs-photo.wide { aspect-ratio: 16 / 9; max-height: 360px; }
.vs-photo.side { height: 100%; min-height: 140px; }
.vs-photo.tile { border-radius: 14px; height: 100%; }
.vs-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vs-photo figcaption { position: absolute; right: 8px; bottom: 8px; background: rgba(20,33,31,.72); color: #fff; font-size: 11.5px; border-radius: 6px; padding: 2px 7px; }
.vs-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #8C8270; font-size: 12.5px; }
.vs-end { display: flex; flex-direction: column; gap: 4px; padding: 18px 0 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.vs-end strong { font-family: var(--font-display); font-size: 22px; color: var(--ink); }

/* Einblenden beim Scrollen */
.vs-anim .vs-item { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s cubic-bezier(.2,.8,.2,1), box-shadow .3s ease; }
.vs-anim .vs-item.vs-in { opacity: 1; transform: none; }

@media (min-width: 1200px) {
  .vs-hero { grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr); align-items: stretch; }
  .vs-collage { grid-auto-rows: minmax(110px, 1fr); }
  .vs-collage.n2 { grid-template-columns: 1fr; }
}
@media (max-width: 899px) {
  .vs { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .vs-mapcol { border-right: 0; border-bottom: 1px solid var(--line); height: 34vh; min-height: 200px; }
  .vs-page .vs-mapcol { position: sticky; top: 0; z-index: 5; height: 34vh; min-height: 200px; }
  /* Seite am Handy: Tagesleiste haftet unter der Karte, Sprungziele landen darunter */
  .vs-page .vs-daynav { top: max(34vh, 200px); }
  .vs-page .vs-day { scroll-margin-top: calc(max(34vh, 200px) + 72px); }
  .vs-page .vs-item { scroll-margin-top: calc(max(34vh, 200px) + 72px); }
  .vs-progress { bottom: 26px; padding: 8px 10px; }
  .vs-stay { grid-template-columns: minmax(0, 1fr); }
  .vs-photo.side { aspect-ratio: 16 / 9; height: auto; }
  .vs-hero h2 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .vs-anim .vs-item { opacity: 1; transform: none; transition: none; }
  .vs-bar i { transition: none; }
}

/* Modales Fenster im Planer */
.vdlg { width: min(1440px, calc(100vw - 32px)); height: calc(100vh - 32px); height: calc(100dvh - 32px); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 22px; box-shadow: 0 24px 60px rgba(10,20,18,.35); overflow: hidden; }
.vdlg[open] { display: flex; flex-direction: column; }
.vdlg::backdrop { background: rgba(20,33,31,.58); }
.vdlg-h { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px 12px 22px; border-bottom: 1px solid var(--line); }
.vdlg-h .vdlg-t { flex: 1 1 260px; min-width: 0; }
.vdlg-h .sdlg-x { position: static; flex: none; }
.vdlg-t span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--k-route); }
.vdlg-t strong { font-family: var(--font-display); font-size: 20px; }
.vdlg-b { flex: 1; min-height: 0; }
.vdlg .msg-error { margin: 0; }
@media (max-width: 899px) {
  .vdlg { width: 100vw; height: 100vh; height: 100dvh; border-radius: 0; }
  .vdlg-h { padding: 8px 10px; }
  .vdlg-t strong { font-size: 16px; }
  .vdlg-h .vdlg-t { flex-basis: calc(100% - 58px); }
  .vdlg-h .sdlg-x { order: 1; }
  .vdlg-h > label, .vdlg-h > .btn { order: 2; }
}
