/* pb_login_bar.css
 * Ticket: loginbar
 *
 * Thin header strip for authenticated and anonymous users.
 * Color source: login-bar scoped variables. These intentionally do not read homepage globals.
 */

.pb-login-bar {
  position: relative;
  width: 100%;
  box-sizing: border-box;

  /*
   * Scoped login-bar palette.
   * Do not read generic homepage palette variables here; homepage JS mutates those globals and can leak into this block.
   */
  --pb-login-gear-color: #ff6600;
  --pb-login-logo-accent: #000000;

  background: #ffffff;
  border: 1px solid var(--pb-login-gear-color, #ff6600);
}

.pb-login-bar__inner {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 8px;

  /* Very thin line feel */
  padding: 6px 12px;

  font-size: 15.6px;
  line-height: 1.2;
  color: var(--pb-login-logo-accent, #000000);
}

.pb-login-bar__left {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.pb-login-bar__left--anonymous {
  gap: 0;
}

.pb-login-bar__language-switcher {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  color: var(--pb-login-logo-accent, #000000);
  font-size: 0.92em;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pb-login-bar__language-list {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 2px 7px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  background: #ffffff;
  line-height: 1;
  white-space: nowrap;
}

.pb-login-bar__language-current,
.pb-login-bar__language-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  box-sizing: border-box;
  border-radius: 999px;
  color: var(--pb-login-logo-accent, #000000);
  line-height: 1;
  text-decoration: none;
}

.pb-login-bar__language-current {
  background: var(--pb-login-gear-color, #ff6600);
  color: #ffffff;
  font-weight: 800;
}

.pb-login-bar__language-link {
  opacity: 0.9;
  transition: background 120ms ease, color 120ms ease, opacity 120ms ease;
}

.pb-login-bar__language-link:hover,
.pb-login-bar__language-link:focus {
  background: rgba(0, 0, 0, 0.06);
  color: var(--pb-login-logo-accent, #000000);
  opacity: 1;
  text-decoration: none;
}

.pb-login-bar__language-link:focus-visible {
  outline: 2px solid var(--pb-login-gear-color, #ff6600);
  outline-offset: 2px;
}

.pb-login-bar__language-sep {
  color: var(--pb-login-logo-accent, #000000);
  opacity: 0.45;
  user-select: none;
}

.pb-login-bar__email {
  display: inline-block;
  min-width: 0; /* required for ellipsis in grid/flex contexts */
  max-width: 100%;
  justify-self: start;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  opacity: 0.95;
}

.pb-login-bar__logo-link {
  display: block;
  justify-self: center;
  width: clamp(160px, 20vw, 260px);
  max-width: 100%;
  line-height: 0;
  color: inherit;
  text-decoration: none;
  transition: transform 140ms ease, opacity 140ms ease;
}

.pb-login-bar__logo-link:hover,
.pb-login-bar__logo-link:focus {
  transform: translateY(-1px);
  opacity: 0.96;
  text-decoration: none;
}

.pb-login-bar__logo-link:focus-visible {
  outline: 2px solid var(--pb-login-gear-color, #ff6600);
  outline-offset: 4px;
  border-radius: 8px;
}

.pb-login-bar__logo {
  width: 100%;
  max-width: 100%;
  line-height: 0;
}

.pb-login-bar__logo svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 30px;
}

.pb-login-bar__links {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  text-align: right;
}

.pb-login-bar__anonymous-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
  text-align: right;
}

.pb-login-bar__google-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  box-sizing: border-box;
  padding: 7px 15px;
  border: 1px solid var(--pb-login-gear-color, #ff6600);
  border-radius: 999px;
  background: #ffffff;
  color: var(--pb-login-logo-accent, #000000);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.pb-login-bar__google-login::before {
  content: "G";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--pb-login-gear-color, #ff6600);
  border-radius: 999px;
  background: #ffffff;
  color: var(--pb-login-logo-accent, #000000);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.pb-login-bar__google-login:hover,
.pb-login-bar__google-login:focus {
  transform: translateY(-1px);
  border-color: var(--pb-login-logo-accent, #000000);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.11);
  color: var(--pb-login-logo-accent, #000000);
  text-decoration: none;
}

.pb-login-bar__google-login:focus-visible {
  outline: 2px solid var(--pb-login-gear-color, #ff6600);
  outline-offset: 3px;
}

.pb-login-bar__link {
  text-decoration: none;
  color: var(--pb-login-logo-accent, #000000);
  opacity: 0.92;
  transition: opacity 120ms ease;
}

.pb-login-bar__link:hover,
.pb-login-bar__link:focus {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pb-login-bar__sep {
  color: var(--pb-login-logo-accent, #000000);
  opacity: 0.9;
  user-select: none;
}

.pb-login-bar__sep--pipe {
  margin: 0 2px;
}

.pb-login-bar__sep--dash {
  margin: 0 2px;
}

/* Mobile: keep the logo centered and controls readable after wrapping. */
@media (max-width: 680px) {
  .pb-login-bar__inner {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 12px;
  }

  .pb-login-bar__logo-link {
    grid-row: 1;
    width: clamp(150px, 54vw, 220px);
  }

  .pb-login-bar__left {
    grid-row: 2;
    width: 100%;
    justify-self: start;
  }

  .pb-login-bar__email {
    max-width: 100%;
  }

  .pb-login-bar__links {
    grid-row: 3;
    width: 100%;
    gap: 10px;
    justify-self: end;
    justify-content: flex-end;
  }

  .pb-login-bar--anonymous .pb-login-bar__anonymous-actions {
    grid-row: 3;
    width: 100%;
    justify-self: end;
    justify-content: flex-end;
  }

  .pb-login-bar__google-login {
    max-width: 100%;
    min-height: 36px;
    padding: 8px 14px;
  }
}
