/* =============================================================================
   CORE component — Navbar Module - default theme
   ============================================================================= */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #1a1a2e;
  color: #fff;
  padding: 0 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

.navbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  flex-wrap: nowrap;
  overflow: visible;
}

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

.nav-logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: #fff;
  margin-right: 12px;
  cursor: pointer;
}
.nav-logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
  cursor: pointer;
}

.navbar .nav-link,
.navbar a {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  cursor: pointer;
  user-select: none;
}
.navbar .nav-link:hover,
.navbar a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.nav-right {
  display: flex;
  align-items: center;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .navbar-inner {
    flex-wrap: nowrap;
    overflow-x: clip;
    height: auto;
    min-height: 52px;
    padding: 8px 0;
    gap: 4px;
    align-items: center;
  }

  .nav-left {
    flex-wrap: nowrap;
    gap: 2px;
    flex-shrink: 0;
  }

  .navbar .nav-link,
  .navbar a {
    padding: 6px 8px;
    font-size: 0.78rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-right {
    flex-shrink: 0;
    margin-left: auto;
  }

  .nav-logo {
    font-size: 1rem;
    margin-right: 8px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-logo-img { height: 28px; }

  .lang-switcher { flex-shrink: 0; }

  .lang-btn {
    padding: 3px 8px;
    font-size: 0.72rem;
  }
}

/* ── Topic 110: auth widget — nav-right içinde, dil seçiciden önce ────────── */
.navbar-auth {
    display:      flex;
    align-items:  center;
    flex-shrink:  0;
    margin-left:  .75rem;
    margin-right: .75rem;   /* v0.110.2.0: gap to the language switcher */
}

.navbar-auth-inner {
    display:     flex;
    align-items: center;
    gap:         .4rem;
    cursor:      pointer;
}

.navbar-auth-icon {
    width:      1.25rem;
    height:     1.25rem;
    object-fit: contain;
    display:    block;
    /* v0.110.3.0: same tint method as .lang-icon-img (language switcher) —
       dark source SVGs become visible on the dark bar. */
    filter: brightness(0) invert(0.75);
    transition: filter 0.2s;
}
.navbar-auth-inner:hover .navbar-auth-icon { filter: brightness(0) invert(1); }

.navbar-auth-label {
    font-size: .875rem;
}

.navbar-auth-username {
    font-size:   .875rem;
    font-weight: 600;
}

/* v0.110.3.0: logout icon shares the filter tint above — the old
   opacity-based hover is superseded by the .navbar-auth-inner:hover rule. */

/* ── Topic 131 Phase B — sister-site (federation) switcher ────────────────── */
/* Paired with the language switcher (F-P-C): same "meta widget" look, sits
   immediately to its right in .nav-right. */
.navbar-federation {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0.5rem;
}
.federation-switcher-navbar {
  position: relative;            /* .federation-dropdown is absolute against this */
}
.federation-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.federation-icon {
  width: 15px;
  height: 15px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  /* Same treatment as .lang-icon-img / .navbar-auth-icon: strip the source
     colour so the icon matches every other nav icon's themed grey. */
  filter: brightness(0) invert(0.75);
  transition: filter 0.2s;
}
.federation-trigger:hover .federation-icon,
.federation-trigger[aria-expanded="true"] .federation-icon {
  filter: brightness(0) invert(1);
}
.federation-trigger::after {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.65;
}
.federation-trigger:hover,
.federation-trigger[aria-expanded="true"] {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.28);
}

.federation-dropdown {
  /* position/top/right/z-index are set by FederationSwitcher::toggleDropdown()
     as position:fixed against the trigger's live rect — see that method. */
  position: fixed;
  z-index: 9999;
  min-width: 220px;
  max-width: 320px;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.federation-dropdown .federation-row {
  display: block;
  padding: 8px 12px;
  border-radius: 5px;
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  white-space: normal;
  transition: background 0.15s, color 0.15s;
}
.federation-dropdown a.federation-row:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.federation-dropdown .federation-row-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
}
.federation-dropdown a.federation-row:hover .federation-row-desc {
  color: rgba(255,255,255,0.65);
}
.federation-dropdown .federation-row-active {
  color: rgba(255,255,255,0.45);
  cursor: default;
}
.federation-dropdown .federation-row-active::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #4ade80;          /* "you are here" */
  vertical-align: middle;
}

@media (max-width: 640px) {
  .navbar-federation { margin-left: 0.25rem; }
  .federation-trigger { padding: 4px 7px; font-size: 0.74rem; }
  .federation-dropdown { min-width: 180px; }
}
