/* =============================================================================================================
   Product palettes. Each product keeps its own brand inside the Zinteli frame: its page (and its card, tab and
   menu entry) sets data-product, and these variables repaint the accents. Values come from each product's
   AppTheme / brand files; --p-text is its accent darkened or lightened to pass WCAG AA on the page background.

   --p-1     primary (buttons, gradients; white text on it passes AA)
   --p-2     deep shade (hero gradient end)
   --p-glow  highlight glow
   --p-text  accent text colour for the current theme
   ============================================================================================================= */

[data-product="school-manager"] {
  --p-1: #2563eb;
  --p-2: #1e3a8a;
  --p-glow: #38bdf8;
  --p-spark: #f2b544;
  --p-text: #1d4ed8;
}

[data-product="nextlet"] {
  --p-1: #0c7564;
  --p-2: #05264d;
  --p-glow: #2cc9ac;
  --p-spark: #2cc9ac;
  --p-text: #0c7564;
}

[data-product="emailgo"] {
  --p-1: #1e6fe4;
  --p-2: #0b3e94;
  --p-glow: #4fc3f7;
  --p-spark: #4fc3f7;
  --p-text: #1d5fd1;
}

[data-product="lesson-manager"] {
  --p-1: #0b7148;
  --p-2: #0b4a33;
  --p-glow: #2dd4a8;
  --p-spark: #f2b544;
  --p-text: #0b7148;
}

[data-product="di-manager"] {
  --p-1: #0a66a6;
  --p-2: #063a63;
  --p-glow: #1fccea;
  --p-spark: #1fccea;
  --p-text: #0a66a6;
}

[data-product="lets-learn"] {
  --p-1: #0068a8;
  --p-2: #062a45;
  --p-glow: #5fc79a;
  --p-spark: #5fc79a;
  --p-text: #00558a;
}

/* ChatNow: corporate blue to the splash's midnight, with the brand's teal accent as the glow (AppTheme.BrandColours). */
[data-product="chatnow"] {
  --p-1: #1e6fe4;
  --p-2: #071b3b;
  --p-glow: #2dd4bf;
  --p-spark: #2dd4bf;
  --p-text: #0b5cd1;
}

/* Astravane: the game's dim cyan to deep space, with its neon cyan glow and gold credits (UIStyle in UIKit.cs). */
[data-product="astravane"] {
  --p-1: #1b6f86;
  --p-2: #06122b;
  --p-glow: #3fe0ff;
  --p-spark: #ffc94d;
  --p-text: #1b6f86;
}

/* ArabicHub: the app's violet to its deep purple, with its lavender as the glow and Jamal's gold as the spark
   (AppColors in client/lib/ui/theme.dart). */
[data-product="arabichub"] {
  --p-1: #5b3be8;
  --p-2: #221061;
  --p-glow: #d9ccff;
  --p-spark: #ffb81f;
  --p-text: #5b3be8;
}

/* SchoolGo: its green to the deep teal of its app bar, with its bright green as the glow and spark, and its light and
   dark primaries as the accent text (BrandColours, LightColours and DarkColours in ClientRcl/Theme/AppTheme.cs). */
[data-product="schoolgo"] {
  --p-1: #008069;
  --p-2: #075e54;
  --p-glow: #25d366;
  --p-spark: #25d366;
  --p-text: #00715a;
}

/* Prayer Companion: the app's emerald to its deep green, with its soft green as the glow and its gold as the spark, and
   its light and dark primaries as the accent text (IslamicTheme in lib/theme/islamic_theme.dart). */
[data-product="prayer-companion"] {
  --p-1: #167a5e;
  --p-2: #0c4a3a;
  --p-glow: #4db892;
  --p-spark: #d1a54f;
  --p-text: #167a5e;
}

/* TodoGo: its indigo accent to the deep indigo of its icon, with its dark-theme indigo as the glow and its emerald as the
   spark (Palette.Accents in src/TodoGo/Theme/Palette.cs and the gradient in Resources/AppIcon/appicon.svg). */
[data-product="todogo"] {
  --p-1: #5b57f5;
  --p-2: #4338ca;
  --p-glow: #8b87ff;
  --p-spark: #34d399;
  --p-text: #5b57f5;
}

/* TidyHours: its blue to the deep blue of its icon's gradient, with its dark-theme blue as the glow and the pale blue
   lines of its icon as the spark, and its light and dark blue accents as the accent text (Palette.Accents "blue" in
   src/TidyHours/Theme/Palette.cs and Resources/AppIcon/appicon.svg and appiconfg.svg). */
[data-product="tidyhours"] {
  --p-1: #2e59d9;
  --p-2: #1f3fa8;
  --p-glow: #7c9cff;
  --p-spark: #bfd0fa;
  --p-text: #2e59d9;
}

/* PaceGo: its blue to the deep blue of its feature graphic, with its dark-theme blue as the glow and the amber needle
   of its icon as the spark, and its light and dark accents as the accent text (Palette in src/PaceGo/Theme/Palette.cs,
   Resources/AppIcon/appiconfg.svg and docs/store/sources/feature.html). */
[data-product="pacego"] {
  --p-1: #1d4ed8;
  --p-2: #1e3a8a;
  --p-glow: #6ea0ff;
  --p-spark: #fbbf24;
  --p-text: #1d4ed8;
}

/* DoseGo: the deep teal of its icon to its dark teal, with its bright teal as the glow and the capsule's mint as the
   spark (the icon gradient in Resources/AppIcon/appicon.svg and appiconfg.svg; the Teal accent in Theme/Palette.cs).
   The app's own accent, #0e9384, is too light for white text (3.80:1), so the icon's darker end is the primary. */
[data-product="dosego"] {
  --p-1: #0b6f64;
  --p-2: #12332f;
  --p-glow: #2dd4bf;
  --p-spark: #b8f2e6;
  --p-text: #0b6f64;
}

/* CountdownGo: the app's violet to its deep violet, with its light violet as the glow and the icon's gold sparkle as
   the spark, and its light and dark violets as the accent text (the Violet accent in src/CountdownGo/Theme/Palette.cs;
   Resources/AppIcon/appiconfg.svg). */
[data-product="countdowngo"] {
  --p-1: #6d28d9;
  --p-2: #2a2145;
  --p-glow: #a78bfa;
  --p-spark: #fde68a;
  --p-text: #6d28d9;
}

/* MeasureGo: the app's olive accent to its charcoal icon tile, with the icon's lime as the glow and the light bubble's
   green as the spark, and its light and dark accents as the accent text (Palette.Light and Palette.Dark in
   src/MeasureGo/Theme/Palette.cs; the icon colour #14181E in MeasureGo.csproj). */
[data-product="measurego"] {
  --p-1: #4a7300;
  --p-2: #14181e;
  --p-glow: #c6f36b;
  --p-spark: #a6d93b;
  --p-text: #4a7300;
}

/* FerroGo: its light-theme blue to the navy of its icon, with the icon's sky-blue rings as the glow and the detector's
   amber as the spark, and its light and dark accents as the accent text (Palette in src/FerroGo/Theme/Palette.cs and
   Resources/AppIcon/appicon.svg and appiconfg.svg). */
[data-product="ferrogo"] {
  --p-1: #0a66c2;
  --p-2: #0e1a2b;
  --p-glow: #5cc8ff;
  --p-spark: #ffb347;
  --p-text: #0a66c2;
}

/* TurnGo: the app's teal to its deep teal, with its bright teal as the glow and the icon's amber clock face as the
   spark, and its light and dark accents as the accent text (Palette in src/TurnGo/Theme/Palette.cs;
   Resources/AppIcon/appiconfg.svg). */
[data-product="turngo"] {
  --p-1: #0f766e;
  --p-2: #123a36;
  --p-glow: #2dd4bf;
  --p-spark: #f59e0b;
  --p-text: #0f766e;
}

/* FifteenTenFive: its burnt orange to its darker rust, with its light peach (the dark theme's primary) as the glow, spark
   and dark accent text (Primary, PrimaryDark and PrimaryLight in src/FifteenTenFive.App/Resources/Styles/Colors.xaml). */
[data-product="fifteentenfive"] {
  --p-1: #c2410c;
  --p-2: #9a3412;
  --p-glow: #fdba74;
  --p-spark: #fdba74;
  --p-text: #c2410c;
}

/* KidCodeGo: its brand violet to its darker violet, with the mint of "Go" as the glow and its sun yellow as the spark
   (Palette in src/KidCodeGo/Theme/Palette.cs, mirrored in Resources/Styles/Colors.xaml). */
[data-product="kidcodego"] {
  --p-1: #5b5bf7;
  --p-2: #3e3ed6;
  --p-glow: #19c3a6;
  --p-spark: #ffb020;
  --p-text: #3e3ed6;
}

/* Tallywink: its deep sea teal to the navy of its ink, with its light teal as the glow and its sun yellow as the spark
   (Palette in src/Tallywink/Theme/Palette.cs; the dark accent text is PrimaryDark in Resources/Styles/Colors.xaml). */
[data-product="tallywink"] {
  --p-1: #147c93;
  --p-2: #1d2b3a;
  --p-glow: #7fd3e3;
  --p-spark: #ffb627;
  --p-text: #136f82;
}

:root[data-theme="dark"] [data-product="school-manager"],
:root[data-theme="dark"][data-product="school-manager"] {
  --p-text: #7aa7ff;
}

:root[data-theme="dark"] [data-product="nextlet"],
:root[data-theme="dark"][data-product="nextlet"] {
  --p-text: #2cc9ac;
}

:root[data-theme="dark"] [data-product="emailgo"],
:root[data-theme="dark"][data-product="emailgo"] {
  --p-text: #6ca8ff;
}

:root[data-theme="dark"] [data-product="lesson-manager"],
:root[data-theme="dark"][data-product="lesson-manager"] {
  --p-text: #34d399;
}

:root[data-theme="dark"] [data-product="di-manager"],
:root[data-theme="dark"][data-product="di-manager"] {
  --p-text: #1fccea;
}

:root[data-theme="dark"] [data-product="lets-learn"],
:root[data-theme="dark"][data-product="lets-learn"] {
  --p-text: #4db8f0;
}

:root[data-theme="dark"] [data-product="chatnow"],
:root[data-theme="dark"][data-product="chatnow"] {
  --p-text: #6ca8ff;
}

:root[data-theme="dark"] [data-product="astravane"],
:root[data-theme="dark"][data-product="astravane"] {
  --p-text: #3fe0ff;
}

:root[data-theme="dark"] [data-product="arabichub"],
:root[data-theme="dark"][data-product="arabichub"] {
  --p-text: #d9ccff;
}

:root[data-theme="dark"] [data-product="schoolgo"],
:root[data-theme="dark"][data-product="schoolgo"] {
  --p-text: #00a884;
}

:root[data-theme="dark"] [data-product="prayer-companion"],
:root[data-theme="dark"][data-product="prayer-companion"] {
  --p-text: #6fd6b1;
}

:root[data-theme="dark"] [data-product="todogo"],
:root[data-theme="dark"][data-product="todogo"] {
  --p-text: #8b87ff;
}

:root[data-theme="dark"] [data-product="tidyhours"],
:root[data-theme="dark"][data-product="tidyhours"] {
  --p-text: #7c9cff;
}

:root[data-theme="dark"] [data-product="pacego"],
:root[data-theme="dark"][data-product="pacego"] {
  --p-text: #6ea0ff;
}

:root[data-theme="dark"] [data-product="dosego"],
:root[data-theme="dark"][data-product="dosego"] {
  --p-text: #2dd4bf;
}

:root[data-theme="dark"] [data-product="countdowngo"],
:root[data-theme="dark"][data-product="countdowngo"] {
  --p-text: #a78bfa;
}

:root[data-theme="dark"] [data-product="measurego"],
:root[data-theme="dark"][data-product="measurego"] {
  --p-text: #c6f36b;
}

:root[data-theme="dark"] [data-product="ferrogo"],
:root[data-theme="dark"][data-product="ferrogo"] {
  --p-text: #5cc8ff;
}

:root[data-theme="dark"] [data-product="turngo"],
:root[data-theme="dark"][data-product="turngo"] {
  --p-text: #2dd4bf;
}

:root[data-theme="dark"] [data-product="fifteentenfive"],
:root[data-theme="dark"][data-product="fifteentenfive"] {
  --p-text: #fdba74;
}

:root[data-theme="dark"] [data-product="kidcodego"],
:root[data-theme="dark"][data-product="kidcodego"] {
  --p-text: #19c3a6;
}

:root[data-theme="dark"] [data-product="tallywink"],
:root[data-theme="dark"][data-product="tallywink"] {
  --p-text: #7fd3e3;
}

/* On a product page the Zinteli primary yields to the product's, so links and focus rings match. */
[data-product] {
  --primary: var(--p-text);
  --primary-soft: color-mix(in srgb, var(--p-1) 11%, transparent);
  --link: var(--p-text);
  --focus: var(--p-text);
}

[data-product] .btn--primary {
  background: linear-gradient(135deg, var(--p-1), color-mix(in srgb, var(--p-1) 70%, var(--p-2)));
  box-shadow: 0 18px 44px -18px color-mix(in srgb, var(--p-1) 80%, transparent);
}

[data-product] .eyebrow::before {
  background: linear-gradient(90deg, var(--p-1), var(--p-glow));
}

/* On the product's own coloured surfaces the primary button turns white, so it stands out from the gradient. */
[data-product] .product-hero .btn--primary,
[data-product] .cta-band .btn--primary {
  background: #fff;
  color: var(--p-2);
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.5);
}

/* Until the page scrolls, the transparent header sits on the product's colour: switch it to white. */
body:has(.product-hero) .site-header:not(.is-scrolled):not(.is-open) .brand,
body:has(.product-hero) .site-header:not(.is-scrolled):not(.is-open) .nav__link,
body:has(.product-hero) .site-header:not(.is-scrolled):not(.is-open) .nav__trigger {
  color: rgba(255, 255, 255, 0.9);
}

body:has(.product-hero) .site-header:not(.is-scrolled):not(.is-open) .nav__link:hover,
body:has(.product-hero) .site-header:not(.is-scrolled):not(.is-open) .nav__trigger:hover,
body:has(.product-hero) .site-header:not(.is-scrolled):not(.is-open) .nav__trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

body:has(.product-hero) .site-header:not(.is-scrolled):not(.is-open) .icon-btn {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
