/* Trast Shop 1.6.41 — scoped dark-mode corrections.
 * Loaded last on the storefront, never on admin pages.
 * All selectors are gated to the user's explicit data-color-theme=dark setting.
 */

/* The homepage wraps its sections in .home-discovery. The older
 * `main > section` dark rule does not reach these nested sections. */
html[data-color-theme="dark"] body.trast-modern main > .home-discovery {
  background: var(--v151-bg);
  color: var(--v151-text);
}
html[data-color-theme="dark"] body.trast-modern .home-discovery > :is(
  .home-slider-shell,
  .home-category-section,
  .home-picks,
  .home-products-section,
  .home-journal,
  .trust-row,
  .section
) {
  background: var(--v151-bg) !important;
  border-color: var(--v151-border) !important;
  color: var(--v151-text);
}
html[data-color-theme="dark"] body.trast-modern .home-discovery > .home-journal {
  background: var(--v151-soft) !important;
}
html[data-color-theme="dark"] body.trast-modern .home-discovery .home-story,
html[data-color-theme="dark"] body.trast-modern .home-discovery .home-pick {
  background: var(--v151-surface);
  border-color: var(--v151-border);
  color: var(--v151-text);
}
html[data-color-theme="dark"] body.trast-modern .home-discovery .home-story-copy p,
html[data-color-theme="dark"] body.trast-modern .home-discovery .section-head p,
html[data-color-theme="dark"] body.trast-modern .home-discovery .home-pick small {
  color: var(--v151-muted);
}

/* Never multiply product photos against a dark surface: transparent and
 * light-background product shots become almost black otherwise. Preserve
 * their real colors on a neutral image stage, while the gallery frame stays dark. */
html[data-color-theme="dark"] body.trast-modern .product-gallery-panel .product-main-image {
  background: #f7f3f5 !important;
  mix-blend-mode: normal !important;
  filter: none !important;
  border-radius: 16px;
}
html[data-color-theme="dark"] body.trast-modern .product-gallery-panel .product-thumbnails button {
  background: #f7f3f5;
  border-color: var(--v151-border);
}
html[data-color-theme="dark"] body.trast-modern .product-gallery-panel .product-thumbnails img {
  mix-blend-mode: normal !important;
  filter: none !important;
}

/* About and partnership pages previously listened to [data-theme=dark],
 * but the storefront actually toggles html[data-color-theme=dark]. */
html[data-color-theme="dark"] .trast-about {
  --about-soft: #321c28;
  --about-line: #714658;
  --about-rose: #f6b0cd;
  --about-ink: #ffebf4;
}
html[data-color-theme="dark"] .trast-about .about-contact {
  background: #382633;
  border-color: var(--about-line);
  color: var(--about-ink);
}
html[data-color-theme="dark"] .trast-about .about-contact a {
  border-color: var(--about-line);
}
html[data-color-theme="dark"] .lia-page {
  --lia-ink: #ffeaf4;
  --lia-paper: #331c2b;
  --lia-border: #6f4159;
  --lia-accent: #f6adc9;
}
html[data-color-theme="dark"] .lia-page .lia-intro .lia-button {
  color: #351123;
}
html[data-color-theme="dark"] .lia-page .lia-intro .lia-button:hover {
  background: #ffdbe9;
}

/* Page Studio pages are composed of hard-coded light panels; provide
 * a matching dark palette without touching the page content or image colors. */
html[data-color-theme="dark"] body .tp-public-page {
  background: linear-gradient(180deg, #211c24 0%, var(--v151-bg) 420px);
  color: var(--v151-text);
}
html[data-color-theme="dark"] body .tp-public-page :is(
  .tp-page-titlebar,
  .tp-classic-head,
  .tp-classic-content,
  .tp-rich,
  .tp-feature,
  .tp-products,
  .tp-faq
) {
  background: var(--v151-surface);
  color: var(--v151-text);
  border-color: var(--v151-border);
}
html[data-color-theme="dark"] body .tp-public-page :is(
  .tp-hero:not(.tp-tone-dark),
  .tp-cta:not(.tp-tone-dark),
  .tp-feature__item,
  .tp-faq details
) {
  background: var(--v151-soft);
  color: var(--v151-text);
  border-color: var(--v151-border);
}
html[data-color-theme="dark"] body .tp-public-page .tp-product {
  background: var(--v151-soft);
  color: var(--v151-text) !important;
  border-color: var(--v151-border);
}
html[data-color-theme="dark"] body .tp-public-page .tp-product__placeholder {
  background: var(--v151-surface);
  color: var(--v151-muted);
}
html[data-color-theme="dark"] body .tp-public-page :is(.tp-image, .tp-product img) {
  background: #f7f3f5;
}
html[data-color-theme="dark"] body .tp-public-page :is(
  .tp-breadcrumb,
  .tp-page-titlebar p,
  .tp-feature__item p,
  .tp-faq details p,
  .tp-image figcaption,
  .tp-classic-head p
) {
  color: var(--v151-muted);
}
html[data-color-theme="dark"] body .tp-public-page :is(
  .tp-eyebrow,
  .tp-page-titlebar__eyebrow,
  .tp-feature__item strong,
  .tp-product > span:last-child
) {
  color: var(--v151-accent);
}
html[data-color-theme="dark"] body .tp-public-page :is(.tp-rich, .tp-classic-content) :is(td, th),
html[data-color-theme="dark"] body .tp-public-page .tp-divider {
  border-color: var(--v151-border);
}
