/* Shared site header — desktop bar (>720px) + mobile topbar/drawer (<=720px).
 *
 * Owner: js/site-header.js (AirmangoSiteHeader.mount). Pages must NOT
 * define .nav / .nav-* / .am-* themselves — the inline copies were
 * removed when the shared header landed. Used by:
 *   /, /about/, /creators/, /operators/, /operators/how-it-works.html, /app/
 * NOT used by:
 *   /investors.html, /share-your-iceland-trip/, /creators/v2/,
 *   /operators/v2/, /creators/panel*, /operators/join/.
 */


/* ─── Desktop bar ─────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 56px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  border-bottom: 1px solid var(--border, #eee);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.nav .logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #111418;
  text-decoration: none;
}
.nav-center {
  display: flex;
  gap: 36px;
}
.nav-center a {
  font-size: 14px;
  font-weight: 500;
  color: #1a1d22;
  text-decoration: none;
  transition: color 0.15s;
}
.nav-center a.active { font-weight: 700; }
.nav-center a:hover { color: var(--accent, #E8366D); }

.nav-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.nav-btn-ghost {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #1a1d22;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.nav-btn-ghost:hover { border-color: #111418; }
.nav-btn-pink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--accent, #E8366D);
  border-radius: 8px;
  background: var(--accent, #E8366D);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background .15s;
}
.nav-btn-pink:hover { background: #c92e5d; }

/* Sign In / Sign Up role-picker dropdowns (desktop) */
.nav-role-wrap { position: relative; display: inline-block; }
.nav-role-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e8e8ec;
  border-radius: 12px;
  min-width: 240px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  overflow: hidden;
}
.nav-role-menu.is-open { display: block; }
.nav-role-option {
  display: block;
  padding: 14px 18px;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.nav-role-option:hover { background: #f7f7f8; }
.nav-role-name {
  font-size: 14px;
  font-weight: 600;
  color: #0a0a0a;
}
.nav-role-sub {
  font-size: 12px;
  color: #8c8c96;
  margin-top: 2px;
}

.nav-avatar-wrap { position: relative; display: inline-block; }
.nav-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent, #E8366D);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  padding: 0;
}
.nav-avatar-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e8e8ec;
  border-radius: 12px;
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  overflow: hidden;
}
.nav-avatar-menu.is-open { display: block; }
.nav-avatar-menu-head {
  padding: 16px 18px;
  border-bottom: 1px solid #f0f0f4;
}
.nav-avatar-menu-name { font-size: 14px; font-weight: 600; color: #0a0a0a; }
.nav-avatar-menu-email { font-size: 12px; color: #8c8c96; margin-top: 2px; }
.nav-avatar-menu-link,
.nav-avatar-menu-signout {
  display: block;
  width: 100%;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: inherit;
}
.nav-avatar-menu-link { color: #0a0a0a; }
.nav-avatar-menu-signout { color: #e74c3c; }
.nav-avatar-menu-link:hover,
.nav-avatar-menu-signout:hover { background: #f7f7f8; }


/* ─── Mobile header ──────────────────────────────────────────────── */

.am-mobile-header { display: none; }

.am-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 0.5px solid #f0f0f0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
}
.am-topbar-logo {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  color: #000;
  letter-spacing: -0.3px;
  text-decoration: none;
}
.am-menu-btn {
  background: transparent;
  border: 0;
  padding: 6px;
  margin: -6px;
  color: #1a1a1a;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.am-menu-btn:focus-visible {
  outline: 2px solid var(--accent, #E8366D);
  outline-offset: 2px;
  border-radius: 4px;
}

.am-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 998;
}
.am-menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.am-menu-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(82vw, 320px);
  background: #fff;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 24px;
  overflow-y: auto;
}
.am-menu-drawer.is-open { transform: translateX(0); }

.am-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0f0f0;
}
.am-menu-logo {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
  color: #000;
  letter-spacing: -0.3px;
}
.am-menu-close {
  background: transparent;
  border: 0;
  padding: 6px;
  margin: -6px;
  color: #555;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.am-menu-auth {
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
  color: #333;
}
.am-menu-userline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.am-menu-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.am-menu-name {
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}
.am-menu-signout {
  color: #888;
  font-size: 12px;
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
/* Sign In / Sign Up expandable sections (mobile drawer) */
.am-menu-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid #f5f5f5;
}
.am-menu-chevron {
  font-size: 18px;
  color: #8c8c96;
  transition: transform 0.2s ease;
  display: inline-block;
}
.am-menu-section-toggle.is-open .am-menu-chevron {
  transform: rotate(90deg);
}
.am-menu-section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding-left: 12px;
}
.am-menu-section-content.is-open {
  max-height: 240px;
}
.am-menu-role-option {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  color: #1a1a1a;
  border-bottom: 1px solid #f5f5f5;
}
.am-menu-role-option:last-child { border-bottom: 0; }
.am-menu-role-name {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
}
.am-menu-role-sub {
  font-size: 12px;
  color: #8c8c96;
  margin-top: 2px;
}

.am-menu-nav {
  display: flex;
  flex-direction: column;
  padding-top: 8px;
}
.am-menu-nav a {
  display: block;
  padding: 12px 0;
  color: #1a1a1a;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1px solid #f5f5f5;
}
.am-menu-nav a:last-child { border-bottom: 0; }
.am-menu-nav a:hover { color: var(--accent, #E8366D); }


/* ─── Breakpoint switch ──────────────────────────────────────────── */

@media (max-width: 720px) {
  body > nav.nav { display: none !important; }
  .am-mobile-header { display: contents; }
  body { padding-top: 0; }
}

@media (max-width: 600px) {
  .am-topbar { padding: 12px 14px; }
}
