/*
 * glass.css: frosted glass, on every page whose <body> has class="glass" (the client's presentation and /admin).
 *
 * The panel and everything floating on the map let the map show through, blurred (tokens: --glass-*), with a bright
 * rim like Apple's Liquid Glass. Where the browser can't blur, or the visitor asked for less transparency, they are
 * solid as before. The glass is tinted with --sheet, the same light colour on every page (one theme, no dark mode).
 */

.glass .sheet,
.glass .toolbar .segmented,
.glass .layers-menu__list,
.glass .toolbar .control--solid,
.glass .compass,
.glass .dial-button,
.glass .to-top,
.glass .status,
.glass .place-card,
.glass .ws-tray,
.glass .map-menu__panel,
.glass .credits {
  background: color-mix(in srgb, var(--sheet) var(--glass-opacity), transparent);
  border-color: color-mix(in srgb, var(--line) 60%, transparent);
  box-shadow: var(--glass-rim), var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}
.glass .sheet { background: color-mix(in srgb, var(--sheet) var(--glass-opacity-panel), transparent); }
.glass .toolbar .control--solid:hover,
.glass .compass:hover,
.glass .dial-button:hover,
.glass .to-top:hover { background: color-mix(in srgb, var(--sheet-sunk) 88%, transparent); }
.glass .toolbar .control--solid[aria-pressed="true"] { background: var(--ink); }
.glass .credits { box-shadow: none; }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass .sheet, .glass .toolbar .segmented, .glass .toolbar .control--solid, .glass .compass, .glass .dial-button,
  .glass .to-top, .glass .status, .glass .place-card, .glass .ws-tray, .glass .map-menu__panel, .glass .credits { background: var(--sheet); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass .sheet, .glass .toolbar .segmented, .glass .toolbar .control--solid, .glass .compass, .glass .dial-button,
  .glass .to-top, .glass .status, .glass .place-card, .glass .ws-tray, .glass .map-menu__panel, .glass .credits {
    background: var(--sheet);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* The pink buttons ("Generate presentation", "Write to us") stay pink and solid: the glass above is for the plain ones.
   Inside the panel the secondary buttons are a soft tint (controls.css), not glass: glass is for what floats on the map. */
.glass .control--flag { background: var(--accent); }
.glass .control--flag:hover { background: var(--accent-hover); }

/* ------------------------------------------------------------------ /admin and /account (.glass--white)
   The same panel colour as every other page. On a phone their panel sits under the map, not over it: nothing to see
   through, so it is solid. */
@media (max-width: 47.5rem) {
  .glass--white .sheet {
    background: var(--sheet);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
