/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* DO NOT EDIT this file directly, instead modify moz-promo.tokens.json
 * and run `mach buildtokens` to see your changes. */

@layer tokens-foundation, tokens-browser-theme, tokens-foundation-brand, tokens-foundation-nova, tokens-browser-theme-nova, tokens-foundation-brand-nova, tokens-prefers-contrast, tokens-prefers-contrast-nova, tokens-forced-colors, tokens-forced-colors-nova;

@layer tokens-foundation {
  :root,
  :host {
    --promo-background-color: color-mix(in lch, currentColor 8%, transparent);
    --promo-background-color-vibrant: light-dark(var(--color-violet-0), var(--color-violet-90));
    --promo-border: var(--promo-border-width) solid var(--promo-border-color);
    --promo-border-color: color-mix(in lch, currentColor 8%, transparent);
    --promo-border-color-vibrant: var(--color-violet-30);
    --promo-border-radius: var(--border-radius-medium);
    --promo-border-width: var(--border-width);
    --promo-heading-text-color: var(--promo-message-text-color);
    --promo-heading-text-color-vibrant: var(--promo-message-text-color);
    --promo-image-size: var(--size-image-xlarge);
    --promo-image-size-large: calc(2 * var(--size-image-xlarge));
    --promo-message-text-color: var(--text-color);
    --promo-message-text-color-vibrant: light-dark(var(--color-violet-80), var(--color-violet-0));
    --promo-padding: var(--space-medium);
  }
}

/* Bug 1879900: Can't nest media queries inside of :host, :root selector
   until Bug 1879349 lands */
@layer tokens-prefers-contrast {
  @media (prefers-contrast) {
    :root,
    :host {
      --promo-background-color: var(--background-color-canvas);
      --promo-border-color: var(--border-color);
    }
  }
}

@media -moz-pref("browser.nova.enabled") {
  @layer tokens-foundation-nova {
    :root,
    :host {
      --promo-background-color: var(--background-color-box-info);
      --promo-background-color-vibrant: light-dark(var(--color-violet-desaturated-10), var(--color-violet-desaturated-70));
      --promo-border-color: light-dark(rgba(24, 14, 48, 0.12), rgba(242, 240, 248, 0.12));
      --promo-border-color-vibrant: var(--promo-border-color);
    }
  }

  /* Bug 1879900: Can't nest media queries inside of :host, :root selector
   until Bug 1879349 lands */
  @layer tokens-forced-colors-nova {
    @media (forced-colors) {
      :root,
      :host {
        --promo-background-color-vibrant: Canvas;
        --promo-border-color: CanvasText;
      }
    }
  }
}
