/* Page defaults: colours, body text, links and the focus ring */

@layer base {
  /* Room for the sticky bar at the top, and the back to top button at the bottom (components.css), so
     neither covers what Tab or a link scrolls into view (WCAG 2.4.11) */
  html {
    scroll-padding-top: calc(var(--header-height) + var(--space-s));
    scroll-padding-bottom: calc(var(--target-size) + var(--space-s) * 2);
  }

  body { background: var(--color-white); color: var(--color-text); font-family: var(--font-sans); font-size: var(--text-base); font-weight: var(--weight-normal); line-height: var(--leading); }

  :where(h1, h2, h3, h4) { color: var(--color-ink); }

  a { text-underline-offset: 0.2em; }

  strong, b { font-weight: var(--weight-bold); }

  /* The old body grey fails contrast on the light bands, so text there is a shade darker */
  .section--light { --color-text: var(--color-text-on-paper); --color-muted: var(--color-text-on-paper); }

  /* One focus ring for everything, shown to keyboard users only: a dark ring with a white halo inside it,
     so it shows on white, grey and photos alike. On dark surfaces the colours swap. */
  :focus-visible { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); box-shadow: 0 0 0 var(--focus-offset) var(--color-focus-halo); }
  /* A frame (a showroom map) with focus inside it: browsers don't match :focus on frames, so
     assets/scripts/components/frame-focus.js marks it */
  iframe[data-focused] { outline: var(--focus-width) solid var(--color-focus); outline-offset: var(--focus-offset); }
  .section--dark, .site-footer, .site-bar, .hero--image, .cta--image { --color-focus: var(--color-white); --color-focus-halo: var(--color-ink-fixed); }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
  }
}
