/* ==========================================================================
   ELEMENTS
   Bare HTML element styling — still no classes. This is the visual
   default every tag gets before any object/component overrides it.
   ========================================================================== */

html {
  font-size: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--text-soft);
  background: var(--bg);
}

::selection {
  background: var(--color-espresso-800);
  color: var(--color-white);
}

h1, h2 {
  font-family: var(--font-heading);
  font-weight: var(--fw-display-xlight);
  line-height: var(--lh-tight);
  letter-spacing: 0.02em;
  color: var(--text);
}

h3, h4 {
  font-family: var(--font-heading);
  font-weight: var(--fw-display-xlight);
  line-height: 1.2;
  color: var(--text);
}

/* The reference uses static "Newsreader Display" cuts at a moderate
   optical size. Pin the variable font's opsz so large headings keep
   that moderate stroke contrast instead of the extreme hairline cut
   the browser would auto-select at display sizes. */
h1, h2, h3, h4 {
  font-optical-sizing: none;
  font-variation-settings: 'opsz' 32;
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p {
  margin-bottom: var(--space-3);
  color: var(--text-soft);
}

a {
  transition: color var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}

a:hover {
  color: var(--text-accent);
}

strong {
  font-weight: 600;
  color: var(--text);
}

address {
  font-style: normal;
}

label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text);
  margin-bottom: var(--space-1);
}

input,
textarea,
select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--text);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

input:focus,
textarea:focus,
select:focus {
  /* Matches #elr-chat-form input:focus (src/chat-widget.ts): a solid
     tan-900 border, no box-shadow glow. The prior 20%-opacity glow fell
     well below the 3:1 SC 1.4.11 non-text-contrast minimum; tan-900 at
     full opacity is the same color already confirmed compliant there. */
  outline: none;
  border-color: var(--color-tan-900);
  border-width: 2px;
}

/* Windows High Contrast Mode strips box-shadow and can render our
   background/border-color-based focus/state cues identically regardless
   of state — restore a real outline and system colors here only.
   Invisible in normal browsing; forced-colors never matches otherwise. */
@media (forced-colors: active) {
  input:focus,
  textarea:focus,
  select:focus {
    outline: 2px solid Highlight;
  }
}

:focus-visible {
  outline: 2px solid var(--color-espresso-800);
  outline-offset: 2px;
}
