#navbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-inline: 1.5rem;
  font-size: 1rem;
  z-index: 99;

  @media (width < 40rem) { grid-template-columns: 1fr 1fr; }

  a,svg {
    position: relative;
    color: white;
  }

  a:hover {
    opacity: 0.5;
  }

  .active::after {
    content: '';
    position: absolute;
    bottom: -0.25em;
    left: 50%;
    transform: translateX(-50%);
    height: 5px;
    width: 5px;
    border-radius: 50%;
    background-color: white;
  }

  .active:hover {
    opacity: 1;
  }
}

#nav-logo {
  font-family: var(--font-serif);
  font-weight: 100;
  letter-spacing: 8%;
  text-transform: uppercase;
}

#nav-links {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  text-transform: uppercase;
  @media (width < 40rem) { display: none; }
}

#nav-burger {
  display: flex;
  justify-content: end;
  align-items: center;
  gap: 0.5rem;
  @media (width >= 40rem) { display: none; }
}

#nav-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--navbar-bg);
  backdrop-filter: blur(1px);
}

/* This navbar background fade-in CSS implementation does not work on older browsers, using JavaScript, see "navbar" controller */

/* @keyframes navbar-fade {
  from { opacity: 0; }
  to { opacity: 1; }
} */

body.floating-navbar #nav-bg {
  opacity: 0;
  background-color: var(--navbar-floating-bg);
  /* animation: navbar-fade linear both; */
  /* animation-timeline: scroll(); */
  /* animation-range: 0vh 100vh; */
}

#navbar>dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  border: none;
  background-color: var(--accent);

  &>div {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: center;
    align-items: center;
    padding-top: calc(var(--nav-h) + 4rem);
  }

  a {
    font-size: 1.6rem;
    padding-block: 1.2rem;
    padding-inline: 4rem;
    text-align: center;
  }

  button {
    position: absolute;
    top: 1.3rem;
    right: 1.5rem;
  }

  .active::after {
    bottom: 0.5rem;
  }
}
