/* The site's colours (PLE-2056): "Light editorial", chosen 17 Nov from coevera.com's palette. White boxes on an
   ice-white page (a step apart, as the theme's #fff on #f3f3f1), navy headings, steel text, thin fog lines; the accent
   #f26648 and the blue #005895 stay wherever the theme has them.
   scripts/theme/build.mjs serves this after the theme's sheets, whose colours it turns into --sp-<text|bg|line>-<the
   theme's hex> slots. One theme colour plays different roles on the light and the dark pages (audio posts,
   style-dark.css), in the navbar, the footer, the bands and form fields, so those set their own values. The page
   slots sit on <html>, where the theme's :root custom properties (--bs-body-bg…) resolve. contrast.test.ts checks
   every pair. */

html:not(:has(> body.header-dark)) {
  --sp-bg-f3f3f1: #f4f7fb;
  --sp-line-f3f3f1: #f4f7fb;
  --sp-bg-eeeeee: #edf2f8;
  --sp-line-eeeeee: #dde5ef;
  --sp-line-cfcfc6: #dde5ef;
  --sp-bg-cfcfc6: #dde5ef;
  --sp-text-979792: #5a6b80;
  --sp-text-6b6b66: #5a6b80;
  --sp-text-434343: #5a6b80;
  --sp-text-262626: #183c66;
  --sp-text-0091d0: #005895;
  --sp-bg-262626: #0f2847;
  --sp-bg-434343: #183c66;
}

html:has(> body.header-dark) {
  --sp-bg-434343: #060e1b;
  --sp-bg-262626: #0f2847;
  --sp-text-979792: #c8d5e3;
  --sp-text-b3b3ac: #dde5ef;
  --sp-text-cfcfc6: #ffffff;
  --sp-text-9ae6fc: #a8d4f5;
  --sp-line-9ae6fc: #a8d4f5;
  --sp-line-5f5f5c: #5a6b80;
}

.site-navbar {
  --sp-bg-262626: #183c66;
  --sp-bg-434343: #0f2847;
  --sp-text-cfcfc6: #ffffff;
  --sp-text-979792: #c8d5e3;
}

:is(.site-footer, .site-copyright) {
  --sp-bg-262626: #183c66;
  --sp-text-979792: #c8d5e3;
  --sp-text-cfcfc6: #ffffff;
  --sp-line-5f5f5c: #5a6b80;
}

/* the near-black bands set in the widgets' settings, navy here (painted below): light text as on the dark pages */
.main-content :is([style*="background-color:#262626"], [style*="background-color:#1b1b1b"], [style*="background-color:#050b01"], [style*="background-color:#202120"]) {
  --sp-text-979792: #c8d5e3;
  --sp-text-6b6b66: #c8d5e3;
  --sp-text-8c8c83: #c8d5e3;
  --sp-text-999999: #c8d5e3;
  --sp-text-0091d0: #a8d4f5;
}

/* their surfaces in three steps, so neighbours stay at least 1.2:1 apart: the news stripe, the dark bands (#1b1b1b,
   #202120) and the podcast page box and bands at #262626. A band holds content no rule recolours (the podcast player,
   its translucent boxes, the share buttons), so none is darker than the theme's: what is darker on it keeps its step */
.main-content [style*="background-color:#050b01"] {
  --sp-bg-262626: #0f2847;
}

.main-content :is([style*="background-color:#1b1b1b"], [style*="background-color:#202120"]) {
  --sp-bg-262626: #183c66;
}

.main-content [style*="background-color:#262626"] {
  --sp-bg-262626: #0f2847;
}

/* placeholders: steel on the light fields, today's grey on the dark pages' grey fields */
:is(input, textarea, select):not(.form-control-dark) {
  --sp-text-979792: #5a6b80;
  --sp-text-cfcfc6: #cfcfc6;
}

/* What the build never sees: component sheets Next bundles and colours set inline from widget settings. Each rule sends
   a part's colour through the slot of the theme colour it copies (#eee field grey, #434343 body text, #262626 dark
   band…), so it changes with the theme on light and dark pages. The html in front outweighs the component's own rule
   of the same classes whatever order the sheets load in; inline colours need !important. Kept on purpose: the photo
   lightbox, the share networks' colours, the yellow testimonial stars, the blue and burgundy bands, the cookie card's
   orange and blue buttons, the e-book dialog's focus ring. */

/* Cookie card and its round button (CookieConsent.tsx sets these inline): the theme's field grey and body text */
html :is(.cc-banner, .cc-floating) {
  --cc-bg: var(--sp-bg-eeeeee, #eee) !important;
  --cc-text: var(--sp-text-434343, #434343) !important;
}

/* Cookie panel (the theme's dark dialog): its rules and badge in the navbar's hover colour (consent.css) */
html :is(.cc-category, .cc-panel .modal-footer) {
  border-top-color: var(--sp-bg-434343, #434343);
}
html .cc-always {
  background: var(--sp-bg-434343, #434343);
}
html .table.cc-table {
  --bs-table-border-color: var(--sp-bg-434343, #434343);
}
/* its switches' off grey (CookieToggle.tsx, inline): a slate that keeps 3:1 on the panel. Keyed on the switch's state:
   the panel renders only in the browser, whose style attribute reads rgb(108, 117, 125), not #6c757d */
html .cc-panel .cc-toggle[aria-checked="false"] {
  background-color: #8494a7 !important;
}

/* Page forms (page-form.css): fields and boxes as the theme's grey fields, placeholder and box edge as its grey text */
html .sp-page-form .form-control:not(:hover, :focus),
html .sp-page-form .form-check-label .checkbox-indicator {
  background-color: var(--sp-bg-eeeeee, #eee) !important;
}
html .sp-page-form .form-control::placeholder {
  color: var(--sp-text-979792, #979792);
}
html .sp-page-form .form-check-label input:not(.error) ~ .checkbox-indicator {
  border-color: var(--sp-text-979792, #868681) !important;
}

/* The 404 page (not-found.css): heading and divider */
html .sp-not-found .sp-not-found-title {
  color: var(--sp-text-262626, #262626);
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  html .sp-not-found .sp-not-found-title {
    background-image: linear-gradient(135deg, var(--sp-text-262626, #262626) 30%, #005895);
  }
}
html .sp-not-found-divider {
  background: var(--sp-line-cfcfc6, #cfcfc6);
}

/* The share note's copy field (share.css) */
html .share-note-box input {
  color: var(--sp-text-262626, #262626);
}

/* Bands coloured in the widgets' settings: the near-black ones take their step (above), the theme-grey testimonials
   band the page colour */
html .main-content :is([style*="background-color:#262626"], [style*="background-color:#1b1b1b"], [style*="background-color:#050b01"], [style*="background-color:#202120"]) {
  --sp-background-color: var(--sp-bg-262626, #262626) !important;
  background-color: var(--sp-bg-262626, #262626) !important;
}
html .main-content [style*="background-color:#f3f3f1"] {
  background-color: var(--sp-bg-f3f3f1, #f3f3f1) !important;
}
html .main-content [style*=";color:#262626"] {
  color: var(--sp-text-262626, #262626) !important;
}
/* the podcasts band's fading edges (an inline <style> in PodcastsRandomCollection.tsx) */
html .salespop-podcasts-random-collection::before {
  background-image: linear-gradient(to left, transparent, var(--sp-bg-262626, #262626));
}
html .salespop-podcasts-random-collection::after {
  background-image: linear-gradient(to right, transparent, var(--sp-bg-262626, #262626));
}
