/* "When is Santa coming?" page. Brand tokens and shared components live in
   ../shared/rotary.css; this file is the page layout. Mobile first. */

body { overflow-x: clip; }
:root { --left: clamp(440px, 42vw, 600px); --chrome-h: 132px; }

/* ---- Layout ------------------------------------------------------------ */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "hero" "results" "map" "routes";
}
.hero { grid-area: hero; }
.results { grid-area: results; }
.mapcol { grid-area: map; }
.routes { grid-area: routes; }

/* Desktop: header and status stay put, the map fills the right-hand side,
   and everything else scrolls in a column on the left. */
@media (min-width: 1000px) {
  .topbar { position: sticky; top: 0; z-index: 1000; }
  .layout, .how, .rc-footer { width: var(--left); border-right: 1px solid var(--rotary-cloud); }
  .mapcol { position: fixed; top: var(--chrome-h); left: var(--left); right: 0; bottom: 0; z-index: 1; }
  .routes, .results, .how, .hero { scroll-margin-top: var(--chrome-h); }
  .rc-footer__inner { flex-direction: column; }
}

/* ---- Hero ------------------------------------------------------------- */

.hero {
  background-color: var(--rotary-royal); color: var(--rotary-white);
  position: relative; overflow: hidden;
  padding: 24px var(--gutter) 22px;
}
/* A light dusting of snow. */
.hero::before, .result__top::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(circle, #fff 1.4px, transparent 1.8px),
    radial-gradient(circle, #fff 1px, transparent 1.4px),
    radial-gradient(circle, #fff 2px, transparent 2.4px);
  background-size: 90px 90px, 53px 61px, 170px 150px;
  background-position: 10px 20px, 30px 7px, 70px 60px;
  opacity: .2;
}
.hero > *, .result__top > * { position: relative; }
.hero h1 { color: var(--rotary-white); font-size: 30px; margin: 8px 0 10px; }
.hero__intro { font-size: 16.5px; margin-bottom: 16px; color: var(--rotary-white); }

.search {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  background: var(--rotary-white); border-radius: var(--radius-lg); padding: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.search__icon { display: flex; padding-left: 10px; }
.search input {
  flex: 1 1 160px; min-width: 0; height: 48px;
  border: 0; outline: 0; background: transparent;
  font-family: var(--font-ui); font-size: 17px; color: var(--rotary-royal); font-weight: 600;
  padding: 0 8px;
}
.search input::placeholder { color: #75777b; font-weight: 400; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search:focus-within { box-shadow: 0 0 0 3px var(--rotary-gold), 0 6px 20px rgba(0, 0, 0, .25); }
.search input:focus-visible { outline: none; box-shadow: none; }
.search .btn { flex: 1 1 100%; font-size: 16px; padding: 13px 22px; border-radius: 12px; }

.hint { font-family: var(--font-ui); font-size: 14.5px; margin: 6px 0 0; color: var(--rotary-white); line-height: 1.4; }
.hint__try {
  background: none; border: 0; padding: 0 4px; cursor: pointer; min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; vertical-align: middle;
  font: inherit; font-weight: 700; color: var(--rotary-gold);
  text-decoration: underline; text-decoration-color: rgba(247, 168, 27, .5); text-underline-offset: 3px;
}
.hint__try:hover { text-decoration-color: var(--rotary-gold); }

@media (min-width: 560px) {
  .search { flex-wrap: nowrap; border-radius: 999px; }
  .search .btn { flex: none; border-radius: 999px; }
}
@media (min-width: 1000px) {
  .hero { padding: 26px 40px 26px; }
  .hero h1 { font-size: 40px; }
  .hero__intro { font-size: 17px; max-width: 520px; }
  .search input { font-size: 18px; }
  /* With a result showing, the hero steps back so the answer sits near the top. */
  body.has-result .hero h1 { font-size: 26px; margin-bottom: 14px; }
  body.has-result .hero__intro, body.has-result .hint { display: none; }
}

/* ---- Results ------------------------------------------------------------ */

.results { padding: 0 var(--gutter); }
.results:empty { display: none; }
.results > :first-child { margin-top: 18px; }
@media (min-width: 1000px) { .results { padding: 0 40px; } }

.results__intro {
  font-family: var(--font-ui); font-weight: 700; color: var(--rotary-royal);
  font-size: 16px; margin: 18px 0 10px;
}
.results__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 0; }
.results__bar .btn-link { font-size: 15px; min-height: 44px; padding: 0 2px; }
.results__wrap { font-family: var(--font-ui); font-weight: 700; color: var(--rotary-royal); font-size: 16px; margin: 16px 0 0; }

.result {
  margin-top: 14px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--rotary-cloud); box-shadow: var(--shadow-lg);
  background: var(--rotary-white);
}
.result.is-active { border-color: var(--rotary-royal); box-shadow: 0 0 0 2px var(--rotary-royal), var(--shadow-lg); }
.result__top {
  background: var(--rotary-royal); color: var(--rotary-white);
  padding: 16px 60px 18px 18px; position: relative; overflow: hidden;
}
.result__top .eyebrow { font-size: 12px; }
.result__chip { position: absolute !important; top: 14px; right: 14px; width: 32px; height: 32px; font-size: 15px; box-shadow: 0 0 0 2.5px var(--rotary-white); }
.result__when {
  font-family: var(--font-ui); font-weight: 800; font-size: 26px; line-height: 1.1;
  margin: 6px 0 0; color: var(--rotary-white);
}
.result__time {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  margin: 12px 0 0; background: var(--rotary-gold); color: var(--rotary-royal);
  font-family: var(--font-ui); font-weight: 800; font-size: 18px;
  border-radius: 18px; padding: 6px 16px;
}
.result__time small { font-weight: 600; font-size: 13px; }
.result__body { padding: 16px 18px 18px; }
.result__body > p { font-size: 17px; line-height: 1.45; margin: 0 0 10px; }
.result__body b { color: var(--rotary-royal); }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 16px; line-height: 1.45; margin: 10px 0 0; color: var(--rotary-charcoal);
  background: #eef5fa; border-left: 4px solid var(--rotary-azure);
  border-radius: 0 8px 8px 0; padding: 9px 12px;
}
.note--warn { background: #fdf3e0; border-left-color: var(--rotary-gold); }
.note__ic {
  flex: none; width: 20px; height: 20px; border-radius: 50%; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 800; font-size: 12px;
  background: var(--rotary-azure); color: var(--rotary-white);
}
.note--warn .note__ic { background: var(--rotary-gold); color: var(--rotary-royal); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions .btn { flex: 1 1 200px; }
.small-print {
  font-size: 16px; color: var(--rotary-charcoal); margin: 14px 0 0;
  display: flex; gap: 8px; align-items: flex-start; line-height: 1.4;
}
.small-print i {
  font-style: normal; flex: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--rotary-azure); color: var(--rotary-white);
  font-family: var(--font-ui); font-weight: 800; font-size: 12px; margin-top: 3px;
  display: flex; align-items: center; justify-content: center;
}

.message {
  margin-top: 18px; border-radius: 14px; border: 2px solid var(--rotary-royal);
  padding: 16px 18px; background: var(--rotary-white);
}
.message h2 { font-size: 19px; margin-bottom: 6px; }
.message p { font-size: 16px; margin: 0 0 8px; }
.message p:last-child { margin-bottom: 0; }
.message .actions { margin-top: 10px; }
.suggest { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button {
  font-family: var(--font-ui); font-weight: 700; font-size: 15px; cursor: pointer; min-height: 44px;
  background: var(--rotary-white); color: var(--rotary-royal);
  border: 2px solid var(--rotary-royal); border-radius: 999px; padding: 7px 14px;
}
.suggest button:hover { background: #eef4fa; }
.loading { font-family: var(--font-ui); font-weight: 600; color: var(--rotary-royal); margin-top: 18px; }

/* ---- Map ---------------------------------------------------------------- */

.mapcol { padding: 22px var(--gutter) 0; }
.mapbox {
  position: relative; height: 380px;
  border: 1px solid var(--rotary-cloud); border-radius: 14px; overflow: hidden;
  background: #e9eef2;
}
#map { position: absolute; inset: 0; background: #e9eef2; }
@media (min-width: 1000px) {
  .mapcol { padding: 0; }
  .mapbox { height: 100%; border: 0; border-radius: 0; }
}
.results, .routes { scroll-margin-top: 8px; }
@media (min-width: 600px) and (max-width: 999px) { .mapbox { height: 460px; } }

.leaflet-container { font-family: var(--font-ui); }
.leaflet-control-attribution { font-size: 11px; }
.leaflet-container a.leaflet-control-zoom-in, .leaflet-container a.leaflet-control-zoom-out { color: var(--rotary-royal); }

.ribbon { position: absolute; top: 12px; right: 0; z-index: 800; pointer-events: none; }
.ribbon span {
  display: block; background: var(--rotary-cardinal); color: var(--rotary-white);
  font-family: var(--font-ui); font-weight: 800; font-size: 11px; letter-spacing: .02em;
  padding: 6px 12px 6px 18px; line-height: 1.2; box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}
.ribbon small { font-weight: 600; font-size: 11px; letter-spacing: 0; margin-left: 8px; }
@media (min-width: 1000px) {
  .ribbon { top: 16px; }
  .ribbon span { font-size: 13px; padding: 8px 18px 8px 22px; }
  .ribbon small { font-size: 12.5px; margin-left: 10px; }
}

.give-card { display: none; }
@media (min-width: 1000px) {
  .give-card {
    position: absolute; top: 62px; right: 16px; z-index: 800; width: 350px;
    display: flex; gap: 14px; align-items: center;
    background: var(--rotary-white); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 14px 16px; font-size: 14px; line-height: 1.4;
  }
  .give-card p { margin: 0; }
  body.route-open .give-card { display: none; }
}
.give-card__ic, .give-band__ic {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--rotary-gold); color: var(--rotary-royal);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 800; font-size: 18px;
}

/* Legend: under the map on phones, floating on the map on desktop. */
.map-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  margin-top: 10px; font-family: var(--font-ui); font-size: 12.5px; line-height: 1.3;
  color: var(--rotary-charcoal);
}
.map-legend:empty { display: none; }
.map-legend i { display: inline-flex; align-items: center; gap: 5px; font-style: normal; }
.map-legend .chip, .map-legend .mk { width: 18px; height: 18px; font-size: 9.5px; border: 2px solid var(--rotary-white); box-shadow: 0 0 0 1px rgba(0,0,0,.18); }
.map-legend .ln { display: inline-block; width: 22px; height: 4px; border-radius: 3px; box-shadow: 0 0 0 1.5px var(--rotary-white), 0 0 0 2.5px var(--rotary-cloud); }
.map-legend .dots { display: inline-block; width: 22px; height: 4px; background-image: radial-gradient(circle, currentColor 1.8px, transparent 2.2px); background-size: 7px 4px; }
.map-legend .lg-arrow { color: var(--rotary-royal); font-weight: 800; }
@media (min-width: 1000px) {
  .map-legend {
    position: absolute; left: 16px; bottom: 24px; z-index: 800; margin: 0;
    background: var(--rotary-white); border-radius: 10px; box-shadow: var(--shadow);
    padding: 9px 14px; gap: 6px 16px; max-width: calc(100% - 80px);
  }
}

/* Map markers (Leaflet divIcons) */
.mk {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2.5px solid var(--rotary-white); box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 800; font-size: 12px; line-height: 1;
  color: var(--rotary-white); cursor: pointer;
}
.mk--sm { width: 20px; height: 20px; font-size: 10px; border-width: 2px; cursor: default; }
.mk--start { background: var(--rotary-gold); color: var(--rotary-royal); }
.mk--finish { background: var(--rotary-royal); }
.mk--wait {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--rotary-white);
  border: 2.5px solid; box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
.mk--wait b { width: 6px; height: 6px; border-radius: 50%; display: block; }
.near-pt {
  width: 22px; height: 22px; border-radius: 50%; background: var(--rotary-gold);
  border: 3px solid var(--rotary-white); box-shadow: 0 0 0 4px var(--rotary-gold), 0 2px 8px rgba(0, 0, 0, .4);
}
.here-pin svg { display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); }
.here-label {
  position: absolute; left: 0; bottom: 0; transform: translateX(-50%);
  background: var(--rotary-royal); color: var(--rotary-white);
  font-family: var(--font-ui); font-weight: 700; font-size: 12px;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.leaflet-tooltip.route-tip {
  font-family: var(--font-ui); font-weight: 700; font-size: 12.5px; color: var(--rotary-royal);
  border-radius: 8px; padding: 5px 9px;
}

/* ---- Route list & panel -------------------------------------------------- */

.routes { padding: 26px var(--gutter) 8px; outline: none; }
@media (min-width: 1000px) { .routes { padding: 24px 40px 32px; } }
.routes h2 { font-size: 22px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.routes h2 small { font-family: var(--font-body); font-weight: 400; font-size: 14px; color: var(--rotary-charcoal); letter-spacing: 0; }
.routes__intro { font-size: 15px; margin: 6px 0 0; }

.route-grid { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; }
@media (min-width: 520px) { .route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.route-card {
  display: flex; gap: 12px; align-items: stretch; height: 100%;
  border: 1px solid var(--rotary-cloud); border-radius: 10px; padding: 9px 12px 9px 0;
  background: var(--rotary-white); overflow: hidden;
  text-decoration: none; color: var(--rotary-charcoal);
  transition: box-shadow .15s, border-color .15s;
}
.route-card:hover { border-color: var(--rotary-royal); box-shadow: var(--shadow-lg); color: var(--rotary-charcoal); }
.route-card__bar { width: 6px; border-radius: 0 4px 4px 0; flex: none; }
.route-card .chip { margin-top: 1px; }
.route-card__d { display: block; font-family: var(--font-ui); font-weight: 800; color: var(--rotary-royal); font-size: 15px; line-height: 1.25; }
.route-card__a { display: block; font-size: 14.5px; line-height: 1.3; margin-top: 1px; }
.route-card__m { display: block; font-family: var(--font-ui); font-size: 14px; color: var(--rotary-charcoal); margin-top: 4px; font-weight: 600; }

.route-panel { outline: none; }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; min-height: 44px;
  font-family: var(--font-ui); font-weight: 700; font-size: 15px; color: var(--rotary-azure); text-decoration: none;
}
.back:hover { text-decoration: underline; }
.panel-head { display: flex; gap: 12px; align-items: flex-start; border-left: 6px solid; padding-left: 12px; }
.panel-head .chip { width: 36px; height: 36px; font-size: 17px; }
.panel-head h2 { font-size: 22px; outline: none; display: block; }
.panel-head p { margin: 3px 0 0; font-size: 16px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 16px 0 0; font-size: 15px; }
.facts dt { font-family: var(--font-ui); font-weight: 700; font-size: 13px; color: var(--rotary-royal); padding-top: 2px; }
.facts dd { margin: 0; }
.panel-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.panel-tools .btn { font-size: 14px; padding: 9px 16px; }
@media (min-width: 1000px) { .panel-tools .show-map { display: none; } }

.streets-h { font-size: 17px; margin: 22px 0 4px; display: flex; align-items: center; gap: 10px; }
.streets-h .sw { width: 16px; height: 16px; border-radius: 4px; flex: none; }
.streets-key { font-size: 16px; color: var(--rotary-charcoal); margin: 0 0 8px; }
.streets { list-style: none; padding: 0; margin: 0; columns: 1; column-gap: 24px; }
@media (min-width: 520px) { .streets { columns: 2; } }
.streets li {
  break-inside: avoid; display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px;
  padding: 6px 4px; border-bottom: 1px solid #ece9e5; font-size: 16px; line-height: 1.3;
}
.streets .n { flex: none; width: 22px; text-align: right; font-family: var(--font-ui); font-weight: 700; font-size: 13px; color: var(--rotary-charcoal); }
.streets .nm { flex: 1 1 auto; min-width: 0; }
.streets .t { flex: none; font-family: var(--font-ui); font-weight: 700; font-size: 16px; color: var(--rotary-royal); white-space: nowrap; }
.streets .again { font-size: 14px; color: var(--rotary-charcoal); font-style: italic; }
.streets .tag {
  display: inline-block; margin-left: 4px; vertical-align: 1px;
  font-family: var(--font-ui); font-weight: 700; font-size: 10.5px; letter-spacing: .02em;
  border-radius: 999px; padding: 1px 7px; background: var(--rotary-powder); color: var(--rotary-royal);
}
.streets li.me { background: #fdf3e0; border-radius: 6px; border-bottom-color: transparent; }
.streets li.me .nm span.hl { background: var(--rotary-gold); color: var(--rotary-royal); border-radius: 4px; padding: 1px 5px; font-family: var(--font-ui); font-weight: 800; font-size: 14px; }
.panel-notes { margin: 16px 0 0; padding-left: 20px; font-size: 16px; }
.panel-notes li { margin-bottom: 4px; }

/* ---- How it works -------------------------------------------------------- */

.how { background: var(--rotary-white); border-top: 1px solid var(--rotary-cloud); padding: 30px var(--gutter) 32px; }
.how__inner { max-width: 1100px; margin: 0 auto; }
.how h2 { font-size: 24px; }
.how__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 18px; }
@media (min-width: 640px) { .how__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .how__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; } .how { padding: 40px 40px 44px; } }
.how__ic { width: 44px; height: 44px; border-radius: 50%; background: var(--rotary-powder); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.how h3 { font-size: 17px; margin-bottom: 6px; }
.how p { font-size: 15.5px; margin: 0; }
.give-band {
  display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center;
  background: var(--rotary-powder); color: var(--rotary-royal);
  border-radius: 14px; padding: 18px; margin-top: 28px;
}
.give-band p { flex: 1 1 240px; margin: 0; font-size: 16px; }

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

/* Touch screens: a short hint when one finger lands on the map (the page scrolls instead). */
.map-hint {
  position: absolute; inset: 0; z-index: 900; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(23, 69, 143, .55); opacity: 0; transition: opacity .2s;
}
.map-hint.is-on { opacity: 1; }
.map-hint span {
  background: var(--rotary-white); color: var(--rotary-royal); font-family: var(--font-ui); font-weight: 700;
  font-size: 16px; padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow);
}
/* Bigger zoom buttons for fingers. */
.leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
.rc-footer p { font-size: 15px; }

/* Not on a route: the nearest place to see Santa, and the walk there. */
.result--near { border: 2px solid var(--rotary-royal); }
.near-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.near-head .chip { width: 30px; height: 30px; font-size: 14px; }
.near-head h2 { font-size: 20px; }
.directions { font-size: 16px; margin: 8px 0 0; }
.directions b { color: var(--rotary-royal); }
.meet-label {
  position: absolute; left: 0; top: 0; transform: translateX(-50%);
  background: var(--rotary-gold); color: var(--rotary-royal);
  font-family: var(--font-ui); font-weight: 800; font-size: 12.5px;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.map-legend .walkln {
  display: inline-block; width: 24px; height: 0; border-top: 3px dashed #1d1d1f;
}

/* Inside the club website's page (an iframe): its banner stays, ours goes.
   The iframe grows to the page's full height, so nothing can be fixed or
   sticky; wide screens get the one-column layout with a bigger map. */
.is-embedded .rc-header { display: none; }
@media (min-width: 1000px) {
  .is-embedded .topbar { position: static; }
  .is-embedded .layout, .is-embedded .how, .is-embedded .rc-footer { width: auto; border-right: 0; }
  .is-embedded .rc-footer__inner { flex-direction: row; }
  .is-embedded .mapcol { position: relative; top: auto; left: auto; right: auto; bottom: auto; padding: 22px 40px 0; }
  .is-embedded .mapbox { height: 560px; border: 1px solid var(--rotary-cloud); border-radius: 14px; }
  .is-embedded .panel-tools .show-map { display: inline-flex; }
}
