/* Site navbar, shared by every page (via stylesheet.css) and the notes
   garden. Uses the color and font variables defined in stylesheet.css. */

/* Handwritten font for the name, the same one the notes sidebar uses for dates */
@import url('https://fonts.googleapis.com/css2?family=Nothing+You+Could+Do&display=swap');

/* Navigation bar styles */

/* Reserve the navbar's space before navbar.js swaps it in, so the page doesn't jump */
#navbar-placeholder,
.navbar {
    height: 96px;
}

.navbar {
    /* Spans exactly the main column (see .page-content in stylesheet.css): the
       name starts at its left edge and the last link ends at its right edge */
    width: calc(min(100% + 16px, 1500px) - 650px);
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Name in script, top left; links home */
.navbar .wordmark {
    font-family: "Nothing You Could Do", cursive;
    font-size: 30px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--accent);
    white-space: nowrap;
    padding: 0;
    border: 0;
}

.nav-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0 24px;
}

.nav-container a {
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    letter-spacing: 0.02em;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent; /* same height whether or not a link is active */
    transition: color 0.15s, border-color 0.15s;
}

.nav-container a:hover {
    color: var(--accent-hover);
}

.nav-container a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Hamburger button (hidden on desktop) */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: -8px;
    flex-direction: column;
    gap: 5px;
    z-index: 10;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1200px) {
  .navbar {
    width: calc(100% + 16px - 357px);
  }
}

@media (max-width: 800px) {
  .navbar {
    width: 100%;
    padding: 0 20px;
  }
}

/* Mobile: hamburger menu */
@media (max-width: 600px) {
  /* Show hamburger, hide inline nav links */
  .hamburger {
    display: flex;
  }

  #navbar-placeholder,
  .navbar {
    height: 72px;
  }

  .navbar {
    padding: 0 16px;
  }

  .navbar .wordmark {
    font-size: 25px;
  }

  .nav-container {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    padding: 10px 0 16px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    z-index: 500;
    border-radius: 0 0 8px 8px;
    gap: 0;
  }

  .nav-container.open {
    display: flex;
  }

  .nav-container a {
    padding: 12px 24px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    font-size: 16px;
  }

  .nav-container a.active {
    border-bottom: none;
    background: var(--accent-soft);
  }
}
