/* GeoZMap: dark theme tokens, the theme/language buttons, and the theme
   switch animation. Loaded after each page's own stylesheet; js/prefs.js
   sets <html data-theme>. The light values live in css/site.css,
   style.css and business.html; these override them by specificity. */

:root[data-theme="dark"] {
  --paper: #131211;
  --sheet: #1C1B19;
  --surface: #242220;
  --surface2: #2B2926;
  --ink: #F3F0EB;
  --ink-2: #ABA49B;
  --ink-mute: #ABA49B;
  --line: #34312D;
  --line-strong: #7A736A;
  --go: #52C48D;
  --go-deep: #86DBB0;
  --go-wash: #16301F;
  --warn: #F0A55A;
  --warn-deep: #F6C38D;
  --warn-wash: #36250F;
  --bad: #F2897F;
  --bad-wash: #3B1814;
  --on-ink: #131211;
  --on-ink-2: #4D4842;
  --ink-hover: #DCD7CF;
  --hover-wash: #2B2926;
  --map-ground: #1A1917;
  --map-road: #2C2A27;
  --map-road-major: #3B3834;
  --map-road-casing: #121110;
  --map-park: #18271D;
  --map-water: #18303A;
  --shadow-chip: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-float: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -12px rgba(0, 0, 0, 0.6);
  --accent-ring: rgba(82, 196, 141, 0.35);
}

/* Hero map card: lift it off the dark map */
:root[data-theme="dark"] .hero-map__card { background: var(--surface); }

/* Theme and language buttons (built by js/prefs.js) */
.pref-group { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.pref-btn {
  display: inline-grid; place-items: center;
  min-width: 40px; height: 40px; padding: 0 10px;
  border: 1px solid var(--line, #E5E5E5); border-radius: 999px;
  background: var(--sheet, #FFF); color: var(--ink, #000);
  font: 600 0.75rem/1 var(--font, 'Sora', system-ui, sans-serif); letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms, transform 150ms;
}
.pref-btn:hover { background: var(--surface, #F5F3F1); border-color: var(--line-strong, #8C857D); }
.pref-btn:active { transform: scale(0.94); }
.pref-btn:focus-visible { outline: 2px solid var(--ink, #000); outline-offset: 2px; }
.pref-btn svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.pref-theme svg { animation: pref-icon-in 420ms cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes pref-icon-in {
  from { transform: rotate(-90deg) scale(0.4); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Marketing header: after the sign-in buttons on desktop, before the
   menu button on small screens. */
.site-nav .pref-group { order: 3; }
@media (max-width: 860px) {
  .site-nav .menu-btn { order: 4; }
}
@media (max-width: 480px) {
  .site-nav .pref-group { margin-left: auto; }
  .site-nav .menu-btn { margin-left: var(--space-2, 0.5rem); }
  .site-nav:has(.gz-auth-area) .pref-group { margin-left: var(--space-2, 0.5rem); }
}
/* Map app and business setup headers */
.appview-nav .pref-group, .bizwiz-nav .pref-group { margin-left: 8px; }

/* Theme switch: the new theme grows as a circle from the button
   (animated by js/prefs.js); the old one stays still underneath. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* English is loading: hide for at most a moment instead of flashing Indonesian. */
.i18n-pending body { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  .pref-theme svg { animation: none; }
}
