/* Light theme for capital.artive.co.za. The site is built on tokens (tokens.css), so light mode is a second set of
   token values on :root[data-theme='light'], plus the few hard-coded dark colours in the built stylesheet.
   Dark stays the default and the brand look; this file does nothing unless data-theme='light' is set on <html>.

   Contrast (WCAG, measured): text on page 17.1:1, muted text 7.0:1, dim text 4.6:1, accent on page 5.1:1,
   accent button text 5.5:1, green 5.0:1, amber 5.7:1, red 5.3:1. The dark accent #89cff0 is only 1.6:1 on white,
   so light mode uses a deeper blue from the same hue. */

:root[data-theme='light'] {
  color-scheme: light;
  --c-bg: #f5f6f8;
  --c-surface: #ffffff;
  --c-surface-2: #eceff3;
  --c-line: #c9d0d8;
  --c-text: #101418;
  --c-text-muted: #4a5560;
  --c-text-dim: #66717c;
  --c-accent: #0a6ea8;
  --c-accent-press: #07557f;
  --c-on-accent: #ffffff;
  --c-online: #0f7a45;
  --c-closed: #8f5400;
  --c-down: #c4262c;
  /* The grain is a light speckle on dark; on light it is a faint dark one. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:root[data-theme='light'] body::after { opacity: 0.045; }

/* Inputs the built stylesheet paints pure black. */
:root[data-theme='light'] .picker__input,
:root[data-theme='light'] .brief__form input[type='email'],
:root[data-theme='light'] .in-input,
:root[data-theme='light'] .cx-search input,
:root[data-theme='light'] .ow-search input {
  background: var(--c-surface);
}

/* Maps (store map, province map, South Africa map): dark land becomes pale land. */
:root[data-theme='light'] .cmap__provinces path { fill: #e8ecf0; }
:root[data-theme='light'] .cmap__provinces path[data-lit] { fill: #dde3e9; stroke: #8b96a1; }
:root[data-theme='light'] .cmap__provinces path[data-on] { fill: color-mix(in srgb, var(--c-accent) 14%, #ffffff); }
:root[data-theme='light'] .cmap__pins line { stroke: #8b96a1; }
:root[data-theme='light'] .cmap__label { stroke: var(--c-bg); }
:root[data-theme='light'] .cmap__body { fill: #8b96a1; stroke: #ffffff; }
:root[data-theme='light'] .cmap__dot[data-dir='up'] .cmap__body { fill: color-mix(in srgb, var(--c-accent) 85%, #ffffff); }
:root[data-theme='light'] .cmap__dot[data-dir='down'] .cmap__body { fill: color-mix(in srgb, var(--c-down) 85%, #ffffff); }
:root[data-theme='light'] .cmap__dot[data-on] .cmap__body,
:root[data-theme='light'] .cmap__dot:hover .cmap__body,
:root[data-theme='light'] .cmap__dot:focus-visible .cmap__body { stroke: var(--c-text); }
:root[data-theme='light'] .cmap__tick { fill: #ffffff; }
:root[data-theme='light'] .smap__land path { fill: #e8ecf0; stroke: #c9d0d8; }
:root[data-theme='light'] .smap__land path[data-on] { fill: color-mix(in srgb, var(--c-accent) 12%, #ffffff); }
:root[data-theme='light'] .sgroup__bar span[data-part='institutions'],
:root[data-theme='light'] .sgroup__own [data-part='institutions'] i { background: color-mix(in srgb, var(--c-accent) 55%, #ffffff); }
:root[data-theme='light'] .sgroup__bar span[data-part='other'],
:root[data-theme='light'] .sgroup__own [data-part='other'] i { background: #9aa4ae; }

/* Our logos are white PNGs (the Artive wordmark, the Artive Commerce logo in the footer). On a light page they are inverted
   to black; their transparency is kept. The footer's company colours are brand colours made for black, so each gets a deeper
   twin on light: Ventures lime is 1.1:1 on white, its twin 5.4:1; Commerce red goes from 4.4:1 to 5.5:1. */
:root[data-theme='light'] img[src='/artive-wordmark.png'],
:root[data-theme='light'] img[src='/logos/artive-commerce.png'] { filter: invert(1); }
:root[data-theme='light'] .site-footer__group li[style*='#bfff00'] { --company: #4f6f00 !important; }
:root[data-theme='light'] .site-footer__group li[style*='#e60012'] { --company: #c9000f !important; }

/* Floating tools panel (capital-watch.js): a lighter shadow. */
:root[data-theme='light'] #ac-fab .ac-fab__panel { box-shadow: 0 1rem 2rem rgb(16 20 24 / 0.14); }

/* The theme switch itself. */
#ac-theme {
  position: fixed;
  left: var(--gutter, 1rem);
  bottom: calc(var(--gutter, 1rem) + 4rem); /* clear of the cookie button, which sits at the gutter */
  z-index: 55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--c-accent);
  border-radius: 50%;
  background: var(--c-bg);
  color: var(--c-text);
  cursor: pointer;
}
#ac-theme svg { width: 1.25rem; height: 1.25rem; }
#ac-theme .ac-theme__moon { display: none; }
:root[data-theme='light'] #ac-theme .ac-theme__sun { display: none; }
:root[data-theme='light'] #ac-theme .ac-theme__moon { display: block; }
@media (hover: hover) and (pointer: fine) {
  #ac-theme:hover { background: var(--c-accent); color: var(--c-on-accent); }
}
#ac-theme:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
@media print { #ac-theme { display: none; } }
