/* Top navigation — shared chrome across index / pricing / account / detail pages.
   Single source of truth; no per-page inline copies.
   Behavior (lang switcher, .scrolled toggle, current-page mark, mobile drawer)
   is in nav.js. */

/* Skip-to-main-content link — invisible until focused, then jumps the user
   past the repeating nav. Required by WCAG 2.4.1 (Bypass Blocks). Pages
   that need it carry a `<main id="main-content">` landmark (or any other
   element with that id) for the link to target. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 18px;
  background: #000;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip-link:focus,
.skip-link:focus-visible {
  left: 0;
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  /* min-height prevents a brief layout shift while nav.js injects content
     (each page has only <nav class="nav"></nav> as a placeholder, populated
     on DOMContentLoaded). 60px ≈ rendered nav height. */
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  background: transparent;
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  transition: box-shadow .18s ease, background .18s ease;
}
.nav.scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 12px 28px -4px rgba(0, 0, 0, 0.14);
}

.brand { display: flex; align-items: center; gap: 4px; }
.brand .gem { height: 32px; width: auto; }
.brand .wordmark { height: 22px; width: auto; }

.nav .links { display: flex; gap: 0; margin-left: 8px; }
.nav .links a {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: 8px;
  transition: background 100ms, color 100ms;
  white-space: nowrap;
}
.nav .links a.on { color: #000; font-weight: 600; }

.nav .sp { flex: 1; }
.nav .right { display: flex; align-items: center; gap: 6px; }

.iconbtn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #000;
  transition: background 100ms;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.iconbtn svg { width: 20px; height: 20px; stroke-width: 1.5; }

.lang-wrap { position: relative; }
.lang-pop {
  position: absolute;
  top: 42px;
  right: 0;
  width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 100ms, transform 100ms;
}
.lang-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.lang-pop h6 {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-2);
  padding: 8px 10px 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.lang-pop button {
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.lang-pop button small { font-size: 12px; color: var(--ink-2); margin-left: auto; }
.lang-pop button .check { color: #000; opacity: 0; }
.lang-pop button.on .check { opacity: 1; }

.signin {
  height: 36px;
  padding: 0 18px;
  background: #000;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.015em;
  transition: background 100ms;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

/* Hover states — only on devices that actually have hover.
   Wrapped to prevent sticky hover after tap on touch devices. */
@media (hover: hover) {
  .nav .links a:hover { background: var(--bg-sub); color: #000; }
  .iconbtn:hover { background: var(--bg-sub); }
  .lang-pop button:hover { background: var(--bg-sub); }
  .signin:hover { background: #333; }
}

/* Burger button + mobile drawer — hidden on desktop. nav.js injects the DOM
   for these unconditionally; the @media block below toggles visibility. */
.nav-burger { display: none; }
.nav-drawer { display: none; }

/* Tablet: tighter spacing, keep desktop layout. Range: 768–1023px. */
@media (max-width: 1023px) {
  .nav { padding: 12px 20px; gap: 16px; }
  .nav .links { margin-left: 0; }
  .nav .links a { padding: 8px 12px; font-size: 13px; }
}

/* Mobile: collapse just the nav links (Home / Gallery / Pricing) into a
   slide-down drawer. The lang switcher + sign-in (or avatar when logged
   in) stay visible on the nav bar itself. Burger goes on the LEFT via
   flex order so the layout reads [☰] [Brand] [spacer] [Lang] [Sign in]. */
@media (max-width: 767px) {
  .nav { padding: 10px 12px; gap: 6px; min-height: 56px; }
  .nav .links { display: none; }
  /* .lang-wrap / .signin / .curio-user-wrap stay visible — no display:none. */

  .nav-burger {
    display: inline-flex;
    order: -1; /* push burger to the leftmost flex slot */
    width: 40px; height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: #000;
    padding: 0;
    font-family: inherit;
  }
  .nav-burger svg {
    width: 22px; height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
  }

  /* Trim the sign-in button so brand + lang + signin fit at 375px. */
  .nav .signin { padding: 0 14px; font-size: 13px; }

  .nav-drawer {
    display: block;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    /* Fully opaque so hero / page content doesn't bleed through. */
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.14);
    z-index: 49;
    padding: 8px;
    transform: translateY(-110%);
    transition: transform 220ms ease, opacity 220ms ease;
    opacity: 0;
    pointer-events: none;
  }
  .nav-drawer.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-drawer a,
  .nav-drawer .drawer-btn {
    display: block;
    width: 100%;
    padding: 13px 16px;
    border-radius: 8px;
    font-size: 16px;
    color: #000;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    text-decoration: none;
    box-sizing: border-box;
  }
  .nav-drawer a.on { font-weight: 600; }
  .nav-drawer .sep {
    height: 1px;
    background: var(--line);
    margin: 8px 4px;
  }
  .nav-drawer .lang-row {
    display: flex;
    gap: 8px;
    padding: 8px;
  }
  .nav-drawer .lang-row button {
    flex: 1;
    padding: 11px 12px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 13px;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    color: #000;
  }
  .nav-drawer .lang-row button.on {
    background: #000;
    color: #fff;
    border-color: #000;
    font-weight: 600;
  }
  .nav-drawer .signin-mobile {
    background: #000;
    color: #fff;
    font-weight: 600;
    text-align: center;
    margin: 8px 4px 4px;
    padding: 14px;
  }

  /* Lang switcher + sign-in live on the nav bar at mobile (see top of this
     @media block), so the drawer only carries the 3 page links. Hide the
     drawer's lang-row + separator + signin-mobile to avoid duplication. */
  .nav-drawer .sep,
  .nav-drawer .lang-row,
  .nav-drawer .signin-mobile { display: none; }
}
