/* ==========================================================================
   Base — reset, elements, typography, accessibility utilities
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchors clear the sticky header. */
  scroll-padding-top: calc(var(--cp-header-h) + 1.5rem);
}
/* ...and the admin bar too, when it is present. */
body.admin-bar {
  --cp-admin-bar: 32px;
}
@media screen and (max-width: 782px) {
  body.admin-bar { --cp-admin-bar: 46px; }
}
html:has(body.admin-bar) {
  scroll-padding-top: calc(var(--cp-header-h) + var(--cp-admin-bar, 0px) + 1.5rem);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--cp-ivory);
  color: var(--cp-ink);
  font-family: var(--cp-font-sans);
  font-size: var(--cp-step-0);
  line-height: var(--cp-lh-normal);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Guarantees the "zero horizontal overflow" requirement even if a
     decorative child misbehaves. */
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--cp-font-display);
  font-weight: 400;
  line-height: var(--cp-lh-tight);
  letter-spacing: var(--cp-track-tight);
  text-wrap: balance;
}

h1 { font-size: var(--cp-step-5); }
h2 { font-size: var(--cp-step-4); }
h3 { font-size: var(--cp-step-2); }
h4 { font-size: var(--cp-step-1); }

p { margin: 0 0 1.15em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }

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

/* Images are presentation content throughout this theme, never drag sources. */
img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { background: none; border: 0; cursor: pointer; }

::selection { background: var(--cp-azure); color: #fff; }

hr {
  border: 0;
  border-top: 1px solid var(--cp-rule);
  margin: var(--cp-space-lg) 0;
}

/* ---- Focus -------------------------------------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--cp-focus);
  outline-offset: 3px;
  border-radius: 2px;
}
.cp-dark :focus-visible { outline-color: var(--cp-focus); }

/* ---- Accessibility utilities ------------------------------------------- */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  position: fixed !important;
  top: 1rem; left: 1rem;
  z-index: 10000;
  width: auto; height: auto;
  clip: auto; clip-path: none;
  padding: 0.75rem 1.25rem;
  background: var(--cp-navy);
  color: var(--cp-on-dark);
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow-lg);
}

/* ---- Type roles --------------------------------------------------------- */
.cp-display   { font-family: var(--cp-font-display); font-size: var(--cp-step-6); line-height: var(--cp-lh-tight); }
.cp-h2        { font-family: var(--cp-font-display); font-size: var(--cp-step-4); line-height: var(--cp-lh-tight); }
.cp-h3        { font-family: var(--cp-font-display); font-size: var(--cp-step-3); line-height: var(--cp-lh-snug); }

.cp-lede {
  font-size: var(--cp-step-1);
  line-height: 1.55;
  color: var(--cp-ink-soft);
  font-weight: 300;
  max-width: var(--cp-measure);
}
.cp-dark .cp-lede { color: var(--cp-on-dark-soft); }

.cp-body { max-width: var(--cp-measure); color: var(--cp-ink-soft); }
.cp-dark .cp-body { color: var(--cp-on-dark-soft); }

.cp-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 var(--cp-space-md);
  font-size: var(--cp-step--1);
  font-weight: 500;
  letter-spacing: var(--cp-track-wide);
  text-transform: uppercase;
  color: var(--cp-azure);
}
.cp-dark .cp-eyebrow { color: var(--cp-azure-bright); }
.cp-eyebrow__rule {
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
  flex: none;
}

/* Italic serif used for emphasis inside display headings. */
.cp-em { font-style: italic; color: var(--cp-azure); }
.cp-dark .cp-em { color: var(--cp-azure-bright); }

/* ---- Dark / light section grounds -------------------------------------- */
.cp-dark {
  background: var(--cp-navy);
  color: var(--cp-on-dark);
}
.cp-light { background: var(--cp-ivory); color: var(--cp-ink); }
.cp-paper { background: var(--cp-paper); color: var(--cp-ink); }
