/* Build Your Own Tour: a paper map. Paper in light and dark mode alike, because a map is paper.
   The lines behind the sheet are real: the mountains around Silz, traced from open elevation data (img/topo.svg). */
.tour-band { --ink: #3a281c; --ink-2: #5c4634; --head-ink: #3a281c; --accent-ink: #a34202; --line: rgb(58 40 28 / 0.2); --sheet: #fbf6ea;
  position: relative; overflow: clip; background: #eadfc6 url("img/topo.svg") center / cover; color: var(--ink); color-scheme: light; }
.tour-band > .wrap { position: relative; z-index: 1; }

/* the sheet: a neatline just inside its edge, and the two creases of a map that has been folded and carried */
.tour-card { position: relative; padding: clamp(24px, 3.6vw, 48px); border-radius: var(--r);
  background: linear-gradient(90deg, transparent 33.2%, rgb(58 40 28 / 0.055) 33.33%, transparent 33.7%, transparent 66.5%, rgb(58 40 28 / 0.055) 66.66%, transparent 67%), linear-gradient(90deg, var(--sheet) 52%, rgb(251 246 234 / 0.72));
  box-shadow: inset 0 0 0 7px var(--sheet), inset 0 0 0 8px rgb(58 40 28 / 0.42), 0 1px 2px rgb(58 40 28 / 0.2), 0 26px 48px -28px rgb(58 40 28 / 0.6); }
.tour-card.is-open, .tour-page .tour-card { background: linear-gradient(90deg, transparent 33.2%, rgb(58 40 28 / 0.055) 33.33%, transparent 33.7%, transparent 66.5%, rgb(58 40 28 / 0.055) 66.66%, transparent 67%), var(--sheet); }
.tour-card__where { position: absolute; top: 20px; right: 26px; font: 400 0.82rem/1.3 var(--ui); letter-spacing: 0.03em; color: var(--ink-2); }
.tour-card .title, .tour-card h3 { color: #3a281c; }
.tour-card .lede { color: rgb(58 40 28 / 0.9); max-width: 54ch; }
.tour-card__top { display: grid; gap: clamp(16px, 2.6vw, 28px); align-items: center; }
.tour-card__words { display: grid; gap: 10px; min-width: 0; }
.tour-card__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.tour-card__acts .more { color: #a34202; }
.tour-card.is-open .tour-card__acts { display: none; }

/* the icon: a little route that draws itself, inside a map-style ring */
.tour-icon { display: grid; place-items: center; width: clamp(84px, 9vw, 112px); aspect-ratio: 1; border-radius: 999px; color: #3a281c; background: #f3e9d2; box-shadow: inset 0 0 0 1px rgb(58 40 28 / 0.5), inset 0 0 0 5px #f3e9d2, inset 0 0 0 6px rgb(58 40 28 / 0.22); transition: box-shadow 200ms var(--ease), transform 200ms var(--ease); }
.tour-icon:hover, .tour-icon[aria-expanded="true"] { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgb(58 40 28 / 0.7), inset 0 0 0 5px #f3e9d2, inset 0 0 0 6px rgb(58 40 28 / 0.3), 0 12px 22px -12px rgb(58 40 28 / 0.6); }
.tour-icon svg { width: 58%; height: 58%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tour-icon .route { stroke: #a34202; stroke-dasharray: 1; }
.tour-icon .pin { fill: #a34202; stroke: none; }

/* the card opens in place: the panel's height grows and everything stays on the sheet */
.tour-panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 700ms var(--ease), visibility 0s 700ms; }
.tour-card.is-open .tour-panel { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 700ms var(--ease), visibility 0s; }
.tour-panel__clip { min-height: 0; overflow: hidden; }
.tour-card.is-open .tour-panel__in { padding-top: clamp(20px, 3vw, 34px); }
.tour-close { margin-top: 18px; }
.tour-link-out { color: #a34202; }
.tb-link, .tour-close { min-height: 44px; padding: 0; border: 0; background: none; color: #a34202; font: 500 0.95rem/1.2 var(--ui); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; transition: color 180ms var(--ease); }
.tb-link:hover, .tour-close:hover { color: #3a281c; }

.tour-band .btn--ghost { color: #3a281c; box-shadow: inset 0 0 0 1px rgb(58 40 28 / 0.55); }
.tour-band .btn--ghost:hover { background: #3a281c; color: #fbf6ea; box-shadow: inset 0 0 0 1px #3a281c; }
.tb-link:hover, .tour-close:hover { color: #3a281c; }

/* the quiz */
.tb { display: grid; gap: clamp(20px, 3vw, 40px); color: #3a281c; font-family: var(--ui); }
.tb__main { display: grid; gap: 14px; align-content: start; min-width: 0; }
.tb__progress { height: 4px; border-radius: 999px; background: repeating-linear-gradient(90deg, rgb(58 40 28 / 0.3) 0 9px, transparent 9px 16px); overflow: hidden; }
.tb__fill { display: block; height: 100%; border-radius: inherit; background: #a34202; transform: scaleX(var(--p, 0)); transform-origin: left; transition: transform 500ms var(--ease); }
.tb__count { font-size: 0.92rem; font-weight: 500; color: rgb(58 40 28 / 0.86); }
.tb__set { margin: 0; padding: 0; border: 0; min-width: 0; }
.tb__set legend { padding: 0; }
.tb h3 { font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.5rem); outline: none; }
.tb__sub { margin-top: 6px; margin-bottom: 16px; font-size: 1rem; color: rgb(58 40 28 / 0.88); }
.tb__nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.tb__nav [data-next] { margin-left: auto; }
.tb__nav .btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.tb__nav .btn[disabled]:hover { transform: none; background: var(--accent); }

/* one option: the real input is the whole card */
.tb-opt { position: relative; display: block; border-radius: var(--r); background: rgb(58 40 28 / 0.08); box-shadow: inset 0 0 0 1px rgb(58 40 28 / 0.2); cursor: pointer; transition: background 200ms var(--ease), box-shadow 200ms var(--ease); }
.tb-opt:hover { background: rgb(58 40 28 / 0.13); box-shadow: inset 0 0 0 1px rgb(58 40 28 / 0.36); }
.tb-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tb-opt:has(input:checked) { background: rgb(200 81 3 / 0.1); box-shadow: inset 0 0 0 2px #a34202; }
.tb-opt:has(input:focus-visible) { outline: 2px solid #3a281c; outline-offset: 2px; }

.tb-places { display: grid; gap: 8px; }
.tb-place { display: grid; grid-template-columns: clamp(84px, 22%, 116px) minmax(0, 1fr); align-items: stretch; overflow: hidden; }
.tb-place img { width: 100%; height: 100%; min-height: 76px; object-fit: cover; }
.tb-place__txt { display: grid; align-content: center; gap: 1px; padding: 8px 46px 8px 12px; font-size: 0.92rem; line-height: 1.32; color: rgb(58 40 28 / 0.9); }
.tb-place__txt b { font: 600 1.28rem/1.1 var(--head); color: #3a281c; }
.tb-place__txt small { display: inline; font-size: 0.82rem; color: #a34202; }
/* the pin drops onto a chosen place */
.tb-pin { position: absolute; top: 50%; right: 8px; margin-top: -16px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: #fff; opacity: 0; translate: 0 -16px; transition: opacity 180ms ease-out, translate 420ms cubic-bezier(0.34, 1.56, 0.64, 1); pointer-events: none; }
.tb-pin svg { width: 20px; height: 20px; fill: none; stroke: #a34202; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
input:checked ~ .tb-pin { opacity: 1; translate: 0 0; }

/* days: the sun crosses the sky as the days add up */
.tb-days { display: grid; gap: 10px; justify-items: center; padding: 18px; border-radius: var(--r); background: rgb(58 40 28 / 0.06); box-shadow: inset 0 0 0 1px rgb(58 40 28 / 0.16); }
.tb-sun { width: min(100%, 320px); overflow: visible; }
.tb-sun__arc { fill: none; stroke: rgb(58 40 28 / 0.4); stroke-width: 1.5; stroke-dasharray: 3 5; }
.tb-sun__ground { stroke: rgb(58 40 28 / 0.5); stroke-width: 1.5; }
.tb-sun__ball { fill: #a34202; transition: transform 420ms var(--ease); }
.tb-days__n { font: 600 clamp(2.6rem, 2rem + 2vw, 3.6rem)/1 var(--head); color: #3a281c; }
.tb-days__n span { font-size: 0.5em; }
.tb-days__dots { display: flex; gap: 6px; }
.tb-days__dots i { width: 10px; height: 10px; border-radius: 999px; background: rgb(58 40 28 / 0.2); transition: background 220ms var(--ease), scale 280ms var(--ease); }
.tb-days__dots i.is-on { background: #a34202; scale: 1.1; }
.tb-range { width: 100%; height: 44px; margin: 0; accent-color: #a34202; cursor: pointer; }

.tb-list { display: grid; gap: 10px; }
.tb-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; }
.tb-row__txt { display: grid; gap: 2px; font-size: 0.95rem; line-height: 1.38; color: rgb(58 40 28 / 0.9); min-width: 0; }
.tb-row__txt b { font: 600 1.28rem/1.15 var(--head); color: #3a281c; }
.tb-letter { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; font: 600 1.4rem/1 var(--head); background: rgb(58 40 28 / 0.12); box-shadow: inset 0 1px 0 rgb(58 40 28 / 0.4), inset 0 0 0 1px rgb(58 40 28 / 0.18); transition: background 220ms var(--ease), color 220ms var(--ease); }
input:checked ~ .tb-letter { background: #a34202; color: #fff; }
.tb-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tb-stay { display: grid; gap: 4px; justify-items: center; padding: 18px 14px; text-align: center; font-size: 0.95rem; line-height: 1.38; color: rgb(58 40 28 / 0.9); }
.tb-stay b { font: 600 1.28rem/1.15 var(--head); color: #3a281c; }

/* the little drawings: each one draws itself when its option is chosen */
.tb-ill { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; color: #a34202; overflow: visible; }
.tb-ill--wide { width: 96px; height: 46px; }
.tb-ill--big { width: 92px; height: 76px; }
.tb-glow { fill: rgb(58 40 28 / 0.16); stroke: none; transition: fill 500ms 400ms ease-out; }
input:checked ~ .tb-ill .tb-glow { fill: #ffe0a8; }
.tb-breath { stroke-opacity: 0.45; transform-box: fill-box; transform-origin: center; }
input:checked ~ .tb-ill .tb-breath { stroke-opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  input:checked ~ .tb-ill .tb-draw { stroke-dasharray: 1; animation: tb-draw 900ms var(--ease) both; }
  input:checked ~ .tb-ill .tb-draw:nth-child(2) { animation-delay: 120ms; }
  input:checked ~ .tb-ill .tb-draw:nth-child(3) { animation-delay: 240ms; }
  input:checked ~ .tb-ill .tb-draw:nth-child(4) { animation-delay: 360ms; }
  input:checked ~ .tb-ill .tb-breath { animation: tb-breath 3.6s ease-in-out 2 both; }
  input:checked ~ .tb-ill .tb-breath--2 { animation-delay: 120ms; }
  input:checked ~ .tb-ill .tb-breath--3 { animation-delay: 240ms; }
  /* each step arrives gently, its options one after another */
  .tb__set > legend, .tb__sub, .tb-days, .tb__result > * { animation: tb-rise 480ms var(--ease) both; }
  .tb-opt { animation: tb-rise 480ms var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms + 60ms); }
  .tb-days-list li { animation: tb-rise 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 110ms + 700ms); }
  .tb-ping { animation: tb-ping 1.1s var(--ease) 1 both; transform-box: fill-box; transform-origin: center; }
  .tour-icon .route { animation: tb-draw 2s var(--ease) 500ms both; }
}
@keyframes tb-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes tb-breath { 0%, 100% { transform: scale(0.82); } 50% { transform: scale(1.06); } }
@keyframes tb-rise { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes tb-ping { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(2.6); opacity: 0; } }

/* the map */
.tb__map { position: relative; display: none; margin: 0; align-self: start; border-radius: var(--r); overflow: hidden; min-width: 0; box-shadow: 0 0 0 1px rgb(58 40 28 / 0.5), 0 0 0 5px var(--sheet), 0 0 0 6px rgb(58 40 28 / 0.22); background: repeating-linear-gradient(0deg, transparent 0 79px, rgb(41 88 117 / 0.16) 79px 80px), repeating-linear-gradient(90deg, transparent 0 79px, rgb(41 88 117 / 0.16) 79px 80px), #cfe0e2; }
.tb.is-result .tb__map { display: block; }
.tb__map svg { display: block; width: 100%; height: auto; aspect-ratio: 1000 / 746; }
.tb__hint { position: absolute; left: 12px; bottom: 10px; right: 12px; font-size: 0.88rem; color: rgb(58 40 28 / 0.88); }
.tb-lands path { fill: #f6eedd; stroke: rgb(58 40 28 / 0.42); stroke-width: 0.8; vector-effect: non-scaling-stroke; transition: fill 500ms var(--ease); }
.tb-lands path.is-on { fill: #ecc9a0; }
.tb-dot { fill: #fbf6ea; stroke: #a34202; stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.tb-ping { fill: #a34202; opacity: 0; }
.tb-head { fill: #a34202; }
.tb-route { fill: none; stroke: #a34202; stroke-linecap: round; }
.tb-route--travel { opacity: 0.6; }
.tb-label { fill: #3a281c; font-family: var(--head); font-weight: 600; paint-order: stroke; stroke: #f6eedd; stroke-width: 0.28em; stroke-linejoin: round; }
.tb-label--stop { font-weight: 500; }

/* the result */
.tb__result { display: grid; gap: 12px; }
.tb__where { font: italic 500 clamp(1.25rem, 1.1rem + 0.6vw, 1.55rem)/1.25 var(--head); color: #a34202; }
.tb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-chips li { padding: 5px 12px; border-radius: 999px; font-size: 0.9rem; font-weight: 500; background: rgb(58 40 28 / 0.12); box-shadow: inset 0 1px 0 rgb(58 40 28 / 0.35), inset 0 0 0 1px rgb(58 40 28 / 0.16); }
.tb-days-list { display: grid; gap: 0; margin: 2px 0 0; padding: 0; list-style: none; }
.tb-days-list li { display: grid; gap: 1px; padding: 9px 0; border-top: 1px solid rgb(58 40 28 / 0.2); font-size: 0.98rem; line-height: 1.38; }
.tb-days-list li:last-child { border-bottom: 1px solid rgb(58 40 28 / 0.2); }
.tb-days-list b { font-weight: 600; color: #a34202; font-size: 0.9rem; }
.tb__note { font-size: 0.95rem; color: rgb(58 40 28 / 0.88); }
.tb__acts { display: flex; flex-wrap: wrap; gap: 10px; }
.tb__small { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 20px; }
.tb-copied { font-size: 0.9rem; color: #3a281c; overflow-wrap: anywhere; }

/* the page */
.tour-page { padding-block: clamp(28px, 4vw, 56px) clamp(48px, 6vw, 88px); }
.tour-page__head { display: grid; gap: 10px; margin-bottom: clamp(18px, 2.6vw, 30px); }
.tour-page__head h1 { font-size: clamp(2.5rem, 1.7rem + 3vw, 4rem); color: #3a281c; }

@media (min-width: 900px) {
  .tour-card__top { grid-template-columns: auto minmax(0, 1fr); }
  .tb { grid-template-columns: minmax(0, 11fr) minmax(0, 12fr); }
  .tb__map { display: block; position: sticky; top: calc(var(--nav-h) + 16px); }
  .tb.is-result { grid-template-columns: minmax(0, 9fr) minmax(0, 14fr); }
}
@media (max-width: 899px) {
  /* phones: the map joins at the result, above the details */
  .tb.is-result .tb__map { order: -1; }
}
@media (max-width: 480px) {
  .tb-row { grid-template-columns: auto minmax(0, 1fr); }
  .tb-row .tb-ill--wide { grid-column: 1 / -1; width: 100%; height: 40px; }
  .tb__acts .btn { flex: 1 1 100%; }
}
@media (max-width: 899px) {
  /* phones: the sheet stays solid so the words read, and the creases give way */
  .tour-card { background: var(--sheet); }
  .tour-card__where { position: static; margin-bottom: 12px; }
}
