/* Slide-out menu: readable contact text on --base-opp panel + wrap long emails */

/* ---------------------------------------------------------------------------
   CRITICAL: full-height menu without viewport units.

   main.min.css sizes menu layers with `height: 100svh` and no fallback.
   Engines without svh support drop the declaration and panels collapse.
   Anchoring top:0 + bottom:0 on a fixed element yields the visible viewport
   height without viewport units. Also pin .mxd-menu__content the same way.
--------------------------------------------------------------------------- */
.mxd-menu,
.mxd-menu__overlay,
.mxd-menu__backdrop,
.mxd-menu__content {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  max-height: none;
  /* --vh is set by mxdViewportHeight() from window.innerHeight */
  min-height: calc(var(--vh, 1vh) * 100);
}

.mxd-menu__navigation,
.mxd-menu__inner {
  height: 100%;
  max-height: 100%;
}

/* main.min.css parks content at translateY(-50%) for the open tween. On some
   mobile browsers that tween never lands at 0, so early items stay above the
   fold and only About/Contact show in the top half. Resting stylesheet state
   is 0 — GSAP still drives yPercent while animating. Closed menu stays hidden
   via clip-path on the overlay. */
.mxd-menu__content {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

/* keep momentum scrolling on older iOS/Android engines */
.mxd-menu__inner {
  -webkit-overflow-scrolling: touch;
}

/* The bottom gradient is anchored to the scroll container and paints an opaque
   band over the last ~100px of content on mobile. The top fade is the one that
   is actually needed there. */
@media only screen and (max-width: 1199px) {
  .mxd-menu__shadow:not(.shadow-top) {
    display: none !important;
  }

  /* If GSAP left an inline translate stuck mid-open, unlock it once open. */
  .mxd-menu.is-open .mxd-menu__content {
    -webkit-transform: translate3d(0, 0, 0) !important;
    transform: translate3d(0, 0, 0) !important;
  }
}

/* ---------------------------------------------------------------------------
   MOBILE MENU DENSITY
--------------------------------------------------------------------------- */
@media only screen and (max-width: 1199px) {
  /* 10rem clears the logo, which ends at ~91px — going lower collided with it */
  .mxd-menu__inner {
    padding-top: 10rem;
    /* room to scroll past the last row instead of it sitting on the edge */
    padding-bottom: 3rem;
  }

  /* was 7.5rem — this produced a 97px dead gap under the tagline */
  .mxd-menu__caption {
    margin-bottom: 2.4rem;
  }

  /* was 2.2rem / 2.9rem => 85px rows; 64px is still a comfortable tap target */
  .main-menu__item {
    padding: 1.4rem 0 1.6rem 0;
  }

  /* contact + socials block sat far below the fold */
  .mxd-menu__right {
    padding-top: 1.6rem;
  }

  /* the real culprit: a 74px margin above the contact block */
  .mxd-menu__right .menu-contact {
    margin-top: 2.4rem;
  }

  .mxd-menu__right .menu-contact + .menu-contact,
  .mxd-menu__right .menu-contact__list + .menu-contact__list {
    margin-top: 1.6rem;
  }

  /* copyright row: 58px of padding for one line of text */
  .mxd-menu__data {
    padding-top: 1.6rem;
    padding-bottom: 1.6rem;
  }

  /* z-index only — do NOT touch position here */
  .mxd-menu__shadow.shadow-top {
    display: block;
    z-index: 6;
    height: 14rem;
    background: linear-gradient(
      to bottom,
      rgba(var(--base-opp-rgb), 1) 0,
      rgba(var(--base-opp-rgb), 1) 68%,
      rgba(var(--base-opp-rgb), 0) 100%
    );
    pointer-events: none;
  }
}

.mxd-menu__navigation {
  min-width: 0;
}

.mxd-menu__right {
  min-width: 0;
  overflow: visible;
}

/* Match main menu: --t-opp-* tracks light/dark menu panel */
.mxd-menu__right .menu-contact__list li a {
  color: var(--t-opp-bright);
}

.no-touch .mxd-menu__right .menu-contact__list li a:hover {
  color: var(--t-opp-medium) !important;
}

/* Long email + domain: wrap instead of clipping */
.mxd-menu__right .menu-contact a.tag {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.5;
  font-size: clamp(1.25rem, 0.35vw + 1.15rem, 1.5rem);
  font-weight: 500;
  color: inherit;
}

.mxd-menu__right .menu-contact a.tag span {
  color: inherit;
}

/* Menu footer copyright line */
.mxd-menu__data .menu-data__text {
  color: var(--t-opp-medium);
}

.mxd-menu__data .menu-data__right .menu-data__text {
  overflow: visible;
}

.mxd-menu__data .menu-data__right {
  justify-content: flex-end;
  gap: 1.2rem;
}

.mxd-menu__data .menu-data__right .menu-data__text:last-child {
  color: var(--t-opp-bright);
  font-family: var(--_font-default);
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
