/* ==========================================================================
   Charles and Lois Home — Base styles
   A restrained reset plus sitewide element defaults. Component-specific
   styling belongs in components.css, not here.
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---- Headings ---- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-forest);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin: 0;
}

p + p {
  margin-top: var(--space-sm);
}

/* ---- Links ---- */
a {
  color: inherit;
  text-decoration: none;
}

/* ---- Lists ---- */
ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---- Forms ---- */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

/* ---- Accessibility: focus ----
   Every interactive element gets a visible, high-contrast focus outline.
   Never remove this without replacing it — do not use outline: none. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- Skip link ----
   Hidden until focused, lets keyboard/screen-reader users bypass the header
   and jump straight to the main content. */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-sm);
  z-index: 1000;
  padding: var(--space-2xs) var(--space-sm);
  background-color: var(--color-forest);
  color: var(--color-cream);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-sm);
}

/* ---- Selection ---- */
::selection {
  background-color: var(--color-gold);
  color: var(--color-forest);
}

/* ---- Visually hidden but screen-reader accessible ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
