/* GENERATED by scripts/build-web-site.mjs from website/app/app.css — do not edit.
 * The web app's map, for the marketing page (TIME-160): the same block, with
 * its dark set keyed to .site-map-dark instead of the document root. Run
 * `make web-site` (or `make web`) after changing the map's styles. */

/* ── The map (TIME-158) ──
 *
 * The list's other face, in the list's place, under the same band. Land,
 * night and pins are three layers in one frame that share a coordinate
 * system: x is degrees east of the map's left edge, y degrees south of 84°N
 * (map.js). The night is a 360 × 142 canvas the browser scales up, and its
 * smoothing is what makes twilight a soft band. */

/* The map follows the reader's theme (TIME-190). Day and night are the one
 * thing it shows, so every value here is held to one test: the two stay
 * apart in greyscale over the sea as well as the land. Night is a dark wash
 * in both themes, and it is the DAY side that has to be light enough for
 * that wash to show — the first map's sea was near black, and night over
 * the ocean, most of the planet, barely moved it. The same values as
 * `MapTones` in Shared/Palette.swift. Scoped to the map, never :root. */
.map {
  --map-sea: #C9D3DE;
  --map-land: #F2F0EB;
  --map-night: #000000;
  --map-night-alpha: 0.55;
  --map-rule: rgba(0, 0, 0, 0.08);
  /* You, once "Show my location" has answered: Apple's system blue, as
   * `Palette.here` (TIME-204). A fill, never text, never a state. */
  --map-here: #007AFF;
}

/* In light, the pills are the page's own panel set. In dark they are a
 * step lighter than the page, so a pill still lifts off a night sky. */

.site-map-dark .map {
  --map-sea: #2B323E;
  --map-land: #7A7F89;
  --map-night-alpha: 0.78;
  --map-rule: rgba(255, 255, 255, 0.08);
  --map-here: #0A84FF;
}

.site-map-dark .map-frame {
  --app: #1C1C1F;
  --sub: #A1A1A8;
}

/* The toggle shows where it goes, not where you are. */
.view-glyph--list { display: none !important; }
body[data-view='map'] .view-glyph--map { display: none !important; }
body[data-view='map'] .view-glyph--list { display: block !important; }

/* The frame is all the room between the header and the dock (map.js sets
 * its height), edge to edge, with no border: the world pans and zooms inside
 * it. What lies past the world's edge is `--map-sea`, exactly the sea, so a
 * zoomed-out world on a tall screen just carries on being ocean (TIME-165) —
 * and the night canvas runs over it, so dusk does not stop at the edge. */
.map {
  flex: 1 1 auto;
}

.map-frame {
  position: relative;
  width: 100%;
  height: 60vh;
  overflow: hidden;
  background: var(--map-sea);
  /* The map takes every gesture over it: pan, pinch and wheel are its own. */
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.map-frame:active { cursor: grabbing; }

.map-land,
.map-night,
.map-leaders,
.map-pins {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-sea { fill: var(--map-sea); }
.map-ice-stop { stop-color: var(--map-sea); }
.map-coast { fill: var(--map-land); }
.map-leaders { pointer-events: none; overflow: visible; }
.map-leader { stroke: var(--ink); stroke-opacity: 0.55; stroke-width: 1; }
.map-night { image-rendering: auto; pointer-events: none; }
.map-pins { pointer-events: none; }
.map-pins .pin { pointer-events: auto; }

/* Pins and the location dot are positioned by transform from the frame's
 * top-left corner (map.js). */
.pin,
.map-me {
  left: 0;
  top: 0;
  will-change: transform;
}

/* Where you are: Apple Maps' mark, so nobody has to learn it (TIME-204) —
 * a blue disc in a white ring with a soft shadow, and a halo that swells to
 * three times its width and fades, every 2s. It replaced the Here arrow at
 * the spot (TIME-199), so the arrow now means only "this block is your
 * clock" and goes back in its pill. Reduce Motion holds the halo still,
 * half-grown: it is part of what makes the mark read as you. */
.map-me {
  position: absolute;
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
  pointer-events: none;
}

.map-me::before,
.map-me::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--map-here);
}

.map-me::before {
  opacity: 0;
  animation: map-here-halo 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.map-me::after {
  border: 3px solid #FFFFFF;
  box-shadow: 0 1px 2.5px rgba(0, 0, 0, 0.3);
}

@keyframes map-here-halo {
  from { transform: scale(1); opacity: 0.4; }
  to { transform: scale(3); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .map-me::before { animation: none; transform: scale(2); opacity: 0.25; }
}

/* The controls: zoom, then you, then everyone — top right, out of the way
 * of the labels' usual seats and well clear of the band. */
.map-controls {
  position: absolute;
  top: 12px;
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1;
}

.map-control-group {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.map-control-group .map-control { border-radius: 0; box-shadow: none; }
.map-control-group .map-control + .map-control { border-top: 1px solid var(--map-rule); }

.map-control {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--app) 90%, transparent);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
}

.map-control:disabled { color: var(--sub); opacity: 0.5; cursor: default; }
.map-control:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.map-control--fit { transition: opacity 0.15s ease-out, visibility 0.15s; }
.map-control--fit:not([data-away]) { visibility: hidden; opacity: 0; }
.map-control--locate[data-state='on'] { color: var(--accent-text); }
/* Waiting on the browser: breathes from the tap, so the button never looks as
 * though it ignored you (TIME-195). Reduce Motion keeps the dimming alone. */
.map-control--locate[data-state='busy'] { animation: sync-breathe 0.6s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) {
  .map-control--locate[data-state='busy'] { animation: none; opacity: 0.6; }
}
.map-control--locate[data-state='unavailable'] { color: var(--sub); }

/* A pin is a 44px target centred on its place; the label hangs off the
 * centre wherever map.js found it room. */
.pin {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pin-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  /* A ring in the panel's colour, so a dot holds its edge over land and
   * night alike. */
  box-shadow: 0 0 0 2px var(--app);
}

.pin[data-state='working'] .pin-dot { background: var(--working); }
.pin[data-state='awake'] .pin-dot { background: var(--awake); }
.pin[data-state='asleep'] .pin-dot {
  background: var(--map-sea);
  border: 2px solid var(--asleep);
}

.pin[data-anchored='true'] .pin-dot { box-shadow: 0 0 0 2px var(--app), 0 0 0 5px var(--accent-soft); }

.pin-label {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  white-space: nowrap;
  line-height: 1.15;
  text-align: left;
  /* Not pointer-events: none — the pill is the bigger target and reads as the
   * place, so a tap on it bubbles to the pin's click and anchors, same as the
   * dot. */
  /* A pill, not a halo. A text-shadow in the sea's colour vanished wherever
   * the label sat over night or land, which is most of the map in daylight
   * mode — and grey time on grey night was unreadable. A near-opaque pill in
   * the panel's own colour reads the same over day, dusk and dark. */
  padding: 3px 7px 4px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--app) 88%, transparent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

/* The text inside a pill always reads from the left, whichever side of its
 * dot the pill sits on: right-aligned, a flag and an arrow on the first line
 * pulled the name out of line with the time beneath it. */

.pin-head {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pin-flag { font-size: 12px; line-height: 1; }
.pin-flag[hidden] { display: none; }

.pin-sky {
  width: 13px;
  height: 13px;
  color: var(--ink);
  opacity: 0.8;
}

.pin[data-state='asleep'] .pin-sky { opacity: 0.5; }

/* Here (DESIGN.md rule 9): `location.fill`, in the primary colour, on the
 * one pin that carries it for its block. */
.pin-here {
  width: 11px;
  height: 11px;
  color: var(--ink);
}

.pin-code {
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: 0.02em;
  color: var(--sub);
}

/* How much a label says (map.js `chooseModes`, per label): everything at
 * `full`; flag, name and time at `compact`; flag and time at `minimal`, on
 * one line. The day marker stays in every mode (DESIGN.md rule 2). */
.pin[data-mode='compact'] :is(.pin-sky, .pin-here, .pin-code),
.pin[data-mode='minimal'] :is(.pin-name, .pin-sky, .pin-here, .pin-code) {
  display: none !important;
}

.pin[data-mode='minimal'] .pin-label {
  flex-direction: row;
  align-items: center;
  gap: 5px;
  padding: 3px 6px;
}

.pin-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.pin[data-anchored='true'] .pin-name { color: var(--accent-text); }

.pin-time {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--sub);
}

/* `+1` / `−1` right after the time it qualifies, ~60% of its size. */
.pin-day {
  font-size: 0.6em;
  margin-left: 2px;
  vertical-align: super;
}

.pin:focus-visible { outline: none; }
.pin:focus-visible .pin-dot { outline: 2px solid var(--accent); outline-offset: 3px; }

.map-note {
  position: absolute;
  left: max(12px, env(safe-area-inset-left));
  right: 68px;
  /* Top left: the foot of the map is the forecast's. */
  top: 12px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--app) 88%, transparent);
  font-size: 13px;
  color: var(--sub);
  pointer-events: none;
}
