/* Visible keyboard focus for desktop, tablet, and mobile header controls. */
.ref-header a:focus-visible,
.ref-header button:focus-visible {
  outline: 3px solid #e5c45d;
  outline-offset: 3px;
}
.fp-questionnaire-page .ref-header {
  position: sticky;
  top: 0;
  z-index: 1001;
}

body.fp-questionnaire-page.admin-bar .ref-header {
  top: 32px;
}

@media screen and (min-width: 601px) and (max-width: 782px) {
  body.fp-questionnaire-page.admin-bar .ref-header {
    top: 46px;
  }
}

@media screen and (max-width: 600px) {
  body.fp-questionnaire-page.admin-bar .ref-header {
    top: 0;
  }
}

.fp-mobile-toggle,
.fp-mobile-panel {
  display: none;
}

@media (max-width: 1100px) {
  .ref-header {
    overflow: visible;
  }

  .ref-nav {
    display: none;
  }

  .ref-logo {
    width: min(255px, calc(100vw - 104px));
    max-height: 58px;
  }

  .fp-mobile-toggle {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid rgba(217, 180, 58, .7);
    background: rgba(5, 5, 5, .35);
    color: #e5c45d;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
  }

  .fp-mobile-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
  }

  .fp-mobile-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(6px) rotate(45deg);
  }

  .fp-mobile-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .fp-mobile-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-6px) rotate(-45deg);
  }

  .fp-mobile-panel {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    padding: 10px 18px 18px;
    flex-direction: column;
    gap: 0;
    background: rgba(5, 5, 5, .97);
    border-top: 1px solid rgba(217, 180, 58, .32);
    box-shadow: 0 16px 28px rgba(0, 0, 0, .4);
  }

  .fp-mobile-panel.is-open {
    display: flex;
  }

  .fp-mobile-panel a {
    box-sizing: border-box;
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 15px 2px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
  }

  .fp-mobile-panel a:last-child {
    border-bottom: 0;
  }

  .fp-mobile-panel a:hover {
    color: #d9ed1b;
  }

  .fp-mobile-panel a:focus-visible {
    color: #d9ed1b;
    outline: 3px solid #e5c45d;
    outline-offset: 2px;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .ref-brand {
    width: calc(100% - 64px);
  }

  .ref-logo {
    width: min(310px, 100%);
    max-height: 66px;
  }

  .fp-mobile-toggle {
    right: 22px;
  }
}

@media (max-width: 340px) {
  .ref-logo {
    width: calc(100vw - 104px);
  }
}

@media (min-width: 761px) and (max-width: 820px) {
  .ref-nav {
    margin-left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fp-mobile-toggle span {
    transition: none;
  }
}

/* Keep the sticky header below the WordPress admin toolbar on non-questionnaire pages. */
body.admin-bar .ref-header {
  top: 32px;
}

@media screen and (min-width: 601px) and (max-width: 782px) {
  body.admin-bar .ref-header {
    top: 46px;
  }
}

@media screen and (max-width: 600px) {
  body.admin-bar .ref-header {
    top: 0;
  }
}
