/* =============================================================================
   zzzzzzzzzzzzzzzzzzzzz_light_mode.css — light mode "Den" (owner choice 2026-11-21; SP_LIGHT_MODE, on by default).

   Colours only. The values live in assets/00_tokens.css under :root[data-sp-theme="light"]; this file hands them to
   the looks' own variable sets (--hl-* of the Explore / navigation look, --hh-* of the Home and the feed) and repairs
   the few places where a colour is written as a literal. assets/00_appearance.js sets the attribute from the
   visitor's choice (the switch on the main bar) and removes it on the surfaces that stay dark: the post editor and
   the Swipe viewer. The story viewer opens over a light page, so section 1 keeps it dark here. The visual of a post (chart, ranking) is never styled here: it is exported as it looks.

   Dash loads this file on every page, so EVERY colour rule starts with :root[data-sp-theme="light"]; without the
   attribute nothing matches (tests/test_light_mode.py). The only other rules are the switch on the main bar
   at the end. The file loads after the looks it re-colours (21 z).
   ============================================================================= */

/* ---- 1. the looks' sets take the Den values ---------------------------------------------------------------- */

/* Explore, the navigation and the header (assets/zzzzzzzzzzzzzzzzzzzz_explore_home_look.css). --hl-k is the block
   under controls (tiles, inputs, segmented controls), so in light it is the light block, never black. */
:root[data-sp-theme="light"] {
  --hl-field: var(--sp-bg);
  --hl-ink: var(--sp-text);
  --hl-paper: var(--sp-surface);
  --hl-k: var(--sp-chip);
  --hl-pi: var(--sp-text);
  --hl-muted: var(--sp-text-2);
  --hl-sel: var(--sp-selected-bg);
  --hl-selink: var(--sp-selected-text);
  --hl-rim: var(--sp-border);
  --hl-line: var(--sp-border);
}

/* the app's frame (header / sidebar, bottom bar, account menu, the menu behind the menu button) reads the same
   names: a white frame whose pressed and current items are one step darker */
:root[data-sp-theme="light"] :is(.sp-top-header, .sp-bottom-nav, .sp-user-menu-dropdown, .sp-nav-drawer) {
  --hl-k: var(--sp-chrome);
  --hl-paper: #EFEEEA;
}

/* the Home (assets/zz_home.css) */
:root[data-sp-theme="light"] .sp-home-hub {
  --hh-field: var(--sp-bg);
  --hh-ink: var(--sp-text);
  --hh-paper: var(--sp-surface);
  --hh-k: var(--sp-chip);
  --hh-kink: var(--sp-text);
  --hh-muted: var(--sp-text-2);
  --hh-kmuted: var(--sp-text-2);
  --hh-pi: var(--sp-text);
  --hh-sel: var(--sp-selected-bg);
  --hh-selink: var(--sp-selected-text);
  --hh-edge: var(--sp-border-strong);
  --hh-rim: var(--sp-border);
  --hh-rimk: var(--sp-border);
  --hh-mapbg: #F8F8F6;
}

/* the feed and Detail carry their own copy of the Home set (assets/zzz_feed_home_look.css) */
:root[data-sp-theme="light"] :is(#main-feed-shell, #detail-feed-shell).sp-feed-home-look {
  --hh-field: var(--sp-bg);
  --hh-ink: var(--sp-text);
  --hh-paper: var(--sp-surface);
  --hh-k: var(--sp-chip);
  --hh-pi: var(--sp-text);
  --hh-muted: var(--sp-text-2);
  --hh-sel: var(--sp-selected-bg);
  --hh-selink: var(--sp-selected-text);
  --hh-rim: var(--sp-border);
  --fh-card: var(--sp-surface);
  --fh-hair: var(--sp-border);
  --fh-placeholder: var(--sp-skeleton);
  --fh-copy: var(--sp-text-2);
}

/* the post's avatar is a white sticker (assets/zzz_feed_home_look.css) whose initials read --hh-k: in light that is
   the light block, so "RS" vanished on the white disc. The initials keep the dark ink. */
:root[data-sp-theme="light"] :is(#main-feed-shell, #detail-feed-shell).sp-feed-home-look .sp-feed-post .sp-avatar {
  color: #141416;
}

/* the story viewer (assets/zz_feed_stories.css) is always dark: its slides are dark designs. It is a dialog over
   the light page, so inside it the core tokens keep the dark values of assets/00_tokens.css
   (tests/test_light_mode.py compares them). */
:root[data-sp-theme="light"] .sp-story-viewer {
  --sp-bg: #0D0E12;
  --sp-surface: #15161C;
  --sp-border-strong: #2A2C33;
  --sp-text: #F2EFE9;
  --sp-text-2: #B8B4AC;
  --sp-text-3: #6E6A63;
}

/* ---- 2. colours written as literals in the files above ------------------------------------------------------- */

/* orange as TYPE fails on a light ground; fills keep the brand orange, type takes the darker ink */
:root[data-sp-theme="light"]:not(#sp-s):not(#sp-s):not(#sp-s):not(#sp-s) #cmp-tiles #cmp-tile-stat-value {
  color: var(--sp-accent-ink) !important;
}

/* the Home's first card: the orange when-line under the title is type, so it takes the darker ink */
:root[data-sp-theme="light"] .sp-home-hub .hh-sheet .hh-word .hh-when {
  color: var(--sp-accent-ink);
}

/* the Create hub's start cards: the icon colour is a literal cream (zzzzzzzzzz_explore_hub_workspace.css) */
:root[data-sp-theme="light"] .sp-hub-card-icon,
:root[data-sp-theme="light"] .sp-hub-outline {
  color: var(--sp-text) !important;
}
:root[data-sp-theme="light"] .sp-hub-card-icon {
  background: var(--sp-chip) !important;
}

/* the Stat library inside the hub: title, back arrow, search field, category chips and card text are literals there */
:root[data-sp-theme="light"] #studio-entry-shell[data-hub-layout="workspace"] :is(.sp-hub-view-title, .sp-hub-back, a.sp-entry-card, a.sp-entry-card .sp-entry-card-title) {
  color: var(--sp-text);
}
:root[data-sp-theme="light"] #studio-entry-shell[data-hub-layout="workspace"] a.sp-entry-card {
  background: var(--sp-surface);
  border-color: var(--sp-border-strong);
}
:root[data-sp-theme="light"] #studio-entry-shell[data-hub-layout="workspace"] a.sp-entry-card .sp-entry-card-cat {
  color: var(--sp-text-2);
}
:root[data-sp-theme="light"] #studio-entry-shell[data-hub-layout="workspace"] #studio-entry-search {
  color: var(--sp-text);
  background-color: var(--sp-surface);
  border-color: var(--sp-border-strong);
}
:root[data-sp-theme="light"] #studio-entry-shell[data-hub-layout="workspace"] .sp-entry-chip {
  color: var(--sp-text);
  background: var(--sp-chip);
  border-color: transparent;
}
:root[data-sp-theme="light"] #studio-entry-shell[data-hub-layout="workspace"] .sp-entry-chip.is-active {
  color: var(--sp-selected-text);
  background: var(--sp-selected-bg);
  border-color: var(--sp-selected-bg);
}

/* the Home: the W / L letter sits on green / red and is always dark (it read the block colour) */
:root[data-sp-theme="light"] .sp-home-hub .cmp-ranking-mark {
  color: #141416 !important;
}
/* the sheets' hard offset shadow was the black of the wall; on a light wall the sheets lie flat */
:root[data-sp-theme="light"] .sp-home-hub .hh-sheet.hh-hs {
  box-shadow: inset 0 0 0 2px var(--hh-rim);
}
:root[data-sp-theme="light"] .sp-home-hub .hh-cta {
  box-shadow: none;
}

/* ---- 3. loading skeletons: a light block (--sp-skeleton) with a white sweep, never the dark blocks of dark mode ---- */

/* the feed's post-shaped loading card (pages/feed/layout.py). The Mantine provider stays dark, so every dmc.Skeleton
   draws a cover (::before) in the dark body colour #242424 over its block: the avatar and the author lines were black.
   Scoped to this card: the interactive card's loading frame is a dark stage, its skeletons stay dark. */
:root[data-sp-theme="light"] #feed-initial-skeleton .mantine-Skeleton-root {
  background: var(--sp-skeleton);
}
:root[data-sp-theme="light"] #feed-initial-skeleton .mantine-Skeleton-root::before {
  background-color: var(--sp-skeleton);
}
:root[data-sp-theme="light"] #feed-initial-skeleton .mantine-Skeleton-root::after {
  background: linear-gradient(90deg, transparent, var(--sp-skeleton-shine), transparent);
}

/* Create hub, Your projects: the outline of the list until the project list answers (editor_hub.projects_skeleton),
   and the drawn stage while a project opens (assets/zzzzzzzzzz_explore_hub_workspace.css, literals #15161C / #22242B) */
:root[data-sp-theme="light"] #studio-entry-shell[data-hub-layout="workspace"] #editor-project-list > .sp-hub-skeleton-card {
  background: var(--sp-surface);
  border-color: var(--sp-border-strong);
}
:root[data-sp-theme="light"] .sp-hub-skeleton-card .sp-hub-thumb,
:root[data-sp-theme="light"] .sp-hub-skeleton-bar,
:root[data-sp-theme="light"] .sp-hub-opening-bar,
:root[data-sp-theme="light"] .sp-hub-opening-stage > span {
  background: var(--sp-skeleton);
  border-color: transparent;
}
:root[data-sp-theme="light"] .sp-hub-opening-stage {
  background: var(--sp-surface);
  border-color: var(--sp-border-strong);
}
:root[data-sp-theme="light"] .sp-hub-opening-text {
  color: var(--sp-text-2);
}

/* ---- 4. the switch on the main bar (layout.py #appearance-toggle; aria-pressed = light is chosen) ------------- */
/* the icon and the label name what a press does: the sun while dark, the moon while light */
.sp-appearance-toggle__to-light,
.sp-appearance-toggle__to-dark {
  display: inline-flex;
  align-items: center;
}
.sp-appearance-toggle[aria-pressed="true"] .sp-appearance-toggle__to-light,
.sp-appearance-toggle:not([aria-pressed="true"]) .sp-appearance-toggle__to-dark {
  display: none;
}
/* the desktop sidebar lays it out as its Pin menu row (the shared .sp-sidebar-pin rules of assets/zz_site_chrome.css);
   on the phone header it is an icon button beside the account */
@media (max-width: 1024px) {
  .sp-top-actions .sp-appearance-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--hl-pi, var(--sp-text));
    cursor: pointer;
  }
  .sp-top-actions .sp-appearance-toggle .sp-sidebar-label {
    display: none;
  }
}
