/* Vanilly design tokens and shared pieces (agreed in docs/mockups/vanilly-mockups.html). */

@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("/fonts/Nunito-500-800.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/AtkinsonHyperlegible-400.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/AtkinsonHyperlegible-700.woff2") format("woff2");
}

:root {
  --bg: #f6f1e8;
  --fg: #2b2320;
  --muted: #6f625c;
  --line: #e3d9cc;
  --card: #fffdf9;
  --soft: #f1ebe1;
  --brand: #f26b8e;
  --brand-ink: #c2456a;
  --sky: #6db7ea;
  --cream: #fbf3e4;
  --ok: #1f9d63;
  --ok-bg: #dcf5e8;
  --ok-ink: #166a44;
  --warn: #d98a12;
  --warn-ink: #b07a1e;
  --danger: #d64545;
  --danger-bg: #fdeaea;
  --display: "Nunito", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 10px 30px rgba(60, 40, 30, 0.14);
  --shadow-sm: 0 3px 10px rgba(0, 0, 0, 0.15);
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 15px/1.5 var(--body);
  color: var(--fg);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 1.4rem; font-weight: 800; }
h2 { font-size: 1.15rem; font-weight: 800; }
h3 { font-size: 0.95rem; font-weight: 800; }
p { margin: 0; }
a { color: var(--brand-ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.help { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

button, .button {
  font: inherit;
  font-family: var(--display);
  font-weight: 800;
  border: 0;
  border-radius: 12px;
  padding: 0.55rem 1rem;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  touch-action: manipulation;
  line-height: 1.3;
}
button:hover, .button:hover { filter: brightness(0.95); }
button.ghost, button.secondary { background: var(--soft); color: var(--fg); }
button.danger { background: var(--danger-bg); color: #b52f2f; }
button.link { background: none; color: var(--muted); font-weight: 700; }
button:disabled { opacity: 0.5; cursor: default; }
button.sm { padding: 5px 10px; font-size: 0.8rem; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

input, select, textarea {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--fg);
  max-width: 100%;
}
input[type="color"] { padding: 2px; width: 48px; height: 36px; }
textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-width: 0;
}
.card h2 { margin-bottom: 8px; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 0.75rem; }

.banner {
  padding: 0.6rem 1rem;
  background: #fff4d6;
  color: #6b4d00;
  font-size: 0.9rem;
}
.banner.error { background: var(--danger-bg); color: var(--danger); }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #eee7dc;
  color: var(--muted);
  white-space: nowrap;
}
.pill.on, .pill.serving, .pill.on_the_move { background: var(--ok-bg); color: var(--ok-ink); }

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c, var(--brand));
  vertical-align: middle;
  flex: none;
}

/* ---------- van markers on Google Maps (built in the DOM by gmaps.js) ---------- */
.van-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.van-marker .halo,
.van-marker .body,
.van-marker .arrow,
.van-marker .label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
}
.van-marker .halo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--c);
  opacity: 0.18;
  pointer-events: none;
}
.van-marker .body {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c);
  border: 4px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  font-size: 19px;
  line-height: 1;
}
.van-marker .arrow {
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 16px solid var(--c);
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(var(--heading, 0deg)) translateY(-24px);
  pointer-events: none;
}
.van-marker .label {
  top: 30px;
  font: 800 14px/1.1 var(--display);
  color: var(--fg);
  white-space: nowrap;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 4px #fff, 0 0 6px #fff;
  transform: translate(-50%, 0);
  pointer-events: none;
}
.van-marker.stale { opacity: 0.6; }
.van-marker.stale .body { border-style: dashed; }
.van-marker.off .body { background: #9a918a; }
.van-marker.off .label { color: #7a716b; }
.van-marker.fresh .halo { animation: pulse 2.4s ease-out infinite; }
.van-marker .body-large { width: 48px; height: 48px; font-size: 24px; }
@keyframes pulse {
  from { transform: translate(-50%, -50%) scale(0.7); opacity: 0.3; }
  to { transform: translate(-50%, -50%) scale(1.25); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .van-marker .halo { animation: none !important; } }

.me-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b8fe0;
  border: 3px solid #fff;
  box-shadow: 0 0 0 8px rgba(59, 143, 224, 0.2), 0 2px 6px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* When Google Maps isn't configured (or fails to load) the map area shows a notice instead. */
.map-missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, #edf1e6, #edf1e6 14px, #e6ebdd 14px, #e6ebdd 28px);
}
.map-missing p { max-width: 40ch; }

/* ---------- Vanilly wordmark ---------- */
.powered {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
}
.powered img { width: 18px; height: 18px; border-radius: 5px; }
.powered b { font-family: var(--display); font-weight: 800; }
