/* ============================================================================
   sitebar.css — global top toolbar for Sargazo Watch
   Shared across the map app, Forecast, and Blog so every page wears the same
   chrome: [Sargazo Watch → home] ............ [Home] [Forecast] [Blog]
   Loaded AFTER styles.css on the map pages so its integration overrides win.
   ============================================================================ */

:root {
  --sb-h: 62px;                                            /* bar content height */
  --sb-total: calc(var(--sb-h) + env(safe-area-inset-top, 0px));
  --sb-accent: #006d99;
  --sb-ink: #0c1d28;
  --sb-ink-soft: #41525d;
}

/* push every page's content below the fixed bar */
body { padding-top: var(--sb-total); }

.sitebar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--sb-total); padding: env(safe-area-inset-top, 0px) 24px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  /* premium frosted glass: clean white with a whisper of cool depth, not flat gray */
  background: #ffffff;
  -webkit-backdrop-filter: blur(28px) saturate(185%);
  backdrop-filter: blur(28px) saturate(185%);
  border-bottom: 1px solid rgba(12,29,40,.07);
  box-shadow: 0 1px 0 rgba(255,255,255,.85) inset, 0 8px 30px rgba(8,40,55,.07);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
/* hairline accent glow along the bottom edge — subtle designer touch */
.sitebar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,109,153,.22), transparent);
}

/* brand: text wordmark only (logo removed), far left */
.sb-brand { display: flex; align-items: center; text-decoration: none; flex: 1 1 0; min-width: 0; }
.sb-logo { display: none !important; }
.sb-name { font-weight: 800; letter-spacing: -.02em; font-size: 18px; color: var(--sb-ink); white-space: nowrap; line-height: 1; }
.sb-name span { color: var(--sb-accent); }

/* centered nav */
.sb-nav { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
/* balances the brand on the left so the nav stays optically centered */
.sb-spacer { flex: 1 1 0; min-width: 0; }
.sb-nav a {
  position: relative;
  font-size: 16px; font-weight: 650; letter-spacing: .005em; color: var(--sb-ink-soft);
  padding: 10px 28px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  transition: background .18s, color .18s, box-shadow .18s;
}
.sb-nav a:hover { background: rgba(12,29,40,.05); color: var(--sb-ink); }
.sb-nav a.active {
  color: #fff; font-weight: 700;
  background: linear-gradient(180deg, #0a85b3, var(--sb-accent));
  box-shadow: 0 3px 12px rgba(0,109,153,.34), inset 0 1px 0 rgba(255,255,255,.25);
}

/* ---- integration with the map app (no-op on Forecast/Blog, which lack these) ---- */
.topbar .brand { display: none !important; }            /* brand now lives in the bar */
.stage { height: calc(100dvh - var(--sb-total)); }      /* map fills the space under the bar */

@media (max-width: 1000px) {
  /* tighten the nav so all seven links (incl. "Find my beach") fit above the
     mobile breakpoint — small-laptop / tablet-landscape widths */
  .sitebar { gap: 10px; padding-left: 16px; padding-right: 16px; }
  .sb-nav a { font-size: 14px; padding: 8px 13px; }
}

@media (max-width: 760px) {
  :root { --sb-h: 54px; }
  /* brand left, nav right, natural space between — no centering squeeze on narrow screens */
  .sitebar { padding-left: 14px; padding-right: 8px; gap: 8px; justify-content: space-between; }
  .sb-brand { flex: 0 0 auto; }
  .sb-spacer { display: none; }
  .sb-citylink { display: none; }   /* "By city" is desktop-only; on mobile it's the in-map toggle */
  .sb-findlink { display: none; }    /* mobile uses the secondary-bar "Find my beach" button instead */
  .sb-name { font-size: 14.5px; }
  .sb-nav { gap: 0; }
  .sb-nav a { font-size: 12.5px; padding: 7px 8px; letter-spacing: -.01em; }
  /* the global bar already eats the safe-area, so the in-stage header shouldn't */
  .topbar { padding-top: 10px !important; }
  /* keep the map fitting under BOTH the global bar and the under-map tabs */
  .stage { height: calc(100dvh - 110px - var(--sb-total)); }
}
@media (max-width: 380px) {
  .sitebar { padding-left: 12px; padding-right: 6px; gap: 6px; }
  .sb-name { font-size: 13px; }
  .sb-nav a { font-size: 11.5px; padding: 7px 6px; }
}
