/* portal-themes.css - named palette themes for the portal.
 *
 * A "theme" is a named palette chosen per-user in Settings; the light/dark
 * switch in the masthead is a SEPARATE axis (mode). Every theme ships a
 * bespoke light AND dark palette, so the two axes compose: theme x mode.
 *
 * HOW IT WORKS, and why it does not violate CLAUDE.md rule 1a.
 * PatternFly 6 resolves colour through three layers: a component reads a
 * SEMANTIC token (e.g. --pf-t--global--background--color--secondary--default),
 * which points at a PALETTE token (--pf-t--global--background--color--200),
 * which points at a raw colour. The dark theme redefines the semantic tokens
 * to point at the `--dark--` palette instead. We re-skin by overriding the
 * PALETTE tokens under a [data-portal-theme] attribute, plus a few documented
 * COMPONENT tokens (masthead/sidebar background). We never write behaviour for
 * a pf-* class and never re-implement a component - we only re-point tokens
 * PatternFly already reads. Loaded AFTER patternfly.css so the attribute
 * selectors win.
 *
 * TWO SCOPES, learned the hard way by reading computed styles live:
 *  - GLOBAL palette tokens (--pf-t--global--*) are defined on :root, so
 *    overriding them at :root[data-portal-theme="x"] (0,2,0 > :root 0,1,0)
 *    flows through every component by inheritance.
 *  - COMPONENT tokens (--pf-v6-c-masthead--BackgroundColor, the sidebar's)
 *    are RE-defined on the component element itself, so a :root override is
 *    shadowed. They must be set on the element: `[data-portal-theme] .pf-v6-c-x`.
 *
 * PALETTE-TOKEN MAP:
 *   LIGHT: background--color--100 = surface/cards, --200 = page ground,
 *          --300 = subtle. brand--200 = primary action + default.
 *   DARK (INVERTED): dark--background--color--100 = page ground,
 *          --200 = cards, --300 = subtle. dark--color--brand--100 = default.
 *   text--color--100/200 = regular/subtle. border--color--100/300/400
 *   = subtle/default/strong. text--color--link--100/200 = link/hover.
 *
 * Every custom theme uses a deep, always-dark masthead (the Satellite
 * signature) with light text in both modes - which also sidesteps the
 * light-mode "dark text on a coloured bar" contrast trap.
 */

/* Light text + icons for the deep masthead every custom theme uses. Overrides
   the semantic text/icon tokens ONLY inside the masthead subtree, so the
   dropdown toggles, the theme switch and the user menu read light on the dark
   bar in both modes. Status count badges keep their own semantic colours. */
:root[data-portal-theme="flyerft"] .pf-v6-c-masthead,
:root[data-portal-theme="midnight"] .pf-v6-c-masthead,
:root[data-portal-theme="graphite"] .pf-v6-c-masthead,
:root[data-portal-theme="evergreen"] .pf-v6-c-masthead {
  color: #f5f2ea;
  --pf-t--global--text--color--regular: #f5f2ea;
  --pf-t--global--text--color--subtle: rgba(245, 242, 234, 0.72);
  --pf-t--global--icon--color--regular: #f5f2ea;
  --pf-t--global--icon--color--subtle: rgba(245, 242, 234, 0.70);
  --pf-t--global--border--color--default: rgba(255, 255, 255, 0.28);
  --pf-v6-c-masthead--BorderColor: rgba(255, 255, 255, 0.14);
  /* The org/location switchers and menu-toggles are form-controls/menu-toggles
     whose surface is background--color--control--default - WHITE in light mode.
     On the always-dark bar that rendered the light text (above) white-on-white,
     the "impossible to read" report (2026-09-12). Give the control surface a
     translucent light fill so it reads as a dark control on the navy bar in
     BOTH modes, with the light text and border above. */
  --pf-t--global--background--color--control--default: rgba(255, 255, 255, 0.12);
}

/* But the masthead's POPUP MENUS (the org/location switcher dropdowns, the user
   menu's "User Settings"/"Log out", the overflow and theme menus) and the
   NOTIFICATION DRAWER are in-DOM descendants of the masthead, and their surface
   follows the MODE - white in light, dark in dark - NOT the navy bar. The light
   text above therefore rendered white-on-white in light mode (owner screenshot
   2026-09-12 for the menus; the drawer's own Settings section, unreadable the
   same way, found live 2026-09-15). Restore the mode-appropriate text on both:
   the theme's own regular/subtle text (dark on the white light-mode popup), and
   its dark-palette text under pf-v6-theme-dark (light on the dark popup).
   `[data-portal-theme]` matches any custom theme (the default renders no
   attribute). */
:root[data-portal-theme] .pf-v6-c-masthead .pf-v6-c-menu,
:root[data-portal-theme] .pf-v6-c-masthead .pf-v6-c-notification-drawer {
  color: var(--pf-t--global--text--color--100);
  --pf-t--global--text--color--regular: var(--pf-t--global--text--color--100);
  --pf-t--global--text--color--subtle: var(--pf-t--global--text--color--200);
  --pf-t--global--icon--color--regular: var(--pf-t--global--text--color--100);
  --pf-t--global--icon--color--subtle: var(--pf-t--global--text--color--200);
}
:root[data-portal-theme].pf-v6-theme-dark .pf-v6-c-masthead .pf-v6-c-menu,
:root[data-portal-theme].pf-v6-theme-dark .pf-v6-c-masthead .pf-v6-c-notification-drawer {
  color: var(--pf-t--global--dark--text--color--100);
  --pf-t--global--text--color--regular: var(--pf-t--global--dark--text--color--100);
  --pf-t--global--text--color--subtle: var(--pf-t--global--dark--text--color--200);
  --pf-t--global--icon--color--regular: var(--pf-t--global--dark--text--color--100);
  --pf-t--global--icon--color--subtle: var(--pf-t--global--dark--text--color--200);
}

/* =====================================================================
   FlyerFT - the go-launcher look, extracted live from onboarding.flyerft.com.
   Light: parchment ground, white cards, navy chrome + actions, sand borders.
   Dark ("Ink"): the parchment carried in as text on a warm espresso ground.
   ===================================================================== */
:root[data-portal-theme="flyerft"] {
  /* light */
  --pf-t--global--background--color--100: #ffffff;
  --pf-t--global--background--color--200: #f7f2e7;
  --pf-t--global--background--color--300: #efe7d5;
  --pf-t--global--text--color--100: #26231c;
  --pf-t--global--text--color--200: #6e6656;
  --pf-t--global--border--color--100: #ece3cd;
  --pf-t--global--border--color--300: #dcc9a0;
  --pf-t--global--border--color--400: #c9b58e;
  --pf-t--global--color--brand--100: #14508c;
  --pf-t--global--color--brand--200: #0c447c;
  --pf-t--global--color--brand--300: #0a3868;
  --pf-t--global--text--color--link--100: #0c447c;
  --pf-t--global--text--color--link--200: #0a3868;
  /* dark (Ink) - bg tokens inverted per PF: 100 = ground, 200 = cards */
  --pf-t--global--dark--background--color--100: #1e1b15;
  --pf-t--global--dark--background--color--200: #2a251e;
  --pf-t--global--dark--background--color--300: #332d25;
  --pf-t--global--dark--text--color--100: #f2ecdd;
  --pf-t--global--dark--text--color--200: #b4aa93;
  --pf-t--global--dark--border--color--100: #3a342a;
  --pf-t--global--dark--border--color--300: #4a4234;
  --pf-t--global--dark--color--brand--100: #6ba6de;
  --pf-t--global--dark--color--brand--200: #5b9ad6;
  --pf-t--global--dark--color--brand--300: #8fbce8;
  --pf-t--global--dark--text--color--link--100: #7fb4e4;
  --pf-t--global--dark--text--color--link--200: #a9cdef;
}
:root[data-portal-theme="flyerft"] .pf-v6-c-masthead { --pf-v6-c-masthead--BackgroundColor: #0a3868; }
:root[data-portal-theme="flyerft"] .pf-v6-c-page__sidebar { --pf-v6-c-page__sidebar--BackgroundColor: #ffffff; }
:root[data-portal-theme="flyerft"].pf-v6-theme-dark .pf-v6-c-page__sidebar { --pf-v6-c-page__sidebar--BackgroundColor: #241f19; }

/* =====================================================================
   Midnight - navy as an identity. Light: cool paper, deep-navy chrome.
   Dark: the navy becomes the whole ground, a crisp azure carries actions.
   ===================================================================== */
:root[data-portal-theme="midnight"] {
  /* light */
  --pf-t--global--background--color--100: #ffffff;
  --pf-t--global--background--color--200: #eef1f5;
  --pf-t--global--background--color--300: #e1e6ec;
  --pf-t--global--text--color--100: #16202e;
  --pf-t--global--text--color--200: #5a6675;
  --pf-t--global--border--color--100: #dee4ec;
  --pf-t--global--border--color--300: #c4ceda;
  --pf-t--global--border--color--400: #a9b6c6;
  --pf-t--global--color--brand--100: #123a63;
  --pf-t--global--color--brand--200: #0e2d50;
  --pf-t--global--color--brand--300: #0a2038;
  --pf-t--global--text--color--link--100: #145091;
  --pf-t--global--text--color--link--200: #0e3a6b;
  /* dark */
  --pf-t--global--dark--background--color--100: #0e2038;
  --pf-t--global--dark--background--color--200: #152b49;
  --pf-t--global--dark--background--color--300: #1b3357;
  --pf-t--global--dark--text--color--100: #e7eef7;
  --pf-t--global--dark--text--color--200: #9db0c6;
  --pf-t--global--dark--border--color--100: #223a5c;
  --pf-t--global--dark--border--color--300: #2f4a72;
  --pf-t--global--dark--color--brand--100: #4c8fd0;
  --pf-t--global--dark--color--brand--200: #3f80c4;
  --pf-t--global--dark--color--brand--300: #6ba6de;
  --pf-t--global--dark--text--color--link--100: #6ba6de;
  --pf-t--global--dark--text--color--link--200: #92c5f9;
}
:root[data-portal-theme="midnight"] .pf-v6-c-masthead { --pf-v6-c-masthead--BackgroundColor: #08182c; }
:root[data-portal-theme="midnight"] .pf-v6-c-page__sidebar { --pf-v6-c-page__sidebar--BackgroundColor: #ffffff; }
:root[data-portal-theme="midnight"].pf-v6-theme-dark .pf-v6-c-page__sidebar { --pf-v6-c-page__sidebar--BackgroundColor: #0c1c31; }

/* =====================================================================
   Graphite - cool, neutral, corporate. Grounded in GitHub Primer's colour
   system: canvas / foreground / accent hexes are Primer's own.
   ===================================================================== */
:root[data-portal-theme="graphite"] {
  /* light (Primer light) */
  --pf-t--global--background--color--100: #ffffff;
  --pf-t--global--background--color--200: #f6f8fa;
  --pf-t--global--background--color--300: #eaeef2;
  --pf-t--global--text--color--100: #1f2328;
  --pf-t--global--text--color--200: #656d76;
  --pf-t--global--border--color--100: #e6eaef;
  --pf-t--global--border--color--300: #d0d7de;
  --pf-t--global--border--color--400: #afb8c1;
  --pf-t--global--color--brand--100: #218bff;
  --pf-t--global--color--brand--200: #0969da;
  --pf-t--global--color--brand--300: #0550ae;
  --pf-t--global--text--color--link--100: #0969da;
  --pf-t--global--text--color--link--200: #0550ae;
  /* dark (Primer dark) */
  --pf-t--global--dark--background--color--100: #0d1117;
  --pf-t--global--dark--background--color--200: #161b22;
  --pf-t--global--dark--background--color--300: #21262d;
  --pf-t--global--dark--text--color--100: #e6edf3;
  --pf-t--global--dark--text--color--200: #9198a1;
  --pf-t--global--dark--border--color--100: #21262d;
  --pf-t--global--dark--border--color--300: #30363d;
  --pf-t--global--dark--color--brand--100: #2f81f7;
  --pf-t--global--dark--color--brand--200: #388bfd;
  --pf-t--global--dark--color--brand--300: #58a6ff;
  --pf-t--global--dark--text--color--link--100: #4493f8;
  --pf-t--global--dark--text--color--link--200: #58a6ff;
}
/* Primer's masthead is near-black; distinct from the slate cards in each mode. */
:root[data-portal-theme="graphite"] .pf-v6-c-masthead { --pf-v6-c-masthead--BackgroundColor: #161b22; }
:root[data-portal-theme="graphite"].pf-v6-theme-dark .pf-v6-c-masthead { --pf-v6-c-masthead--BackgroundColor: #010409; }
:root[data-portal-theme="graphite"] .pf-v6-c-page__sidebar { --pf-v6-c-page__sidebar--BackgroundColor: #ffffff; }
:root[data-portal-theme="graphite"].pf-v6-theme-dark .pf-v6-c-page__sidebar { --pf-v6-c-page__sidebar--BackgroundColor: #0d1117; }

/* =====================================================================
   Evergreen - calm and warm. Warm-white paper with a pine accent in light;
   a deep charcoal-green in dark. The quiet ops-console option.
   ===================================================================== */
:root[data-portal-theme="evergreen"] {
  /* light */
  --pf-t--global--background--color--100: #ffffff;
  --pf-t--global--background--color--200: #f5f4ef;
  --pf-t--global--background--color--300: #e9e8e0;
  --pf-t--global--text--color--100: #1c2b26;
  --pf-t--global--text--color--200: #5c6660;
  --pf-t--global--border--color--100: #e4e3da;
  --pf-t--global--border--color--300: #d2d2c6;
  --pf-t--global--border--color--400: #b4b8ac;
  --pf-t--global--color--brand--100: #1f7a5c;
  --pf-t--global--color--brand--200: #16624a;
  --pf-t--global--color--brand--300: #0f4d3a;
  --pf-t--global--text--color--link--100: #16624a;
  --pf-t--global--text--color--link--200: #0f4d3a;
  /* dark */
  --pf-t--global--dark--background--color--100: #14201b;
  --pf-t--global--dark--background--color--200: #1d2b25;
  --pf-t--global--dark--background--color--300: #26352e;
  --pf-t--global--dark--text--color--100: #e7efe9;
  --pf-t--global--dark--text--color--200: #9ba89f;
  --pf-t--global--dark--border--color--100: #2a3a32;
  --pf-t--global--dark--border--color--300: #35473d;
  --pf-t--global--dark--color--brand--100: #4fae86;
  --pf-t--global--dark--color--brand--200: #43a078;
  --pf-t--global--dark--color--brand--300: #6fc2a0;
  --pf-t--global--dark--text--color--link--100: #5bb891;
  --pf-t--global--dark--text--color--link--200: #7fc9a8;
}
:root[data-portal-theme="evergreen"] .pf-v6-c-masthead { --pf-v6-c-masthead--BackgroundColor: #143026; }
:root[data-portal-theme="evergreen"] .pf-v6-c-page__sidebar { --pf-v6-c-page__sidebar--BackgroundColor: #ffffff; }
:root[data-portal-theme="evergreen"].pf-v6-theme-dark .pf-v6-c-page__sidebar { --pf-v6-c-page__sidebar--BackgroundColor: #0f1a15; }
