/* Left navbar (web/includes/nav.html), loaded by web/base.html with base.css. */

:root {
  --nav-width: 15rem;
  --nav-width-collapsed: 4rem;
}

.nav {
  width: var(--nav-width);
  flex-shrink: 0;
  background: var(--brand);
  color: var(--brand-text);
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.nav a,
.nav summary,
.nav .link-button {
  color: var(--brand-text);
  text-decoration: none;
}
.nav-toggle {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  align-self: flex-start;
  padding: 0.5rem;
  margin-bottom: 0.25rem;
  border-radius: 0.4rem;
}
.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.1rem;
  margin-bottom: 1rem;
  font-weight: 700;
}
.nav-groups {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}
.nav-group summary,
.nav-single {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
  border-radius: 0.4rem;
  cursor: pointer;
  list-style: none;
}
.nav-group summary::-webkit-details-marker {
  display: none;
}
.nav-group summary:hover,
.nav-single:hover {
  background: rgba(255, 255, 255, 0.08);
}
/* chevron-down when closed, pointing up when open */
.nav-chevron {
  margin-left: auto;
  width: 1rem;
  height: 1rem;
  opacity: 0.7;
  transition: transform 0.15s;
}
.nav-group[open] > summary .nav-chevron {
  transform: rotate(180deg);
}
.nav-group.is-active > summary,
.nav-single.is-active {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 3px 0 var(--accent);
}
.nav-links {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0 0 0 2.4rem;
}
.nav-links a,
.nav-links .link-button {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.92rem;
  opacity: 0.85;
}
.nav-links a:hover,
.nav-links a[aria-current='page'] {
  opacity: 1;
  text-decoration: underline;
}
/* The language switcher: a group-like row; its list opens above, inside the navbar. */
.nav-language .language-menu-list {
  right: 0;
  min-width: 0;
}
.nav-account {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 0.5rem;
}
/* Account links have icons, lined up under the avatar. */
.nav-account .nav-links {
  padding-left: 0.5rem;
}
.nav-account .nav-links a,
.nav-account .nav-links .link-button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.nav-account .nav-links svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.todo-tag {
  font-size: 0.65rem;
  background: var(--accent);
  color: var(--brand);
  border-radius: 0.25rem;
  padding: 0 0.25rem;
  font-weight: 700;
}

/* Hidden state: icons only, the current group stays highlighted. */
.nav-collapsed .nav {
  width: var(--nav-width-collapsed);
}
.nav-collapsed .nav-label,
.nav-collapsed .nav-chevron,
.nav-collapsed .nav-links,
.nav-collapsed .nav .language-menu-label {
  display: none;
}
.nav-collapsed .nav-group summary,
.nav-collapsed .nav-single {
  justify-content: center;
}
