/*
 * The steel photograph behind the site and the "photo" theme over it (user, 2026-11-20: "some sort of steely metalic
 * background that gives the feel of industrial machinery", then "I'd rather have the full fantasy look"), done the way
 * fantasy.rokroot.com does it (PhotoBackdrop.jsx, PhotoTheme.css):
 *   - the photo is fixed behind the page, larger than the window, and drifts as the page scrolls (js/backdrop.js),
 *     under a dark veil;
 *   - text turns white with a soft shadow, and boxes, tables, inputs and the page itself are see-through glass, so the
 *     picture shows between the words. Each box keeps a tint of its old colour.
 * Only pages on Training.master carry the markup (body.has-backdrop); admin pages are unchanged. The theme is for the
 * screen only: printing keeps the site's original light look. The photo is CC BY-SA 3.0, credited in the footer.
 */

/* ---- The photograph ---- */

.photo-backdrop {
  --pan-x: 0.5;
  --pan-y: 0.3;
  --zoom: 1.3;

  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: #22262a;
}

.photo-backdrop__image {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100vw * var(--zoom));
  height: calc(100vh * var(--zoom));
  background: url("backdrop/bearing-2560.jpg") center / cover no-repeat;
  transform: translate3d(calc(100vw * (1 - var(--zoom)) * var(--pan-x)), calc(100vh * (1 - var(--zoom)) * var(--pan-y)), 0);
  will-change: transform;
}

/* The veil: darkest at the top and bottom, as on the fantasy site; a little darker overall, because this photo is
   bright polished steel. */
.photo-backdrop::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, rgba(3, 7, 15, 0.7) 0%, rgba(3, 7, 15, 0.55) 40%, rgba(3, 7, 15, 0.65) 100%);
}

@media (max-width: 900px) {
  .photo-backdrop__image {
    background-image: url("backdrop/bearing-1440.jpg");
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-backdrop__image {
    will-change: auto;
  }
}

@media print {
  .photo-backdrop {
    display: none;
  }
}

/* ---- The photo theme: light text, see-through surfaces (screen only) ---- */

@media screen {

  body.has-backdrop {
    margin: 0;
    background: #22262a;            /* until the photo arrives */
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  }

  /* The page: a pane of glass over the photo, the banner on top of it */
  body.has-backdrop .site-panel {
    width: 1125px;
    margin: 16px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    background: rgba(5, 9, 18, 0.42);
    backdrop-filter: blur(3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  }

  body.has-backdrop .auto-style1 {   /* the layout table's cells, white in Training.master */
    background-color: transparent;
  }

  body.has-backdrop a:link,
  body.has-backdrop a:visited {
    color: #9fcbff;
  }

  body.has-backdrop a:hover {
    color: #c8e1ff;
  }

  /* Titles and text that were coloured for white */
  body.has-backdrop .CatalogTitle,
  body.has-backdrop .ShoppingCartTitle,
  body.has-backdrop a.ProductName:link,
  body.has-backdrop a.ProductName:visited {
    color: #ff8a80;
  }

  body.has-backdrop .ProductTitle {
    color: #9fcbff;
  }

  body.has-backdrop .CatalogDescription,
  body.has-backdrop .ProductDescription,
  body.has-backdrop .ProductPrice,
  body.has-backdrop .PagingText,
  body.has-backdrop .Button,
  body.has-backdrop .SmallButtonText,
  body.has-backdrop .RecommendationHead,
  body.has-backdrop .RecommendationText {
    color: #e9eef4;
  }

  body.has-backdrop a.RecommendationLink,
  body.has-backdrop a.CartLink:link,
  body.has-backdrop a.CartLink:visited {
    color: #9fcbff;
  }

  body.has-backdrop a.CartLink:hover,
  body.has-backdrop a.RecommendationLink:hover {
    color: #c8e1ff;
  }

  /* Colours set inline by the pages (ForeColor="Red", style="color: red", the access box's states) */
  body.has-backdrop [style*="color:Red"],
  body.has-backdrop [style*="color: red"] {
    color: #ffb4b4 !important;
  }

  body.has-backdrop [style*="color: #006400"] {
    color: #8ff0b2 !important;
  }

  body.has-backdrop [style*="color: #b00020"] {
    color: #ffb4b4 !important;
  }

  body.has-backdrop [style*="color: #7a5c00"] {
    color: #fcd98c !important;
  }

  /* The home page's red and yellow markers on modules still in production */
  body.has-backdrop a[style*="background-color:Red"] {
    color: #ffffff !important;
  }

  body.has-backdrop a[style*="background-color:Yellow"] {
    color: #000000 !important;
    text-shadow: none;
  }

  /* Glass boxes, each with a tint of its old colour */
  body.has-backdrop .UserInfoContent,
  body.has-backdrop .SearchBoxContent,
  body.has-backdrop .CartSummary,
  body.has-backdrop .UserDetailsTable,
  body.has-backdrop .FocusAreaListContent,
  body.has-backdrop .CategoryListContent {
    border-color: rgba(255, 255, 255, 0.24);
    background-color: rgba(10, 16, 28, 0.5);
    color: #ffffff;
  }

  body.has-backdrop .FocusAreaListContent {
    background-color: rgba(16, 70, 48, 0.55);       /* was mint green */
  }

  body.has-backdrop .CategoryListContent {
    background-color: rgba(90, 52, 14, 0.55);       /* was orange */
  }

  body.has-backdrop .UserInfoHead {
    border-color: rgba(255, 255, 255, 0.24);
    background-color: rgba(220, 20, 60, 0.78);
    color: #ffffff;
  }

  body.has-backdrop .SearchBoxHead {
    border-color: rgba(255, 255, 255, 0.24);
    background-color: rgba(5, 131, 181, 0.78);
    color: #ffffff;
  }

  body.has-backdrop .UserDetailsTableHead {
    border-bottom-color: rgba(255, 255, 255, 0.24);
    background-color: rgba(102, 102, 153, 0.8);
    color: #ffffff;
  }

  body.has-backdrop .UserDetailsTable {
    border-color: rgba(147, 197, 253, 0.5);
  }

  body.has-backdrop .CartSummary {
    border-color: rgba(147, 197, 253, 0.5);
  }

  body.has-backdrop a.FocusAreaUnselected:link,
  body.has-backdrop a.FocusAreaUnselected:visited {
    color: #a8e6cf;
  }

  body.has-backdrop a.FocusAreaUnselected:hover {
    color: #d8ffe8;
  }

  body.has-backdrop a.FocusAreaSelected:link,
  body.has-backdrop a.FocusAreaSelected:visited {
    color: #ffffff;
  }

  body.has-backdrop a.CategoryUnselected:link,
  body.has-backdrop a.CategoryUnselected:visited {
    color: #f8c78c;
  }

  body.has-backdrop a.CategoryUnselected:hover {
    color: #ffe2bd;
  }

  body.has-backdrop a.CategorySelected:link,
  body.has-backdrop a.CategorySelected:visited {
    color: #ffffff;
  }

  body.has-backdrop a.UserInfoLink:link,
  body.has-backdrop a.UserInfoLink:visited {
    color: #ff9fb3;
  }

  body.has-backdrop a.UserInfoLink:hover {
    color: #ffc8d3;
  }

  /* Grids (the cart, the order details): the box is the glass, the cells are clear */
  body.has-backdrop .GridHeader {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
  }

  body.has-backdrop .GridRow,
  body.has-backdrop .GridEditingRow {
    background-color: rgba(10, 16, 28, 0.45);
    color: #ffffff;
  }

  body.has-backdrop .GridAlternateRow {
    background-color: rgba(255, 255, 255, 0.07);
    color: #ffffff;
  }

  /* Inputs and buttons */
  body.has-backdrop input[type="text"],
  body.has-backdrop input[type="password"],
  body.has-backdrop input[type="email"],
  body.has-backdrop textarea,
  body.has-backdrop select {
    border: 1px solid rgba(255, 255, 255, 0.32);
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  body.has-backdrop select option {
    color: #0f172a;
    background: #ffffff;
    text-shadow: none;
  }

  body.has-backdrop input[type="submit"],
  body.has-backdrop input[type="button"],
  body.has-backdrop button,
  body.has-backdrop a.LabDownload {
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
  }

  body.has-backdrop input[type="submit"]:hover,
  body.has-backdrop input[type="button"]:hover,
  body.has-backdrop button:hover,
  body.has-backdrop a.LabDownload:hover {
    background-color: rgba(255, 255, 255, 0.2);
  }

  /* The sign-up wizard's own colours (Register.aspx) */
  body.has-backdrop [style*="#F7F6F3"],
  body.has-backdrop [style*="#FFFBFF"] {
    background-color: rgba(10, 16, 28, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.24) !important;
    color: #ffffff !important;
  }

  body.has-backdrop [style*="#5D7B9D"] {
    background-color: rgba(93, 123, 157, 0.8) !important;
  }

  body.has-backdrop [style*="#284775"] {
    color: #ffffff !important;
  }

  /* The photo credit at the foot of the page */
  body.has-backdrop .photo-credit {
    margin-top: 16px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    font-family: Verdana, Arial, sans-serif;
    font-size: 10px;
    line-height: 15px;
    color: #c5d0dd;
  }

  /* Written case studies (CaseStudy.css): its light values swapped for dark ones. The chart keeps a solid surface,
     #1a1a19, the dark surface its colours (the dataviz palette's dark steps for slots 1 and 2) were validated on. */
  body.has-backdrop .CaseStudy {
    --cs-ink: #ffffff;
    --cs-ink-2: #e9eef4;
    --cs-muted: #c5d0dd;
    --cs-grid: #383835;
    --cs-axis: #6b6a64;
    --cs-surface: #1a1a19;
    --cs-wash: rgba(255, 255, 255, 0.08);
    --cs-rule: rgba(255, 255, 255, 0.18);
    --cs-accent: #5fb6e0;
    --cs-series-1: #3987e5;
    --cs-series-2: #d95926;
  }

  body.has-backdrop .CaseStudy h2 {
    color: #9fcbff;
  }

  body.has-backdrop .CaseStudy a:link,
  body.has-backdrop .CaseStudy a:visited {
    color: #9fcbff;
  }

  body.has-backdrop .CaseStudy blockquote {
    background: rgba(147, 197, 253, 0.14);
  }

  body.has-backdrop .CaseStudy p.CsLocked {
    background: rgba(245, 158, 11, 0.28);
    border-left: 4px solid #fcd98c;
  }

  body.has-backdrop .CaseStudy p.CsWarning {
    background: rgba(239, 68, 68, 0.28);
    border-left-color: #ffb4b4;
  }

  body.has-backdrop .CaseStudy .CsFigure {
    text-shadow: none;
  }

  body.has-backdrop .CaseStudy .CsFigure figcaption,
  body.has-backdrop .CaseStudy .CsLegend {
    color: #c3c2b7;
  }

  body.has-backdrop .CaseStudy .CsTip {
    background: #1a1a19;
    color: #f0efec;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  }
}
