/*
 * rml-nav: the Main menu (ADR 0006), drawn to look exactly like the Max Mega
 * Menu it replaces. Values are the live menu's computed styles at 1440, 1024,
 * 961, 960 and 390px (measured 2026-11-21); see design-guide/README.md, "Main
 * menu (rml-nav)".
 *
 * The rml-nav__* classes are the element's own parts, styled only here. They are
 * not Global classes (a Global class label cannot contain "__"); the element's
 * root takes Global classes like any Atomic element. Colours and fonts are the
 * rml- Variables, which Elementor prints on every page.
 *
 * Breakpoint: 960px, as Max Mega Menu (desktop from 961px).
 */

.rml-nav {
  position: relative;
}

:where(.rml-nav) ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rml-nav__toggle {
  display: none;
}

/* Top-level items (button or link) */
.rml-nav__link {
  display: block;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--neutral-800);
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  line-height: 40px;
  letter-spacing: normal;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

/* Panel and dropdown text */
.rml-nav__heading {
  display: block;
  margin: 0 50px 20px 0;
  border-bottom: 1px solid var(--black);
  color: var(--brand-primary);
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 500;
  line-height: 47.6px;
  text-decoration: none;
}

.rml-nav__sublink {
  display: block;
  color: var(--black);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 27.2px;
  text-decoration: none;
}

a.rml-nav__sublink:is(:hover, :focus-visible) {
  color: var(--brand-primary);
}

.rml-nav__image {
  display: block;
  max-width: calc(100% - 50px);
  height: auto;
  margin: 0 0 20px;
}

/* Each column starts 10px down, as Max Mega Menu's nested lists (on mobile,
   where the columns stack, above each one). */
.rml-nav__column {
  padding-top: 10px;
}

.rml-nav__group {
  padding: 6px 12px 2px;
}

/* Floats, as Max Mega Menu: in two columns a long name that wraps pushes only
   the links that float after it (visible at 390px). */
.rml-nav__links {
  display: flow-root;
}

.rml-nav__links > li {
  float: left;
  width: 100%;
}

.rml-nav__links--2col > li {
  width: 50%;
}

.rml-nav__dropdown-item {
  padding: 6px 12px 2px;
}

.rml-nav__dropdown .rml-nav__sublink {
  font-size: 14px;
  line-height: 23.8px;
}

.rml-nav__dropdown-sub {
  margin-top: 10px;
}

.rml-nav__dropdown-sub .rml-nav__sublink {
  margin-bottom: 10px;
}

/* Keyboard focus, as Max Mega Menu's keyboard navigation */
.rml-nav :is(a, button):focus {
  outline: none;
}
.rml-nav :is(a, button):focus-visible {
  outline: 3px solid #109CDE;
  outline-offset: -3px;
}
.rml-nav .rml-nav__toggle:focus-visible {
  outline-offset: 2px;
}

/* ---------- Desktop (961px and up) ---------- */
@media (min-width: 961px) {
  .rml-nav__list {
    display: flex;
    flex-wrap: wrap;
    position: relative;
  }

  .rml-nav__item {
    position: relative;
    margin-right: 3vw;
  }

  /* The panel spans the header container, not the item. */
  .rml-nav__item--panel {
    position: static;
  }

  .rml-nav__link:is(:hover, :focus-visible),
  .rml-nav__item.is-open > .rml-nav__link,
  .rml-nav__item.is-current > .rml-nav__link {
    color: var(--brand-accent);
  }

  .rml-nav__panel,
  .rml-nav__dropdown {
    position: absolute;
    top: 40px;
    z-index: 9999;
    margin-top: 10px;
    background: var(--white);
    border-radius: 30px;
    visibility: hidden;
    opacity: 0;
    transform: translate(0, 10px);
    transition: opacity 200ms ease-in, transform 200ms ease-in, visibility 200ms ease-in;
  }

  /* Keeps the pointer "inside" while it crosses the 10px gap above. */
  .rml-nav__panel::before,
  .rml-nav__dropdown::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
  }

  .rml-nav__item.is-open > :is(.rml-nav__panel, .rml-nav__dropdown),
  .rml-nav:not(.is-ready) .rml-nav__item:is(:hover, :focus-within) > :is(.rml-nav__panel, .rml-nav__dropdown) {
    visibility: visible;
    opacity: 1;
    transform: translate(0, 0);
    /* Visible at once, so focus can move into it; it still fades up. */
    transition: opacity 200ms ease-in, transform 200ms ease-in, visibility 0s;
  }

  /* rml-nav.js sets the two properties from the panel container (default: the
     closest .u-container or .e-con-inner), as Max Mega Menu's panel width. */
  .rml-nav__panel {
    left: var(--rml-nav-panel-left, 0px);
    width: var(--rml-nav-panel-width, 100%);
    padding: 65px 40px 60px 110px;
  }

  .rml-nav__columns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
  }

  .rml-nav__column--wide {
    grid-column: span 2;
  }

  .rml-nav__dropdown {
    left: -50px;
    width: 375px;
    padding: 55px 40px 55px 60px;
  }
}

/* ---------- Mobile (960px and below) ---------- */
@media (max-width: 960px) {
  .rml-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 40px;
    margin: 0 6px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    transform: scale(1.2);
  }

  .rml-nav__toggle-box {
    position: relative;
    display: block;
    width: 30px;
    height: 10px;
  }

  .rml-nav__toggle-bars,
  .rml-nav__toggle-bars::before,
  .rml-nav__toggle-bars::after {
    position: absolute;
    display: block;
    width: 30px;
    height: 2px;
    border-radius: 4px;
    background-color: var(--black);
    transition: transform 0.15s ease;
  }

  .rml-nav__toggle-bars {
    top: 2px;
    margin-top: -2px;
  }

  .rml-nav__toggle-bars::before,
  .rml-nav__toggle-bars::after {
    content: "";
    left: 0;
  }

  .rml-nav__toggle-bars::before {
    top: 8px;
    transition-property: transform, opacity;
  }

  .rml-nav__toggle-bars::after {
    top: 15px;
  }

  .rml-nav.is-open .rml-nav__toggle-bars {
    transform: translate3d(0, 10px, 0) rotate(45deg);
  }

  .rml-nav.is-open .rml-nav__toggle-bars::before {
    transform: rotate(-45deg) translate3d(-5.71429px, -6px, 0);
    opacity: 0;
  }

  .rml-nav.is-open .rml-nav__toggle-bars::after {
    transform: translate3d(0, -15px, 0) rotate(-90deg);
  }

  /* The open menu spans the viewport: rml-nav.js sets the offset. */
  .rml-nav__list {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 40px;
    left: var(--rml-nav-mobile-left, 0px);
    z-index: 9999999;
    width: var(--rml-nav-mobile-width, 100vw);
    margin-top: 20px;
    background: var(--white);
  }

  .rml-nav.is-open .rml-nav__list {
    display: flex;
  }

  .rml-nav__item {
    position: relative;
    margin-right: 3vw;
  }

  .rml-nav__link {
    width: 100%;
    padding: 0 10px;
    color: var(--brand-primary);
  }

  .rml-nav__item.is-open > .rml-nav__link,
  .rml-nav__item.is-current > .rml-nav__link {
    background-color: #424241;
  }

  .rml-nav__panel,
  .rml-nav__dropdown {
    display: none;
    margin-top: 10px;
    background: var(--white);
    border-radius: 30px;
  }

  .rml-nav__item.is-open > :is(.rml-nav__panel, .rml-nav__dropdown) {
    display: block;
  }

  .rml-nav__panel {
    padding: 20px 10px 10px;
  }

  .rml-nav__dropdown {
    padding: 10px 10px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rml-nav__panel,
  .rml-nav__dropdown,
  .rml-nav__toggle-bars,
  .rml-nav__toggle-bars::before,
  .rml-nav__toggle-bars::after {
    transition: none;
  }
}

/* Theme guard (#13). Hello Elementor's reset gives every button a pink
   background and white text on :hover and :focus ([type=button]:hover,
   specificity 0,2,0), and the Design guide doesn't load that reset, so its
   samples never showed it. These rules (html button[type]:where(...), 0,2,2)
   beat the theme and restate this element's own resting and state colours;
   rules with three or more classes (open, current) still win over them. */
html button[type]:where(.rml-nav__toggle):is(:hover, :focus),
html button[type]:where(.rml-nav__link):is(:hover, :focus) {
  background-color: transparent;
}

@media (min-width: 961px) {
  html button[type]:where(.rml-nav__link):focus:where(:not(:focus-visible)) {
    color: var(--neutral-800);
  }

  html button[type]:where(.rml-nav__link):is(:hover, :focus-visible) {
    color: var(--brand-accent);
  }
}

@media (max-width: 960px) {
  html button[type]:where(.rml-nav__link):is(:hover, :focus) {
    color: var(--brand-primary);
  }
}
