/*
 * Felt glass, dark scheme: a site opts in with `theme: 'felt-glass-dark'` (SiteOptions), which
 * puts `bf-theme-felt-glass-dark` on <html>, sets --bf-glass-background to the Felt dark
 * background asset and loads this file after rhds-felt.css. Trial on IslandView (ADR 0024).
 *
 * Source: @patternfly/patternfly 6.6.1 base/tokens/tokens-felt-glass-dark.scss and the glass
 * mode handbook (patternfly.org/foundations-and-styles/theming/glass-mode-handbook): glass
 * panels are gray-80 at 50% with a 16px backdrop blur, the alt border, the medium radius and the
 * md shadow, over the Felt dark background image. Glass is never nested, and reduced
 * transparency or more contrast turns it into solid panels.
 *
 * RHDS mechanism at 4.2.2: color-palette sets `color-scheme` and --rh-color-surface on :host,
 * and every --rh-* and --bf-* colour is light-dark(). Author styles on the host beat :host
 * rules, so forcing `color-scheme: only dark` on palette hosts turns the whole page dark without
 * repointing a colour token, and a transparent host background lets the image through.
 */
.bf-theme-felt-glass-dark {
  --_glass: color-mix(in srgb, var(--rh-color-gray-80) 50%, transparent);
  --_glass-solid: var(--rh-color-gray-80);

  color-scheme: only dark;
  background: var(--rh-color-gray-95) var(--bf-glass-background) center / cover fixed no-repeat;

  & body,
  & [color-palette],
  & .bf-hero,
  & .bf-footer {
    color-scheme: only dark;
    background: transparent;
  }

  /* Single near-black fill logos, inverted as on the dark footer (layouts/site.css). */
  & .bf-header img,
  & .bf-logo-wall__logos img {
    filter: invert(1);
  }

  /* Glass panels: the masthead, cards, the FAQ, the closing band and the footer. */
  & rh-navigation-primary,
  & rh-card::part(container),
  & rh-accordion,
  & .bf-closing-cta rh-surface,
  & .bf-footer-surface {
    background-color: var(--_glass);
    backdrop-filter: blur(var(--rh-space-lg));
    border: var(--rh-border-width-sm) solid var(--rh-color-border-subtle);
    box-shadow: var(--rh-box-shadow-md);
  }

  & rh-card::part(container),
  & rh-accordion,
  & .bf-closing-cta rh-surface {
    border-radius: var(--rh-border-radius-default);
  }

  @media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
    & rh-navigation-primary,
    & rh-card::part(container),
    & rh-accordion,
    & .bf-closing-cta rh-surface,
    & .bf-footer-surface {
      background-color: var(--_glass-solid);
      backdrop-filter: none;
    }
  }
}
