/*
 * Light mode, picked automatically from the visitor's OS setting.
 *
 * The site is designed dark. Every neutral in the stylesheets comes from six
 * tokens (--black, --dark-gray, --mid-gray, --light-gray, --off-white, --white),
 * so light mode mirrors that scale: the page background becomes the lightest
 * step and the text the darkest. Brand colours (--primary and the Mast blues)
 * stay as they are.
 *
 * The overrides below the token block cover the places the compiled Webflow CSS
 * hard-codes a neutral (alpha tints, gradients, an SVG) or reuses a token where
 * the colour must not flip, like white text on an orange button.
 *
 * Loaded after the other stylesheets; nothing here applies in dark mode.
 */

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --black: #f3f1e8;       /* page background (dark: #1d1c1a) */
    --dark-gray: #e7e4d8;   /* cards, inputs, raised surfaces (dark: #292825) */
    --mid-gray: #d3cfc1;    /* borders, hover surfaces, tags (dark: #3f3e3a) */
    --light-gray: #6b675f;  /* secondary text (dark: #918d84) */
    --off-white: #1d1c1a;   /* body text (dark: #eeebdd) */
    --white: #000;          /* strongest text / emphasis (dark: white) */

    /* Mast's light accents are tuned for the dark ground; deepen them to stay legible. */
    --mast-light-blue: #1668b8;
    --mast-light-orange: #b25e0b;

    /* Fixed colours for content that sits on a brand or photo background. */
    --on-color: #fff;
  }

  /* ---- Text on the orange (primary) fill stays white ---- */
  .btn,
  .search_skip-link,
  .newsletter-richtext button a,
  .tag.cc-filter:has(input:checked),
  .tag.cc-orange,
  .tag.cc-shop-subtitle,
  .comingsoon-tag.cc-shop,
  .nav-link.cc-cta,
  .nav-link.cc-cta.w--current,
  .cart-btn_count {
    color: var(--on-color);
  }

  /* …but .btn variants with a neutral fill follow the theme. */
  .btn.cc-dark,
  .btn.cc-load-more,
  .btn.cc-product-toggle,
  .btn.jetboost-pagination-next-g2eg,
  .btn.jetboost-pagination-next-gxld,
  .btn.jetboost-pagination-next-8znn {
    color: var(--off-white);
  }
  .btn.cc-light {
    color: var(--dark-gray);
  }

  .btn:hover {
    box-shadow: inset 0 -1px 0 30px #1d1c1a26;
  }
  .btn.jetboost-pagination-next-g2eg:hover,
  .btn.jetboost-pagination-next-gxld:hover,
  .btn.jetboost-pagination-next-8znn:hover {
    box-shadow: inset 0 -1px 0 50px #1d1c1a14;
  }

  /* ---- Logos sit on white in both modes ---- */
  .card-header_img-wrapper.cc-logo,
  .card-header_img-wrapper.cc-mark,
  .input.cc-static.cc-checkout-payments {
    background-color: #fff;
  }

  /* ---- Hard-coded light-on-dark tints, re-tinted dark-on-light ---- */
  .tag:hover {
    box-shadow: inset 0 0 0 20px #1d1c1a0f;
  }
  .card-details.cc-date {
    border-right-color: #1d1c1a40;
  }
  .search_form {
    background-color: #1d1c1a14;
  }
  .search_dropdown-radio:hover {
    background-color: #1d1c1a12;
  }
  .heading-link-icon:hover {
    background-color: #1d1c1a1a;
  }
  .heading-link-icon.cc-copy-link:hover {
    background-image: url('../images/link-icon-dark.svg');
  }
  .styles__tab-link:hover {
    background-color: #1d1c1a12;
  }
  .bg-dark-gray,
  .page-wrapper {
    color: var(--white);
  }

  /* ---- Fades into the page background ---- */
  .subscribe-email_overlay {
    background-image: linear-gradient(to bottom, #f3f1e81f 10%, #f3f1e8f2 80%, var(--black));
  }
  .subscribe-email_overlay.cc-cta {
    background-image: linear-gradient(to bottom, #e7e4d81f 10%, var(--dark-gray) 98%);
  }
  .about_supplies-overlay {
    background-image: linear-gradient(to bottom, #f3f1e800, var(--black) 98%);
  }
  .mast-docs_header-overlay {
    background-image: linear-gradient(to bottom, #f3f1e833, var(--black) 70%);
  }

  /* ---- Code samples (Mast pages): darker token colours for a light ground ---- */
  .hljs {
    color: var(--off-white) !important;
  }
  .hljs-attribute, .hljs-function .hljs-title, .hljs-section, .hljs-title.function_, .ruby .hljs-property {
    color: #005bb8 !important;
  }
  .hljs-bullet, .hljs-deletion, .hljs-name, .hljs-selector-tag, .hljs-template-variable, .hljs-variable {
    color: #b2391e !important;
  }
  .hljs-attr, .hljs-link, .hljs-literal, .hljs-number, .hljs-symbol, .hljs-variable.constant_ {
    color: #a65300 !important;
  }
  .hljs-addition, .hljs-code, .hljs-string, .hljs-title.class_.inherited__ {
    color: #5f6400 !important;
  }

  /* ---- Open menu button: Webflow's .w-nav-button.w--open forces white text ---- */
  .nav-link.cc-menu.w--open {
    color: var(--off-white);
  }

  /* ---- Search dock: custom.css lights the clear / group buttons with a fixed
     #eeebdd while the input is hovered or focused. Use the token so they stay
     dark like the input, mirroring the dark-mode look. ---- */
  .search_input:hover + .search_tag-wrapper .search_input-reset,
  .search_input:focus + .search_tag-wrapper .search_input-reset,
  .search_input:hover + .search_tag-wrapper .search_dropdown-btn,
  .search_input:focus + .search_tag-wrapper .search_dropdown-btn,
  .search_input:hover + .search_tag-wrapper .search_dropdown-list,
  .search_input:focus + .search_tag-wrapper .search_dropdown-list {
    background-color: var(--off-white);
  }

  /* ---- Slider arrows: the icon is a fixed #181818 on an --off-white button,
     which turns dark-on-dark here. ---- */
  .swiper-nav_btn {
    color: var(--black);
  }

  /* ---- Selection ---- */
  ::selection {
    color: var(--on-color);
  }
  ::-moz-selection {
    color: var(--on-color);
  }
}
