/* BIG-858 rung 2: "a day assembles", styled after the app's own split (map left, timeline right, as on the
   iPhone Duo's inner screen), simplified and stylised rather than copied. A made-up day in a made-up city. */

/* the map palette, shared by the day animation and the extras' illustrations */
.day, .extras {
  --land: #f3efea;
  --road: #ffffff;
  --road-edge: #e6e0d8;
  --park: #d3eac7;
  --water: #c3def0;
  --rail: #d2cbc1;
  --raw: #9a97a3;
  --walk: #22a45d;
  --train: #d29a1e;
  --cycle: #2f80dd;
  --visit: #7a3cf0;
  --pane: #ffffff;
  --label-bg: #ffffff;
  --casing: #ffffff;
}

.day {
  position: relative;
  height: 420vh;
  overflow-x: clip;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 18%, var(--bg-soft) 82%, var(--bg) 100%);
}

@media (prefers-color-scheme: dark) {
  .day, .extras {
    --land: #1c1b21;
    --road: #2c2a33;
    --road-edge: #24232a;
    --park: #1d2e22;
    --water: #182b3b;
    --rail: #3a3843;
    --raw: #8a8794;
    --walk: #3fbf74;
    --train: #e3b04a;
    --cycle: #5aa2ec;
    --visit: #a07bff;
    --pane: #16151b;
    --label-bg: #24232b;
    --casing: #16151b;
  }
}

.day-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 22px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 7vh 24px 6vh;
}

.day-head { text-align: center; }
.day-head h2 { font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 6px; }
.day-head p { color: var(--text-soft); margin: 0 auto; max-width: 36em; font-size: 17px; }

/* the window: one rounded panel, map and timeline side by side */
.day-window {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 0;
  max-height: 620px;
  border-radius: 30px;
  overflow: hidden;
  background: var(--pane);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 30px 70px -20px rgba(40, 20, 90, 0.28), 0 8px 24px rgba(40, 20, 90, 0.08);
}

.day-map { position: relative; min-height: 0; background: var(--land); }
.day-map svg { display: block; width: 100%; height: 100%; }

.day-label {
  position: absolute;
  transform: translate(-50%, calc(-100% - 16px));
  background: var(--label-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px 6px 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(30, 20, 60, 0.16);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.day-label::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--visit); margin-right: 7px; vertical-align: 1px; }
.day-label.on { opacity: 1; }

/* the timeline pane */
.day-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--rule);
  background: var(--pane);
}
.day-list header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--rule);
}
.day-list header b { font-size: 18px; letter-spacing: -0.01em; }
.day-list header strong { font-size: 18px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }

.day-rows {
  list-style: none; margin: 0; padding: 6px 0; overflow: hidden; flex: 1; min-height: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent);
}
.day-rows li {
  display: grid;
  grid-template-columns: 74px 26px 1fr;
  gap: 10px;
  align-items: center;
  padding: 0 22px;
  font-size: 15px;
}
.day-rows li.new { animation: day-row-in 0.35s ease-out; }
.day-rows li.visit { min-height: 58px; }
.day-rows li.trip { min-height: 44px; }
.day-rows .t { font-variant-numeric: tabular-nums; line-height: 1.25; white-space: nowrap; }
.day-rows .t b { display: block; font-weight: 600; font-size: 15px; }
.day-rows .t small { color: var(--text-soft); font-size: 13px; }
.day-rows .ic { color: var(--visit); display: grid; place-items: center; }
.day-rows .ic svg { width: 22px; height: 22px; }
.day-rows .bar { justify-self: center; width: 5px; height: 34px; border-radius: 3px; background: var(--c); opacity: 0.45; }
.day-rows .n { font-weight: 600; }
.day-rows li.trip .n { font-weight: 400; color: var(--text-soft); }
.day-rows li.pending .bar { opacity: 0.25; animation: day-pulse 1.2s ease-in-out infinite alternate; }
.day-rows li.old { opacity: 0.5; }

.day-note { text-align: center; color: var(--text-soft); font-size: 12px; margin: 0; position: absolute; left: 0; right: 0; bottom: 2vh; }

@keyframes day-row-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes day-pulse { to { opacity: 0.6; } }

/* Reduced motion: no scroll theatre; the finished day as a still. */
@media (prefers-reduced-motion: reduce) {
  .day { height: auto; }
  .day-stage { position: static; height: auto; padding-top: 64px; padding-bottom: 64px; }
  .day-window { height: 560px; }
  .day-note { position: static; margin-top: 12px; }
  .day-rows li, .day-rows li.pending .bar { animation: none; }
}

@media (max-width: 860px) {
  .day-stage { padding: 4vh 14px 4vh; gap: 14px; }
  .day-head h2 { font-size: 24px; }
  .day-head p { display: none; }
  .day-window { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1.1fr) minmax(0, 1fr); max-height: none; border-radius: 24px; }
  .day-list { border-left: 0; border-top: 1px solid var(--rule); }
  .day-list header { padding: 12px 16px 10px; }
  .day-list header b, .day-list header strong { font-size: 16px; }
  .day-rows li { padding: 0 16px; grid-template-columns: 70px 24px 1fr; gap: 8px; font-size: 14px; }
  .day-rows .t b { font-size: 14px; }
  .day-rows li.visit { min-height: 50px; }
  .day-rows li.trip { min-height: 36px; }
  .day-rows .bar { height: 26px; }
  .day-note { bottom: 1vh; }
  .day-label { font-size: 13px; padding: 5px 10px 5px 8px; }
}
