/*
 * Engineering Edge — navbar auth control (frozen V2,
 * docs/navbar-auth-explorer.html § "V2 — Outline pill & avatar chip ★ FROZEN").
 * Values copied verbatim from the mockup. Custom classes (.ee-auth-*) so they
 * don't collide with Semantic UI's dropdown machinery.
 */

/* ── §1 logged-out: outline "Log in" pill ─────────────────── */
/* The pill is an <a> inside .right.menu.item, so the SAME upstream navbar rule
   `#invenio-nav.ui.menu .ui.menu .item a:not(.ui.button) { padding: 2rem 1rem }`
   (1,7,1) that inflated the dropdown items also hit it — with a 999px radius the
   tall box rounded into a giant clipped circle (round-4 bug). Pin the compact
   pill padding with `!important` (can't out-specify that id rule), center the
   text with inline-flex, and `align-self:center` so the nav's flex row never
   stretches it. Height then hugs content (~33px). */
.ee-auth-login {
  display: inline-flex;
  align-items: center;
  align-self: center;
  line-height: 1.2;
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  padding: 7px 18px !important;
  transition: 0.15s;
}
.ee-auth-login:hover,
.ee-auth-login:focus {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}
/* Sign up (only when registration is on) — a quiet secondary link. Full white
   (no opacity) so it clears AA on the slate navbar. Also an <a> in .item, so it
   needs the same padding override + centering to sit compact beside the pill. */
.ee-auth-signup {
  display: inline-flex;
  align-items: center;
  align-self: center;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  margin-left: 14px;
  padding: 7px 4px !important;
}
.ee-auth-signup:hover,
.ee-auth-signup:focus {
  text-decoration: underline;
  color: #fff;
}

/* ── §2 signed-in: avatar chip ────────────────────────────── */
.ee-auth {
  position: relative;
  display: inline-block;
}
.ee-auth-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 3px 12px 3px 3px;
  cursor: pointer;
  transition: 0.15s;
  background: transparent;
  font-family: inherit;
}
.ee-auth-chip:hover,
.ee-auth-chip:focus-visible {
  border-color: rgba(255, 255, 255, 0.6);
}
.ee-auth-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  flex: none;
  /* background-color is inline per-user (hashed palette colour). */
}
.ee-auth-name {
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ee-auth-chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(255, 255, 255, 0.75);
  border-bottom: 2px solid rgba(255, 255, 255, 0.75);
  transform: rotate(45deg);
  margin-top: -3px;
  flex: none;
}

/* ── §3 dropdown (white card) ─────────────────────────────── */
.ee-auth-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  min-width: 210px;
  padding: 6px;
  z-index: 1000;
}
.ee-auth-who {
  padding: 9px 12px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 5px;
}
.ee-auth-who b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
}
.ee-auth-who span {
  font-size: 12px;
  color: #697586;
  word-break: break-all;
}
/* The dropdown lives inside .outer-navbar, whose link rules leak in and would
   otherwise wreck the entries: `.outer-navbar a { color:#fff }` (0,1,1) beats a
   bare `.ee-auth-item` (0,1,0) → white text on the white card (the "no entries"
   report), and a deep `#invenio-nav.ui.menu .ui.menu .item a { padding:2rem 1rem }`
   makes each item ~70px tall (the "absurdly tall" panel). Fix, scoped to the
   dropdown: the `.ee-auth-menu` prefix (0,2,0) wins the base colour back; padding
   and the hover colour/background need `!important`.

   Round 3: the UPSTREAM rule `#invenio-nav.ui.menu .ui.menu .item a:not(.ui.button):hover`
   (invenio_app_rdm theme menu.overrides — must not edit upstream) sets
   `color:@white; background:rgba(255,255,255,.2)` at specificity (1,8,1), which a
   sane instance selector can't out-specify — so a HOVERED entry went white on the
   white card and vanished. The entry colour is therefore pinned with `!important`
   in every state (normal/hover/focus/active), and the hover/focus tint background
   is `!important` too (else the upstream translucent-white wins). Log out stays
   red in every state. */
.ee-auth-menu .ee-auth-item {
  display: block;
  padding: 8px 12px !important;
  border-radius: 6px;
  color: #1e293b !important;
  font-size: 13.5px;
  text-decoration: none;
}
.ee-auth-menu .ee-auth-item:hover,
.ee-auth-menu .ee-auth-item:focus,
.ee-auth-menu .ee-auth-item:active {
  background: #f8fafc !important;
  color: #1e293b !important;
  text-decoration: none;
}
.ee-auth-menu .ee-auth-out,
.ee-auth-menu .ee-auth-out:hover,
.ee-auth-menu .ee-auth-out:focus,
.ee-auth-menu .ee-auth-out:active {
  color: #dc2626 !important;
}
.ee-auth-menu .ee-auth-out:hover,
.ee-auth-menu .ee-auth-out:focus {
  background: #f8fafc !important;
}
.ee-auth-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 5px 0;
}

/* ── §4 responsive: hide the label when it would crowd ────── */
@media (max-width: 1100px) {
  .ee-auth-name {
    display: none;
  }
  .ee-auth-chip {
    padding: 3px;
  }
}

/* ── mobile inline panel (inside InvenioRDM's dark burger menu) ──
   Same entries as the dropdown, but light text on the dark menu. */
.ee-auth-mobile .ee-auth-who {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}
.ee-auth-mobile .ee-auth-who b {
  color: #fff;
}
.ee-auth-mobile .ee-auth-who span {
  color: rgba(255, 255, 255, 0.7);
}
.ee-auth-mobile .ee-auth-item {
  color: #fff;
}
.ee-auth-mobile .ee-auth-item:hover,
.ee-auth-mobile .ee-auth-item:focus {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.ee-auth-mobile .ee-auth-out,
.ee-auth-mobile .ee-auth-out:hover,
.ee-auth-mobile .ee-auth-out:focus {
  color: #fca5a5; /* lighter red so it clears AA on the dark menu */
}
.ee-auth-mobile .ee-auth-divider {
  background: rgba(255, 255, 255, 0.2);
}
