/* One background layer prevents the theme's inner rows from turning white instantly. */
body.has-overlay-header #masthead { position: fixed; inset: 0 0 auto; width: 100%; background: rgba(15,23,42,.12) !important; border-bottom: 1px solid rgba(255,255,255,.25); box-shadow: 0 0 0 rgba(15,23,42,0); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background-color .45s ease, border-color .45s ease, box-shadow .45s ease !important; }
body.has-overlay-header #masthead .header-main,
body.has-overlay-header #masthead .header-main-inner,
body.has-overlay-header #masthead .header--row-inner,
body.has-overlay-header #masthead .nv-navbar { background: transparent !important; }
body.has-overlay-header #masthead .site-title,
body.has-overlay-header #masthead .site-description,
body.has-overlay-header #masthead .primary-menu-ul li a { color: #fff !important; }
body.has-overlay-header #masthead .site-brand-img { width: 60px; height: 60px; background: transparent; padding: 0; border-radius: 0; }
body.has-overlay-header #header-menu-sidebar .site-brand-img { width: 48px; height: 48px; background: transparent; padding: 0; border-radius: 0; }
body.has-overlay-header #masthead .site-branding { min-width: 0; }
body.has-overlay-header #masthead .nv-title-tagline-wrap { min-width: 0; }
body.has-overlay-header #masthead .header-actions { flex-shrink: 0; }
body.has-overlay-header #masthead .site-title,
body.has-overlay-header #masthead .site-description,
body.has-overlay-header #masthead .primary-menu-ul li a,
body.has-overlay-header #masthead .primary-menu-ul li a::after,
body.has-overlay-header #masthead .language-switcher a,
body.has-overlay-header #masthead .mobile-nav-toggle,
body.has-overlay-header #masthead .icon-bar { transition: color .45s ease, background-color .45s ease, border-color .45s ease !important; }
body.has-overlay-header #masthead .primary-menu-ul li.current-menu-item a::after { background: #fff; }
body.has-overlay-header #masthead .language-switcher a { color: #fff; border-color: rgba(255,255,255,.55); }
body.has-overlay-header #masthead .language-switcher a[aria-current] { background: rgba(255,255,255,.2); }
body.has-overlay-header #masthead .mobile-nav-toggle { background: rgba(255,255,255,.15) !important; border-color: rgba(255,255,255,.6) !important; }
body.has-overlay-header #masthead .icon-bar { background: #fff !important; }
body.has-overlay-header #masthead.is-scrolled { background: #fff !important; border-bottom-color: #e2e8f0; box-shadow: 0 3px 18px rgba(15,23,42,.1); }
body.has-overlay-header #masthead.is-scrolled .site-title,
body.has-overlay-header #masthead.is-scrolled .primary-menu-ul li a { color: #1e293b !important; }
body.has-overlay-header #masthead.is-scrolled .site-description { color: #64748b !important; }
body.has-overlay-header #masthead.is-scrolled .primary-menu-ul li.current-menu-item a,
body.has-overlay-header #masthead.is-scrolled .primary-menu-ul li a:hover { color: var(--nv-primary-accent) !important; }
body.has-overlay-header #masthead.is-scrolled .primary-menu-ul li.current-menu-item a::after { background: var(--nv-primary-accent); }
body.has-overlay-header #masthead.is-scrolled .language-switcher a[aria-current] { background: var(--nv-primary-accent); color: #fff !important; }
body.has-overlay-header #masthead.is-scrolled .language-switcher a { color: #234786; border-color: #cbd5e1; }
body.has-overlay-header #masthead.is-scrolled .mobile-nav-toggle { background: #f8fafc !important; border-color: #e2e8f0 !important; }
body.has-overlay-header #masthead.is-scrolled .icon-bar { background: #1e293b !important; }

.page-cover { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; min-height: 460px; padding: 160px 24px 80px; overflow: hidden; background: #172554; }
.page-cover-image, .page-cover-shade { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.page-cover-image { object-fit: cover; object-position: center; }
.page-cover-shade { opacity: .85; background: linear-gradient(110deg,rgba(27,22,65,.86),rgba(15,35,67,.64) 55%,rgba(7,67,82,.6)); }
.page-cover-content { text-align: center; max-width: 1000px; }
.page-cover h1 { color: #fff; font-size: clamp(2rem,4.8vw,4.4rem); line-height: 1.12; font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.page-cover p { color: #f1f5f9; font-size: 1.1rem; line-height: 1.75; max-width: 760px; margin: 24px auto 0; }
body.page-about .page-cover,
body.page-services .page-cover { min-height: min(820px, 100svh); padding: 152px 24px 112px; }
body.page-about .page-cover-shade,
body.page-services .page-cover-shade { opacity: .85; background: linear-gradient(110deg,rgba(27,22,65,.85),rgba(15,35,67,.65),rgba(7,67,82,.6)); }
body.page-about .page-cover h1,
body.page-services .page-cover h1 { font-size: clamp(2.2rem,4.8vw,4.4rem); line-height: 1.2; }
body.page-about .page-cover p,
body.page-services .page-cover p { color: #fff; font-size: 1.15rem; line-height: 1.7; max-width: 960px; margin: 20px auto 0; }
body.has-overlay-header .hero-cover-section { min-height: min(820px, 100svh); background: #172554 !important; padding: 80px 24px 0; }
body.has-overlay-header .hero-bg-slide.active { opacity: 1 !important; }
body.has-overlay-header .hero-slider-bg > div { opacity: .85; background: linear-gradient(110deg,rgba(27,22,65,.85),rgba(15,35,67,.65),rgba(7,67,82,.6)) !important; }
body.has-overlay-header .hero-cover-section h1,
body.has-overlay-header .hero-cover-section p { color: #fff !important; text-align: center !important; }
body.has-overlay-header .hero-cover-section h1 { font-size: clamp(2.2rem,4.8vw,4.4rem) !important; }
body.has-overlay-header .hero-cover-section .wp-block-columns { max-width: 960px; }
body.has-overlay-header .hero-cover-section .wp-block-column:first-child { flex-basis: 100% !important; }
body.has-overlay-header .hero-cover-section .wp-block-column:empty { display: none; }
body.has-overlay-header .hero-slide-dot::after { background: rgba(255,255,255,.4); }
body.has-overlay-header .hero-slide-dot.active::after { background: #fff; }
@media (max-width: 781px) {
  .page-cover { min-height: 380px; padding: 130px 20px 56px; }
  .page-cover p { font-size: 1rem; line-height: 1.65; }
  body.page-about .page-cover,
  body.page-services .page-cover { min-height: 600px; min-height: min(740px,100svh); padding: 138px 20px 106px; }
  body.page-about .page-cover h1,
  body.page-services .page-cover h1 { font-size: clamp(1.9rem,7.5vw,2.8rem); }
  body.page-about .page-cover p,
  body.page-services .page-cover p { font-size: 1.05rem; line-height: 1.65; }
  /* Keep the mobile homepage hero at least one full screen tall. */
  body.has-overlay-header .hero-cover-section { min-height: 100vh; min-height: 100svh; padding: 90px 20px 20px; }
  body.has-overlay-header .hero-cover-section .wp-block-cover__inner-container { padding: 48px 0 86px !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.has-overlay-header #masthead,
  body.has-overlay-header #masthead:is(.is-scrolled, :not(.is-scrolled)) *,
  body.has-overlay-header #masthead:is(.is-scrolled, :not(.is-scrolled)) *::before,
  body.has-overlay-header #masthead:is(.is-scrolled, :not(.is-scrolled)) *::after { transition: none !important; }
}

/* Logo lettering follows the background; the original asset stays unchanged. */
body.has-overlay-header #masthead:not(.is-scrolled) .site-brand-img,
body.has-overlay-header #header-menu-sidebar .site-brand-img { filter: url(#logo-light-lettering); }
body.has-overlay-header #masthead.is-scrolled .site-brand-img { filter: none; }

/* Mobile navigation expands within the header, over the page background. */
@media (max-width: 1199px) {
  body.has-overlay-header.is-menu-sidebar #masthead:not(.is-scrolled) {
    background: rgba(15, 23, 42, .72) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  body.has-overlay-header #masthead #header-menu-sidebar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: calc(100svh - 110px);
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    display: none !important;
    padding: 0 24px !important;
    border-bottom: 1px solid rgba(255, 255, 255, .3);
  }
  body.has-overlay-header.is-menu-sidebar #masthead #header-menu-sidebar {
    display: flex !important;
  }
  #masthead #header-menu-sidebar > * { flex-shrink: 0; }
  #masthead .sidebar-menu-list { gap: 6px !important; }
  #masthead .sidebar-menu-list a {
    padding: 14px 16px !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 5px !important;
    font-size: 1.05rem !important;
    line-height: 1.5;
  }
  #masthead .sidebar-menu-list a:is(.active, :hover, :focus-visible) {
    color: #fff !important;
    background: rgba(255, 255, 255, .24) !important;
  }
  #masthead #header-menu-sidebar > .language-switcher { padding: 16px 16px 24px; }
  body.has-overlay-header #masthead .mobile-nav-toggle {
    border: 0 !important;
    border-radius: 0 !important;
    background: #f0ebff !important;
  }
  body.has-overlay-header #masthead .mobile-nav-toggle .icon-bar {
    background: #332080 !important;
    background-color: #332080 !important;
  }
  body.has-overlay-header.is-menu-sidebar #masthead:not(.is-scrolled) .site-title,
  body.has-overlay-header.is-menu-sidebar #masthead:not(.is-scrolled) .site-description { color: #fff !important; }
  body.has-overlay-header.is-menu-sidebar #masthead:not(.is-scrolled) .site-brand-img { filter: url(#logo-light-lettering); }
}
@media (min-width: 1200px) {
  #masthead #header-menu-sidebar { display: none !important; }
}

/* Reveal the dropdown downward, then bring in each navigation row in order. */
@keyframes mobile-menu-reveal {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}
@keyframes mobile-menu-item {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 1199px) and (prefers-reduced-motion: no-preference) {
  body.has-overlay-header.is-menu-sidebar #masthead #header-menu-sidebar {
    animation: mobile-menu-reveal 360ms ease-out both;
  }
  body.is-menu-sidebar #masthead .sidebar-menu-list li {
    animation: mobile-menu-item 280ms ease-out both;
  }
  body.is-menu-sidebar #masthead .sidebar-menu-list li:nth-child(2) { animation-delay: 45ms; }
  body.is-menu-sidebar #masthead .sidebar-menu-list li:nth-child(3) { animation-delay: 90ms; }
  body.is-menu-sidebar #masthead .sidebar-menu-list li:nth-child(4) { animation-delay: 135ms; }
  body.is-menu-sidebar #masthead .sidebar-menu-list li:nth-child(5) { animation-delay: 180ms; }
  body.is-menu-sidebar #masthead .sidebar-menu-list li:nth-child(6) { animation-delay: 225ms; }
}

@keyframes mobile-menu-close {
  from { max-height: var(--mobile-menu-height); clip-path: inset(0); }
  to { max-height: 0; clip-path: inset(0 0 100% 0); }
}
@media (max-width: 1199px) and (prefers-reduced-motion: no-preference) {
  body.has-overlay-header.is-menu-closing #masthead #header-menu-sidebar {
    animation: mobile-menu-close 280ms ease-in-out both;
    overflow: hidden !important;
    pointer-events: none !important;
    border-bottom: 0;
  }
}

/* Desktop and tablet heroes fill the first screen, including the overlay header. */
@media (min-width: 600px) {
  body.has-overlay-header .hero-cover-section,
  body.page-about .page-cover,
  body.page-services .page-cover {
    min-height: 100vh;
    min-height: 100svh;
  }
}

/* The dropdown follows the white header after leaving the hero. */
body.has-overlay-header #masthead.is-scrolled .sidebar-menu-list a { color: #1e293b !important; }
body.has-overlay-header #masthead.is-scrolled .sidebar-menu-list a:is(.active, :hover, :focus-visible) {
  color: var(--nv-primary-accent, #2f5aae) !important;
  background: #eff6ff !important;
}
body.has-overlay-header #masthead.is-scrolled #header-menu-sidebar { border-bottom-color: #e2e8f0; }
