/* hamburger.css — unified hamburger overlay, used on every page.
   Spec-5 — defensive resets defeat Pico CSS Classless rules that
   leak into the drawer on pages that load Pico (admin pages via
   base.html). Marketing pages don't load Pico, so on /research /
   /universe / /login / / the drawer renders with neither these
   overrides nor Pico's bleed — meaning the overrides bring admin
   pages back into parity with marketing. Every override here is
   scoped to descendants of .hamburger-overlay so nothing else on
   the page is touched. */
.hamburger-overlay,
.hamburger-overlay * {
  box-sizing: border-box;
  /* Defeat Pico's body line-height: 1.5 cascade so admin and
     marketing render drawer line-height identically. The drawer
     class rules set their own line-heights where they care; the
     rest pick this up consistently. */
  line-height: 1.4;
}
.hamburger-overlay nav {
  /* Defeat Pico's `nav { justify-content: space-between; overflow:
     visible }` — without this, admin drawers stretch their links
     and the section-label dividers across the entire column height
     and the profile-pin's `margin-top: auto` is neutered. */
  justify-content: flex-start;
  align-items: stretch;
  overflow: visible;
  overflow-y: auto;
  flex-wrap: nowrap;
}
.hamburger-overlay a {
  /* Defeat Pico's `:where(a:not([role=button])):is(:hover,...){
     text-decoration: underline }` so admin drawer links don't
     underline on hover the way marketing links don't. */
  text-decoration: none !important;
  background-color: transparent;
}
.hamburger-overlay a:hover,
.hamburger-overlay a:focus,
.hamburger-overlay a:active {
  text-decoration: none !important;
}
.hamburger-overlay button {
  /* Defeat Pico's button defaults so the close button + any future
     drawer buttons inherit drawer typography rather than Pico's. */
  font-family: 'Montserrat', sans-serif;
  font-size: inherit;
  margin: 0;
  background-color: transparent;
}
.hamburger-overlay h1,
.hamburger-overlay h2,
.hamburger-overlay h3 {
  /* Defeat Pico's `h2 { margin-bottom: var(--pico-typography-
     spacing-vertical) }`. Drawer titles set their own margin: 0. */
  margin-top: 0;
  margin-bottom: 0;
}

.hamburger-overlay-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(28,28,26,0.5);
  backdrop-filter: blur(3px);
  z-index: 999;
}
.hamburger-overlay-backdrop[hidden] { display: none; }

.hamburger-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--landing-card-bg, #FAFAF7);
  border-right: 1px solid var(--landing-card-border, #D6D3C7);
  box-shadow: 4px 0 16px rgba(0,0,0,0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: hamburgerSlide 200ms ease-out;
}
.hamburger-overlay[hidden] { display: none; }

@keyframes hamburgerSlide {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

.hamburger-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem 0.85rem;
  border-bottom: 1px solid var(--landing-card-border, #D6D3C7);
}

.hamburger-overlay-title {
  font-family: 'Khand', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--landing-accent, #B64926);
  letter-spacing: 0.04em;
  margin: 0;
}

.hamburger-overlay-close {
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid var(--landing-card-border, #D6D3C7);
  border-radius: 4px;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  color: var(--landing-text-muted, #5A5A57);
}

.hamburger-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
}

.hamburger-link {
  display: block;
  padding: 0.5rem 1.5rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.92rem;
  color: var(--landing-text-primary, #1C1C1A);
  text-decoration: none;
}

.hamburger-link:hover {
  background: rgba(182, 73, 38, 0.05);
  color: var(--landing-accent, #B64926);
}

.hamburger-link-active {
  background: rgba(182, 73, 38, 0.08);
  color: var(--landing-accent, #B64926);
  font-weight: 600;
  border-left: 3px solid var(--landing-accent, #B64926);
  padding-left: calc(1.5rem - 3px);
}

.hamburger-section-label {
  font-family: 'Khand', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--landing-text-muted, #5A5A57);
  padding: 0.85rem 1.5rem 0.35rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--landing-card-border, #D6D3C7);
}
.hamburger-section-label:first-of-type {
  border-top: none;
  margin-top: 0;
}

/* Spec-2 — shared drawer styles for WORKSPACE badge + profile pin.
   Originally lived inline in web/base.html; moved here so every
   drawer instance (base.html, public_base.html, landing.html,
   rag_cockpit.html, stub_partner_gos.html) renders identically. */

.hamburger-link-badged {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.hamburger-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0.1rem 0.4rem;
  border-radius: 9px;
  background: #B22600;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.hamburger-badge[hidden] { display: none; }

.hamburger-profile-pin {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  margin-top: auto;
  border-top: 1px solid var(--landing-card-border, #D6D3C7);
  background: var(--landing-card-bg, #FAFAF7);
  flex-shrink: 0;
}
.hamburger-profile-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
/* Phase 7.3.6 — superuser view-switcher dropdown above the profile row. */
.superuser-view-switcher {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--landing-card-border, #D6D3C7);
}
.superuser-view-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--landing-text-muted, #5A5A57);
}
.superuser-view-select {
  width: 100%;
  padding: 0.4rem 0.55rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--landing-bg, #EDEBE2);
  border: 1px solid var(--landing-card-border, #D6D3C7);
  border-radius: 5px;
  color: var(--landing-text-primary, #1C1C1A);
  cursor: pointer;
  /* Defeat Pico's <select> baseline so it doesn't expand or theme weirdly inside the drawer. */
  height: auto;
  margin: 0;
  box-shadow: none;
  appearance: auto;
}
.superuser-view-select:focus {
  outline: none;
  border-color: var(--landing-accent, #B64926);
}
.superuser-view-select:disabled { opacity: 0.7; cursor: progress; }
.hamburger-profile-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  padding: 0.15rem;
  border-radius: 6px;
  transition: background 0.12s;
}
.hamburger-profile-link:hover {
  background: rgba(182, 73, 38, 0.08);
  text-decoration: none;
  color: inherit;
}
.hamburger-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--landing-accent, #B64926);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.hamburger-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hamburger-profile-initials { line-height: 1; }
.hamburger-profile-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.hamburger-profile-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--landing-text-primary, #1C1C1A);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hamburger-profile-logout {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--landing-text-muted, #5A5A57);
  text-decoration: none;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--landing-card-border, #D6D3C7);
  border-radius: 4px;
  flex-shrink: 0;
}
.hamburger-profile-logout:hover {
  color: #B22600;
  border-color: #B22600;
  text-decoration: none;
}

/* Role-badge styling reused by the profile pin (originally defined on
   .user-pill-role in Phase 7.0 — duplicated here so public templates
   that do not load the inline style block in base.html still pick it up). */
.user-pill-role {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  text-transform: uppercase;
  display: inline-block;
  width: max-content;
}
.user-pill-role-admin {
  background: rgba(182, 73, 38, 0.12);
  color: var(--landing-accent, #B64926);
  border: 1px solid rgba(182, 73, 38, 0.4);
}
.user-pill-role-sme {
  background: rgba(46, 109, 178, 0.12);
  color: #1F4F86;
  border: 1px solid rgba(46, 109, 178, 0.35);
}
/* Phase 7.3.6 — superuser badge (cool slate to distinguish from admin orange). */
.user-pill-role-superuser,
.user-pill-role-vendor,
.user-pill-role-subscriber {
  background: rgba(74, 85, 104, 0.12);
  color: #2D3748;
  border: 1px solid rgba(74, 85, 104, 0.35);
}


/* Phase 7.5.4B/9 — anonymous-visitor pin at the bottom of the
   slide-out drawer. Mirrors the profile-pin partial's footprint
   but renders Sign In + Apply-as-SME CTAs instead. */
.hamburger-anonymous-pin {
  margin-top: auto;
  padding: 1rem 1.1rem;
  border-top: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
}
.hamburger-anon-cta {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.hamburger-anon-signin,
.hamburger-anon-register {
  display: block;
  padding: 0.55rem 0.85rem;
  font-family: 'Khand', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  border-radius: 5px;
  text-decoration: none;
}
.hamburger-anon-signin {
  background: var(--tml-primary, #B64926);
  color: #fff;
  border: 1px solid var(--tml-primary, #B64926);
}
.hamburger-anon-signin:hover {
  background: #9D3F22;
  border-color: #9D3F22;
  text-decoration: none;
}
.hamburger-anon-register {
  background: transparent;
  color: var(--tml-primary, #B64926);
  border: 1px solid var(--tml-primary, #B64926);
}
.hamburger-anon-register:hover {
  background: rgba(182, 73, 38, 0.06);
  text-decoration: none;
}
.hamburger-anon-divider {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--neutral-text-muted, #8A8779);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hamburger-anon-hint {
  margin: 0.75rem 0 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--neutral-text-muted, #8A8779);
  text-align: center;
}

/* DRAWER RESTRUCTURE - Aug 2026. ADDITIVE ONLY. No rule above is edited. */

.hamburger-cta-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0 1rem 0;
  margin: 0 0 0.5rem 0;
  border-bottom: 1px solid var(--tml-divider, #DEE0E0);
}
.hamburger-cta {
  display: block;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: var(--tml-radius, 4px);
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease;
}
.hamburger-cta-primary {
  background: var(--tml-primary, #B64926);
  color: var(--tml-on-primary, #FBFDFD);
  border: 1px solid var(--tml-primary, #B64926);
}
.hamburger-cta-primary:hover {
  background: var(--tml-primary-hover, #B22600);
  border-color: var(--tml-primary-hover, #B22600);
  text-decoration: none;
}
.hamburger-cta-ghost {
  background: transparent;
  color: var(--tml-primary, #B64926);
  border: 1px solid var(--tml-primary, #B64926);
}
.hamburger-cta-ghost:hover {
  background: var(--tml-primary-wash, rgba(182, 73, 38, 0.10));
  text-decoration: none;
}
.hamburger-cta-quiet {
  background: transparent;
  color: var(--tml-ink-body, #393B3B);
  border: 1px solid var(--tml-border, #CDCFCF);
}
.hamburger-cta-quiet:hover {
  background: var(--tml-surface-hover, #DEE0E0);
  border-color: var(--tml-ink-muted, #5D5F5F);
  text-decoration: none;
}

.hamburger-link-continue {
  font-weight: 600;
  color: var(--tml-primary, #B64926);
}

.hamburger-link-home {
  font-weight: 600;
  color: var(--tml-ink, #1B1D1D);
}
.hamburger-link-home:hover {
  color: var(--tml-primary, #B64926);
}

.hamburger-quiet {
  font-size: 0.76rem;
  color: var(--tml-ink-muted, #5D5F5F);
}
.hamburger-quiet:hover {
  color: var(--tml-ink-body, #393B3B);
}
