/* Site navigation. Lives here, not in ds/, because ds/ is a byte-for-byte copy
   of nt-design's published files and a sync overwrites anything added to it.
   The header component ships the empty nav slot and the menu-button styles;
   this file fills the slot and nothing more. When the dropdown behaviour moves
   into the header component, this file goes away. */

/* Everything in the bar sits on one baseline at the bottom: the wordmark, the
   menu, and the call to action. The component centres them; Tracy wants them
   bottom-aligned. */
.nt-header__bar { align-items: flex-end; }
.nt-header__brand { align-items: flex-end; }
.nt-header__actions { align-items: flex-end; }
.site-nav__list { align-items: flex-end; }

/* Layout follows the pattern Tracy picked out on nooks.ai: the menu sits
   beside the wordmark on the left, and the right-hand side carries the
   controls and one call to action. The header component's bar is a flex row
   with space-between, so an auto end-margin on the nav is all that takes. */
.site-nav {
  min-width: 0;
  margin-inline-end: auto;
  margin-inline-start: var(--nt-p-space-8, 3rem);
}
.site-nav__list {
  display: flex;
  align-items: center;
  gap: var(--nt-p-space-6);
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav__item { position: relative; }

.site-nav__top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 8px 0 0;
  border: 0;
  line-height: 1;
  background: none;
  font: inherit;
  font-size: .95rem;
  color: var(--nt-text-primary);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
/* A top-level item with no page behind it reads as present but inactive. */
.site-nav__top--muted { color: var(--nt-text-muted); cursor: default; }
.site-nav__top[aria-expanded="true"] { color: var(--nt-accent-ink); }
.site-nav__top::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--nt-accent-default);
  border-bottom: 1.5px solid var(--nt-accent-default);
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--nt-p-motion-duration-base) var(--nt-p-motion-easing-standard);
}
.site-nav__top[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }


/* An item with no page yet reads as present but not clickable, so the menu can
   show the shape of the site without sending anyone to a 404. */
.site-nav__soon { color: var(--nt-text-muted); cursor: default; }

.site-nav__menu {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: calc(100% + 10px);
  min-width: 15rem;
  margin: 0;
  padding: var(--nt-p-space-3);
  list-style: none;
  background: var(--nt-surface-page);
  border: var(--nt-p-border-hairline) solid var(--nt-rule-hairline);
  border-radius: var(--nt-p-radius-md);
  box-shadow: 0 12px 32px rgb(0 0 0 / 22%);
  z-index: 60;
}
.site-nav__menu[hidden] { display: none; }
/* The panel sits below the trigger with a gap. The gap belongs to neither, so
   a pointer crossing it leaves the item and the menu closes before anyone
   reaches a link. This bridges it: part of the panel, invisible, so the
   pointer never leaves. */
.site-nav__menu::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: -12px;
  height: 12px;
}
.site-nav__menu li { margin: 0; }
.site-nav__menu a,
.site-nav__menu .site-nav__soon {
  display: block;
  padding: 7px 10px;
  border-radius: var(--nt-p-radius-sm, 4px);
  font-size: .93rem;
  line-height: 1.45;
  text-decoration: none;
  color: var(--nt-text-primary);
}
.site-nav__menu a:hover,
.site-nav__menu a:focus-visible { background: var(--nt-surface-raised, rgb(127 127 127 / 12%)); }
.site-nav__menu .site-nav__soon { color: var(--nt-text-muted); }

/* The header component already shows its menu button below 48rem whenever the
   nav slot is not empty, so the button only needs its own look and the panel. */
.site-nav__burger {
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: var(--nt-p-border-hairline) solid var(--nt-rule-hairline);
  border-radius: var(--nt-p-radius-md);
  background: none;
  color: var(--nt-text-primary);
  cursor: pointer;
}
.site-nav__burger svg { width: 1.1rem; height: 1.1rem; display: block; }

/* One call to action, filled, so it reads as the thing to do rather than as
   another link in the row. */
.site-nav__cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--nt-accent-default);
  color: var(--nt-text-on-accent);
  font-size: .92rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav__cta:hover, .site-nav__cta:focus-visible { filter: brightness(1.06); }
@media (max-width: 30rem) { .site-nav__cta { display: none; } }

@media (max-width: 48rem) {
  .site-nav { display: none; margin-inline: 0; }
  .site-nav[data-open="true"] {
    display: block;
    position: absolute;
    inset-inline: 0;
    inset-block-start: 100%;
    padding: var(--nt-p-space-4) var(--nt-p-space-5) var(--nt-p-space-6);
    background: var(--nt-surface-page);
    border-block-start: var(--nt-p-border-hairline) solid var(--nt-rule-hairline);
    box-shadow: 0 16px 32px rgb(0 0 0 / 24%);
  }
  .site-nav[data-open="true"] .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: var(--nt-p-space-2);
  }
  .site-nav[data-open="true"] .site-nav__menu {
    position: static;
    min-width: 0;
    margin-block-start: 6px;
    box-shadow: none;
  }
  .nt-header__bar { position: relative; }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav__top::after { transition: none; }
}

/* The theme control sits in a raised, bordered box by default, which reads as
   a second button next to the call to action. In the site header it is a bare
   icon. The component keeps its own look everywhere else. */
.nt-header .nt-theme-toggle__button {
  background: none;
  border-color: transparent;
  min-height: 0;
  min-width: 0;
  padding: 0;
}
.nt-header .nt-theme-toggle__button:hover,
.nt-header .nt-theme-toggle__button:focus-visible {
  background: none;
  border-color: transparent;
  color: var(--nt-accent-ink);
}
/* Sized against the button beside it rather than against the menu text: a
   bare icon next to a filled pill needs the height to hold its own. */
.nt-header .nt-theme-toggle__button svg { width: 1.6rem; height: 1.6rem; display: block; }
/* Past the call to action, with a hairline between them: a utility control
   rather than something competing with the one thing to do. */
.nt-header .nt-theme-slot {
  align-self: center;
  padding-inline-start: var(--nt-p-space-4);
  border-inline-start: var(--nt-p-border-hairline) solid var(--nt-rule-hairline);
}
.nt-header__actions { gap: var(--nt-p-space-4); }
