/**
 * Detector Checker — Evidence Lab shell V4
 *
 * Global, presentation-only layer for the shared header, footer, search,
 * keyboard focus and back-to-top control. Load after the existing V2 assets.
 * This file intentionally does not target detector forms or result content.
 */

:root {
  --dc-shell-canvas: #f5f7f6;
  --dc-shell-surface: #ffffff;
  --dc-shell-ink: #13232b;
  --dc-shell-muted: #52636c;
  --dc-shell-border: #d6e0dd;
  --dc-shell-primary: #0d766e;
  --dc-shell-primary-hover: #095f59;
  --dc-shell-primary-soft: #e2f2ef;
  --dc-shell-footer: #102630;
  --dc-shell-footer-muted: #aebdc3;
  --dc-shell-footer-link: #e3ecea;
  --dc-shell-focus: #0b6f68;
  --dc-shell-focus-dark: #79e4d7;
  --dc-shell-max: 1240px;
  --dc-shell-gutter: 24px;
  --dc-shell-radius: 10px;
  --dc-shell-shadow: 0 12px 34px rgb(19 35 43 / 0.10);
}

/* Shared 1240px alignment */
#dc-header .dc-header__inner,
.dc-footer .dc-footer__main,
.dc-footer .dc-footer__bottom {
  width: min(calc(100% - (var(--dc-shell-gutter) * 2)), var(--dc-shell-max));
  max-width: none;
  margin-inline: auto;
}

/* Keyboard focus: visible, consistent and independent of brand-state colour. */
:where(
  #dc-header,
  .dc-footer,
  .dc-search-modal,
  .dc-global-cta,
  #main-content
) :where(a, button, input, textarea, select, summary, [tabindex]):focus,
:where(
  #dc-header,
  .dc-footer,
  .dc-search-modal,
  .dc-global-cta,
  #main-content
) :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible,
.dc-back-to-top:focus,
.dc-back-to-top:focus-visible {
  outline: 3px solid var(--dc-shell-focus) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px var(--dc-shell-surface) !important;
}

.dc-footer :where(a, button, input, summary, [tabindex]):focus,
.dc-footer :where(a, button, input, summary, [tabindex]):focus-visible {
  outline-color: var(--dc-shell-focus-dark) !important;
  box-shadow: 0 0 0 2px var(--dc-shell-footer) !important;
}

/* The older internal-page baseline sets a blue focus ring with !important.
 * Outrank it explicitly so the unified teal identity is real, not dependent
 * on which page-specific stylesheet happens to load last. */
html body.wp-theme-detector-checker :where(a, button, input, textarea, select, summary, [tabindex]):focus,
html body.wp-theme-detector-checker :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--dc-shell-focus) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 2px var(--dc-shell-surface) !important;
}

html body.wp-theme-detector-checker :where(
  .dc-footer,
  .dc-bm-v4__hero,
  .dc-ir-v3__section--dark,
  aside.dc-cta
) :where(a, button, input, textarea, select, summary, [tabindex]):focus,
html body.wp-theme-detector-checker :where(
  .dc-footer,
  .dc-bm-v4__hero,
  .dc-ir-v3__section--dark,
  aside.dc-cta
) :where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline-color: var(--dc-shell-focus-dark) !important;
  box-shadow: 0 0 0 2px var(--dc-shell-footer) !important;
}

.dc-skip-link:focus {
  z-index: 100000;
  inset: 12px auto auto 12px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  clip: auto;
  clip-path: none;
  border: 1px solid var(--dc-shell-primary);
  border-radius: 8px;
  background: var(--dc-shell-surface);
  color: var(--dc-shell-primary-hover);
  font-weight: 700;
}

/* Header */
:where(#dc-header, .dc-header--landing) {
  min-height: 72px;
  border-bottom: 1px solid var(--dc-shell-border);
  background: rgb(248 250 249 / 0.96);
  color: var(--dc-shell-ink);
  box-shadow: 0 1px 0 rgb(19 35 43 / 0.02);
  backdrop-filter: saturate(135%) blur(12px);
}

#dc-header.scrolled {
  box-shadow: var(--dc-shell-shadow);
}

#dc-header .dc-header__inner {
  min-width: 0;
  height: 72px;
  padding: 0;
  gap: 18px;
}

#dc-header .dc-logo,
.dc-footer .dc-logo {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

:where(#dc-header, .dc-footer) .dc-logo__mark {
  flex: 0 0 auto;
  border-radius: 11px;
  box-shadow: 0 1px 2px rgb(19 35 43 / 0.14);
}

:where(#dc-header, .dc-footer) .dc-logo__mark rect {
  fill: var(--dc-shell-primary);
}

:where(#dc-header, .dc-footer) .dc-logo__text {
  min-width: 0;
  color: inherit;
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

#dc-header .dc-logo__text,
#dc-header .dc-logo__text span {
  color: var(--dc-shell-ink);
}

#dc-header .dc-nav {
  min-width: 0;
}

#dc-header .dc-nav .menu {
  align-items: center;
  gap: 2px;
}

#dc-header .dc-nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--dc-shell-muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

#dc-header .dc-nav a:hover,
#dc-header .dc-nav .current-menu-item > a,
#dc-header .dc-nav a[aria-current="page"],
#dc-header .dc-nav a[aria-current="location"],
#dc-header .dc-nav .dc-current-section > a {
  background: var(--dc-shell-primary-soft);
  color: var(--dc-shell-primary-hover);
}

/* The theme's legacy active item draws a purple gradient underline. The
 * shell already uses a high-contrast teal pill, so remove the duplicate mark. */
#dc-header .dc-nav .current-menu-item > a::after,
#dc-header .dc-nav a[aria-current="page"]::after,
#dc-header .dc-nav a[aria-current="location"]::after,
#dc-header .dc-nav .dc-current-section > a::after {
  content: none !important;
  display: none !important;
  background: none !important;
}

#dc-header .dc-header__cta {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: 18px;
  border: 1px solid var(--dc-shell-primary);
  border-radius: var(--dc-shell-radius);
  background: var(--dc-shell-primary);
  color: #ffffff;
  box-shadow: 0 2px 5px rgb(13 118 110 / 0.18);
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease,
    box-shadow 160ms ease;
}

#dc-header .dc-header__cta:hover {
  border-color: var(--dc-shell-primary-hover);
  background: var(--dc-shell-primary-hover);
  color: #ffffff;
  box-shadow: 0 4px 10px rgb(9 95 89 / 0.20);
}

#dc-header :where(.dc-menu-toggle, .dc-header__search) {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--dc-shell-border);
  border-radius: var(--dc-shell-radius);
  background: var(--dc-shell-surface);
  color: var(--dc-shell-ink);
  box-shadow: none;
}

#dc-header :where(.dc-menu-toggle, .dc-header__search):hover {
  border-color: #9fb3ae;
  background: var(--dc-shell-primary-soft);
  color: var(--dc-shell-primary-hover);
}

#dc-header .dc-menu-toggle span {
  background: currentColor;
}

#dc-header .dc-nav__mobile-actions {
  display: none;
}

/* Search dialog belongs to the shared shell. */
.dc-search-modal__content {
  width: min(calc(100% - 32px), 720px);
  border: 1px solid var(--dc-shell-border);
  border-radius: 18px;
  background: var(--dc-shell-surface);
  color: var(--dc-shell-ink);
  box-shadow: 0 24px 70px rgb(19 35 43 / 0.22);
}

.dc-search-modal__input-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-color: var(--dc-shell-border);
  border-radius: 12px;
  background: var(--dc-shell-surface);
}

.dc-search-modal__close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  flex: 0 0 44px;
  display: inline-grid;
  place-items: center;
  margin-inline-start: auto;
  padding: 0;
  border: 1px solid var(--dc-shell-border);
  border-radius: 10px;
  background: var(--dc-shell-surface);
  color: var(--dc-shell-ink);
  cursor: pointer;
}

.dc-search-modal__close:hover {
  border-color: var(--dc-shell-primary);
  background: var(--dc-shell-primary-soft);
  color: var(--dc-shell-primary-hover);
}

.dc-search-modal__close svg {
  pointer-events: none;
}

.dc-search-modal__input {
  color: var(--dc-shell-ink);
  font-size: 16px;
}

.dc-search-modal__input::placeholder {
  color: #718087;
  opacity: 1;
}

.dc-search-modal__tag {
  min-height: 40px;
  border-color: var(--dc-shell-border);
  border-radius: 999px;
  background: var(--dc-shell-surface);
  color: var(--dc-shell-primary-hover);
}

.dc-search-modal__tag:hover {
  border-color: var(--dc-shell-primary);
  background: var(--dc-shell-primary-soft);
}

/* Footer */
.dc-footer {
  border-top: 0;
  background: var(--dc-shell-footer);
  color: var(--dc-shell-footer-muted);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.dc-footer .dc-footer__main {
  display: grid;
  grid-template-columns:
    minmax(260px, 1.35fr)
    minmax(150px, 1fr)
    minmax(190px, 1.2fr)
    minmax(125px, 0.82fr)
    minmax(145px, 0.95fr);
  gap: 32px;
  padding: 64px 0 46px;
}

.dc-footer .dc-footer__brand {
  max-width: 320px;
}

.dc-footer .dc-logo {
  margin-bottom: 18px;
  color: #ffffff;
}

.dc-footer :where(.dc-logo__text, .dc-logo__text span) {
  color: #ffffff;
}

.dc-footer .dc-footer__brand p {
  max-width: 34ch;
  margin: 0;
  color: var(--dc-shell-footer-muted);
  font-size: 14px;
  line-height: 1.65;
}

.dc-footer .dc-footer__col {
  min-width: 0;
}

.dc-footer .widget-title {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.dc-footer .dc-footer__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: left;
  text-transform: inherit;
  pointer-events: none;
}

.dc-footer .dc-footer__toggle-icon {
  display: none;
}

.dc-footer :where(.menu, .menu li) {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dc-footer .menu {
  display: grid;
  gap: 4px;
}

.dc-footer a,
html body .dc-footer :where(.widget_nav_menu a, .dc-footer__col a) {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  color: var(--dc-shell-footer-link);
  font-size: 14px;
  line-height: 1.45;
  text-decoration: none;
  text-decoration-color: rgb(121 228 215 / 0.55);
  text-underline-offset: 4px;
}

.dc-footer a:hover,
html body .dc-footer :where(.widget_nav_menu a, .dc-footer__col a):hover {
  color: var(--dc-shell-focus-dark);
  text-decoration: underline;
}

.dc-footer .dc-footer__bottom {
  min-height: 68px;
  display: flex;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid rgb(255 255 255 / 0.12);
  color: var(--dc-shell-footer-muted);
}

.dc-footer .dc-footer__bottom p {
  margin: 0;
  color: inherit;
  font-size: 13px;
  line-height: 1.5;
}

/*
 * The detector skin applies an !important light footer on some internal page
 * templates. Keep the shared brand shell consistent without changing any
 * page content or template structure.
 */
html body.wp-theme-detector-checker footer.dc-footer.dc-footer {
  border-top: 0 !important;
  background: var(--dc-shell-footer) !important;
  color: var(--dc-shell-footer-muted) !important;
}

html body.wp-theme-detector-checker footer.dc-footer.dc-footer .dc-logo,
html body.wp-theme-detector-checker footer.dc-footer.dc-footer :where(.dc-logo__text, .dc-logo__text span, .widget-title) {
  color: #ffffff !important;
}

/* Page-specific polish layers color the title's injected label span. Keep the
 * footer taxonomy neutral and consistent on every template. */
html body.wp-theme-detector-checker footer.dc-footer.dc-footer .widget-title > span:first-child,
html body.wp-theme-detector-checker footer.dc-footer.dc-footer .dc-footer__toggle > span:first-child {
  color: #ffffff !important;
}

html body.wp-theme-detector-checker footer.dc-footer.dc-footer .dc-footer__brand p,
html body.wp-theme-detector-checker footer.dc-footer.dc-footer .dc-footer__bottom,
html body.wp-theme-detector-checker footer.dc-footer.dc-footer .dc-footer__bottom p {
  color: var(--dc-shell-footer-muted) !important;
}

html body.wp-theme-detector-checker footer.dc-footer.dc-footer a,
html body.wp-theme-detector-checker footer.dc-footer.dc-footer :where(.widget_nav_menu a, .dc-footer__col a),
html body.wp-theme-detector-checker footer.dc-footer.dc-footer a:visited {
  color: var(--dc-shell-footer-link) !important;
}

html body.wp-theme-detector-checker footer.dc-footer.dc-footer a:hover,
html body.wp-theme-detector-checker footer.dc-footer.dc-footer a:focus-visible {
  color: var(--dc-shell-focus-dark) !important;
}

html body.wp-theme-detector-checker footer.dc-footer.dc-footer .dc-footer__bottom {
  border-top-color: rgb(255 255 255 / 0.12) !important;
}

/* Shared closing action on internal pages: keep it aligned with the shell and
 * prevent legacy gradient text from losing contrast on the dark surface. */
html body:not(.home).wp-theme-detector-checker > aside.dc-cta {
  width: min(calc(100% - (var(--dc-shell-gutter) * 2)), var(--dc-shell-max));
  max-width: none;
  margin: 0 auto !important;
  border-radius: 22px;
}

html body:not(.home).wp-theme-detector-checker > aside.dc-cta .dc-gradient-text {
  background: none !important;
  color: var(--dc-shell-focus-dark) !important;
  -webkit-text-fill-color: currentColor !important;
}

/* Back to top */
.dc-back-to-top {
  width: 46px;
  height: 46px;
  border: 1px solid rgb(255 255 255 / 0.34);
  border-radius: 50%;
  background: var(--dc-shell-primary);
  color: #ffffff;
  box-shadow: 0 10px 28px rgb(19 35 43 / 0.24);
  transition: background-color 160ms ease, box-shadow 160ms ease,
    transform 160ms ease;
}

.dc-back-to-top:hover {
  background: var(--dc-shell-primary-hover);
  color: #ffffff;
  box-shadow: 0 13px 32px rgb(19 35 43 / 0.30);
  transform: translateY(-2px);
}

@media (max-width: 1100px) {
  .dc-footer .dc-footer__main {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 34px 28px;
  }

  .dc-footer .dc-footer__brand {
    grid-column: 1 / -1;
    max-width: 560px;
  }

  #dc-header .dc-header__inner {
    gap: 14px;
  }
}

@media (max-width: 1024px) {
  #dc-header .dc-logo {
    order: 1;
    margin-right: auto;
  }

  #dc-header .dc-header__cta {
    order: 2;
  }

  #dc-header .dc-header__search {
    order: 3;
  }

  #dc-header .dc-menu-toggle {
    order: 4;
    margin-left: 0;
  }

  #dc-header .dc-nav {
    width: min(360px, calc(100vw - 24px));
    max-width: none;
    border-left: 1px solid var(--dc-shell-border);
    background: var(--dc-shell-surface);
    color: var(--dc-shell-ink);
    box-shadow: -20px 0 54px rgb(19 35 43 / 0.18);
  }

  #dc-header .dc-nav .menu {
    width: 100%;
    align-items: stretch;
  }

  #dc-header .dc-nav a {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    white-space: normal;
  }

  #dc-header .dc-nav-backdrop {
    background: rgb(19 35 43 / 0.54);
    backdrop-filter: blur(2px);
  }
}

@media (max-width: 900px) {
  .dc-footer .dc-footer__main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dc-footer .dc-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  :root {
    --dc-shell-gutter: 16px;
  }

  :where(#dc-header, .dc-header--landing),
  #dc-header .dc-header__inner {
    min-height: 64px;
  }

  #dc-header .dc-header__inner {
    height: 64px;
    gap: 12px;
  }

  #dc-header .dc-logo {
    max-width: calc(100% - 56px);
    overflow: hidden;
  }

  #dc-header .dc-logo__text {
    overflow: hidden;
    font-size: 1rem;
    text-overflow: ellipsis;
  }

  #dc-header .dc-menu-toggle {
    order: 3;
    flex: 0 0 44px;
    margin-left: auto;
    padding: 0;
  }

  #dc-header .dc-nav {
    height: 100dvh;
    padding: 76px 20px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #dc-header .dc-nav__mobile-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 18px;
    padding: 18px 0 0;
    border-top: 1px solid var(--dc-shell-border);
  }

  #dc-header .dc-nav__mobile-actions :where(a, button) {
    width: 100%;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 14px;
    border-radius: var(--dc-shell-radius);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
  }

  #dc-header .dc-nav__mobile-cta,
  #dc-header .dc-nav__mobile-cta:visited {
    border: 1px solid var(--dc-shell-primary);
    background: var(--dc-shell-primary);
    color: #fff;
  }

  #dc-header .dc-nav__mobile-search {
    border: 1px solid var(--dc-shell-border);
    background: var(--dc-shell-surface);
    color: var(--dc-shell-primary-hover);
    cursor: pointer;
  }

  .dc-footer .dc-footer__main {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 40px 0 28px;
  }

  .dc-footer .dc-footer__brand {
    grid-column: 1;
    max-width: none;
    margin-bottom: 12px;
    padding-bottom: 26px;
    border-bottom: 1px solid rgb(255 255 255 / 0.12);
  }

  .dc-footer .dc-footer__col {
    border-bottom: 1px solid rgb(255 255 255 / 0.12);
  }

  .dc-footer .widget-title {
    margin: 0;
  }

  .dc-footer .dc-footer__toggle {
    min-height: 50px;
    padding: 0 2px;
    color: #ffffff;
    cursor: pointer;
    pointer-events: auto;
  }

  .dc-footer .dc-footer__toggle-icon {
    position: relative;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: block;
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 50%;
  }

  .dc-footer .dc-footer__toggle-icon::before,
  .dc-footer .dc-footer__toggle-icon::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 9px;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
    transform: translate(-50%, -50%);
    transition: opacity 160ms ease, transform 160ms ease;
  }

  .dc-footer .dc-footer__toggle-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
  }

  .dc-footer .dc-footer__toggle[aria-expanded="true"] .dc-footer__toggle-icon::after {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg);
  }

  .dc-footer .widget-title + div:not([hidden]) {
    padding-bottom: 14px;
  }

  .dc-footer .menu {
    gap: 0;
  }

  .dc-footer a,
  html body .dc-footer :where(.widget_nav_menu a, .dc-footer__col a) {
    min-height: 44px;
  }

  .dc-footer .widget-title,
  .dc-footer a,
  html body .dc-footer :where(.widget_nav_menu a, .dc-footer__col a) {
    font-size: 13px;
  }

  .dc-footer .dc-footer__bottom {
    min-height: 62px;
  }

  .dc-back-to-top {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 420px) {
  .dc-search-modal__content {
    width: calc(100% - 24px);
  }

  .dc-search-modal__input-wrap {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .dc-search-modal__input {
    width: 100%;
    min-width: 0;
    padding-inline: 0;
  }

  .dc-search-modal__kbd {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #dc-header .dc-nav a,
  #dc-header .dc-header__cta,
  .dc-back-to-top {
    transition: none;
  }

  .dc-back-to-top:hover {
    transform: none;
  }
}

@media print {
  #dc-header,
  .dc-footer,
  .dc-back-to-top,
  .dc-search-modal {
    display: none !important;
  }
}
