/*
 * nav.css
 * ReyBelen Standalone Theme — Navigation
 *
 * Authority: REYBELEN-COMPONENT-BLUEPRINT-SYSTEM.md §02
 *            REYBELEN-ARCHITECTURAL-AMENDMENTS.md AM-02 (scroll border: Required)
 *            REYBELEN-ARCHITECTURAL-AMENDMENTS.md AM-06 (scroll trigger: IntersectionObserver)
 *
 * Owns: .rb-nav structural layout, identity block, nav links, mobile toggle,
 *       mobile panel appearance, sticky behavior, default color state,
 *       body.scrolled color and border-bottom state.
 *
 * Does not own: .rb-btn visual treatment (components.css), hero (hero.css),
 *               @media breakpoint toggles (responsive.css).
 */


/* ── Nav: Shell ──────────────────────────────────────────────────────────── */

.rb-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: var(--rb-navy);
  transition: background-color 200ms ease, border-color 200ms ease;
}


/* ── Nav: Container ──────────────────────────────────────────────────────── */

.rb-nav__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}


/* ── Nav: Identity ───────────────────────────────────────────────────────── */

.rb-nav__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

/* Boxed RB monogram — border box, no SVG, no image */
.rb-nav__monogram-box {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 200ms ease;
}

body.scrolled .rb-nav__monogram-box {
  border-color: rgba(0, 0, 0, 0.18);
}

.rb-nav__monogram-text {
  font-family: var(--rb-font-heading);
  font-weight: 300;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  line-height: 1;
  transition: color 200ms ease;
}

body.scrolled .rb-nav__monogram-text {
  color: var(--rb-ink);
}

/* Name + subtitle stack */
.rb-nav__name-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rb-nav__name {
  font-family: var(--rb-font-heading);
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 0;
  color: #FFFFFF;
  line-height: 1;
  transition: color 200ms ease;
}

.rb-nav__subtitle {
  font-family: var(--rb-font-mono);
  font-weight: 400;
  font-size: 8.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.32);
  line-height: 1;
  transition: color 200ms ease;
}

body.scrolled .rb-nav__name {
  color: var(--rb-ink);
}

body.scrolled .rb-nav__subtitle {
  color: rgba(0, 0, 0, 0.35);
}


/* ── Nav: Links ──────────────────────────────────────────────────────────── */

.rb-nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.rb-nav__links a {
  font-family: var(--rb-font-mono);
  font-weight: 400;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #FFFFFF;
  text-decoration: none;
  transition: color 150ms ease;
}

.rb-nav__links a:hover {
  color: var(--rb-cognac);
}


/* ── Nav: CTA Spacing ────────────────────────────────────────────────────── */

/*
 * Visual treatment of .rb-btn--primary is in components.css.
 * This rule only establishes the positional gap from the last nav link.
 */

.rb-nav__cta {
  margin-left: var(--sp-3);
}


/* ── Nav: Right Group ────────────────────────────────────────────────────── */

/*
 * Wraps links + CTA so they align together to the right
 * while the identity block stays left.
 */

.rb-nav__right {
  display: flex;
  align-items: center;
}


/* ── Nav: Mobile Toggle ──────────────────────────────────────────────────── */

/*
 * Default state: hidden on desktop.
 * responsive.css sets display:flex at < 768px.
 */

.rb-nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.rb-nav__toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: #FFFFFF;
  transition: background-color 150ms ease;
}

.rb-nav__toggle:hover .rb-nav__toggle-bar {
  background-color: var(--rb-cognac);
}


/* ── Nav: Mobile Panel ───────────────────────────────────────────────────── */

/*
 * Default: panel is hidden (max-height: 0, overflow: hidden).
 * nav.js reads scrollHeight and sets max-height to pixel value on open,
 * returns to 0 on close. The CSS transition animates the reveal.
 * aria-hidden state is managed by nav.js.
 */

.rb-nav__mobile {
  max-height: 0;
  overflow: hidden;
  background-color: var(--rb-navy);
  transition: max-height 250ms ease;
  width: 100%;
}

.rb-nav__mobile[aria-hidden="false"] {
  /* max-height set to scrollHeight px value by nav.js */
}

.rb-nav__mobile-inner {
  padding: var(--sp-6) var(--rb-pad-h);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.rb-nav__mobile-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.rb-nav__mobile-links a {
  font-family: var(--rb-font-mono);
  font-weight: 400;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #FFFFFF;
  text-decoration: none;
  transition: color 150ms ease;
  display: block;
}

.rb-nav__mobile-links a:hover {
  color: var(--rb-cognac);
}

.rb-nav__mobile-cta {
  margin-top: var(--sp-2);
  width: 100%;
  text-align: center;
}


/* ── Nav: Default Color State (over dark / hero) ─────────────────────────── */

/*
 * This is the nav's default state — displayed over the dark hero section.
 * Identity and links are white. No background on the nav shell.
 * The white text declarations above already establish this default.
 */


/* ── Nav: Scroll State (body.scrolled) ───────────────────────────────────── */

/*
 * Applied by nav.js via IntersectionObserver on .rb-hero (AM-06).
 * When .rb-hero leaves the viewport, body.scrolled is added.
 * Required per AM-02: border-bottom must appear on scroll — not optional.
 */

body.scrolled .rb-nav {
  background-color: var(--rb-bg);
  border-bottom: 1px solid var(--rb-border);
}

body.scrolled .rb-nav__monogram,
body.scrolled .rb-nav__name {
  color: var(--rb-ink);
}

body.scrolled .rb-nav__links a {
  color: var(--rb-ink);
}

body.scrolled .rb-nav__links a:hover {
  color: var(--rb-cognac);
}

body.scrolled .rb-nav__toggle-bar {
  background-color: var(--rb-ink);
}

body.scrolled .rb-nav__toggle:hover .rb-nav__toggle-bar {
  background-color: var(--rb-cognac);
}
