/* ═══════════════════════════════════════════════════════
   RH Main Navigation — rh-gravity-tools
   Scoped to .rh-nav — no global bleed
   ═══════════════════════════════════════════════════════ */

/* ─── Avada theme resets ─────────────────────────────── */
/* ID selector (#rh-nav) beats Avada's class selectors    */
/* even when Avada loads after us in source order.        */
#rh-nav a,
#rh-nav a:hover,
#rh-nav a:visited,
#rh-nav a:focus,
#rh-nav a:active {
  text-decoration: none !important;
  color: inherit !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline-offset: 2px;
}
/* Avada applies margin/padding to li globally */
#rh-nav ul,
#rh-nav li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}


/* ─── Tokens ─────────────────────────────────────────── */
.rh-nav {
  --rh-nav-primary:   #400718;
  --rh-nav-hover:     #5d061f;
  --rh-nav-cream:     #fff9f6;
  --rh-nav-muted:     #86777b;
  --rh-nav-border:    hsla(0,8%,86%,1);
  --rh-nav-h:         56px;
  --rh-nav-font:      'Inter', 'Source Sans 3', -apple-system, sans-serif;
}

/* ─── Skip link ──────────────────────────────────────── */
.rh-nav__skip {
  position: absolute; top: -100px; left: 0;
  padding: 8px 16px;
  background: var(--rh-nav-primary); color: #fff;
  text-decoration: none; font-size: 13px; font-weight: 600;
  border-radius: 0 0 6px 6px; z-index: 9999;
  transition: top 0.2s;
}
.rh-nav__skip:focus { top: 0; }

/* ─── Nav wrapper ────────────────────────────────────── */
.rh-nav {
  position: relative;
  font-family: var(--rh-nav-font) !important;
  width: 100%;
}

/* ─── Bar ────────────────────────────────────────────── */
.rh-nav__bar {
  display: flex;
  align-items: center;
  height: var(--rh-nav-h);
  width: 100%;
}

/* ─── Item list ──────────────────────────────────────── */
.rh-nav__list {
  display: flex;
  align-items: stretch;
  list-style: none;
  height: 100%;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
}

/* ─── Each item ──────────────────────────────────────── */
.rh-nav__item {
  position: relative;
  display: flex;
  align-items: stretch;
}

/* ─── Top-level link/button ──────────────────────────── */
.rh-nav__top {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 13px;
  font-size: 14px;
  font-weight: 500;
  color: var(--rh-nav-primary);
  text-decoration: none;
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s, color 0.15s;
  height: 100%;
  font-family: var(--rh-nav-font) !important;
  line-height: 1;
}

.rh-nav__item:hover > .rh-nav__top,
.rh-nav__item:focus-within > .rh-nav__top {
  border-bottom-color: var(--rh-nav-primary);
  color: var(--rh-nav-hover);
}
.rh-nav__top:focus-visible {
  outline: 2px solid var(--rh-nav-primary);
  outline-offset: -2px;
}

/* ─── Hub badge ──────────────────────────────────────── */
.rh-nav__badge {
  font-size: 7.5px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--rh-nav-primary); color: #fff;
  padding: 2px 5px; border-radius: 3px; line-height: 1.4;
  opacity: 0.65; flex-shrink: 0;
}

/* ─── Chevron ────────────────────────────────────────── */
.rh-nav__chev {
  width: 10px; height: 10px; flex-shrink: 0; opacity: 0.5;
  transition: transform 0.2s, opacity 0.15s;
}
.rh-nav__item:hover > .rh-nav__top .rh-nav__chev,
.rh-nav__item:focus-within > .rh-nav__top .rh-nav__chev {
  transform: rotate(180deg); opacity: 1;
}

/* ─── CTA button ─────────────────────────────────────── */
.rh-nav__cta {
  margin-left: 12px;
  align-self: center;
  padding: 10px 20px;
  background: var(--rh-nav-primary);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--rh-nav-font) !important;
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.rh-nav__cta:hover { background: var(--rh-nav-hover); transform: translateY(-1px); }
.rh-nav__cta:focus-visible { outline: 2px solid var(--rh-nav-primary); outline-offset: 3px; }

/* ─── Burger ─────────────────────────────────────────── */
.rh-nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none; border: none; cursor: pointer;
  border-radius: 8px; padding: 6px;
  margin-left: auto; flex-shrink: 0;
}
.rh-nav__burger span {
  display: block; height: 2px;
  background: var(--rh-nav-primary); border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}
.rh-nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.rh-nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.rh-nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.rh-nav__burger:focus-visible { outline: 2px solid var(--rh-nav-primary); }

/* ═══════════════════════════════════════════════════════
   STANDARD DROPDOWN
   ═══════════════════════════════════════════════════════ */
.rh-nav__drop {
  position: absolute;
  top: calc(var(--rh-nav-h) + 2px);
  left: 0;
  min-width: 240px;
  background: #fff;
  border: 1px solid var(--rh-nav-border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(64,7,24,.10), 0 2px 8px rgba(64,7,24,.06);
  padding: 8px 0;
  z-index: 500;

  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s, visibility .18s, transform .18s;
  pointer-events: none;
}

.rh-nav__item:hover .rh-nav__drop,
.rh-nav__item:focus-within .rh-nav__drop {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}

.rh-nav__section {
  padding: 12px 18px 4px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--rh-nav-muted);
  border-top: 1px solid var(--rh-nav-border); margin-top: 4px;
}
.rh-nav__section:first-child { border-top: none; margin-top: 0; }

.rh-nav__sub {
  display: block; padding: 8px 18px;
  font-size: 13.5px; font-family: var(--rh-nav-font) !important;
  color: var(--rh-nav-primary); text-decoration: none;
  transition: background .12s, padding-left .12s;
}
.rh-nav__sub:hover { background: var(--rh-nav-cream); padding-left: 22px; }
.rh-nav__sub:focus-visible { outline: 2px solid var(--rh-nav-primary); outline-offset: -2px; }

/* ═══════════════════════════════════════════════════════
   MEGA PANEL
   ═══════════════════════════════════════════════════════ */
.rh-nav__mega {
  position: absolute;
  top: calc(var(--rh-nav-h) + 2px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: 780px;
  background: #fff;
  border: 1px solid var(--rh-nav-border);
  border-radius: 12px;
  box-shadow: 0 16px 56px rgba(64,7,24,.12), 0 4px 16px rgba(64,7,24,.07);
  padding: 28px;
  z-index: 500;
  display: grid;
  gap: 0 32px;

  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s, transform .2s;
  pointer-events: none;
}

/* Right-align mega panels near the right edge */
.rh-nav__item:nth-last-child(-n+3) .rh-nav__mega {
  left: auto; right: 0;
  transform: translateY(-8px);
}

.rh-nav__item:hover .rh-nav__mega,
.rh-nav__item:focus-within .rh-nav__mega {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.rh-nav__item:nth-last-child(-n+3):hover .rh-nav__mega,
.rh-nav__item:nth-last-child(-n+3):focus-within .rh-nav__mega {
  transform: translateY(0);
}

/* Grid columns */
.rh-nav__mega[data-cols="1"] { grid-template-columns: 1fr; width: 260px; }
.rh-nav__mega[data-cols="2"] { grid-template-columns: 1fr 1fr; width: 520px; }
.rh-nav__mega[data-cols="3"] { grid-template-columns: 2fr 1.3fr 1.3fr; }

/* Column */
.rh-nav__col { border-left: 1px solid var(--rh-nav-border); padding-left: 24px; min-width: 0; }
.rh-nav__col:first-child { border-left: none; padding-left: 0; }

/* Column heading */
.rh-nav__col-head {
  display: block;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--rh-nav-muted);
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--rh-nav-border);
  text-decoration: none; transition: color .12s;
  font-family: var(--rh-nav-font) !important;
}
a.rh-nav__col-head:hover { color: var(--rh-nav-primary); }

/* Mega links */
.rh-nav__mega-link {
  display: block; padding: 4.5px 0;
  font-size: 12.5px; font-family: var(--rh-nav-font) !important;
  color: var(--rh-nav-primary); text-decoration: none;
  transition: color .12s, padding-left .12s; line-height: 1.45;
}
.rh-nav__mega-link:hover { color: var(--rh-nav-hover); padding-left: 5px; }
.rh-nav__mega-link:focus-visible { outline: 2px solid var(--rh-nav-primary); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════
   CONDENSED — 1160-1300px
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1300px) {
  .rh-nav__top   { font-size: 13px; padding: 0 10px; }
  .rh-nav__cta   { font-size: 12.5px; padding: 9px 14px; margin-left: 8px; }
  .rh-nav__badge { display: none; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE — ≤ 1160px
   ═══════════════════════════════════════════════════════ */
@media (max-width: 1160px) {
  .rh-nav__list  { display: none; }
  .rh-nav__cta   { display: none; }
  .rh-nav__burger { display: flex; }
  .rh-nav__bar   { height: 52px; }
}

/* ─── Mobile panel ───────────────────────────────────── */
/* position:fixed breaks out of the Avada column container */
/* JS sets panel.style.top = navBar.getBoundingClientRect().bottom */
.rh-nav__mobile {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid var(--rh-nav-border);
  max-height: 0;
  overflow: hidden;
  z-index: 9998;
  transition: max-height 0.32s cubic-bezier(0.16,1,0.3,1);
  /* top is injected by rh-nav.js on burger click */
}
.rh-nav__mobile.is-open {
  max-height: calc(100svh - 56px); /* svh = small viewport height for mobile browsers */
  overflow-y: auto;
}

.rh-mob__item { border-bottom: 1px solid var(--rh-nav-border); }

.rh-mob__trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 15px 20px;
  font-size: 15px; font-weight: 500;
  font-family: var(--rh-nav-font) !important; color: var(--rh-nav-primary);
  background: none; border: none; cursor: pointer;
  text-decoration: none; text-align: left;
}
.rh-mob__trigger:focus-visible { outline: 2px solid var(--rh-nav-primary); outline-offset: -2px; }

.rh-mob__chev {
  width: 14px; height: 14px; flex-shrink: 0; opacity: 0.4;
  transition: transform 0.25s, opacity 0.2s;
}
.rh-mob__trigger[aria-expanded="true"] .rh-mob__chev {
  transform: rotate(180deg); opacity: 0.8;
}

.rh-mob__sub {
  background: var(--rh-nav-cream);
  max-height: 0; overflow: hidden;
  transition: max-height 0.25s ease;
}
.rh-mob__sub.is-open { max-height: 1400px; }

.rh-mob__section {
  padding: 10px 20px 4px 24px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--rh-nav-muted);
  font-family: var(--rh-nav-font) !important;
}
.rh-mob__link {
  display: block; padding: 10px 20px 10px 24px;
  font-size: 14px; font-family: var(--rh-nav-font) !important;
  color: var(--rh-nav-primary); text-decoration: none;
  border-bottom: 1px solid var(--rh-nav-border);
}
.rh-mob__link:last-child { border-bottom: none; }
.rh-mob__link:hover { color: var(--rh-nav-hover); background: #fff; }
.rh-mob__link:focus-visible { outline: 2px solid var(--rh-nav-primary); }

.rh-mob__cta-wrap { padding: 20px; background: #fff; }
.rh-mob__cta {
  display: block; padding: 15px; text-align: center;
  background: var(--rh-nav-primary); color: #fff;
  font-size: 15px; font-weight: 600; font-family: var(--rh-nav-font) !important;
  text-decoration: none; border-radius: 8px;
  transition: background .15s;
}
.rh-mob__cta:hover { background: var(--rh-nav-hover); }
.rh-mob__cta:focus-visible { outline: 2px solid var(--rh-nav-primary); outline-offset: 3px; }
