/* ==========================================================================
   trip.css: the trip companion layout (Today / Days / Kit tabs).
   Used by every page in /<trip>/. Colours come from base.css tokens.
   ========================================================================== */

body.trip { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.trip .topbar, .ticket, .wrap { max-width: 620px; }
.wrap { margin: 0 auto; padding: 6px 16px 24px; }

/* ---------- Hero ticket ---------- */
.ticket { margin: 0 auto; background: var(--card); border: 2px solid var(--ink); border-radius: 22px; padding: 22px 20px 20px; position: relative; box-shadow: 0 6px 0 var(--shadow); min-height: 170px; }
.ticket .th { font-size: clamp(32px, 9vw, 44px); color: var(--title); }
.ticket .th.small { font-size: 28px; margin-top: 6px; }
.ticket p { margin: 10px 0 0; color: var(--soft); }
.big { font-family: Fraunces, serif; font-size: clamp(44px, 14vw, 64px); font-weight: 700; color: var(--accent); line-height: 1; }
.stk { position: absolute; right: 14px; top: -22px; width: 54px; height: 54px; transform: rotate(10deg); }

/* ---------- Word of the day ---------- */
.word { text-align: center; background: var(--butter); }
.word .w { font-family: var(--word-font, Fraunces, serif); font-weight: 700; font-size: clamp(46px, 14vw, 66px); color: var(--title); line-height: 1.1; margin-top: 4px; }
.word .say { font-family: Caveat, cursive; font-size: 30px; font-weight: 700; line-height: 1; }
.word .mean { font-weight: 600; margin-top: 4px; }
.word .tip { color: var(--soft); font-size: 15px; margin: 6px 0 12px; }
.row-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- Highlights strip (polaroids) ---------- */
.strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 18px 6px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip .pola { flex: none; width: 168px; scroll-snap-align: center; cursor: pointer; transition: transform .2s; }
.strip .pola:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.strip .pola.on { box-shadow: 0 0 0 2px var(--ink), 0 0 0 6px var(--accent), 0 6px 0 var(--shadow); }

/* ---------- Simple info cards ---------- */
.legs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; margin-top: 6px; }
.legs span { background: var(--tint); border-radius: 8px; padding: 2px 8px; font-size: 14px; }
.legs i { font-style: normal; color: var(--accent); }
.upnext h3 { font-size: 22px; }

/* ---------- Days ---------- */
.group-pola { width: min(270px, 78%); margin: 34px auto 16px; }
.day { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; margin-bottom: 10px; overflow: hidden; scroll-margin-top: 16px; }
.day.today { box-shadow: 0 0 0 4px var(--accent); }
.day-head { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; cursor: pointer; min-height: 64px; }
.day-head:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.date { text-align: center; background: var(--tint); color: var(--ink); border-radius: 12px; padding: 4px 0; line-height: 1.1; }
.date b { display: block; font-family: Fraunces, serif; font-size: 24px; }
.date small { font-size: 13px; font-weight: 600; }
.day h3 { font-size: 19px; }
.day .tg { font-size: 14px; color: var(--soft); font-weight: 500; }
.chev { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; transition: transform .2s; font-weight: 700; }
.day.open .chev { transform: rotate(90deg); }
.day-body { display: none; padding: 0 14px 14px; border-top: 2px dashed var(--hairline); }
.day.open .day-body { display: block; }
.move { background: var(--mint); border-radius: 12px; padding: 8px 12px; margin: 12px 0 4px; font-size: 15px; }
.flag { background: var(--butter); border-radius: 12px; padding: 8px 12px; margin: 10px 0 4px; font-size: 15px; }
.filler { font-size: 14px; color: var(--soft); margin: 12px 0 6px; }
textarea { width: 100%; min-height: 72px; border: 2px solid var(--hairline); border-radius: 12px; padding: 10px; background: var(--bg); font-size: 16px; resize: vertical; margin-top: 8px; }

/* ---------- Kit ---------- */
.phrases { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.phrases button { text-align: left; border: 2px solid var(--ink); background: var(--card); border-radius: 14px; padding: 10px 12px; min-height: 44px; }
.phrases b { display: block; font-family: var(--word-font, Fraunces, serif); font-size: 20px; }
.phrases small { color: var(--soft); font-size: 14px; }
.conv { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.conv input { width: 100%; min-height: 52px; border: 2px solid var(--hairline); border-radius: 12px; padding: 8px 12px; background: var(--bg); font-size: 20px; font-weight: 600; }
.rate { width: 72px; border: 0; border-bottom: 2px solid var(--hairline); background: none; font-size: 16px; }
.money-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 2px dashed var(--hairline); }
.money-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; gap: 10px; }
.money-total .big { font-size: 34px; }

/* ---------- Full-screen "show it" card ---------- */
.show { position: fixed; inset: 0; z-index: 20; background: var(--bg); display: none; place-items: center; text-align: center; padding: 24px; }
.show.on { display: grid; }
.show .w { font-family: var(--word-font, Fraunces, serif); font-size: clamp(44px, 14vw, 90px); font-weight: 700; color: var(--title); line-height: 1.2; }
.show .say { font-size: 22px; margin: 8px 0 4px; }

/* ---------- Bottom tabs ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 2px solid var(--ink); display: flex; justify-content: center; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabs a { flex: 1; max-width: 150px; text-align: center; text-decoration: none; color: var(--ink); font-size: 13px; font-weight: 600; padding: 6px 0; border-radius: 14px; min-height: 52px; }
.tabs svg { margin: 0 auto 2px; width: 24px; height: 24px; }
.tabs a[aria-current="page"] { color: var(--title); background: var(--tint); }

.view { display: none; }
.view.on { display: block; animation: pop .35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Theme effects ---------- */
/* Falling particles (assets/js/effects.js) sit above content but never block taps */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 15; }

/* Decorations inside the gingham lid. They sit behind the ticket. */
.lid .decor { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lid .topbar, .lid .ticket { position: relative; z-index: 1; }

/* China: a string of red lanterns swinging between the logo and the ticket */
.garland { position: relative; z-index: 1; max-width: 620px; height: 50px; margin: -6px auto 4px; display: flex; justify-content: space-between; padding: 0 14px; }
.garland::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 26px; border-bottom: 2px solid var(--ink); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.garland svg { width: 26px; height: 44px; transform-origin: 50% 0; animation: swing 3.2s ease-in-out infinite; }
.garland svg:nth-child(2n) { animation-delay: -1.1s; } .garland svg:nth-child(3n) { animation-delay: -2.1s; }
.garland svg:nth-child(1), .garland svg:nth-child(5) { margin-top: -6px; } .garland svg:nth-child(3) { margin-top: 6px; }
@keyframes swing { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }

/* Tromsø: a slow aurora glow drifting behind the ticket */
.aurora { position: absolute; left: -30%; right: -30%; top: 0; height: 55%; background:
    radial-gradient(40% 60% at 30% 50%, rgba(80, 255, 180, .55), transparent 70%),
    radial-gradient(35% 55% at 70% 40%, rgba(255, 120, 210, .45), transparent 70%);
  filter: blur(18px); animation: aurora 9s ease-in-out infinite alternate; }
@keyframes aurora { from { transform: translateX(-8%) skewX(-6deg); } to { transform: translateX(8%) skewX(6deg); } }

/* Static "plan at a glance" (written by tools/prerender.js for SEO) */
.glance { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 4px 16px; margin: 4px 0 12px; }
.glance summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.glance ol { margin: 0 0 12px; padding-left: 20px; font-size: 15px; color: var(--soft); }
.glance li { margin: 0 0 8px; }
.glance b { color: var(--ink); }

/* ---------- Route map (illustrated, see renderMap in trip-app.js) ---------- */
.map-card { padding: 10px; background: var(--paper); }
.trip-map { width: 100%; height: auto; border-radius: 14px; box-shadow: 0 0 0 2px var(--ink); }
.trip-map .route-under { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; opacity: .85; }
.trip-map .route { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-dasharray: 1 7; stroke-linecap: round; animation: route-march 1s linear infinite; }
.trip-map .stamp-shadow { fill: rgba(0, 0, 0, .22); }
.trip-map .stamp-ring { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.trip-map .stamp-edge { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.trip-map .num { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.trip-map .num-t { font: 700 9px Outfit, system-ui, sans-serif; fill: #fff; text-anchor: middle; }
.trip-map .here-ring { fill: none; stroke: var(--accent); stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: pin-pulse 1.6s ease-out infinite; }
.trip-map .label rect { fill: #fff; stroke: var(--ink); stroke-width: 1.4; }
.trip-map .label text { font: 700 10px Outfit, system-ui, sans-serif; fill: var(--ink); text-anchor: middle; }
.trip-map .m-n { font: 700 7px Outfit, system-ui, sans-serif; fill: var(--ink); }
.trip-map .mover-shape { fill: #fff; stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.trip-map .mover-dot { fill: #fff; stroke: var(--accent); stroke-width: 2.5; }
.trip-map .mover-glow { fill: rgba(255, 255, 255, .35); }
.trip-map .m-cloud { animation: cloud-drift 8s ease-in-out infinite alternate; }
.trip-map .m-aurora { animation: aurora-wave 7s ease-in-out infinite alternate; }
@keyframes route-march { to { stroke-dashoffset: -16; } }
@keyframes pin-pulse { from { transform: scale(1); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@keyframes cloud-drift { to { transform: translateX(10px); } }
@keyframes aurora-wave { from { transform: translateX(-10px) skewX(-4deg); } to { transform: translateX(10px) skewX(4deg); } }

/* ---------- Weather + packing hint ---------- */
.weather { background: var(--card); border: 2px dashed var(--hairline); border-radius: 14px; padding: 10px 12px; margin: 10px 0 14px; font-size: 15px; }
.weather b { font-family: Fraunces, serif; font-size: 18px; color: var(--title); }
.weather span { color: var(--soft); }
.weather p { margin: 4px 0 0; font-size: 14px; color: var(--ink); }
.group-pola + .weather { max-width: 420px; margin: -2px auto 18px; text-align: center; }

/* ---------- Memories (photos after the trip) ---------- */
.memories { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; margin: 14px 0; }
.memories .pola img { aspect-ratio: 4 / 5; }

/* ---------- Postcard ---------- */
.postcard-btn { width: 100%; margin-top: 10px; }
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .45); display: grid; align-items: end; justify-items: center; }
.sheet-card { width: min(520px, 100%); max-height: 94vh; overflow: auto; background: var(--bg); border: 2px solid var(--ink); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-card h2 { font-size: 22px; margin-bottom: 4px; }
.pc-preview { display: block; width: min(250px, 62vw); margin: 10px auto 12px; border-radius: 12px; box-shadow: 0 0 0 2px var(--ink), 0 6px 0 var(--shadow); background: var(--tint); }
.pc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-actions .full { grid-column: 1 / -1; }
.pc-file { position: relative; overflow: hidden; }
.pc-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pc-saved { text-align: center; }
.pc-saved img { width: min(250px, 62vw); margin: 6px auto; border-radius: 12px; }

/* "Say it like" pronunciation line (word of the day) */
.say-like { margin-top: 6px; font-size: 15px; color: var(--soft); }
.say-like span { display: inline-block; font-size: 12px; font-weight: 600; text-transform: lowercase; background: var(--card); border: 1.5px solid var(--hairline); border-radius: 99px; padding: 1px 8px; margin-right: 4px; vertical-align: 1px; }
.say-like b { font-family: Fraunces, serif; font-size: 20px; color: var(--ink); letter-spacing: .02em; }
.show .row-btns { margin-top: 18px; }
