/* Home-page left navigation (public/js/home-nav.js). Frosted LDV-blue sidebar
   over the beach hero; persistent on desktop, off-canvas drawer on mobile. */

:root {
  --hn-blue: #005B83;
  --hn-blue-dark: #004a6b;
  --hn-accent: #7fd1f0;
}

/* ---------- Sidebar shell ---------- */
.hn-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 264px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 4px;
  color: #fff;
  font-family: 'Jost', sans-serif;
  background: rgba(0, 91, 131, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.28);
  overflow-y: auto;
  transition: width 0.18s ease, transform 0.22s ease;
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .hn-nav { background: rgba(0, 74, 107, 0.94); }
}

/* ---------- Brand (logo bar only — no wordmark) ---------- */
.hn-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 8px;
}
.hn-brand-link { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.hn-brand-logo { height: 45px; width: auto; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); }
.hn-collapse {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff; border: none; border-radius: 7px;
  width: 26px; height: 26px; cursor: pointer;
  font-size: 0.8rem; line-height: 1; transition: background 0.15s;
}
.hn-collapse:hover { background: rgba(255, 255, 255, 0.24); }

/* Collapse is a desktop-only affordance (mobile uses the hamburger/drawer).
   The collapse toggle itself STAYS visible when collapsed so the rail can be
   re-opened; only the logo + labels are hidden. */
@media (min-width: 769px) {
  .hn-nav.collapsed { width: 62px; }
  .hn-nav.collapsed .hn-brand { justify-content: center; }
  .hn-nav.collapsed .hn-brand-link,
  .hn-nav.collapsed .hn-user-info,
  .hn-nav.collapsed .hn-flyout,
  .hn-nav.collapsed .hn-group-title,
  .hn-nav.collapsed .hn-link-label,
  .hn-nav.collapsed .hn-footer { display: none; }
  .hn-nav.collapsed .hn-user-card,
  .hn-nav.collapsed .hn-link { justify-content: center; }
}

/* ---------- User card + flyout ---------- */
.hn-user { position: relative; margin-bottom: 8px; }
.hn-user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); transition: background 0.15s;
}
.hn-user-card:hover { background: rgba(255, 255, 255, 0.16); }
.hn-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: #3b82f6 center / cover no-repeat; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 600;
}
.hn-user-info { min-width: 0; }
.hn-user-name { font-size: 0.85rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.hn-user-role { font-size: 0.7rem; color: rgba(255, 255, 255, 0.7); text-transform: capitalize; line-height: 1.2; }

.hn-flyout {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px; z-index: 5;
  border-radius: 10px; overflow: hidden;
  background: rgba(0, 45, 66, 0.92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .hn-flyout { background: rgba(0, 45, 66, 0.98); }
}
.hn-flyout.active { display: block; }
.hn-flyout-email { padding: 11px 12px; font-size: 0.74rem; color: rgba(255, 255, 255, 0.72); word-break: break-all; }
.hn-flyout-divider { height: 1px; background: rgba(255, 255, 255, 0.12); }
.hn-flyout-item { display: block; padding: 11px 12px; font-size: 0.85rem; font-weight: 500; color: #fff; text-decoration: none; transition: background 0.1s; }
.hn-flyout-item:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- Nav groups + links ---------- */
.hn-group-title {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55); padding: 12px 8px 4px;
}
.hn-links { display: flex; flex-direction: column; gap: 2px; }
.hn-link {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 8px;
  color: rgba(255, 255, 255, 0.9); text-decoration: none;
  font-size: 0.86rem; transition: background 0.12s, color 0.12s;
}
.hn-link:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.hn-link-icon { width: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.98rem; opacity: 0.92; }
.hn-link-icon svg { display: block; }
.hn-link-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hn-footer {
  margin-top: auto; padding: 12px 8px 4px; font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.55); text-decoration: none;
}
.hn-footer:hover { color: #fff; }

/* ---------- Hamburger + scrim (mobile) ---------- */
.hn-hamburger {
  position: fixed; top: 14px; left: 14px; z-index: 40; display: none;
  width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px; cursor: pointer; color: #fff;
  align-items: center; justify-content: center;
  background: rgba(0, 91, 131, 0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .hn-hamburger { background: rgba(0, 74, 107, 0.94); }
}
.hn-hamburger-icon { font-size: 1.3rem; line-height: 1; }
.hn-scrim {
  position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.22s ease;
}
.hn-scrim.active { opacity: 1; pointer-events: auto; }

/* ---------- Sign-in pill (logged out) ---------- */
.hn-signin {
  position: fixed; top: 16px; left: 16px; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 8px; text-decoration: none;
  font-family: 'Jost', sans-serif;
  background: rgba(17, 24, 39, 0.45);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); transition: background 0.15s;
}
.hn-signin:hover { background: rgba(31, 41, 55, 0.55); }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .hn-signin { background: rgba(17, 24, 39, 0.82); }
}
.hn-signin-icon {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255, 255, 255, 0.15); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.hn-signin-icon svg { width: 20px; height: 20px; }
.hn-signin-label { font-size: 0.9rem; font-weight: 600; color: #fff; }

/* ---------- Mobile: drawer mode ---------- */
@media (max-width: 768px) {
  .hn-hamburger { display: flex; }
  .hn-nav {
    width: 280px;
    transform: translateX(-100%);
    box-shadow: 4px 0 32px rgba(0, 0, 0, 0.4);
  }
  .hn-nav.open { transform: translateX(0); }
  /* collapse rules are scoped to min-width:769px, so .collapsed is inert here;
     the collapse toggle is hidden on mobile (the drawer uses the hamburger). */
  .hn-nav .hn-collapse { display: none; }
}

@media (max-width: 480px) {
  .hn-nav { width: 86vw; }
}
