/*
 * VHR sitefixes (W1). Every block is scoped by a class on <html> that inc/sitefixes.php adds only when that flag is on:
 * vhr-sf-width (vhr_blog_widthfix), vhr-sf-nav (vhr_blog_navfix), vhr-sf-contrast (vhr_blog_contrast), vhr-sf-badge (vhr_blog_badgefix).
 * Header/footer templates are not edited; rules here win through specificity + !important where the templates use !important.
 */

/* === UX-01 widthfix ================================================================================================
 * Cause: header.vhr-header.is-scrolled gets backdrop-filter, which makes the header the containing block of the
 * position:fixed #vhrMobileNav (translateX(100%)), so the closed menu lies at x = viewport..2x viewport inside the document.
 * Fix 1 (cause): the blur moves to a ::before, so the header is no longer a containing block.
 * Fix 2 (safety net): overflow-x:clip on the root (clip, not hidden: position:sticky keeps working). */
html.vhr-sf-width { overflow-x: clip; }
html.vhr-sf-width .vhr-header.is-scrolled {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html.vhr-sf-width .vhr-header.is-scrolled::before {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: -1;
  pointer-events: none;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* === UX-02 navfix: closed menu / collapsed accordion panels are really hidden (out of the Tab order) ============== */
html.vhr-sf-nav .vhr-mobile-nav { overscroll-behavior: contain; }
html.vhr-sf-nav .vhr-mobile-nav:not(.is-open) {
  visibility: hidden;
  transition: transform .35s var(--ease, cubic-bezier(.22, .61, .36, 1)), visibility 0s linear .35s;
}
html.vhr-sf-nav .vhr-mobile-nav__head:not(.is-open) + .vhr-mobile-nav__panel {
  visibility: hidden;
  transition: max-height .35s var(--ease, cubic-bezier(.22, .61, .36, 1)), visibility 0s linear .35s;
}

/* The burger is meant for <= 1120 px only, but the generic `.vhr-header button {display:flex !important}` of the template (higher
 * specificity) shows it on desktop next to the full menu (and puts a second, redundant control into the Tab order). */
html.vhr-sf-nav .vhr-header .vhr-header__toggle { display: none !important; }
@media (max-width: 1120px) {
  html.vhr-sf-nav .vhr-header .vhr-header__toggle { display: flex !important; }
}

/* === UX-03 navfix: visible keyboard focus in header and footer =================================================== */
html.vhr-sf-nav :is(.vhr-header, .vhr-mobile-nav, .vhr-footer, .elementor-location-header, .elementor-location-footer)
  :is(a[href], button, [role="button"], [tabindex="0"], input, select, textarea, summary):focus-visible {
  outline: 2px solid #00a0df !important;
  outline-offset: 3px !important;
}
/* the services list items already have an inset outline of their own (inside the white panel); only the colour changes */
html.vhr-sf-nav .vhr-header__cat-item:focus-visible { outline: 2px solid #0077a8 !important; outline-offset: -2px !important; }
/* white dropdown panels: #00a0df on white is only 3:1, use the darker brand blue there */
html.vhr-sf-nav .vhr-header__panel :is(a[href], button, [role="button"]):focus-visible { outline-color: #0077a8 !important; }
@media (forced-colors: active) {
  html.vhr-sf-nav :is(.vhr-header, .vhr-mobile-nav, .vhr-footer) :focus-visible { outline-color: Highlight !important; }
}

/* === UX-26 badgefix: hero stat chips ("15+ years" etc.) stay inside the image card on tablets ================================
 * On desktop they overlap the card edge by 22px on purpose; between 761 and 1100 px the card is next to the viewport edge and they stick out. */
@media (max-width: 1100px) {
  html.vhr-sf-badge :is(.vhr-svc-hero__chip, .vhr-loc-hero__chip, .vhr-emp-hero__chip, .vhr-hm-hero__chip, .vhr-cand-hero__stat-chip) {
    right: 12px;
    top: 14px;
    max-width: calc(100% - 24px);
  }
  html.vhr-sf-badge .vhr-cand-hero__reply-chip {
    left: 12px;
    max-width: min(250px, calc(100% - 24px));
  }
}

/* === UX-07 contrast ==================================================================================================
 * Ink #0a0d12 on cyan (#00a0df 6.6:1, hover #0086bd 4.8:1), #0077a8 (5.0:1 on white) for cyan text on light backgrounds,
 * #5d6a79 (5.5:1) for the muted grey #8793a1 (3.1:1). The brand cyan itself, the logo and imagery are not touched.
 * Several primary buttons carry an inline `style="color:#fff !important"`: an inline !important cannot be beaten from a stylesheet, so
 * -webkit-text-fill-color (paints the glyphs) + svg stroke are set here and sitefixes.js corrects the computed colour as well. */
html.vhr-sf-contrast :is(.vhr-header__btn, .vhr-mobile-nav__btn, [class*="__btn--primary"], .vhr-hm-events__btn, .vhr-loc-office__btn),
html.vhr-sf-contrast :is(.vhr-header__btn, .vhr-mobile-nav__btn, [class*="__btn--primary"], .vhr-hm-events__btn, .vhr-loc-office__btn):is(:hover, :focus-visible) {
  color: #0a0d12 !important;
  -webkit-text-fill-color: #0a0d12;
}
html.vhr-sf-contrast :is(.vhr-header__btn, .vhr-mobile-nav__btn, [class*="__btn--primary"], .vhr-hm-events__btn, .vhr-loc-office__btn) svg { stroke: #0a0d12 !important; }

/* ghost buttons / outline-on-light CTAs: darker blue text, ink on the cyan hover fill */
html.vhr-sf-contrast :is([class*="__btn--ghost"], .cta-button) { color: #0077a8 !important; -webkit-text-fill-color: #0077a8; }
html.vhr-sf-contrast :is([class*="__btn--ghost"], .cta-button):is(:hover, :focus-visible) { color: #0a0d12 !important; -webkit-text-fill-color: #0a0d12; }

/* Elementor kit buttons turn white on #1abef0 on hover (2.2:1) */
html.vhr-sf-contrast .elementor-kit-17 :is(button, input[type="button"], input[type="submit"], .elementor-button):is(:hover, :focus) { color: #0a0d12; }

/* job cards on /jobs/ (loop item 8893): title #00a0df -> #0077a8 */
html.vhr-sf-contrast .e-loop-item.elementor-8893 .elementor-heading-title { color: #0077a8 !important; }

/* muted grey text on light cards (var(--text-3) = #8793a1) */
html.vhr-sf-contrast :is(.vhr-svc-process__status, .vhr-svc-sectors__ds, .vhr-cand-process__status, .vhr-cand-sectors__ds,
  .vhr-emp-process__status, .vhr-emp-sectors__ds, .vhr-loc-sectors__ds, .vhr-loc-cities__ds, .vhr-expert-box__label,
  .vhr-expert-box__role, .vhr-form-disclaimer__inspector span) { color: #5d6a79 !important; }

/* remaining small groups found by the contrast scan (events list status chips, section numerals, price-list labels) */
html.vhr-sf-contrast .vh-status--upcoming { color: #1d7a44 !important; }
html.vhr-sf-contrast .vh-status--tba { color: #96510a !important; }
html.vhr-sf-contrast :is(.vh-panel__num, .vh-section-num) { color: #1f6fb5 !important; }
html.vhr-sf-contrast .elementor-price-list-title { color: #6b6b6b !important; }
