/*
 * Bimer Unified Topbar, Dropdown Menu, Footer, and Auth Widget Styles
 * Uses Bimer Design System CSS custom properties from bimer-tokens.css.
 */

.bimer-topbar {
  height: var(--bimer-nav-h, 56px);
  z-index: 400;
  background: var(--bg-2, #0d0e10);
  background: color-mix(in srgb, var(--bg-2, #0d0e10) 88%, transparent);
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--ink, #f2f1ec);
  font-family: var(--font, ui-sans-serif, system-ui, sans-serif);
  transition: background 0.25s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 0.25s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
    color 0.25s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.bimer-topbar--editorial {
  position: fixed;
  inset: 0 0 auto 0;
}

.bimer-topbar--workspace {
  position: relative;
  flex-shrink: 0;
}

.bimer-topbar-inner {
  max-width: 1380px;
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter, 22px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bimer-topbar--workspace .bimer-topbar-inner {
  max-width: 100%;
  padding: 0 16px;
}

.bimer-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.bimer-brand-word {
  font-family: var(--serif, ui-serif, Georgia, serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink, #f2f1ec);
}

.bimer-brand-sub {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3, #62645f);
  border-left: 1px solid var(--line-2, rgba(255, 255, 255, 0.14));
  padding-left: 10px;
}

.bimer-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.bimer-nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.14));
  background: transparent;
  color: var(--ink-2, #a3a49f);
  font-family: var(--font, ui-sans-serif, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
    color 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
    background 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.bimer-nav-pill:hover {
  border-color: var(--ink, #f2f1ec);
  color: var(--ink, #f2f1ec);
  background: var(--card, rgba(255, 255, 255, 0.024));
}

.bimer-nav-pill.is-active {
  border-color: var(--ink, #f2f1ec);
  color: var(--ink, #f2f1ec);
  background: var(--accent-soft, rgba(255, 255, 255, 0.12));
}

.bimer-nav-more {
  position: relative;
  display: inline-block;
}

.bimer-nav-more > summary {
  list-style: none;
}

.bimer-nav-more > summary::-webkit-details-marker {
  display: none;
}

.bimer-nav-more > summary::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  margin-left: 3px;
  transition: transform 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.bimer-nav-more[open] > summary::after {
  transform: translateY(1px) rotate(-135deg);
}

.bimer-nav-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 310px;
  max-width: calc(100vw - 24px);
  max-height: 75vh;
  overflow-y: auto;
  background: var(--ed-panel, rgba(16, 17, 19, 0.92));
  color: var(--ed-panel-ink, #ecebe6);
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.14));
  border-radius: var(--radius-md, 8px);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card, 0 30px 80px -30px rgba(0, 0, 0, 0.8));
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 500;
}

.bimer-menu-group-label {
  padding: 7px 10px 3px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3, #62645f);
}

.bimer-nav-more-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm, 3px);
  font-size: 12px;
  font-weight: 500;
  color: var(--ed-panel-ink, #ecebe6);
  text-decoration: none;
  transition: background 0.16s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
    color 0.16s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.bimer-nav-more-menu a:hover,
.bimer-nav-more-menu a.is-active {
  background: var(--accent-soft, rgba(255, 255, 255, 0.12));
  color: var(--ink, #f2f1ec);
}

.bimer-menu-tier {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: var(--radius-sm, 3px);
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.14));
  color: var(--ink-2, #a3a49f);
  flex-shrink: 0;
}

.bimer-menu-tier.is-trial {
  border-color: var(--mep-rooftop, #5ce1c6);
  color: var(--mep-rooftop, #5ce1c6);
}

.bimer-auth-slot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 2px;
}

.bimer-visitor-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  background: var(--bg-2, #0d0e10);
  color: var(--ink-2, #a3a49f);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 10.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bimer-visitor-badge .bimer-vc-num,
.bimer-footer-visitor .bimer-vc-num {
  color: var(--mep-rooftop, #5ce1c6);
  font-weight: 700;
}

.bimer-footer-visitor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 12px;
  padding: 2px 9px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  background: var(--bg-3, rgba(255, 255, 255, 0.04));
  color: var(--ink-2, #a3a49f);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.bimer-auth-widget {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.bimer-auth-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.14));
  background: var(--bg-2, #0d0e10);
  color: var(--ink-2, #a3a49f);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.bimer-auth-pill--ok {
  border-color: var(--mep-rooftop, #5ce1c6);
  color: var(--mep-rooftop, #5ce1c6);
  background: var(--accent-soft, rgba(255, 255, 255, 0.08));
}

.bimer-auth-btn-primary {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid var(--accent, #ffffff);
  background: var(--accent, #ffffff);
  color: var(--accent-ink, #000000);
  font-family: var(--font, ui-sans-serif, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.bimer-auth-btn-primary:hover {
  opacity: 0.86;
}

.bimer-auth-btn-ghost {
  height: 30px;
  padding: 0 10px;
  border-radius: var(--radius-full, 999px);
  border: 1px solid var(--line-2, rgba(255, 255, 255, 0.14));
  background: transparent;
  color: var(--ink-2, #a3a49f);
  font-family: var(--font, ui-sans-serif, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
    color 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.bimer-auth-btn-ghost:hover {
  border-color: var(--ink, #f2f1ec);
  color: var(--ink, #f2f1ec);
}

.bimer-footer {
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  background: var(--bg-2, #0d0e10);
  color: var(--ink-2, #a3a49f);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
}

.bimer-footer-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 26px var(--gutter, 24px) 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.bimer-footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.bimer-footer-links a {
  color: var(--ink-2, #a3a49f);
  text-decoration: none;
  transition: color 0.2s var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.bimer-footer-links a:hover {
  color: var(--ink, #f2f1ec);
}

@media (max-width: 1180px) {
  .bimer-visitor-badge {
    display: none;
  }
}

@media (max-width: 1080px) {
  .bimer-brand-sub {
    display: none;
  }
}

@media (max-width: 820px) {
  .bimer-nav-pill.bimer-nav-primary {
    display: none;
  }
  .bimer-topbar-inner {
    padding: 0 12px;
    gap: 6px;
  }
  .bimer-nav-more-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(var(--bimer-nav-h, 56px) + 6px);
    min-width: 0;
    width: auto;
    max-width: none;
    max-height: calc(100vh - var(--bimer-nav-h, 56px) - 24px);
  }
}

@media (max-width: 480px) {
  .bimer-auth-pill.is-trial {
    display: none;
  }
}
