/* ==========================================================================
   Global — base element styles

   Tokens live in variables.css and load first. Nothing here may redefine a
   token; only consume them.
   ========================================================================== */

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

html {
  /* Never disable zoom. user-scalable=0 is an accessibility violation and
     fails Lighthouse's meta-viewport audit. */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--bk-font);
  font-size: var(--bk-fs-lg);
  line-height: var(--bk-lh-normal);
  font-weight: var(--bk-fw-normal);
  color: var(--bk-ink);
  background-color: var(--bk-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Prevent horizontal scroll from full-bleed backgrounds on mobile */
  overflow-x: hidden;
}

/* ---------------------------------------------------------------
   Typography
   ---------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--bk-space-md);
  font-family: var(--bk-font);
  font-weight: var(--bk-fw-extrabold);
  line-height: var(--bk-lh-snug);
  color: var(--bk-navy);
  /* Avoid orphan words at the end of a heading */
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);   /* 36px -> 60px */
  line-height: var(--bk-lh-tight);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.875rem); /* 28px -> 46px */
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);     /* 20px -> 24px */
  line-height: 1.22;
}

h4 {
  font-size: var(--bk-fs-xl);
  line-height: 1.3;
  font-weight: var(--bk-fw-bold);
}

h5, h6 {
  font-size: var(--bk-fs-lg);
  font-weight: var(--bk-fw-bold);
}

p {
  margin: 0 0 var(--bk-space-md);
  line-height: var(--bk-lh-relaxed);
  /* Comfortable measure. Long lines are hard to read. */
  max-width: 68ch;
}

strong { font-weight: var(--bk-fw-bold); }

em { font-style: italic; }

small { font-size: var(--bk-fs-sm); }

/* ---------------------------------------------------------------
   Links

   Underlined by default. Removing underlines breaks WCAG 1.4.1 unless
   colour alone distinguishes the link, which fails on the light
   backgrounds. Underline only to keep body links legible; remove
   underline for buttons and nav where context makes it clear.
   ---------------------------------------------------------------- */

a {
  color: var(--bk-mint-deep);
  text-decoration: underline;
  text-underline-offset: 0.15em;
  transition: color var(--bk-transition);
}

a:hover {
  color: var(--bk-navy);
}

/* Links on dark backgrounds. --bk-mint passes contrast on navy (~9:1);
   --bk-mint-deep would not. */
.bk-on-dark a,
.bk-navy a {
  color: var(--bk-mint);
}

.bk-navy a:hover {
  color: var(--bk-white);
}

.bk-btn,
.bk-nav-menu a,
.bk-footer a {
  text-decoration: none;
}

/* ---------------------------------------------------------------
   Media
   ---------------------------------------------------------------- */

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

svg { fill: currentColor; }

/* Reserve space so lazy-loaded images do not shift layout (CLS). */
img[width][height] {
  height: auto;
}

/* ---------------------------------------------------------------
   Lists
   ---------------------------------------------------------------- */

ul, ol {
  margin: 0 0 var(--bk-space-md);
  padding-left: 1.25rem;
}

li { margin-bottom: var(--bk-space-xs); }

li > ul,
li > ol {
  margin-top: var(--bk-space-xs);
}

/* ---------------------------------------------------------------
   Forms
   ---------------------------------------------------------------- */

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

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: var(--bk-space-md);
  background-color: var(--bk-white);
  border: 1px solid #cbd5e1;
  border-radius: var(--bk-radius-sm);
  transition: border-color var(--bk-transition);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

label {
  display: block;
  margin-bottom: var(--bk-space-xs);
  font-weight: var(--bk-fw-medium);
  color: var(--bk-navy);
}

/* Never use placeholder as the only label. Visually hidden labels are
   available via .bk-sr-only in components.css. */

/* ---------------------------------------------------------------
   Tables
   ---------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: var(--bk-space-md);
  text-align: left;
  border-bottom: 1px solid #dde4ea;
  vertical-align: top;
}

th {
  font-weight: var(--bk-fw-bold);
  color: var(--bk-navy);
}

/* ---------------------------------------------------------------
   Utility
   ---------------------------------------------------------------- */

.visually-hidden,
.bk-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.bk-text-center { text-align: center; }

/* Divi's flex rows default to 80% width with a 1240px cap. These match the
   values found in the live export so new sections line up with existing ones. */
.bk-container {
  width: var(--bk-container-width);
  max-width: var(--bk-container);
  margin-inline: auto;
}

/* ---------------------------------------------------------------
   Print — keeps clinical content legible if a page is ever printed
   ---------------------------------------------------------------- */

@media print {
  .bk-header,
  .bk-footer,
  .bk-nav-menu,
  .bk-btn { display: none !important; }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }
}