/* The Menu pill and its panel, as on the home page (america.gov's menu, measure for
   measure). Built from the home page's design file; change it there. */
.menu-trigger-wrap, #menu-portal {
    --ink: #000c1f;
    --ink-65: #000c1fa6;
    --navy: #a30b3f;        /* the campaign red, more vivid on wide-gamut screens (end of file) */
    --navy-hover: #680126;
    --on-navy: #ffffff;
    --tint-5: #a30b3f0d;
    --tint-10: #a30b3f1a;
    --hairline: #000c1f0d;
    --ring-3: #000c1f08;
    --paper: #ffffff;
    --note: #fafafa;
    --wash-1: #fafafa;
    --wash-2: #ececec;
    --surface: #f7f7f7;
    --focus: #0c0c0c;
    --scrim: rgba(0, 0, 0, 0.2);
    --ink-80: #000c1fcc;
    --ink-45: #000c1f73;
    --ink-30: #000c1f4d;
    --border: #000c1f1a;
    --border-strong: #000c1f33;
    --blue: var(--navy);
    --shadow-soft: 0 10px 40px rgba(1, 14, 36, 0.08);
    --shadow-panel: 0 0 0 1px var(--hairline), 2px 11px 24px #0000001a, 8px 42px 43px #00000017, 18px 95px 58px #0000000d;
    --font-display: "Sohne VF", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-body: "Tiempos Text", Georgia, serif;
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --scale-press: 0.98;
    --panel-radius: 40px;
    color-scheme: light;
}

#menu-portal .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- Menu trigger ---------- */

.menu-trigger-wrap {
  position: relative;
  display: inline-flex;
  justify-self: end;
}

.menu-pill-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.menu-trigger-fade {
  position: relative;
  display: flex;
}

.menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px 1px;
  border: 0;
  border-radius: 40px;
  background: var(--navy);
  color: var(--on-navy);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 436;
  line-height: 1;
  letter-spacing: -0.01em;
  cursor: pointer;
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  transition:
    color 0.2s var(--ease-out-quint),
    background-color 0.2s var(--ease-out-quint),
    box-shadow 0.2s var(--ease-out-quint),
    scale 0.2s var(--ease-out-quint),
    opacity 0.2s var(--ease-out-quint);
}

.menu-trigger:hover { background: var(--navy-hover); }
.menu-trigger:active { background: var(--navy); scale: var(--scale-press); }

.menu-trigger:focus-visible,
.menu-close:focus-visible,
.menu-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--focus);
}

/* ---------- Menu panel ---------- */

.menu-backdrop {
  position: fixed;
  top: -4rem;
  right: 0;
  bottom: -8rem;
  left: 0;
  z-index: 50;
  background: var(--scrim);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.menu-panel {
  position: fixed;
  top: var(--menu-panel-top, 1rem);
  right: 1rem;
  left: 1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - var(--menu-panel-top, 1rem) - 1rem);
  color: var(--ink);
  outline: none;
}

.menu-panel-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--panel-radius);
  background: var(--paper);
  box-shadow: var(--shadow-panel);
}

.menu-panel-scroll {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-height: inherit;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--panel-radius);
}

.menu-close-row {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-end;
}

.menu-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: var(--menu-close-offset, 0px);
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: var(--tint-5);
  color: var(--ink);
  cursor: pointer;
  -webkit-backdrop-filter: blur(25px);
  backdrop-filter: blur(25px);
  transition:
    color 0.2s var(--ease-out-quint),
    background-color 0.2s var(--ease-out-quint),
    box-shadow 0.2s var(--ease-out-quint),
    scale 0.2s var(--ease-out-quint),
    opacity 0.2s var(--ease-out-quint);
}

.menu-close:hover { background: var(--tint-10); }
.menu-close:active { background: var(--tint-5); scale: var(--scale-press); }

.menu-body {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 56px;
  /* Room under the links: 72px to the panel's edge on phones, 80px on wider screens. */
  padding-bottom: 48px;
}

.menu-body nav {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.menu-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-links li { max-width: 100%; }

.menu-link {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  text-decoration-thickness: from-font;
  text-underline-position: from-font;
  white-space: normal;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  line-height: 2.5rem;
  letter-spacing: -0.025em;
}

.menu-link:hover,
.menu-link:focus-visible,
.menu-link[aria-current="page"] { text-decoration-line: underline; }

button.menu-link:focus-visible { background: var(--tint-5); }

@media (min-width: 768px) {
  .menu-panel {
    /* The same distance outside the Menu button as on america.gov (the × lands 36px in from
       the panel's corner), now that the button sits further in from the edge. */
    left: auto;
    right: 58px;
    width: min(435px, calc(100% - 116px));
    max-height: calc(100dvh - var(--menu-panel-top, 2rem) - 2rem);
  }
  .menu-panel-scroll { padding: 40px; }
  .menu-body { padding-bottom: 40px; }
  .menu-close { width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-trigger, .menu-close { transition: none; }
  .menu-close:active { scale: 1; }
}

@media (color-gamut: p3) {
  .menu-trigger-wrap, #menu-portal { --navy: color(display-p3 0.614 0.017 0.236); --navy-hover: color(display-p3 0.387 0.005 0.143); }
}
