/*
 * The clock in the toolbar and its time panel (js/clock-control.js). Colours come from the tokens in map.css.
 */
/* Clock: the toolbar button shows Hyderabad time, a red dot while it is live,
   and a sun, low sun or moon for the light (data-map-time, set by ui.js showMapTime). */
.time-control { position: relative; display: inline-flex; }
.tool-time { font-variant-numeric: tabular-nums; }
.tool-time .time-icon-dusk, .tool-time .time-icon-moon { display: none; }
:root[data-map-time="dusk"] .tool-time .time-icon-sun, :root[data-map-time="night"] .tool-time .time-icon-sun { display: none; }
:root[data-map-time="dusk"] .tool-time .time-icon-dusk, :root[data-map-time="night"] .tool-time .time-icon-moon { display: block; }
.live-dot { display: none; width: 6px; height: 6px; background: var(--accent); }
.tool-time.is-live .live-dot { display: block; }
.time-panel {
  position: absolute;
  left: -2px;
  bottom: calc(100% + 14px);
  z-index: 6;
  width: 280px;
  padding: 12px;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: var(--pixel-shadow);
}
/* The landmark strip (its tab, or its cards when open) sits in the same spot above the toolbar, so it
   steps aside while the time panel is open. */
.hud:has(.time-panel:not([hidden])) .landmark-strip { visibility: hidden; }
.time-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.time-panel-clock { font: 700 30px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.time-live, .time-presets button {
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  padding: 6px 10px;
  font: 600 13px/1 var(--font-display);
  cursor: pointer;
}
.time-live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; vertical-align: 1px; background: var(--muted); }
.time-live[aria-pressed="true"]::before { background: var(--accent); }
.time-live[aria-pressed="true"], .time-presets button[aria-pressed="true"] { background: var(--chip); box-shadow: inset 0 0 0 1px var(--line); }
/* The track is the day's sky: night, dawn, day, golden hour and dusk, night again. */
.time-slider {
  width: 100%;
  height: 14px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--line);
  background: linear-gradient(90deg, #1d2050 0%, #2c2f6e 20%, #f29aa6 26%, #ffd9a0 30%, #9fd8f5 38%, #9fd8f5 64%, #ffcf8f 70%, #f29aa6 75%, #3a2a5c 81%, #1d2050 100%);
  cursor: pointer;
}
.time-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 22px; background: var(--paper); border: 2px solid var(--line); }
.time-slider::-moz-range-thumb { width: 12px; height: 20px; border-radius: 0; background: var(--paper); border: 2px solid var(--line); }
.time-slider:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.time-scale { display: flex; justify-content: space-between; margin-top: 4px; font: 500 10px/1 var(--font-mono); color: var(--muted); }
.time-sun { display: flex; justify-content: space-between; margin: 10px 0; font: 500 12px/1.3 var(--font-mono); color: var(--muted); }
.time-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.time-presets button { padding: 7px 4px; }
.time-live:focus-visible, .time-presets button:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }

/* Phones hide toolbar labels; the clock keeps its time. */
@media (max-width: 860px) {
  .tool-time .tool-text { display: inline; }
  .time-panel { width: min(280px, calc(100vw - 24px)); }
}
