/* ── Avatar dropdown — positioned in the header right side (desktop) ── */

.khronicles-avatar-wrap {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  z-index: 100;
}

/* Toggle button (avatar + chevron) */
.khronicles-avatar-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #ffffff;
}

.khronicles-avatar-toggle:hover {
  opacity: 0.85;
}

/* Avatar image */
img.khronicles-menu-avatar,
.khronicles-avatar-wrap img.gravatar,
.khronicles-avatar-wrap img.um-avatar,
.khronicles-avatar-wrap img.avatar {
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: cover !important;
}

/* Guest icon (logged-out) */
.khronicles-guest-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #555;
  color: #ffffff;
}

/* Chevron */
.khronicles-chevron {
  font-size: 10px;
  color: #ffffff;
  transition: transform 0.2s ease;
}

.khronicles-avatar-toggle[aria-expanded="true"] .khronicles-chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.khronicles-avatar-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 160px;
  background: #333;
  border: 1px solid #555;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 6px 0;
  margin: 4px 0 0 0;
  list-style: none;
  z-index: 9999;
}

.khronicles-avatar-dropdown.open {
  display: block;
}

.khronicles-avatar-dropdown li {
  margin: 0;
  padding: 0;
}

.khronicles-avatar-dropdown li a {
  display: block;
  padding: 8px 16px;
  color: #ffffff !important;
  text-decoration: none;
  font-family: "Jost", sans-serif;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
}

.khronicles-avatar-dropdown li a:hover {
  background-color: #555;
}

/* ── Mobile menu items — hidden on desktop ── */

/* Hide mobile-only items on desktop (48.1em = theme breakpoint) */
@media (min-width: 48.1em) {
  .khronicles-mobile-only {
    display: none !important;
  }
}

/* Mobile styles */
@media (max-width: 48em) {
  /* Separator border */
  .khronicles-mobile-separator {
    border-bottom: 1px solid #555 !important;
    margin: 8px 15px !important;
    padding: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
  }

  /* Avatar item at top of the mobile menu */
  .khronicles-mobile-avatar-item a {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    color: #ffffff !important;
    text-decoration: none;
    font-family: "Jost", sans-serif;
    font-size: 14px;
  }

  /* Force circular avatar in mobile menu */
  .khronicles-mobile-avatar-item img,
  .khronicles-mobile-avatar-item img.khronicles-mobile-avatar,
  .khronicles-mobile-avatar-item img.gravatar,
  .khronicles-mobile-avatar-item img.um-avatar,
  .khronicles-mobile-avatar-item img.avatar {
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    object-fit: cover !important;
    overflow: hidden !important;
  }
}
