/* =========================
   NAVBAR
   ========================= */

:root {
  --nav-h: clamp(60.78px, 8vh, 80px);
}

.navbar {
  display: grid;
  position: sticky;
  top: 0;
  z-index: 10;
  align-items: center;
  grid-template-columns: 1fr auto;
  grid-template-areas:
  "logo lang"
  "links links";
  gap: 0 16px;

  /* Used in file.css */
  min-height: var(--nav-h);
  padding: 0.5rem 0.6rem;
  border: 1px solid #111;
  color: #111;
  background-color: #FFFDF4;
}

/* --- Logo --- */
.nav-logo {
  display: flex;
  align-items: center;
  grid-area: logo;
  padding: 0.4rem;
}

.nav-logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  background-color: inherit;
}

.nav-logo img {
  display: block;
  width: 40px;
  height: auto;
}

.nav-logo .logo-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: inherit;
  font-variant: small-caps;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-area: links;
  gap: 20px;
  margin: 0;
  padding: 0.4rem;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;

  /* Hide scrollbar (Firefox) */
  scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
  /* Hide scrollbar (Chrome/Safari) */
  display: none;
}

.nav-menu-item {
  list-style: none;
}

.nav-menu-link {
  display: inline-block;
  min-width: 80px;
  padding: 0.4rem;
  border: 1px solid #111;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-align: center;
  text-decoration: none;
  color: #111;
  background-color: #FFFDF4;
  transition: all 0.4s ease;
  font-variant: small-caps;
  white-space: nowrap;
}

.nav-menu-link:focus {
  box-shadow: none;
  outline: none;
}

.nav-menu-link:hover,
.nav-menu-link-active {
  color: #FFFDF4;
  background-color: #111;
}

/* --- Language buttons --- */
.nav-lang {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  grid-area: lang;
  gap: 12px;
  padding: 0.4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.nav-lang-item {
  list-style: none;
}

.nav-lang-link {
  font-weight: lighter;
  text-decoration: none;
  color: #111;
  transition: color 0.2s ease;
  font-variant: small-caps;
}

.nav-lang-link-active,
.nav-lang-link:hover {
  font-weight: bold;
  color: #111;
}

/* --- Wide screens: collapse to one row --- */
@media (width >= 900px) {
  .navbar {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo links lang";
  }

  .nav-menu {
    justify-content: center;
  }
}

@media (width < 450px) {
  .nav-menu {
    justify-content: flex-start;
  }
}
