/* Right cluster: bell + avatar + hamburger stay on one row */
.jt-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin-left: auto;
  max-width: 100%;
}
.jt-auth-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  font-family: "Source Sans 3", system-ui, sans-serif;
}
.jt-auth-nav-empty {
  display: none !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Guest vs user menu blocks swap; both use .jt-auth-menu-block */
html.jt-logged-in .jt-auth-menu-guest { display: none !important; }
html.jt-logged-out .jt-auth-menu-user { display: none !important; }

/* Guest links inside hamburger / nav.links only */
.jt-auth-menu-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
  margin-top: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(246, 241, 232, 0.18);
}
.jt-auth-menu-login,
.jt-auth-menu-signup {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
}
.jt-auth-menu-login {
  color: var(--cream, #f6f1e8);
  border: 1px solid rgba(246, 241, 232, 0.35);
  background: transparent;
}
.jt-auth-menu-login:hover {
  color: var(--gold, #e3b23c);
  border-color: rgba(227, 178, 60, 0.7);
}
.jt-auth-menu-signup {
  color: #0b1f3a;
  background: var(--gold, #e3b23c);
  border: 1px solid var(--gold, #e3b23c);
}
.jt-auth-menu-signup:hover { filter: brightness(1.06); }

@media (min-width: 961px) {
  .jt-auth-menu-block {
    flex-direction: row;
    align-items: center;
    width: auto;
    margin-top: 0;
    margin-left: 0.5rem;
    padding-top: 0;
    padding-left: 0.65rem;
    border-top: none;
    border-left: 1px solid rgba(246, 241, 232, 0.18);
  }
  .jt-auth-menu-login,
  .jt-auth-menu-signup {
    min-height: 36px;
    font-size: 12px;
    padding: 0.35rem 0.85rem;
  }
  /* On desktop hamburger is hidden — keep icons at end of bar */
  .jt-header-right .nav-toggle { display: none; }
}

.jt-auth-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  color: var(--cream, #f6f1e8);
  text-decoration: none;
  border: 1px solid rgba(246, 241, 232, 0.22);
  background: rgba(255, 255, 255, 0.06);
  flex: 0 0 auto;
  box-sizing: border-box;
}
.jt-auth-icon-btn:hover,
.jt-auth-icon-btn:focus-visible {
  color: var(--gold, #e3b23c);
  border-color: rgba(227, 178, 60, 0.7);
  background: rgba(227, 178, 60, 0.12);
  outline: none;
}
.jt-auth-icon-svg { display: block; pointer-events: none; }
.jt-auth-avatar {
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(227, 178, 60, 0.45);
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.jt-auth-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
}
.jt-auth-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 999px;
  display: block;
}

/* Tight red DOT on the bell — only rendered in JS when unread > 0 */
.jt-auth-bell {
  overflow: visible;
}
.jt-auth-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  min-width: 8px;
  padding: 0;
  border-radius: 999px;
  background: #e74c3c;
  border: 1.5px solid rgba(11, 31, 58, 0.95);
  box-sizing: border-box;
  pointer-events: none;
  z-index: 2;
}

/* Mobile: shrink hamburger slightly so bell+avatar+toggle fit */
@media (max-width: 960px) {
  .jt-header-right {
    gap: 0.28rem;
  }
  .jt-header-right .nav-toggle {
    display: inline-flex !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
    margin-left: 0 !important;
    flex: 0 0 auto;
  }
  header.site .bar {
    flex-wrap: nowrap;
    gap: 10px;
  }
  header.site .bar > .logo {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.jt-auth-menu-who {
  margin: 0 0 0.35rem;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(246, 241, 232, 0.85);
}
.jt-auth-menu-who strong { color: var(--gold, #e3b23c); }
.jt-auth-menu-profile,
.jt-auth-menu-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}
.jt-auth-menu-profile {
  color: #0b1f3a;
  background: var(--gold, #e3b23c);
  border: 1px solid var(--gold, #e3b23c);
}
.jt-auth-menu-profile:hover { filter: brightness(1.06); }
.jt-auth-menu-logout {
  color: var(--cream, #f6f1e8);
  border: 1px solid rgba(246, 241, 232, 0.35);
  background: transparent;
}
.jt-auth-menu-logout:hover {
  color: #ffb4a8;
  border-color: rgba(231, 76, 60, 0.55);
}
@media (min-width: 961px) {
  .jt-auth-menu-profile,
  .jt-auth-menu-logout {
    min-height: 36px;
    font-size: 12px;
    padding: 0.35rem 0.85rem;
    width: auto;
  }
  .jt-auth-menu-who { display: none; }
}


/* Profile dropdown under avatar */
.jt-auth-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 11.5rem;
  padding: 0.4rem;
  background: #f6f1e8;
  border: 2px solid #c9a227;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(11, 31, 58, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.jt-auth-dropdown[hidden] { display: none !important; }
.jt-auth-dropdown a,
.jt-auth-dropdown button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 7px;
  color: #0b1f3a;
  font: 700 0.92rem Georgia, "Source Serif 4", serif;
  text-decoration: none;
  cursor: pointer;
}
.jt-auth-dropdown a:hover,
.jt-auth-dropdown button:hover {
  background: rgba(201, 162, 39, 0.22);
}
.jt-auth-dropdown-logout {
  color: #6b2b2b !important;
  border-top: 1px solid rgba(11, 31, 58, 0.12) !important;
  margin-top: 0.15rem;
  border-radius: 0 0 7px 7px !important;
}

/* Every page gets a hamburger for mobile; desktop keeps the full link row */
html.jt-has-nav-toggle .jt-header-right .nav-toggle {
  display: inline-flex !important;
}
@media (min-width: 961px) {
  html.jt-has-nav-toggle .jt-header-right .nav-toggle,
  html.jt-has-nav-toggle header.site .nav-toggle {
    display: none !important;
  }
}

/* Keep bell + avatar + hamburger on-screen (Watch was pushing the toggle off) */
@media (max-width: 960px) {
  header.site .bar {
    overflow: visible;
  }
  header.site .bar > .logo {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: calc(100vw - 9.5rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .jt-header-right {
    flex: 0 0 auto;
    margin-left: auto;
    max-width: none;
  }
  .jt-auth-nav {
    flex: 0 0 auto;
  }
  .jt-auth-icon-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }
  .jt-header-right .nav-toggle {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
  }
}
