/* ==========================================================================
   Magengrim — mobile navigation
   A self-contained drawer built by nav.js and appended to <body>. It shares no
   markup or class names with the theme's own menu, so nothing competes over
   the same elements.
   ========================================================================== */

.mg-nav {
  --mg-nav-ink: #100c2a;
  --mg-nav-accent: #5270aa;
  --mg-nav-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- Trigger ------------------------------------------------------------ */

/* The theme styles bare <button> elements as filled pills, so the trigger is
   reset to a plain, chromeless control. */
.mg-navbtn,
.mg-navbtn:hover,
.mg-navbtn:focus {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  color: #100c2a !important;
}

.mg-navbtn {
  display: none;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  margin: 0 0 0 auto;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: opacity 200ms ease;
}

.mg-navbtn:hover {
  opacity: 0.62;
}

.mg-navbtn:focus-visible {
  outline: 2px solid #5270aa;
  outline-offset: 4px;
}

/* Two bars that cross when the drawer is open. */
.mg-navbtn__bars {
  position: relative;
  display: block;
  width: 26px;
  height: 12px;
}

.mg-navbtn__bars i {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 340ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mg-navbtn__bars i:nth-child(1) { top: 1px; }
.mg-navbtn__bars i:nth-child(2) { top: 9px; }

.mg-navbtn[aria-expanded="true"] .mg-navbtn__bars i:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.mg-navbtn[aria-expanded="true"] .mg-navbtn__bars i:nth-child(2) {
  transform: translateY(-4px) rotate(-45deg);
}

/* Pin the trigger to the right edge of the header row. */
@media (max-width: 1024px) {
  .ekit-template-content-header .jeg-elementor-kit.jkit-nav-menu {
    display: flex !important;
    width: 100%;
    justify-content: flex-end;
    align-items: center;
  }
}

/* --- Scrim -------------------------------------------------------------- */

.mg-scrim {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(8, 6, 24, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 0s linear 320ms;
}

.mg-scrim.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms ease, visibility 0s;
}

/* --- Drawer ------------------------------------------------------------- */

.mg-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  width: min(86vw, 330px);
  height: 100%;
  height: 100dvh;
  background: #100c2a;
  box-shadow: -26px 0 64px rgba(0, 0, 0, 0.4);
  transform: translate3d(100%, 0, 0);
  visibility: hidden;
  transition:
    transform 440ms cubic-bezier(0.22, 0.61, 0.36, 1),
    visibility 0s linear 440ms;
}

.mg-drawer.is-open {
  transform: none;
  visibility: visible;
  transition:
    transform 440ms cubic-bezier(0.22, 0.61, 0.36, 1),
    visibility 0s;
}

/* Head: logo and close */
.mg-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mg-drawer__logo img {
  display: block;
  width: auto;
  max-width: 128px;
  height: auto;
}

/* Plain X. The theme styles bare <button> elements as filled pills, so every
   piece of that chrome is reset here. */
.mg-drawer__close,
.mg-drawer__close:hover,
.mg-drawer__close:focus,
.mg-drawer__close:active {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

.mg-drawer__close {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.mg-drawer__close:hover {
  opacity: 0.65;
}

.mg-drawer__close:active {
  transform: scale(0.9);
}

.mg-drawer__close:focus-visible {
  outline: 2px solid #5270aa;
  outline-offset: 4px;
}

.mg-drawer__close svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none !important;
  stroke: currentColor !important;
}

/* Links */
.mg-drawer__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0 24px;
  scrollbar-width: thin;
  scrollbar-color: #5270aa rgba(255, 255, 255, 0.06);
}

.mg-drawer__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mg-drawer__list li {
  opacity: 0;
  transform: translateX(18px);
  transition:
    opacity 360ms ease,
    transform 400ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mg-drawer.is-open .mg-drawer__list li {
  opacity: 1;
  transform: none;
}

.mg-drawer.is-open .mg-drawer__list li:nth-child(1) { transition-delay: 130ms; }
.mg-drawer.is-open .mg-drawer__list li:nth-child(2) { transition-delay: 190ms; }
.mg-drawer.is-open .mg-drawer__list li:nth-child(3) { transition-delay: 250ms; }
.mg-drawer.is-open .mg-drawer__list li:nth-child(4) { transition-delay: 310ms; }
.mg-drawer.is-open .mg-drawer__list li:nth-child(5) { transition-delay: 370ms; }

.mg-drawer__list a {
  display: block;
  padding: 16px 22px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;
  transition:
    background-color 220ms ease,
    color 220ms ease,
    padding-left 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.mg-drawer__list a:hover,
.mg-drawer__list a:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  padding-left: 28px;
  outline: none;
}

.mg-drawer__list a[aria-current="page"] {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 0 0 #5270aa;
}

/* Footer call to action */
.mg-drawer__foot {
  flex: 0 0 auto;
  padding: 18px 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mg-drawer__cta {
  display: block;
  padding: 14px 20px;
  border-radius: 999px;
  background: #2c1b63;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: background-color 240ms ease, transform 240ms ease;
}

.mg-drawer__cta:hover {
  background: #5270aa;
  color: #ffffff;
  transform: translateY(-2px);
}

/* --- Breakpoint --------------------------------------------------------- */

@media (max-width: 1024px) {
  .mg-navbtn {
    display: inline-flex;
  }
}

@media (min-width: 1025px) {
  .mg-navbtn,
  .mg-drawer,
  .mg-scrim {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mg-drawer,
  .mg-scrim,
  .mg-drawer__list li,
  .mg-navbtn__bars i {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
}
