/* ===========================================================================
   Balam-Bäbäm - site header, shared by the home page and the hubs.
   Every rule is scoped under .bar so it wins over page-level rules that reuse
   generic names (.brand, .btn) and renders identically on both stylesheets.
   Needs the colour tokens from styles.css or hubs/hub.css.
   Menu: inline at >= 960px, a hamburger dropdown below that.
   =========================================================================== */

.bar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
  font-family: var(--font); font-size: 17px; line-height: 1.62;
}
.bar.stuck, .bar.open { border-bottom-color: var(--line); }
.bar .wrap { width: 100%; max-width: var(--wrap, 1120px); margin-inline: auto; padding-inline: 24px; }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }

.bar .brand {
  display: inline-flex; align-items: center; gap: .6rem; text-decoration: none;
  min-height: 0; font-size: inherit; color: inherit; flex: none;
}
.bar .brand img { width: 40px; height: auto; border-radius: 0; }
.bar .brand-name {
  font-weight: 800; font-size: 1.28rem; color: var(--brown);
  letter-spacing: -.025em; white-space: nowrap;
}

.bar-r { display: flex; align-items: center; gap: .75rem; }

.bar .lang { display: inline-flex; gap: 2px; background: var(--band); padding: 3px; border-radius: 999px; }
.bar .lang button {
  font: inherit; font-size: .78rem; font-weight: 800; letter-spacing: .04em; line-height: 1.62;
  padding: .34rem .62rem; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-soft); cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.bar .lang button:hover { color: var(--ink); }
.bar .lang button[aria-pressed="true"] { background: var(--terracotta); color: #fff; }

.bar .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .5rem 1.05rem; border-radius: 999px; min-height: 0;
  font-weight: 700; font-size: .9rem; text-decoration: none;
  border: 2px solid var(--terracotta); color: var(--terracotta-d); background: transparent;
  white-space: nowrap; transition: transform .16s ease, background-color .16s ease;
}
.bar .btn:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--terracotta) 10%, transparent); }
.bar .btn:active { transform: translateY(0); }

/* ------------------------------------------------------------- menu --- */
.bar .menu ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.bar .menu a {
  display: flex; align-items: center; white-space: nowrap; text-decoration: none;
  font-size: .9rem; font-weight: 700; color: var(--ink-mid);
  padding: .42rem .78rem; border-radius: 999px;
  transition: background-color .15s ease, color .15s ease;
}
.bar .menu a:hover { color: var(--ink); background: var(--band); }
.bar .menu .follow-m { display: none; }
.bar .menu a[aria-current] { color: var(--terracotta-d); background: color-mix(in srgb, var(--terracotta) 12%, transparent); }

.bar .burger {
  display: none; flex: none; width: 42px; height: 42px; padding: 0; margin: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
  color: var(--ink-mid); cursor: pointer; place-items: center;
}
.bar .burger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.bar .burger .x { display: none; }
.bar.open .burger .x { display: block; }
.bar.open .burger .l { display: none; }

@media (min-width: 960px) {
  .bar .menu { margin-inline-start: auto; }
}

@media (max-width: 959.98px) {
  .bar .burger { display: grid; }
  .bar-in { position: relative; }
  .bar .menu {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--ground); border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -22px rgba(46,32,24,.45);
  }
  .bar.open .menu { display: block; }
  .bar .menu ul {
    flex-direction: column; align-items: stretch; gap: 2px;
    max-width: var(--wrap, 1120px); margin: 0 auto; padding: 8px 16px 14px;
  }
  .bar .menu a { min-height: 52px; padding: 0 14px; border-radius: 14px; font-size: 1.02rem; }
}

@media (max-width: 620px) {
  .bar { font-size: 16px; }
  .bar .wrap { padding-inline: 20px; }
  .bar .brand-name { font-size: 1.06rem; }
  .bar .brand img { width: 34px; }
  .bar-in { min-height: 60px; gap: .5rem; }
  .bar-r { gap: .5rem; }
  .bar .lang button { padding: .3rem .5rem; font-size: .72rem; }
}

/* the narrowest phones: "Yzarla" moves into the menu sheet */
@media (max-width: 419.98px) {
  .bar .wrap { padding-inline: 16px; }
  .bar .bar-r > .btn { display: none; }
  .bar .menu .follow-m { display: block; }
}
@media (max-width: 359.98px) {
  .bar .brand { gap: .45rem; }
  .bar .brand-name { font-size: .98rem; }
  .bar .lang button { padding: .3rem .42rem; }
  .bar .burger { width: 40px; height: 40px; }
}
