/* Aulama site fixes, 2026-11-04. Loaded last on every page that uses the site header. */

/* Menus and sheets: thick frosted glass. The sheet set its own --lg-blur to a bare
   40px, which replaced the shared filter list, so backdrop-filter became an invalid
   "40px" and the page showed through the sheet with nothing but 28% white over it:
   the opening's headline and buttons read straight through the menu. */
:root:root .site-nav :is(.nav-panel, .nav-sheet, .nav-language-menu, .home-account-menu) {
  background: var(--glass-menu);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
          backdrop-filter: blur(30px) saturate(1.4);
}

/* The phone menu hangs below the header on every page. Only the home page placed
   it; elsewhere it sat in a 30px header row and was centred on it, so half of it
   rose above the screen (the products were out of reach) and the rest covered
   the logo and the close button. */
@media (max-width: 899px) {
  :root:root .site-nav .nav-sheet {
    position: absolute; top: 100%; left: 0; right: 0;
    width: auto; margin-top: 8px; border-radius: 28px;
    max-height: calc(100svh - var(--nav-h) - var(--nav-top) - 24px);
  }
}

/* Phone menu: product names stay on one line in the two columns. */
@media (max-width: 520px) {
  .site-nav .nav-sheet { padding: 10px; }
  .site-nav .nav-sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-nav .nav-sheet-grid a { gap: 8px; padding: 10px 6px; overflow: hidden; white-space: nowrap; font-size: clamp(13px, calc((100vw - 36px) / 24), 15px); }
  .site-nav .nav-sheet-grid a img { width: 24px; height: 24px; flex: none; }
}
@media (max-width: 340px) {
  .site-nav .nav-sheet-grid a { white-space: normal; line-height: 1.25; }
}

/* Signed-in header on narrow screens: the name and chevron are hidden, so the
   button is just the avatar in a round frame. A later rule had put 14px of
   right padding back, leaving an empty capsule beside the picture. */
@media (max-width: 899px) {
  .site-nav .home-account-button { width: 46px; padding: 0; gap: 0; justify-content: center; }
}

/* Account page. Its icons are outline drawings but had no stroke set, so they
   rendered as solid black shapes: a dark triangle for "back to home" and
   invisible tab icons in dark mode. */
.account-home-link { flex: none; color: var(--ink); }
.account-home-link svg, .account-section-nav a svg {
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
@media (max-width: 860px) {
  /* four sections share the row instead of scrolling the last one off the edge */
  .account-section-nav { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .account-section-nav a { justify-content: center; gap: 8px; padding: 11px 6px; }
}
@media (max-width: 640px) {
  /* the logo and the menu already lead home; the round button only crowded the title */
  .account-home-link { display: none; }
  .account-page-head { margin-bottom: 24px; }
  .account-section-nav { gap: 2px; padding: 6px; }
  .account-section-nav a { flex-direction: column; gap: 4px; padding: 9px 2px; font-size: 13px; line-height: 1.25; text-align: center; border-radius: 16px; }
  .account-section-nav a svg { width: 20px; height: 20px; }
}

/* Touch screens: no lens refraction over the moving 3D scene. The SVG
   displacement filter is redrawn every frame the scene behind it moves, which
   phones do on the CPU; the plain frosted glass looks the same at arm's length. */
@media (pointer: coarse) {
  .lg-lensing .lg.has-lens {
    -webkit-backdrop-filter: blur(16px) saturate(1.6) brightness(var(--glass-bright));
            backdrop-filter: blur(16px) saturate(1.6) brightness(var(--glass-bright));
  }
  .lg-lensing .nav-lens.has-lens {
    -webkit-backdrop-filter: blur(12px) saturate(1.25) brightness(1.06);
            backdrop-filter: blur(12px) saturate(1.25) brightness(1.06);
  }
}

/* Account e-mail and role: keep 管理員 together instead of leaving 員 alone on a line. */
#account-profile-email { word-break: keep-all; overflow-wrap: anywhere; }
