/* Appearance only: brand colors, photographs and third-party embeds stay intact. */
html { color-scheme: light; }
.site-header__controls { display: flex; align-items: center; gap: .65rem; order: 2; }
.site-header .primary-navigation { margin-left: auto; }
.site-header__inner { gap: 1.25rem; }
.primary-navigation, .primary-navigation__list { gap: 1.1rem; }
.theme-toggle {
  display: inline-grid; place-items: center; flex: 0 0 44px;
  width: 44px; height: 44px; padding: 0;
  color: var(--jci-navy); background: transparent;
  border: 1px solid var(--jci-line); border-radius: 50%; cursor: pointer;
}
.theme-toggle:hover { background: var(--jci-sky); }
.theme-toggle[hidden], .theme-system[hidden], .site-brand__logo--night,
.theme-toggle__sun { display: none; }
.theme-toggle svg { width: 22px; height: 22px; }
.theme-system { padding: .4rem 0; min-height: 44px; border: 0; background: none; color: #c7dde7; font: inherit; font-size: .82rem; text-decoration: underline; cursor: pointer; }

html[data-jci-theme="dark"] {
  color-scheme: dark;
  --jci-ink: #e5eef6;
  --jci-muted: #b0c2d2;
  --jci-line: #30465a;
  --jci-sky: #192f43;
  --jci-shadow: 0 1.25rem 3.5rem rgba(0, 0, 0, .24);
  --jci-night-bg: #0b1726;
  --jci-night-card: #122437;
  --jci-night-heading: #f1f6fb;
  --jci-night-link: #74d4ff;
}
html[data-jci-theme="dark"] body { color: var(--jci-ink); background: var(--jci-night-bg); }
html[data-jci-theme="dark"] :is(h1, h2, h3, h4) { color: var(--jci-night-heading); }
html[data-jci-theme="dark"] a { color: var(--jci-night-link); }
html[data-jci-theme="dark"] a:hover { color: #c1edff; }
html[data-jci-theme="dark"] .site-header { background: rgba(11, 23, 38, .97); border-color: var(--jci-line); }
html[data-jci-theme="dark"] .site-brand > .site-brand__logo:not(.site-brand__logo--night) { display: none; }
html[data-jci-theme="dark"] .site-brand__logo--night { display: block; }
/* An administrator-supplied logo retains a neutral backing instead of being recolored. */
html[data-jci-theme="dark"] .site-brand .custom-logo { background: #fff; border-radius: .35rem; padding: .2rem; }
html[data-jci-theme="dark"] .primary-navigation a { color: var(--jci-ink); }
html[data-jci-theme="dark"] .primary-navigation a:hover { color: var(--jci-night-link); }
html[data-jci-theme="dark"] :is(.theme-toggle, .nav-toggle) { color: var(--jci-night-heading); background: var(--jci-night-card); }
html[data-jci-theme="dark"] .theme-toggle__moon { display: none; }
html[data-jci-theme="dark"] .theme-toggle__sun { display: block; }
html[data-jci-theme="dark"] .jci-section--tint { background: linear-gradient(150deg, #101f30, #13293d); }
html[data-jci-theme="dark"] :is(.wp-block-column.is-style-jci-card, .jci-card, .jci-form, .jci-opportunity, .jci-program-card:not(.jci-program-card--blue), .jci-values-grid article, .jci-benefit-grid article, .jci-action-steps--light li, .jci-faq details, .jci-video-card, .jci-events-month, .jci-event-card, .jci-event-past, .jci-story-photo figcaption, .jci-newsletter-message) {
  background: var(--jci-night-card); border-color: var(--jci-line);
}
html[data-jci-theme="dark"] :is(.jci-kicker, .page-hero h1, .jci-opportunity span, .jci-action-steps--light span, .jci-events-month__header span) { color: var(--jci-night-link); }
html[data-jci-theme="dark"] :is(.jci-faq summary, .jci-callout, .jci-event-date, .jci-form label, .jci-newsletter-message) { color: var(--jci-night-heading); }
html[data-jci-theme="dark"] .jci-event-type { color: var(--jci-night-link); }
html[data-jci-theme="dark"] .jci-event-variant { color: var(--jci-ink); background: #233a50; }
html[data-jci-theme="dark"] :is(.jci-event-dot--mastermind) { background: #b7c8ff; }
html[data-jci-theme="dark"] .jci-event-card--mastermind { border-left-color: #b7c8ff; }
html[data-jci-theme="dark"] .jci-event-card.is-past { opacity: 1; }
html[data-jci-theme="dark"] .jci-logo-grid > div { background: #fff; }
html[data-jci-theme="dark"] :is(.jci-form input, .jci-form textarea, .jci-form select, .jci-newsletter-form input[type="text"], .jci-newsletter-form input[type="email"]) { color: var(--jci-ink); background: #0b1b2b; border-color: #69869e; }
html[data-jci-theme="dark"] :is(input, textarea)::placeholder { color: #a9bdce; opacity: 1; }
html[data-jci-theme="dark"] :is(input, select) { accent-color: #74d4ff; }
html[data-jci-theme="dark"] :is(a, button, summary, input, textarea, select):focus-visible { outline: 3px solid #74d4ff; outline-offset: 3px; }
/* Keep solid brand panels and button labels readable against their fixed backgrounds. */
html[data-jci-theme="dark"] :is(.jci-button, .wp-block-button__link, .site-header__cta, .jci-program-card--blue a, .jci-program-card--blue .jci-kicker, .is-style-jci-hero .jci-kicker) { color: #fff; }
html[data-jci-theme="dark"] .jci-button--outline { color: var(--jci-night-link); }
html[data-jci-theme="dark"] .jci-button--outline:hover { color: #fff; }
html[data-jci-theme="dark"] :is(.jci-button:not(.jci-button--outline), .wp-block-button__link, .primary-navigation .site-header__cta, .jci-form button, .jci-newsletter-form button) { background: #007db3; border-color: #007db3; }
html[data-jci-theme="dark"] :is(.jci-button:not(.jci-button--outline), .wp-block-button__link, .primary-navigation .site-header__cta, .jci-form button, .jci-newsletter-form button):hover { background: #062f4f; border-color: #74d4ff; }
html[data-jci-theme="dark"] .jci-media-settings { background: var(--jci-night-card); color: var(--jci-ink); border-color: var(--jci-line); }
html[data-jci-theme="dark"] .jci-privacy-analytics { border-color: var(--jci-line); }
html[data-jci-theme="dark"] #stcm-wrapper {
  --backgroundColor: #122437; --textColor: #e5eef6; --primaryColor: #74d4ff;
  --iconColor: #e5eef6; --iconBackgroundColor: #122437;
}
html[data-jci-theme="dark"] #stcm-wrapper :is(#stcm-banner, #stcm-modal) { border-color: #30465a; border-top-color: #0097d7; }
html[data-jci-theme="dark"] #stcm-wrapper .stcm-button { color: #0b1726; border-color: #69869e; }
html[data-jci-theme="dark"] #stcm-wrapper .stcm-button-secondary { color: #74d4ff; }
html[data-jci-theme="dark"] #stcm-wrapper .stcm-button-secondary:hover { color: #0b1726; }

@media (max-width: 1040px) {
  .site-header__inner { gap: .75rem; }
  .site-brand .custom-logo, .site-brand__logo { max-width: min(13rem, 46vw); max-height: 3rem; }
  .nav-toggle { display: inline-grid; }
  .primary-navigation {
    position: absolute; top: calc(100% + 1px); left: 0; display: none;
    width: 100%; align-items: stretch; padding: 1rem;
    border-bottom: 1px solid var(--jci-line); background: var(--jci-white); box-shadow: var(--jci-shadow);
  }
  .primary-navigation.is-open, .primary-navigation__list { display: grid; }
  .primary-navigation__list { align-items: stretch; gap: .4rem; }
  .primary-navigation a { display: block; padding: .7rem; }
  .primary-navigation .site-header__cta { display: flex; margin-top: .45rem; padding: .8rem 1rem; }
  .language-switcher { width: 3rem; }
  html[data-jci-theme="dark"] .primary-navigation { background: var(--jci-night-bg); }
}

/* Printed pages remain legible regardless of the visitor's screen preference. */
@media print {
  html[data-jci-theme="dark"] { --jci-ink: #17212b; --jci-muted: #5b6772; --jci-line: #d9e4ea; --jci-night-bg: #fff; --jci-night-card: #fff; --jci-night-heading: #062f4f; --jci-night-link: #007db3; color-scheme: light; }
  .site-header__controls, .theme-system { display: none !important; }
}
