/* ==========================================================================
   BBCB BASE STYLES
   Reset, page defaults, typography, focus and layout helpers.
   Loads on every page, after tokens.css. Uses tokens only.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* "clip" stops sideways scroll without creating a scroll container.
   (The prototype's overflow-x: hidden caused the Safari/iPad rotation bug.) */
html,
body {
  overflow-x: clip;
}

body {
  margin: 0;
  background: var(--color-white);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-4);
  color: var(--color-navy);
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
}

h4,
h5,
h6 {
  font-size: var(--fs-h4);
  font-weight: 600;
}

p {
  margin: 0 0 var(--space-4);
}

/* Links use the stronger blue: it passes AA on white, the brand blue does not. */
a {
  color: var(--color-primary-strong);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary-dark);
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

::placeholder {
  color: var(--color-input-placeholder);
  opacity: 1;
}

::selection {
  background: var(--color-primary-strong);
  color: var(--color-white);
}

/* Keyboard focus: a white ring inside a navy ring, so it shows on any background. */
:focus-visible {
  outline: 3px solid var(--color-navy);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--color-white);
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Helpers
   -------------------------------------------------------------------------- */
.bbcb-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.bbcb-skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 1000;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  background: var(--color-navy);
  color: var(--color-white);
  font-weight: 600;
}

.bbcb-skip-link:focus {
  top: var(--space-4);
  color: var(--color-white);
}

.bbcb-container {
  width: 100%;
  max-width: calc(var(--container-max) + (var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.bbcb-nowrap {
  white-space: nowrap;
}

.bbcb-lead {
  font-size: var(--fs-lead);
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   Content is visible by default. It is only hidden while waiting to animate
   when JavaScript is running (html.bbcb-js) and the visitor has not asked for
   reduced motion. reveal.js adds .is-revealed when the element scrolls in.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .bbcb-js [data-bbcb-reveal] {
    opacity: 0;
    transform: translateY(var(--reveal-distance));
    transition:
      opacity var(--duration-slow) var(--ease-out),
      transform var(--duration-slow) var(--ease-out);
    transition-delay: calc(var(--reveal-index, 0) * var(--reveal-stagger));
  }

  .bbcb-js [data-bbcb-reveal="fade"] {
    transform: none;
  }

  .bbcb-js [data-bbcb-reveal].is-revealed,
  .elementor-editor-active [data-bbcb-reveal] {
    opacity: 1;
    transform: none;
  }
}
