/* Dark theme for the whole site: redefines the roles from styles.css, so
   nothing here names a component unless a role can't express the change.
   Applies when theme.js has put data-theme="dark" on <html> (the visitor's
   choice, or the system setting when they have none); load it after
   styles.css. */

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: var(--night);
  --bgSoft: var(--nightSoft);
  --bgTranslucent: rgb(from var(--night) r g b / 72%);
  --bgClear: rgb(from var(--night) r g b / 0%);
  --bgMostly: rgb(from var(--night) r g b / 85%);
  --bgAlmost: rgb(from var(--night) r g b / 93%);
  --surface: var(--nightRaised);
  --panel: var(--night);
  --text: var(--cream);
  --textMuted: var(--grey11);
  --textFaint: var(--grey15);
  /* On a dark surface the separation comes from the surface itself, so
       the borders all but disappear. */
  --border: rgb(from var(--snowWhite) r g b / 7%);
  --accentDark: var(--goldBright);
  --accentLight: rgb(from var(--gold) r g b / 18%);

  --strong: var(--grey5);
  --onStrong: var(--black);
  --buttonPrimaryBgHover: var(--grey3);
  --bgHover: var(--nightHover);
  --bgInset: var(--nightInset);
  --highlight: var(--nightHighlight);
  --highlightBorder: var(--grey17);
  --textHint: var(--grey17);
  --textDisabled: var(--grey20);
  --gridLine: var(--nightHover);
  --tableFill: rgb(from var(--nightSoft) r g b / 80%);
  --rowHighlight: rgb(from var(--snowWhite) r g b / 6%);
  --buttonText: var(--grey9);
  --buttonBorder: var(--grey20);
  --buttonBorderHover: var(--grey17);
  --buttonInnerBg: var(--bg);
  --segmentTrack: var(--nightHover);
  --segmentSelected: var(--nightHighlight);
  --segmentShadow: 0 1px 2px rgb(0 0 0 / 0.3);

  --footerBg: var(--nightDeep);
  --footerText: var(--grey14);
  --shadow-soft: 0 4px 20px -4px rgb(0 0 0 / 0.35);
  --shadow-elevated: 0 12px 40px -8px rgb(0 0 0 / 0.55);
  --shadow-media: 0 12px 32px rgb(0 0 0 / 0.45);
}

/* The rules below nest under :where(), which adds no specificity, so a rule
   here weighs what it would weigh on its own, and the hover and focus rules
   in the other files still beat it. */
:where(:root[data-theme="dark"]) {
  /* The black table colour, brightened so tables, chairs and the "Black"
     entry in the colour picker show on the dark room. Set on body, not
     :root, on purpose: the PDF export reads its colours from :root and must
     keep the real black for its white pages. */
  body {
    --black: var(--blackBright);
    --blackDark: var(--blackBright);
    --blackSemi: rgb(from var(--blackBright) r g b / 47%);
    --blackLight: rgb(from var(--blackBright) r g b / 20%);
  }

  /* The hero shows the gala photo (index.php); the overlay fades the page
     colour over its left side, where the text sits. */
  .landingBody .heroOverlay {
    background: linear-gradient(90deg, var(--bg) 0%, var(--bgMostly) 30%, var(--bgClear) 100%);
  }
  .landingBody .heroImageLight {
    display: none;
  }
  .landingBody .heroImageDark {
    display: block;
  }
  .header-content {
    border-bottom: none;
  }
  /* The logo is the grey-and-gold mark here, like the footer's; the landing
     header also lights it up on hover, and the name brightens with it. */
  #logo {
    display: none;
  }
  #logoDark {
    display: block;
  }
  .landingBody #logoDarkHover {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    height: 54px;
    width: 54px;
    opacity: 0.4;
    transition: 0.2s;
  }
  .landingBody .headerBrand:hover #logoDarkHover {
    opacity: 1;
  }
  /* The app's header name matches its grey logo mark; the landing header
     has its own rule below. */
  #logoTitle {
    color: var(--grey);
  }
  .landingBody #logoTitle {
    color: var(--footerText);
    transition: 0.2s;
  }
  .landingBody .headerBrand:hover #logoTitle {
    color: var(--footerTextHover);
  }
  /* Photographs and recordings, quieter against a dark page. */
  .landingBody .photoTile img,
  .landingBody .pricingImage,
  .landingBody .stepMedia video {
    filter: brightness(0.88);
  }
  /* The PDF pages are white paper; a touch less white. */
  .landingBody .pdfCard img {
    filter: brightness(0.92);
    border: none;
  }

  /* Narrow screens: the text spans most of the width, so the fade runs
     further across. */
  @media (max-width: 800px) {
    .landingBody .heroOverlay {
      background: linear-gradient(90deg, var(--bg) 0%, rgb(from var(--night) r g b / 50%) 100%);
    }
  }

  .tableInfoButton .selectedOption {
    border-color: #fff2;
  }
  .themeMenuPanel {
    border: none;
  }
  .warning {
    color: var(--text);
  }
  .step p:not(button p),
  .stepP {
    color: var(--textMuted);
  }
}
