/*
 * Theme palette bridge.
 *
 * Single responsibility: re-point the Tailwind v4 design tokens that markup
 * hardcodes (emerald/teal shades, heavy font weights) to the store theme
 * tokens defined in base.jinja2 (--zenshop-accent, ...).
 *
 * Tailwind v4 utilities read their values from these custom properties
 * (e.g. `.bg-emerald-500/10` -> color-mix(var(--color-emerald-500) 10%, ...)),
 * so overriding the tokens covers every shade, opacity modifier and variant
 * (hover:, focus:, ring-, shadow-, from-/to-, selection:) at once, without
 * listing classes one by one. Tailwind declares its tokens inside
 * `@layer theme`; these rules are unlayered and therefore always win.
 *
 * To theme another hardcoded palette, add its tokens here (Open/Closed).
 */
:root {
    /* Fallback keeps the palette valid where base.jinja2 tokens are absent (editor canvas). */
    --zen-accent-base: var(--zenshop-accent, #32c6a5);

    /* Accent scale derived from the configured accent color. */
    --zen-accent-50:  color-mix(in oklab, var(--zen-accent-base) 10%, #ffffff);
    --zen-accent-100: color-mix(in oklab, var(--zen-accent-base) 20%, #ffffff);
    --zen-accent-200: color-mix(in oklab, var(--zen-accent-base) 38%, #ffffff);
    --zen-accent-300: color-mix(in oklab, var(--zen-accent-base) 60%, #ffffff);
    --zen-accent-400: color-mix(in oklab, var(--zen-accent-base) 80%, #ffffff);
    --zen-accent-500: var(--zen-accent-base);
    --zen-accent-600: color-mix(in oklab, var(--zen-accent-base) 85%, #000000);
    --zen-accent-700: color-mix(in oklab, var(--zen-accent-base) 70%, #000000);
    --zen-accent-800: color-mix(in oklab, var(--zen-accent-base) 55%, #000000);
    --zen-accent-900: color-mix(in oklab, var(--zen-accent-base) 42%, #000000);
    --zen-accent-950: color-mix(in oklab, var(--zen-accent-base) 28%, #000000);

    /* Emerald -> theme accent */
    --color-emerald-50:  var(--zen-accent-50);
    --color-emerald-100: var(--zen-accent-100);
    --color-emerald-200: var(--zen-accent-200);
    --color-emerald-300: var(--zen-accent-300);
    --color-emerald-400: var(--zen-accent-400);
    --color-emerald-500: var(--zen-accent-500);
    --color-emerald-600: var(--zen-accent-600);
    --color-emerald-700: var(--zen-accent-700);
    --color-emerald-800: var(--zen-accent-800);
    --color-emerald-900: var(--zen-accent-900);
    --color-emerald-950: var(--zen-accent-950);

    /* Teal is used as a secondary accent alongside emerald. */
    --color-teal-50:  var(--zen-accent-50);
    --color-teal-100: var(--zen-accent-100);
    --color-teal-200: var(--zen-accent-200);
    --color-teal-300: var(--zen-accent-300);
    --color-teal-400: var(--zen-accent-400);
    --color-teal-500: var(--zen-accent-500);
    --color-teal-600: var(--zen-accent-600);
    --color-teal-700: var(--zen-accent-700);
    --color-teal-800: var(--zen-accent-800);
    --color-teal-900: var(--zen-accent-900);
    --color-teal-950: var(--zen-accent-950);

    /* Typography: align heavy weights with the theme scale (headings 650, emphasis 600). */
    --font-weight-bold: 600;
    --font-weight-extrabold: 650;
    --font-weight-black: 650;
}

/* Icon buttons over image thumbnails (edit / move / delete): white until hovered, then they take the
   accent color and a shaded box appears behind the icon. */
.zen-thumb-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    border-radius: 0.625rem;
    border: 1px solid transparent;
    color: #ffffff;
    cursor: pointer;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); /* stays readable over bright photos */
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.zen-thumb-action:hover,
.zen-thumb-action:focus-visible {
    color: var(--zenshop-accent, #32c6a5);
    background-color: color-mix(in srgb, var(--zenshop-accent, #32c6a5) 20%, rgba(2, 6, 23, 0.7));
    border-color: color-mix(in srgb, var(--zenshop-accent, #32c6a5) 55%, transparent);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 0 3px color-mix(in srgb, var(--zenshop-accent, #32c6a5) 18%, transparent);
    outline: none;
}
.zen-thumb-action--danger:hover,
.zen-thumb-action--danger:focus-visible {
    color: #fb7185;
    background-color: rgba(136, 19, 55, 0.55);
    border-color: rgba(251, 113, 133, 0.55);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(251, 113, 133, 0.18);
}

/* Hover layer over an image thumbnail: darkens the picture (it stays visible underneath) instead of
   using a theme surface color, which turns white in the light theme. */
.zen-thumb-overlay {
    background-color: rgba(2, 6, 23, 0.55);
}
