/* Self-hosted so the page renders instantly on patchy reception. */
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/oswald-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/oswald-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Oswald';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/oswald-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/barlow-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/barlow-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/barlow-latin-600-normal.woff2') format('woff2');
}

/* ============================================================================
   Sunshine Coast Pub Run 2026
   Palette lifted from the merch: near-black fabric, warm antique gold ink.
   ========================================================================== */

:root {
  --ink:        #0d0d0e;
  --fabric:     #131315;
  --panel:      #1a1a1d;
  --panel-2:    #202024;
  --line:       #2c2c31;
  --line-soft:  #232327;

  --gold:       #c9a961;
  --gold-bright:#e0c485;
  --gold-deep:  #a5854a;
  --gold-glow:  rgba(201, 169, 97, 0.15);

  --bone:       #ece7dc;
  --bone-dim:   #a9a294;
  --bone-faint: #767061;

  --live:       #7bbf6a;

  --sans: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --cond: 'Oswald', 'Barlow Condensed', 'Arial Narrow', sans-serif;

  --radius: 10px;
  --map-h: 42vh;

  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

/* ---------------------------------------------------------------- layout -- */

.app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
}

/* ---------------------------------------------------------------- header -- */

.masthead {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #17171a 0%, var(--fabric) 100%);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 500;
}

.masthead::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
  opacity: .5;
}

.masthead__logo {
  width: 40px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 10px var(--gold-glow));
}

.masthead__text { min-width: 0; flex: 0 0 auto; }

.masthead__eyebrow {
  font-family: var(--cond);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0;
  white-space: nowrap;
}

.masthead__title {
  font-family: var(--cond);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gold);
  margin: -2px 0 0;
  line-height: 1;
  white-space: nowrap;
}

.masthead__title span {
  font-size: 14px;
  color: var(--bone-faint);
  letter-spacing: .18em;
  margin-left: 6px;
  vertical-align: 3px;
}

.masthead__status {
  margin-left: auto;
  text-align: right;
  font-size: 11px;
  color: var(--bone-dim);
  line-height: 1.35;
  /* Shrinkable + capped: a long venue name must never ride over the wordmark. */
  flex: 0 1 auto;
  min-width: 0;
  max-width: 42%;
  overflow: hidden;
}

.masthead__status strong {
  display: block;
  font-family: var(--cond);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--bone);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masthead__status .is-live { color: var(--live); }

/* ------------------------------------------------------------------ body -- */

.main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ------------------------------------------------------------------- map -- */

.mapwrap {
  position: relative;
  flex: 0 0 var(--map-h);
  min-height: 180px;
  background: #101014;
  border-bottom: 1px solid var(--line);
  transition: flex-basis .28s ease;
}

#map { position: absolute; inset: 0; background: #101014; }

.map-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 20px;
  color: var(--bone-dim);
  font-size: 13px;
}

.map-fallback strong { color: var(--gold); font-family: var(--cond); letter-spacing: .08em; }

body.map-failed .map-fallback { display: flex; }

/* Basemap unavailable: the pins + trail still draw, so explain the void. */
.tiles-note {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 440;
  display: none;
  padding: 5px 11px;
  background: rgba(19,19,21,.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 11px;
  color: var(--bone-dim);
  white-space: nowrap;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

body.tiles-offline .tiles-note { display: block; }
body.map-failed .tiles-note { display: none; }

/* Raster fallback, used only when the vector basemap cannot run. The tiles are
   OpenStreetMap's standard light ones — the only keyless raster source with
   uptime worth relying on — so they are inverted to sit in a dark page. The
   hue-rotate puts blue back where inverting turned it orange, keeping the
   ocean reading as ocean. Leaflet puts this class on the layer's own container,
   which holds nothing but these tiles, so the gold trail, the pins and the
   labels — all in panes above it — are untouched. */
.basemap-raster {
  filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.92) saturate(.75);
}

.map-btns {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 450;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: rgba(19, 19, 21, .9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--gold);
  font-size: 16px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 0;
  line-height: 1;
}

.map-btn:active { background: var(--panel-2); }

/* Expanded-map mode (mobile) */
body.map-expanded .mapwrap { flex-basis: calc(100dvh - 66px); }
body.map-expanded .sidebar { display: none; }

/* --------------------------------------------------------------- sidebar -- */

.sidebar {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--fabric);
  padding: 0 12px calc(28px + var(--safe-b));
}

/* ------------------------------------------------------------- summary -- */

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 12px 0;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.summary__cell {
  background: var(--panel);
  padding: 10px 8px;
  text-align: center;
}

.summary__num {
  display: block;
  font-family: var(--cond);
  font-size: 21px;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.1;
}

.summary__lbl {
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.route-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: #17140c;
  font-family: var(--cond);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

.route-cta:hover { filter: brightness(1.08); color: #17140c; }

/* ------------------------------------------------------------------ list -- */

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--cond);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--bone-faint);
  margin: 4px 0 12px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.route-list { list-style: none; margin: 0; padding: 0; }

/* --- venue card --- */

.stop {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scroll-margin-top: 12px;
  transition: border-color .2s, background .2s;
}

.stop:hover { border-color: var(--gold-deep); }

.stop.is-current {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(201,169,97,.09), var(--panel) 60%);
  box-shadow: 0 0 0 1px rgba(201,169,97,.25), 0 6px 22px -12px var(--gold);
}

.stop.is-done { opacity: .5; }

.stop.is-selected { border-color: var(--gold-bright); }

.stop__num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--gold-deep);
  color: var(--gold);
  font-family: var(--cond);
  font-size: 14px;
  font-weight: 600;
  background: var(--ink);
}

.stop.is-current .stop__num {
  background: var(--gold);
  border-color: var(--gold-bright);
  color: #17140c;
}

.stop__body { min-width: 0; flex: 1; }

.stop__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--cond);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--bone);
  line-height: 1.2;
}

.stop__name:hover { color: var(--gold-bright); }
.stop__name .pin { font-size: 12px; color: var(--gold-deep); }

.stop__addr {
  font-size: 12.5px;
  color: var(--bone-dim);
  margin-top: 3px;
  line-height: 1.4;
}

.chip-q {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  border: 1px solid rgba(201,169,97,.4);
  border-radius: 4px;
  font-size: 9.5px;
  letter-spacing: .1em;
  color: var(--gold-deep);
  vertical-align: 1px;
  cursor: help;
}

.stop__times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.time {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

.time__lbl {
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.time__val {
  font-family: var(--cond);
  font-size: 14px;
  font-weight: 500;
  color: var(--bone);
  letter-spacing: .04em;
}

.time--in .time__val  { color: var(--gold); }
.time--out .time__val { color: var(--bone-dim); }

.stop__note {
  margin-top: 8px;
  padding-left: 9px;
  border-left: 2px solid var(--gold-deep);
  font-size: 12.5px;
  color: var(--bone-dim);
  font-style: italic;
}

.badge-live {
  position: absolute;
  top: -8px;
  right: 10px;
  padding: 2px 8px;
  background: var(--gold);
  color: #17140c;
  font-family: var(--cond);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  border-radius: 4px;
}

/* --- leg connector --- */

.leg {
  display: flex;
  gap: 12px;
  padding: 0;
}

.leg__rail {
  flex: 0 0 30px;
  display: flex;
  justify-content: center;
  position: relative;
}

/* dotted gold trail, echoing the poster's route */
.leg__rail::before {
  content: '';
  width: 2px;
  background-image: linear-gradient(180deg, var(--gold-deep) 55%, transparent 55%);
  background-size: 2px 8px;
  opacity: .75;
}

.leg__body {
  flex: 1;
  min-width: 0;
  padding: 10px 0 10px 2px;
}

.leg__stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-family: var(--cond);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--gold);
  text-transform: uppercase;
}

.leg__stats .dot { color: var(--bone-faint); }
.leg__stats .muted { color: var(--bone-dim); }

/* Time budgeted for the leg — the number the schedule is actually built on. */
.leg__stats .allowed {
  padding: 1px 7px;
  border: 1px solid rgba(201, 169, 97, .32);
  border-radius: 4px;
  font-size: 12px;
  color: var(--gold-deep);
}

.leg__detour {
  margin-top: 4px;
  font-size: 12px;
  color: var(--bone-dim);
  line-height: 1.45;
}

.leg__detour::before {
  content: '↳ ';
  color: var(--gold-deep);
}

.leg__detour { color: var(--gold-deep); }

.leg__direct {
  margin-top: 4px;
  font-size: 12px;
  color: var(--bone-faint);
}

.leg__nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-family: var(--cond);
  color: var(--gold);
}

.leg__nav:hover { border-color: var(--gold-deep); background: var(--panel-2); }

/* ---------------------------------------------------------------- footer -- */

.foot {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--bone-faint);
  line-height: 1.6;
  text-align: center;
}

.foot__rule {
  display: block;
  margin: 0 auto 10px;
  width: 60px;
  height: 1px;
  background: var(--gold-deep);
  opacity: .6;
}

/* ------------------------------------------------------------ leaflet fx -- */

.leaflet-container {
  background: #101014;
  font-family: var(--sans);
}

.leaflet-control-attribution {
  background: rgba(13,13,14,.8) !important;
  color: var(--bone-faint) !important;
  font-size: 9px !important;
}

.leaflet-control-attribution a { color: var(--bone-dim) !important; }

.leaflet-control-zoom a {
  background: rgba(19,19,21,.92) !important;
  border-color: var(--line) !important;
  color: var(--gold) !important;
}

.leaflet-control-zoom a:hover { background: var(--panel-2) !important; }

.pin-marker {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--gold);
  color: var(--gold);
  font-family: var(--cond);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.6);
}

.pin-marker.is-current {
  background: var(--gold);
  color: #17140c;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 5px var(--gold-glow), 0 2px 8px rgba(0,0,0,.6);
}

/* Detour point — deliberately smaller than a numbered venue pin. */
.wp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-deep);
  border: 1.5px solid var(--ink);
  box-shadow: 0 0 0 1px rgba(201, 169, 97, .5);
}

.pin-marker.is-selected {
  transform: scale(1.22);
  border-color: var(--gold-bright);
}

.leaflet-popup-content-wrapper {
  background: var(--panel);
  color: var(--bone);
  border: 1px solid var(--gold-deep);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
}

.leaflet-popup-tip { background: var(--panel); border: 1px solid var(--gold-deep); }
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; min-width: 170px; }
.leaflet-popup-close-button { color: var(--bone-faint) !important; }

.pop__n {
  font-family: var(--cond);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.pop__name {
  display: block;
  font-family: var(--cond);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 1px 0 4px;
}

.pop__meta { color: var(--bone-dim); font-size: 12px; line-height: 1.45; }
.pop__link { display: inline-block; margin-top: 7px; font-size: 12px; }

/* ------------------------------------------------------------- desktop -- */

@media (min-width: 880px) {
  .masthead { padding: 12px 22px; gap: 16px; }
  .masthead__logo { width: 52px; height: 60px; }
  .masthead__title { font-size: 34px; }
  .masthead__eyebrow { font-size: 11px; }
  .masthead__status { max-width: 340px; }

  .main { flex-direction: row-reverse; }

  .mapwrap {
    flex: 1 1 auto;
    border-bottom: 0;
    border-left: 1px solid var(--line);
    min-height: 0;
  }

  .sidebar {
    flex: 0 0 400px;
    padding: 0 18px 32px;
  }

  /* the expand button is a mobile affordance */
  .map-btn--expand { display: none; }

  body.map-expanded .sidebar { display: block; }
  body.map-expanded .mapwrap { flex-basis: auto; }
}

@media (min-width: 1400px) {
  .sidebar { flex-basis: 460px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
