/*
 * pnsite header: the Contact Me button and the mobile side menu (below 1280px, where #navbar becomes a slide-in panel).
 * Loaded after the theme stylesheet. --menu-accent is set inline from the active theme (same colour as .btn-theme).
 */

/* Contact Me button */
.header .header-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  background: #fff;
  color: #1f252a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.header .header-contact:hover,
.header .header-contact:focus {
  color: #1f252a;
  text-decoration: none;
  transform: translateY(-1px);
  background: #f5f7fa;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
}

/* Email icon in the theme accent colour */
.header .header-contact svg {
  flex-shrink: 0;
  color: var(--menu-accent, #113dfa);
}

@media (max-width: 400px) {
  .header .header-contact {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }
}

/* Open / close buttons in the header */
.header .mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  line-height: 0;
  cursor: pointer;
}

/* Extra menu parts and icons only exist in the mobile panel */
.navbar .mnav-head,
.navbar .mnav-cta,
.navbar .mnav-icon {
  display: none;
}

@media (max-width: 1279px) {
  .header .mobile-nav-show {
    display: inline-flex;
    width: 40px;
    height: 40px;
    margin-left: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s;
  }

  .header .mobile-nav-show:hover {
    background: rgba(255, 255, 255, 0.18);
  }

  .header .mobile-nav-hide {
    display: inline-flex;
    position: fixed;
    top: 20px;
    right: 18px;
    z-index: 10000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f3f6;
    color: #1f252a;
  }

  .header .mobile-nav-hide.d-none {
    display: none;
  }

  /* Panel */
  .header .navbar {
    width: 86%;
    max-width: 360px;
    border-left: 0;
  }

  .mobile-nav-active .navbar:before {
    background: rgba(15, 20, 25, 0.55);
  }

  .header .navbar ul {
    display: flex;
    flex-direction: column;
    padding: 0 0 24px;
    background: #fff;
    border-radius: 24px 0 0 24px;
    box-shadow: -12px 0 40px rgba(15, 20, 25, 0.18);
  }

  /* Panel header */
  .navbar .mnav-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 28px 72px 20px 24px;
    border-bottom: 1px solid #eef0f3;
    margin-bottom: 8px;
  }

  .navbar .mnav-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f252a;
    line-height: 1.3;
  }

  .navbar .mnav-subtitle {
    font-size: 13px;
    color: #8a929b;
  }

  /* Menu items */
  .header .navbar > ul > li:not(.mnav-head):not(.mnav-cta) {
    padding: 0 12px;
  }

  /* ".header .navbar > ul > li > a" matches custom.css, which otherwise forces display:block and a 200px max width */
  .header .navbar a,
  .header .navbar a:focus,
  .header .navbar > ul > li > a {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: none;
    overflow: visible;
    justify-content: flex-start;
    gap: 14px;
    min-height: 52px;
    padding: 8px 12px;
    border-radius: 14px;
    color: #1f252a;
    font-size: 16px;
    font-weight: 500;
    white-space: normal;
  }

  .header .navbar > ul > li > a:not(.mnav-cta-primary):not(.mnav-cta-secondary)::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-top: 1.8px solid #b7bec6;
    border-right: 1.8px solid #b7bec6;
    transform: rotate(45deg);
    flex-shrink: 0;
  }

  .header .navbar a:hover,
  .header .navbar li:hover > a {
    color: #1f252a;
    opacity: 1;
    background: #f5f7fa;
  }

  .navbar .mnav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    color: var(--menu-accent, #113dfa);
    background: color-mix(in srgb, var(--menu-accent, #113dfa) 10%, #fff);
  }

  .header .navbar .active,
  .header .navbar .active:focus,
  .header .navbar a.active {
    color: var(--menu-accent, #113dfa);
    font-weight: 600;
    background: color-mix(in srgb, var(--menu-accent, #113dfa) 8%, #fff);
  }

  .header .navbar a.active .mnav-icon {
    color: #fff;
    background: var(--menu-accent, #113dfa);
  }

  /* Contact block at the bottom */
  .navbar .mnav-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding: 20px 24px 0;
  }

  .header .navbar .mnav-cta a,
  .header .navbar > ul > li.mnav-cta > a {
    display: flex;
    align-items: center;
    text-align: center;
    justify-content: center;
    min-height: 48px;
    border-radius: 14px;
    font-weight: 600;
  }

  .header .navbar .mnav-cta .mnav-cta-primary {
    color: #fff;
    background: var(--menu-accent, #113dfa);
  }

  .header .navbar .mnav-cta .mnav-cta-primary:hover {
    color: #fff;
    background: var(--menu-accent, #113dfa);
    filter: brightness(1.08);
  }

  .header .navbar .mnav-cta .mnav-cta-secondary {
    color: #1f252a;
    background: #f1f3f6;
  }
}
