/* v2-header.css: the server-rendered copy of the Lovable header (guides,
   articles, privacy, terms, 404). Markup comes from src/v2-header.mjs and
   uses the lv: utilities in lovable.css, exactly like #lvHeader in the SPA.
   Only header.v2h and nav.v2h-nav are styled here, with the numbers of
   'sticky top-0 z-30 border-b border-border bg-background/85 backdrop-blur'
   and 'hidden items-center gap-7 text-sm text-muted-foreground md:flex'.
   No scrollbar-gutter here: the SPA uses auto (lovable.css), so the header
   is the same width on every page. */
/* titanium.css (loaded by the 404 page) sets scrollbar-gutter: stable, which
   made the header 12px narrower there. */
html { scrollbar-gutter: auto; }
/* Same scrollbar look on every page (the app's 12px one). */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a3a3c; border-radius: 999px; border: 3px solid oklch(0.13 0.004 260); }
::-webkit-scrollbar-thumb:hover { background: #48484a; }

.v2h {
  position: sticky; top: 0; z-index: 120;
  display: block; box-sizing: border-box; width: 100%; margin: 0; padding: 0;
  border: 0; border-bottom: 1px solid var(--lvc-border);
  background-color: var(--lvc-background);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 16px; line-height: 1.5; font-weight: 400; letter-spacing: normal;
  color: var(--lvc-foreground);
  -webkit-font-smoothing: antialiased;
}
@supports (color: color-mix(in lab, red, red)) {
  .v2h { background-color: color-mix(in oklab, var(--lvc-background) 85%, transparent); }
}
.v2h [class*="lv:"] { font-family: inherit; }
/* Page CSS (titanium.css on the 404) must not show hidden header parts. */
.v2h [hidden] { display: none !important; }
.v2h-nav {
  display: none; align-items: center; gap: 1.75rem; margin: 0; padding: 0;
  font-size: 0.875rem; line-height: 1.25rem; color: var(--lvc-muted-foreground);
}
@media (min-width: 48rem) {
  .v2h-nav { display: flex; }
}

/* SPA legacy topbar (hidden in v2 by lovable.css; kept for the old UI). */
html.v2 body header.topbar { box-sizing: border-box; }
html.v2 body header.topbar .brand { margin: 0; gap: 10px; }
html.v2 body header.topbar .brand .logo { width: 30px; height: 30px; flex: 0 0 30px; }
@media (max-width: 860px) {
  html.v2 body header.topbar { flex-wrap: nowrap !important; gap: 16px !important; height: 56px !important; padding: 0 16px !important; transform: none !important; }
  html.v2 body header.topbar .brand { flex: 0 1 auto !important; gap: 10px !important; }
  html.v2 body header.topbar .brand .logo { width: 30px !important; height: 30px !important; flex: 0 0 30px !important; }
  html.v2 body header.topbar .topnav { margin-left: auto !important; gap: 8px !important; }
}
@media (max-width: 560px) {
  html.v2 body header.topbar .brand .brand-name { font-size: 16px !important; }
}


/* 2026-11-18: signed-in Alerts inbox re-hosted in #lvHeader / .v2h.
   The legacy topbar control stays hidden; this is the visible slot. */
#lvHeader .lv-header-tools,
.v2h .lv-header-tools { position: relative; min-width: 0; }
#lvHeader .notif-wrap,
.v2h .notif-wrap { position: static; flex: 0 0 auto; }
#lvHeader .lv-notif-btn,
.v2h .lv-notif-btn {
  display: grid; place-items: center; position: relative;
  width: 2.25rem; height: 2.25rem; padding: 0;
  border-radius: 0.5rem;
  border: 1px solid var(--lvc-border, rgba(255,255,255,.14));
  background: transparent; color: inherit; cursor: pointer;
}
#lvHeader .lv-notif-btn:hover,
.v2h .lv-notif-btn:hover { background: rgba(255,255,255,.06); }
#lvHeader .lv-notif-btn:focus-visible,
.v2h .lv-notif-btn:focus-visible {
  outline: 2px solid rgba(200,162,90,.65); outline-offset: 2px;
}
#lvHeader .notif-badge,
.v2h .notif-badge {
  position: absolute; top: -4px; right: -4px; margin: 0;
  z-index: 1;
}
#lvHeader .notif-panel,
.v2h .notif-panel {
  position: absolute; top: calc(100% + 8px); right: 0; left: auto;
  z-index: 140;
  box-sizing: border-box;
  width: min(360px, calc(100vw - 24px));
  max-width: calc(100vw - 16px);
  max-height: min(480px, calc(100vh - 96px - var(--ipf-consent-h, 0px)));
  max-height: min(480px, calc(100dvh - 96px - var(--ipf-consent-h, 0px)));
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;
}
#lvHeader .notif-section,
.v2h .notif-section {
  margin: 8px 12px 4px; font-size: 11px; font-weight: 650;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--lvc-muted-foreground, rgba(231,227,218,.62));
}
#lvHeader .notif-empty-soft,
.v2h .notif-empty-soft { padding: 12px 16px; }
@media (max-width: 360px) {
  #lvHeader:has(.notif-wrap:not([hidden])) [data-lv-brand-text],
  .v2h:has(.notif-wrap:not([hidden])) [data-lv-brand-text] { display: none; }
}
