@import url('/static/css/fonts.css');

/* Montréal, late September — the maples turning. Warm paper, deep ink, and a
   colour per category so the map reads at a glance on a phone in the street.
   Not a rainbow: the celebration is in the warmth and the type, not a flag. */
:root {
  --paper:      #FDF8F3;
  --paper-2:    #FFFCF8;
  --ink:        #17131A;
  --ink-soft:   #5C5460;
  --rule:       #E6DACD;
  --maple:      #D2452F;
  --amber:      #E8912B;
  --forest:     #2F6B54;
  --plum:       #C2277A;
  --teal:       #0E7C86;
  --blue:       #1F5F8B;
  --radius:     14px;
  --shadow:     0 1px 2px rgba(23,19,26,.06), 0 8px 24px rgba(23,19,26,.07);
  --shadow-lg:  0 2px 6px rgba(23,19,26,.08), 0 18px 48px rgba(23,19,26,.12);
  --font-display: 'Fraunces', Georgia, serif;
  --font-ui: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Safe areas: they will use this one-handed, walking. */
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; margin: 0; }

/* --- top bar -------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 900;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px calc(12px);
  background: rgba(253,248,243,.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
  padding-top: calc(12px + env(safe-area-inset-top));
}
.brand { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.02em; }
.brand .accent { color: var(--maple); }
.top nav { margin-inline-start: auto; display: flex; gap: 4px; }
.top nav a {
  text-decoration: none; font-size: .875rem; font-weight: 500;
  padding: 7px 13px; border-radius: 999px; color: var(--ink-soft);
}
.top nav a.on { background: var(--ink); color: var(--paper); }
.top nav a:not(.on):hover { background: #EFE5D9; color: var(--ink); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 22px 16px 64px; }

/* --- countdown ------------------------------------------------------------ */
.countdown {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-display);
}
.countdown .n { font-size: clamp(2.6rem, 9vw, 4.2rem); font-weight: 700; line-height: .95; letter-spacing: -0.03em; }
.countdown .lbl { color: var(--ink-soft); font-family: var(--font-ui); font-size: .95rem; }

/* --- map ------------------------------------------------------------------ */
#map {
  height: calc(100dvh - 168px);
  min-height: 380px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  z-index: 1;
}
.filters { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--rule); background: var(--paper-2);
  padding: 7px 13px; border-radius: 999px; font-size: .82rem; font-weight: 500;
  cursor: pointer; white-space: nowrap; color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.chip:active { transform: scale(.97); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip.all[aria-pressed="true"] { background: var(--maple); border-color: var(--maple); }

/* The OSM basemap is louder than this palette wants. Desaturating the tile
   pane turns it into a quiet ground for the category colours, and costs nothing
   — no second tile provider, no key. */
.leaflet-tile-pane { filter: saturate(.42) brightness(1.06) contrast(.95); }
.leaflet-container { background: #EFE7DC; font-family: var(--font-ui); }

/* Leaflet popups, restyled to match the page rather than fight it. */
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--shadow-lg); }
.leaflet-popup-content { margin: 14px 16px; font-family: var(--font-ui); line-height: 1.5; }
.pop-name { font-family: var(--font-display); font-weight: 600; font-size: 1.06rem; }
.pop-meta { color: var(--ink-soft); font-size: .8rem; margin-top: 2px; }
.pop-why { margin-top: 8px; font-size: .89rem; }
.pop-links { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.pop-links a {
  font-size: .8rem; font-weight: 600; text-decoration: none;
  border: 1px solid var(--rule); border-radius: 999px; padding: 5px 11px;
}
.pop-links a.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.badge-approx { font-size: .72rem; color: var(--ink-soft); font-style: italic; margin-top: 6px; }

/* --- plan ----------------------------------------------------------------- */
.day { border-top: 1px solid var(--rule); padding: 22px 0; }
.day:first-of-type { border-top: 0; }
.day-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.day-date { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.day-label { color: var(--maple); font-weight: 600; font-size: .95rem; }
.day-where { color: var(--ink-soft); font-size: .85rem; margin-inline-start: auto; }
.day-note { color: var(--ink-soft); font-size: .92rem; margin: 2px 0 14px; }
.item { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 11px 0; border-top: 1px dashed var(--rule); }
.item:first-of-type { border-top: 0; }
.item-time { font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--ink-soft); font-weight: 600; padding-top: 2px; }
.item-title { font-weight: 600; }
.item-detail { color: var(--ink-soft); font-size: .9rem; margin-top: 3px; }
.item .tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; margin-inline-start: 8px; vertical-align: 2px; }
.tag.proposed { background: #FBE9CE; color: #8A5A12; }
.tag.chosen   { background: #DCEBE2; color: #1F5540; }
.tag.booked   { background: #DDE7F1; color: #1F5F8B; }
.tag.free     { background: #F0E6F5; color: #6B3FA0; }

.card { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--rule); font-size: .9rem; }
.kv:first-of-type { border-top: 0; }
.kv .k { color: var(--ink-soft); }
.kv .v { font-weight: 600; text-align: end; }
.section-title { font-size: 1.35rem; margin: 34px 0 12px; }
.muted { color: var(--ink-soft); }
.small { font-size: .85rem; }

/* --- login ---------------------------------------------------------------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card h1 { font-size: 2.4rem; letter-spacing: -0.03em; }
.login-card .sub { color: var(--ink-soft); margin: 6px 0 22px; }
input[type=password] {
  width: 100%; padding: 13px 15px; font-size: 1rem; font-family: var(--font-ui);
  border: 1px solid var(--rule); border-radius: 11px; background: var(--paper-2); color: var(--ink);
}
input[type=password]:focus { outline: 2px solid var(--maple); outline-offset: 1px; }
button.go {
  width: 100%; margin-top: 10px; padding: 13px; font-size: 1rem; font-weight: 600;
  font-family: var(--font-ui); border: 0; border-radius: 11px; cursor: pointer;
  background: var(--ink); color: var(--paper);
}
button.go:active { transform: scale(.99); }
.err { color: var(--maple); font-size: .9rem; margin-top: 12px; }

@media (max-width: 640px) {
  .item { grid-template-columns: 60px 1fr; gap: 10px; }
  #map { height: calc(100dvh - 200px); }
  .wrap { padding: 16px 12px 56px; }
}

/* --- leave-by cards ---------------------------------------------------------
   The single most useful thing on the page: when to walk out of the door. The
   time is the largest thing in the card because that is what gets read at a
   glance while putting shoes on. */
.card.leave { border-color: #E2CDBD; }
.leave-when { font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft); }
.leave-by { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.05; color: var(--maple); margin: 2px 0 2px; }
.leave-lbl { font-family: var(--font-ui); font-size: .8rem; font-weight: 600;
  letter-spacing: .02em; color: var(--ink-soft); display: block; margin-bottom: -4px; }
.leave-what { font-weight: 600; margin-bottom: 10px; }
.src { font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-soft); background: #F0E7DA; border-radius: 999px; padding: 1px 6px; margin-inline-start: 5px; }

/* --- walking times inside a popup ------------------------------------------ */
.walk-list:empty { display: none; }
.walk-title { font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-soft); margin: 12px 0 6px;
  border-top: 1px solid var(--rule); padding-top: 10px; }
.walk-ul { list-style: none; margin: 0; padding: 0; max-height: 190px; overflow-y: auto; }
.walk-ul li { display: flex; align-items: baseline; gap: 9px; padding: 3px 0; font-size: .84rem; }
.w-min { font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  min-width: 34px; text-align: end; color: var(--maple); }
.w-unit { font-family: var(--font-ui); font-size: .6rem; font-weight: 600;
  color: var(--ink-soft); margin-inline-start: 2px; }
.w-name { flex: 1; }
.w-km { color: var(--ink-soft); font-size: .74rem; font-variant-numeric: tabular-nums; }
