/* Navbar component */

.nav {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--banner-bg);
  color: var(--banner-text);
  height: var(--nav-h);

  display: flex;
  align-items: center;

  justify-content: flex-start;

  padding: 0 12px;
  width: 100vw;
  overflow: hidden;
}

.no-fill {
  fill: none;
}

/* =========================================================
   LEFT / LOGO
   ========================================================= */

.nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-logo-icon svg {
  width: 14px;
  height: 14px;
  fill: var(--banner-text);
  stroke: none;
}

.nav-logo-text {
  color: white;
}

/* =========================================================
   DESKTOP NAV
   Mobile-first: hidden by default
   ========================================================= */

.site-nav,
.nav-right-group {
  display: none;
}

.site-nav {
  align-items: center;
}

.site-nav .nav-link {
  color: var(--banner-text);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.8;
  padding: 6px 8px;
  transition:
    opacity 0.15s ease,
    background-color 0.15s ease;
}

.site-nav .nav-link:hover,
.site-nav .nav-link.active {
  opacity: 1;
}

.site-nav .nav-link h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* =========================================================
   DESKTOP SEARCH / SETTINGS
   ========================================================= */

.nav-right-group {
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-search-input {
  width: 180px;
  height: 30px;
  border: none;
  border-radius: 4px;
  padding: 0 10px;
  font-family: "Dosis", sans-serif;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  outline: none;
}

.nav-search-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.nav-search-input:focus {
  background: rgba(255, 255, 255, 0.25);
}

.nav-gear-btn {
  background: none;
  border: none;
  color: var(--banner-text);
  cursor: pointer;
  padding: 6px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.nav-gear-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-gear-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* =========================================================
   MOBILE HAMBURGER
   Visible by default
   ========================================================= */

.nav-hamburger {
  background: none;
  border: none;
  color: var(--banner-text);
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  margin-right: -8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-hamburger svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: white;
}

/* =========================================================
   MOBILE MENU OVERLAY
   ========================================================= */

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  height: 100dvh;
}

.menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   MOBILE DRAWER
   ========================================================= */

.menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(280px, 80vw);
  height: 100%;
  background: var(--doc-bg);
  z-index: 301;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100dvh;
}

.menu-overlay.open .menu-drawer {
  transform: translateX(0);
}

/* =========================================================
   DRAWER HEADER
   ========================================================= */

.menu-drawer-header {
  background: var(--banner-bg);
  color: var(--banner-text);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nav-h);
  flex-shrink: 0;
}

.menu-drawer-header span {
  font-weight: 700;
  font-size: 15px;
}

.menu-close {
  background: none;
  border: none;
  color: var(--banner-text);
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

/* =========================================================
   DRAWER SEARCH
   ========================================================= */

.menu-search {
  padding: 12px 16px;
}

.menu-search input {
  width: 100%;
  height: 40px;
  border: 1.5px solid var(--banner-bg);
  border-radius: 4px;
  padding: 0 12px;
  font-family: "Dosis", sans-serif;
  font-size: 15px;
  background: #fff;
  color: #2e2e2e;
  outline: none;
}

.menu-search input:focus {
  box-shadow: 0 0 0 2px rgba(11, 82, 89, 0.2);
}

/* =========================================================
   DRAWER LINKS
   ========================================================= */

.menu-links {
  list-style: none;
  flex: 1;
  padding-left: 15px;
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  font-family: "Dosis", sans-serif;
  color: var(--colourD);
}

.menu-links li {
  border-bottom: 1px solid rgba(11, 82, 89, 0.1);
}

.menu-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--label);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  min-height: 48px;
}

.menu-links svg {
  width: 20px;
  height: 20px;
  stroke: var(--label);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: var(--svgText);
  flex-shrink: 0;
}

.menu-links .no-fill svg {
  fill: none;
}

.menu-link:hover {
  background: rgba(0, 95, 103, 0.09);
  border-left-color: var(--backgroundPrimary);
}

#discourse-button svg {
  fill: var(--label);
}

/* =========================================================
   DRAWER PANELS
   ========================================================= */

.drawer-panels {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.drawer-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--doc-bg);
}

.drawer-panel-main {
  transform: translateX(0);
}

.drawer-panel-settings {
  transform: translateX(100%);
}

.drawer-panels.show-settings .drawer-panel-main {
  transform: translateX(-100%);
}

.drawer-panels.show-settings .drawer-panel-settings {
  transform: translateX(0);
}

/* =========================================================
   ACTIVE MOBILE LINK
   ========================================================= */

.menu-links .menu-link {
  position: relative;
  border-left: 4px solid transparent;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.menu-links .menu-link.active {
  background: rgba(0, 95, 103, 0.09);
  border-left-color: var(--backgroundPrimary);
  color: var(--backgroundPrimary);
  font-weight: 700;
}

.menu-links .menu-link.active svg {
  stroke-width: 2.3;
}

.menu-link {
  position: relative;
}

/* =========================================================
   "YOU ARE HERE"
   ========================================================= */

.you-are-here {
  display: none;
}

.menu-link.active .you-are-here {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.75;
  font-family: "Caveat", "Comic Sans MS", cursive;
  flex-direction: column;
}

.you-are-here i {
  line-height: 1;
}

.you-are-here small {
  white-space: nowrap;
  line-height: 1;
}

/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (min-width: 360px) {
  .nav {
    padding: 0 14px;
  }
}

/* =========================================================
   DESKTOP
   ========================================================= */

@media (min-width: 768px) {
  .nav {
    padding: 0 20px;
    gap: 12px;
  }

  /*
   * Desktop navigation becomes visible.
   */
  .site-nav {
    display: flex;
    align-items: center;
  }

  /*
   * Search + settings become visible.
   */
  .nav-right-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
  }

  /*
   * Hamburger disappears on desktop.
   */
  .nav-hamburger {
    display: none;
  }

  /*
   * Desktop search styling.
   */
  .nav-search-input {
    background: #fff;
    color: #2e2e2e;
  }

  .nav-search-input::placeholder {
    color: #777;
  }

  .nav-search-input:focus {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
  }
}

/* =========================================================
   LARGE DESKTOP
   ========================================================= */

@media (min-width: 1280px) {
  .nav {
    padding: 0 32px;
    gap: 20px;
  }

  .site-nav .nav-link {
    padding: 6px 12px;
  }

  .site-nav .nav-link h2 {
    font-size: 12px;
  }

  .nav-search-input {
    width: 240px;
    height: 32px;
    font-size: 14px;
  }
}

.placeholder-nav-item {
  display: none !important;
}
