/* Optional high contrast uses the existing light/dark contexts and brand navy.
   It never filters the page, recolours photographs or overrides system colours. */
@media (forced-colors: none) {
  html[data-el-contrast=high],
  html[data-el-contrast=high] .el-design-system {
    --el-text-primary: #101828;
    --el-text-secondary: #101828;
    --el-text-muted: #333333;
    --el-text-brand: #00235f;
    --el-text-inverse: #ffffff;
    --el-text-inverse-muted: #ffffff;
    --el-link-default: #00235f;
    --el-link-hover: #101828;
    --el-surface-canvas: #ffffff;
    --el-surface-subtle: #ffffff;
    --el-surface-background: #ffffff;
    --el-surface-brand-subtle: #ffffff;
    --el-surface-brand: #00235f;
    --el-surface-brand-strong: #00235f;
    --el-border-default: #101828;
    --el-border-control: #101828;
    --el-border-subtle: #101828;
    --el-border-strong: #101828;
    --el-border-brand: #00235f;
    --el-border-on-dark-card: #ffffff;
    --el-icon-functional: #00235f;
    --el-icon-brand: #00235f;
    --el-icon-muted: #333333;
    --el-focus-ring: #00235f;
    --el-brand-blue-600: #00235f;
    --el-brand-blue-700: #00235f;
    --el-bg-gradient-dark-blue: linear-gradient(#0b2437, #0b2437);
    --el-process-step-dark-one: #0b2437;
    --el-process-step-dark-two: #0b2437;
    --el-process-step-dark-three: #00235f;
    --el-process-step-dark-four: #00235f;
    --el-comparison-featured-dark: #0b2437;
  }

  /* Context selectors are explicit so white forms/cards nested in navy sections
     retain navy text and controls. The palette itself stays usable on both. */
  html[data-el-contrast=high] :where(.on-dark, .el-surface-dark, .is-style-el-dark, .el-surface-gradient, .is-style-el-gradient) {
    --el-btn-border: #ffffff;
    --el-btn-focus: #ffffff;
    --el-link-on-media: #ffffff;
    --el-heading-accent-color: #ffffff;
  }
  html[data-el-contrast=high] :where(.on-light, .el-contact__card) {
    --el-btn-border: #101828;
    --el-btn-focus: #00235f;
    --el-focus-ring: #00235f;
    --el-link-on-media: #60b7dd;
    --el-heading-accent-color: #00235f;
  }
  html[data-el-contrast=high] .el-heading-accent {
    color: var(--el-heading-accent-color, #00235f) !important;
  }

  /* Keep the navigation readable while the original header sits over a photo. */
  html[data-el-contrast=high] .el-header,
  html[data-el-contrast=high] .el-topbar:not(.el-topbar--dark) {
    background: #ffffff !important;
    color: #101828;
  }
  html[data-el-contrast=high] .el-header.el-header--dark:not(.el-header--panel-open),
  html[data-el-contrast=high] .el-topbar--dark {
    background: #0b2437 !important;
    color: #ffffff;
  }
  html[data-el-contrast=high] .el-header--panel-open {
    --el-btn-primary-bg: #101828;
    --el-btn-primary-text: #ffffff;
    --el-btn-primary-hover: #00235f;
    --el-btn-primary-hover-bg: #101828;
    --el-btn-border: #101828;
  }
  html[data-el-contrast=high] .el-header--panel-open,
  html[data-el-contrast=high] :is(.el-mega, .el-mobile-menu, .el-mobile-menu__top, .el-search-panel) {
    background: #ffffff !important;
    color: #101828;
  }
  html[data-el-contrast=high] .el-topbar--dark :is(.el-topbar__contact-link, .el-topbar__faq, .el-topbar__social-link, .el-topbar__languages a) {
    color: #ffffff;
  }
  html[data-el-contrast=high] .el-topbar--dark .el-topbar__languages a[aria-current] {
    color: #101828;
  }
  html[data-el-contrast=high] .el-topbar--dark .el-topbar__languages,
  html[data-el-contrast=high] .el-topbar--dark .el-topbar__contact > * + *::before,
  html[data-el-contrast=high] .el-topbar--dark .el-topbar__utilities > * + *::before {
    border-color: #ffffff !important;
  }
  html[data-el-contrast=high] .el-site-footer {
    color: #101828;
    background: #ffffff;
  }

  /* Inputs remain opaque white even inside a dark newsletter or ebook form. */
  html[data-el-contrast=high] :where(input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=tel], input[type=number], input[type=date], select, textarea) {
    background-color: #ffffff !important;
    border-color: #101828 !important;
    color: #101828 !important;
    color-scheme: light;
  }
  html[data-el-contrast=high] :where(input, textarea)::placeholder {
    color: #333333 !important;
    opacity: 1 !important;
  }
  html[data-el-contrast=high] :is(.el-news__newsletter-field, .el-open-zone .el-news__newsletter-field, .el-header__search-field) {
    background: #ffffff !important;
    border-color: #101828 !important;
    color: #101828 !important;
  }
  html[data-el-contrast=high] .el-header__search-field-icon {
    color: #00235f !important;
  }
  html[data-el-contrast=high] .el-header__search-submit {
    --el-btn-primary-bg: #00235f;
    --el-btn-primary-text: #ffffff;
    --el-btn-primary-hover: #101828;
    --el-btn-primary-hover-bg: #00235f;
  }
  html[data-el-contrast=high] :is(.wpcf7, .el-ebook-download__form, .el-archive-filters) input[type=checkbox] {
    background: #ffffff !important;
    color: #ffffff !important;
    border-color: #101828 !important;
    box-shadow: 0 0 0 1px #ffffff;
  }
  html[data-el-contrast=high] :is(.wpcf7, .el-ebook-download__form, .el-archive-filters) input[type=checkbox]:checked,
  html[data-el-contrast=high] :is(.wpcf7, .el-ebook-download__form, .el-archive-filters) input[type=checkbox]:indeterminate {
    background: #00235f !important;
    border-color: #00235f !important;
  }
  html[data-el-contrast=high] :where(input, select, textarea)[aria-invalid=true],
  html[data-el-contrast=high] :where(input, select, textarea).wpcf7-not-valid,
  html[data-el-contrast=high] :is(.wpcf7, .el-ebook-download__form, .el-archive-filters) input[type=checkbox][aria-invalid=true] {
    border-color: var(--el-status-error-content) !important;
  }
  html[data-el-contrast=high] :is(.wpcf7-not-valid-tip, .el-field__error) {
    color: var(--el-status-error-content) !important;
  }

  /* All three CTA variants keep their shared states. Radio/checkbox selection
     remains recognisable by its native state and a strong light/dark fill. */
  html[data-el-contrast=high] .el-button--secondary {
    --el-btn-stroke: var(--el-btn-border);
  }
  html[data-el-contrast=high] .el-knowledge-archive__filter > input:checked + span {
    border-color: #00235f !important;
    background: #00235f !important;
    color: #ffffff !important;
  }
  html[data-el-contrast=high] .el-knowledge-archive__filter > input:not(:checked) + span {
    border-color: #101828 !important;
    color: #101828 !important;
    background: #ffffff !important;
  }
  html[data-el-contrast=high] .el-knowledge-archive__group--type .el-knowledge-archive__filter > input:checked + span {
    border-color: #101828 !important;
    background: #101828 !important;
    color: #ffffff !important;
  }

  /* A dual-colour focus indicator remains visible across both contexts. */
  html[data-el-contrast=high] :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid #00235f !important;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #ffffff !important;
  }
  html[data-el-contrast=high] .el-knowledge-archive__filter > input:focus-visible + span {
    outline: 3px solid #00235f !important;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #ffffff;
  }

  /* Only decorative photo layers are flattened. Content images, figures,
     library SVGs, logos and videos keep their original appearance. */
  html[data-el-contrast=high] .el-section-background {
    --el-section-background-card-8: #0b2437;
    --el-section-background-card-10: #0b2437;
    --el-section-background-card-12: #0b2437;
  }
  html[data-el-contrast=high] .el-section-background > .el-section-background__media::after {
    background: #0b2437 !important;
  }
  html[data-el-contrast=high] .el-event-hero--light {
    --el-event-photo-overlay: #ffffff;
  }
  html[data-el-contrast=high] .el-event-hero--light.el-section-background > .el-section-background__media::after {
    background: #ffffff !important;
  }
  html[data-el-contrast=high] .el-event-hero--dark {
    --el-event-photo-overlay: #0b2437;
  }
  html[data-el-contrast=high] :is(.el-case-archive__card--feature .el-case-archive__copy, .el-mega__event-content, .el-media__content, .el-article-video__bottom, .el-testimonial-case__case-copy) {
    background: #0b2437 !important;
    color: #ffffff;
    border-radius: 8px;
  }
  html[data-el-contrast=high] :is(.el-vertical-solutions__tile-label, .el-solutions-paths__gallery-tile-label) {
    background: #0b2437;
    border-radius: 8px;
    padding: 6px 8px;
  }
  html[data-el-contrast=high] .el-photo-hero :is(.el-photo-hero__title, .el-photo-hero__description, .el-photo-hero__breadcrumb) {
    background: #0b2437;
    box-shadow: 8px 0 #0b2437, -8px 0 #0b2437;
  }
  html[data-el-contrast=high] .el-photo-hero__actions {
    width: fit-content;
    max-width: 100%;
    background: #0b2437;
    border-radius: 8px;
  }
  html[data-el-contrast=high] .el-main-hero__play,
  html[data-el-contrast=high] .el-reel-glass {
    --el-play-glass-background: #0b2437;
    --el-play-glass-hover: #00235f;
  }
  html[data-el-contrast=high] .el-reel-ctl {
    background: #0b2437 !important;
    box-shadow: 0 0 0 1px #ffffff;
  }

  /* Local component variables otherwise mix pale text/borders with photos. */
  html[data-el-contrast=high] .el-event-hero__card {
    --el-event-card-text: #101828;
    --el-event-card-secondary: #101828;
    --el-event-card-accent: #00235f;
    --el-event-card-surface: #ffffff;
    --el-event-card-rule: #101828;
    --el-event-card-tile: #ffffff;
    --el-event-card-control: #101828;
    --el-event-card-track: #ffffff;
    --el-event-card-fill: #00235f;
    --el-event-counter-unit: #101828;
    background: #ffffff !important;
  }
  html[data-el-contrast=high] .el-event-hero--dark .el-event-hero__card {
    --el-event-card-text: #ffffff;
    --el-event-card-secondary: #ffffff;
    --el-event-card-accent: #ffffff;
    --el-event-card-surface: #0b2437;
    --el-event-card-rule: #ffffff;
    --el-event-card-tile: #0b2437;
    --el-event-card-control: #ffffff;
    --el-event-card-track: #0b2437;
    --el-event-card-fill: #ffffff;
    --el-event-counter-unit: #ffffff;
    background: #0b2437 !important;
  }
  html[data-el-contrast=high] .el-event-hero--dark .el-event-hero__card .el-button {
    --el-btn-border: #ffffff;
  }
  html[data-el-contrast=high] .el-agenda--dark {
    --el-agenda-secondary: #ffffff;
    --el-agenda-rule: #ffffff;
    --el-agenda-control-border: #ffffff;
    --el-agenda-card-background: #0b2437;
  }
  html[data-el-contrast=high] .el-ebook-download--dark {
    --el-ebook-copy-color: #ffffff;
    --el-ebook-card-background: #0b2437;
  }
  html[data-el-contrast=high] .el-people--dark {
    --el-people-card-background: #0b2437;
  }
  html[data-el-contrast=high] .el-project-schedule {
    --el-schedule-rule: #ffffff;
  }
  html[data-el-contrast=high] .el-feature-switcher--dark {
    --el-fsw-border: #ffffff;
    --el-fsw-card: #0b2437;
    --el-fsw-active-bg: #0b2437;
    --el-fsw-muted: #ffffff;
  }
  html[data-el-contrast=high] :is(.el-scope-grid--dark .el-scope-grid__card, .el-content-media-cards--dark .el-content-media-cards__cards > li, .el-scope-exclusions .el-scope-exclusions__card, .el-history-timeline__card, .el-case-banner .el-case-banner__client, .el-project-schedule__card, .el-open-zone__grid > li) {
    background: #0b2437 !important;
    border-color: #ffffff !important;
  }
  html[data-el-contrast=high] :is(.el-scope-grid--dark .el-scope-grid__card, .el-history-timeline__card, .el-project-schedule__card, .el-open-zone__grid > li) {
    color: #ffffff;
  }
  html[data-el-contrast=high] .el-open-zone__intro h2 span,
  html[data-el-contrast=high] .el-open-zone :is(.el-open-zone__benefits, .el-open-zone__grid) .el-library-icon {
    color: #ffffff !important;
  }
  html[data-el-contrast=high] :is(.el-history-timeline__card, .el-package-cards__card--dark, .el-scope-grid--dark .el-scope-grid__card) {
    border-color: #ffffff !important;
  }
  html[data-el-contrast=high] .el-package-cards__card--dark .el-package-cards__features .el-library-icon {
    color: #ffffff !important;
  }
  html[data-el-contrast=high] .el-package-cards__card--dark :is(.el-package-cards__features, .el-package-cards__badge) {
    border-color: #ffffff !important;
  }
  html[data-el-contrast=high] .el-stepped-process--dark .el-stepped-process__card--tone-4 {
    color: #ffffff;
    --el-stp-copy: #ffffff;
    --el-stp-icon: #ffffff;
  }
  html[data-el-contrast=high] :is(.el-ebook-download--dark .el-ebook-download__card, .el-agenda--dark .el-agenda__entry, .el-people--dark .el-people__card, .el-process-selector__effect, .el-solutions-hero__metrics > li + li) {
    border-color: #ffffff !important;
  }
}
