/* ══════════════════════════════════════════════════
   Kitchen Board - Theme Definitions
   All colours expressed as CSS custom properties.
   ══════════════════════════════════════════════════ */

/* ── Kraft (default) ─ warm parchment ─────────── */
[data-theme="kraft"] {
  color-scheme: light;
  --color-bg:            #f4ede0;
  --color-bg-secondary:  #ece4d5;
  --color-bg-card:       #faf6ee;
  --color-text:          #2c1810;
  --color-text-secondary:#6b4a2e;
  --color-text-muted:    #9e7a5a;
  --color-accent:        #7a4928;
  --color-accent-hover:  #5c3318;
  --color-on-accent:     #fff;
  --color-border:        #c8b49a;
  --color-border-light:  #ddd0bb;
  --color-checked:       #b0956d;
  --color-shadow:        rgba(44, 24, 16, 0.12);
  --color-shadow-key:    rgba(44, 24, 16, 0.20);
  --color-shadow-ambient:rgba(44, 24, 16, 0.10);
  --color-success:       #4a7030;
  --color-warning:       #a05a00;
  --color-danger:        #8a2c1c;
  --color-on-warning:    #fff;
  --color-on-danger:     #fff;
  --color-nav-bg:        #2c1810;
  --color-nav-text:      #f4ede0;
  --color-event-bg:        #c4864a;
  --color-event-text:      #fff;
  --color-event-chip-bg:   #f4e9da;
  --color-event-chip-text: #7a4928;
  --color-today-bg:        #c4864a22;
  --color-today-border:    #c4864a;
}

/* ── Chalkboard ─ dark slate-green ────────────── */
[data-theme="chalkboard"] {
  color-scheme: dark;
  --color-bg:            #172219;
  --color-bg-secondary:  #1c2a1f;
  --color-bg-card:       #222f24;
  --color-text:          #f1efdf;
  --color-text-secondary:#c3cdb2;
  --color-text-muted:    #9aaa8f;
  --color-accent:        #dccb7d;
  --color-accent-hover:  #eadb99;
  --color-on-accent:     #172019;
  --color-border:        #5c7262;
  --color-border-light:  #394b3f;
  --color-checked:       #b1bba7;
  --color-shadow:        rgba(0, 0, 0, 0.35);
  --color-shadow-key:    rgba(0, 0, 0, 0.62);
  --color-shadow-ambient:rgba(0, 0, 0, 0.32);
  --color-success:       #8fc274;
  --color-warning:       #efbe62;
  --color-danger:        #ef7666;
  --color-on-warning:    #221804;
  --color-on-danger:     #251010;
  --color-nav-bg:        #0f1911;
  --color-nav-text:      #f1efdf;
  --color-event-bg:        #527349;
  --color-event-text:      #f1efdf;
  --color-event-chip-bg:   #314134;
  --color-event-chip-text: #f1efdf;
  --color-today-bg:        #dccb7d22;
  --color-today-border:    #dccb7d;
}

/* ── Slate ─ cool dark blue-grey ──────────────── */
[data-theme="slate"] {
  color-scheme: dark;
  --color-bg:            #151b2a;
  --color-bg-secondary:  #1a2234;
  --color-bg-card:       #202a40;
  --color-text:          #edf1fb;
  --color-text-secondary:#b9c2d8;
  --color-text-muted:    #8e9ab8;
  --color-accent:        #8dabf4;
  --color-accent-hover:  #a7bdf5;
  --color-on-accent:     #101725;
  --color-border:        #596987;
  --color-border-light:  #313d59;
  --color-checked:       #aab4cc;
  --color-shadow:        rgba(0, 0, 0, 0.45);
  --color-shadow-key:    rgba(0, 0, 0, 0.68);
  --color-shadow-ambient:rgba(0, 0, 0, 0.38);
  --color-success:       #70c991;
  --color-warning:       #efbd61;
  --color-danger:        #ef7d83;
  --color-on-warning:    #211703;
  --color-on-danger:     #251013;
  --color-nav-bg:        #0d1320;
  --color-nav-text:      #edf1fb;
  --color-event-bg:        #4566b3;
  --color-event-text:      #edf1fb;
  --color-event-chip-bg:   #293a62;
  --color-event-chip-text: #edf1fb;
  --color-today-bg:        #8dabf422;
  --color-today-border:    #8dabf4;
}

/* ── Grove ─ fresh greens ─────────────────────── */
[data-theme="grove"] {
  color-scheme: light;
  --color-bg:            #f0f5ed;
  --color-bg-secondary:  #e5ede0;
  --color-bg-card:       #f8fbf6;
  --color-text:          #1a2e1a;
  --color-text-secondary:#3a5c3a;
  --color-text-muted:    #6a8c6a;
  --color-accent:        #3a7a3a;
  --color-accent-hover:  #2a5a2a;
  --color-on-accent:     #fff;
  --color-border:        #9aba9a;
  --color-border-light:  #c0d8c0;
  --color-checked:       #80a880;
  --color-shadow:        rgba(26, 46, 26, 0.12);
  --color-shadow-key:    rgba(26, 46, 26, 0.19);
  --color-shadow-ambient:rgba(26, 46, 26, 0.10);
  --color-success:       #3a7a3a;
  --color-warning:       #a56800;
  --color-danger:        #8a2c1c;
  --color-on-warning:    #fff;
  --color-on-danger:     #fff;
  --color-nav-bg:        #1a2e1a;
  --color-nav-text:      #f0f5ed;
  --color-event-bg:        #3a7a3a;
  --color-event-text:      #f0f5ed;
  --color-event-chip-bg:   #e1ecdf;
  --color-event-chip-text: #3a7a3a;
  --color-today-bg:        #3a7a3a22;
  --color-today-border:    #3a7a3a;
}

/* ── Stock compartment accents on dark themes ──
   Lift the per-kind tints and accents so they stay
   visible and readable over dark card backgrounds. */
[data-theme="chalkboard"] .compartment--fridge,
[data-theme="slate"] .compartment--fridge { --inv-tint: rgba(125, 175, 215, 0.10); --inv-accent: #7fa8cc; }
[data-theme="chalkboard"] .compartment--freezer,
[data-theme="slate"] .compartment--freezer { --inv-tint: rgba(115, 160, 240, 0.12); --inv-accent: #8fa5e0; }
[data-theme="chalkboard"] .compartment--cupboard,
[data-theme="slate"] .compartment--cupboard { --inv-tint: rgba(195, 150, 90, 0.10); --inv-accent: #bd9257; }
[data-theme="chalkboard"] .compartment--fruit,
[data-theme="slate"] .compartment--fruit { --inv-tint: rgba(150, 195, 105, 0.11); --inv-accent: #9cc471; }
[data-theme="chalkboard"] .compartment--bread,
[data-theme="slate"] .compartment--bread { --inv-tint: rgba(215, 180, 120, 0.11); --inv-accent: #c8a468; }
[data-theme="chalkboard"] .compartment--spice,
[data-theme="slate"] .compartment--spice { --inv-tint: rgba(235, 160, 80, 0.11); --inv-accent: #dc9a4e; }
[data-theme="chalkboard"] .compartment--drinks,
[data-theme="slate"] .compartment--drinks { --inv-tint: rgba(180, 125, 175, 0.11); --inv-accent: #c093bb; }
[data-theme="chalkboard"] .compartment--bathroom,
[data-theme="slate"] .compartment--bathroom { --inv-tint: rgba(120, 195, 200, 0.10); --inv-accent: #7cbcc1; }
[data-theme="chalkboard"] .compartment--medicine,
[data-theme="slate"] .compartment--medicine { --inv-tint: rgba(215, 140, 140, 0.10); --inv-accent: #d08e8e; }
[data-theme="chalkboard"] .compartment--cleaning,
[data-theme="slate"] .compartment--cleaning { --inv-tint: rgba(115, 200, 175, 0.10); --inv-accent: #79c3ac; }
[data-theme="chalkboard"] .compartment--pets,
[data-theme="slate"] .compartment--pets { --inv-tint: rgba(185, 185, 120, 0.10); --inv-accent: #b3b478; }
[data-theme="chalkboard"] .compartment--garage,
[data-theme="slate"] .compartment--garage { --inv-tint: rgba(155, 168, 182, 0.10); --inv-accent: #9aa7b5; }

/* ── Berry ─ muted purples ────────────────────── */
[data-theme="berry"] {
  color-scheme: light;
  --color-bg:            #f5f0f5;
  --color-bg-secondary:  #ede5ee;
  --color-bg-card:       #faf7fa;
  --color-text:          #2a1530;
  --color-text-secondary:#6a3c78;
  --color-text-muted:    #9a70a8;
  --color-accent:        #7a3c90;
  --color-accent-hover:  #5a2870;
  --color-on-accent:     #fff;
  --color-border:        #c8a8d4;
  --color-border-light:  #ddc8e5;
  --color-checked:       #a888b8;
  --color-shadow:        rgba(42, 21, 48, 0.12);
  --color-shadow-key:    rgba(42, 21, 48, 0.19);
  --color-shadow-ambient:rgba(42, 21, 48, 0.10);
  --color-success:       #4a7a4a;
  --color-warning:       #a06400;
  --color-danger:        #8a2c3c;
  --color-on-warning:    #fff;
  --color-on-danger:     #fff;
  --color-nav-bg:        #2a1530;
  --color-nav-text:      #f5f0f5;
  --color-event-bg:        #7a3c90;
  --color-event-text:      #fff;
  --color-event-chip-bg:   #ebe1ed;
  --color-event-chip-text: #7a3c90;
  --color-today-bg:        #7a3c9022;
  --color-today-border:    #7a3c90;
}

/* ── Broadsheet and Blackout ─ eInk ───────────────
   Two pure monochrome themes for eInk panels, which
   render every grey as dither and smear anything that
   moves. Only two colours exist here, so state that
   other themes show with a tint is carried by borders,
   weight and strikethrough instead. */
[data-theme="broadsheet"] {
  color-scheme: light;
  --color-bg:            #fff;
  --color-bg-secondary:  #fff;
  --color-bg-card:       #fff;
  --color-bg-inset:      #fff;
  --color-text:          #000;
  --color-text-secondary:#000;
  --color-text-muted:    #000;
  --color-accent:        #000;
  --color-accent-hover:  #000;
  --color-on-accent:     #fff;
  --color-border:        #000;
  --color-border-light:  #000;
  --color-checked:       #000;
  --color-shadow:        transparent;
  --color-shadow-key:    transparent;
  --color-shadow-ambient:transparent;
  --color-success:       #000;
  --color-warning:       #000;
  --color-danger:        #000;
  --color-on-warning:    #fff;
  --color-on-danger:     #fff;
  --color-nav-bg:        #000;
  --color-nav-text:      #fff;
  --color-event-bg:        #000;
  --color-event-text:      #fff;
  --color-event-chip-bg:   #fff;
  --color-event-chip-text: #000;
  --color-today-bg:        transparent;
  --color-today-border:    #000;
}

[data-theme="blackout"] {
  color-scheme: dark;
  --color-bg:            #000;
  --color-bg-secondary:  #000;
  --color-bg-card:       #000;
  --color-bg-inset:      #000;
  --color-text:          #fff;
  --color-text-secondary:#fff;
  --color-text-muted:    #fff;
  --color-accent:        #fff;
  --color-accent-hover:  #fff;
  --color-on-accent:     #000;
  --color-border:        #fff;
  --color-border-light:  #fff;
  --color-checked:       #fff;
  --color-shadow:        transparent;
  --color-shadow-key:    transparent;
  --color-shadow-ambient:transparent;
  --color-success:       #fff;
  --color-warning:       #fff;
  --color-danger:        #fff;
  --color-on-warning:    #000;
  --color-on-danger:     #000;
  --color-nav-bg:        #000;
  --color-nav-text:      #fff;
  --color-event-bg:        #fff;
  --color-event-text:      #000;
  --color-event-chip-bg:   #000;
  --color-event-chip-text: #fff;
  --color-today-bg:        transparent;
  --color-today-border:    #fff;
}

/* An eInk refresh takes a few hundred milliseconds, so a 160ms fade is drawn
   as a smear of half-finished frames. Nothing moves on these two themes. */
[data-theme="broadsheet"] *, [data-theme="broadsheet"] *::before, [data-theme="broadsheet"] *::after,
[data-theme="blackout"] *, [data-theme="blackout"] *::before, [data-theme="blackout"] *::after {
  transition: none !important;
  animation: none !important;
}

/* Faded text dithers to a grey speckle; strikethrough alone says "bought". */
[data-theme="broadsheet"] .item-list__item--checked .item-list__text,
[data-theme="blackout"] .item-list__item--checked .item-list__text,
[data-theme="broadsheet"] .shopping-trip .item-list__item--checked,
[data-theme="blackout"] .shopping-trip .item-list__item--checked { opacity: 1; }

/* Today is a tint everywhere else; here it is a heavier rule. */
[data-theme="broadsheet"] .cal-cell--today,
[data-theme="blackout"] .cal-cell--today,
[data-theme="broadsheet"] .mini-cal__day--today,
[data-theme="blackout"] .mini-cal__day--today { outline: 2px solid var(--color-today-border); outline-offset: -2px; }

/* With the track and the accent both ink, a toggle would read "on" either
   way. Off is an outline, on is solid. */
[data-theme="broadsheet"] .toggle,
[data-theme="blackout"] .toggle { background: var(--color-bg); box-shadow: inset 0 0 0 2px var(--color-border); }
[data-theme="broadsheet"] .toggle--on,
[data-theme="blackout"] .toggle--on { background: var(--color-accent); }
[data-theme="broadsheet"] .toggle__knob { background: #000; box-shadow: none; }
[data-theme="broadsheet"] .toggle--on .toggle__knob { background: #fff; }
[data-theme="blackout"] .toggle__knob { background: #fff; box-shadow: none; }
[data-theme="blackout"] .toggle--on .toggle__knob { background: #000; }

/* Stock places keep their watermark, which is line art, but lose the tint. */
[data-theme="broadsheet"] .compartment,
[data-theme="blackout"] .compartment { --inv-tint: transparent; --inv-accent: var(--color-border); }

/* Every translucent backdrop becomes solid: a dithered grey over the page is
   harder to read than either colour on its own. */
[data-theme="broadsheet"] .nav__link:hover,
[data-theme="broadsheet"] .nav__link--active,
[data-theme="blackout"] .nav__link:hover,
[data-theme="blackout"] .nav__link--active { background: transparent; text-decoration: underline; }

/* Everything else tinted with color-mix() comes out as a grey wash, so it
   gets the plain card colour; its border and wording already say what it is. */
[data-theme="broadsheet"] .sticky-note, [data-theme="blackout"] .sticky-note,
[data-theme="broadsheet"] .inv-item--expired, [data-theme="blackout"] .inv-item--expired,
[data-theme="broadsheet"] .inv-navigation, [data-theme="blackout"] .inv-navigation,
[data-theme="broadsheet"] .item-list__pending, [data-theme="blackout"] .item-list__pending,
[data-theme="broadsheet"] .autocomplete__remove:hover, [data-theme="blackout"] .autocomplete__remove:hover,
[data-theme="broadsheet"] .alert, [data-theme="blackout"] .alert,
[data-theme="broadsheet"] .badge, [data-theme="blackout"] .badge,
[data-theme="broadsheet"] .ws-status, [data-theme="blackout"] .ws-status,
[data-theme="broadsheet"] .notif-mode-item--active, [data-theme="blackout"] .notif-mode-item--active,
[data-theme="broadsheet"] .kb-offline-banner, [data-theme="blackout"] .kb-offline-banner { background: var(--color-bg-card); }
[data-theme="broadsheet"] .sticky-note::before,
[data-theme="blackout"] .sticky-note::before { background: var(--color-border); }
[data-theme="broadsheet"] .field__input:focus,
[data-theme="blackout"] .field__input:focus { box-shadow: 0 0 0 1px var(--color-accent); }
[data-theme="broadsheet"] .notif-mode-item--active,
[data-theme="blackout"] .notif-mode-item--active { box-shadow: inset 0 0 0 1px var(--color-accent); }

/* Sign out is a ghost button in secondary text, which is ink on an ink nav. */
[data-theme="broadsheet"] .nav .btn--ghost,
[data-theme="blackout"] .nav .btn--ghost { color: var(--color-nav-text); border-color: var(--color-nav-text); }
[data-theme="broadsheet"] .nav__burger,
[data-theme="blackout"] .nav__burger { background: transparent; border-color: var(--color-nav-text); }
[data-theme="broadsheet"] .badge, [data-theme="blackout"] .badge,
[data-theme="broadsheet"] .item-list__pending, [data-theme="blackout"] .item-list__pending { border-color: currentColor; }
