/* ============================================================================
 * base.css  --  Element-default styling anchored on tokens
 *
 * Project: EFI / Experiencer Team -- unified UI shell
 * Owner:   /srv/efi-unified-ui/static/css/base.css
 * Served:  https://forum.experiencerteam.com/shared/css/base.css
 * Loaded:  After reset.css, before layout.css.
 *
 * --------------------------------------------------------------------------
 * Algorithm summary
 * --------------------------------------------------------------------------
 *   base.css gives every raw HTML element its default look using ONLY token
 *   values from tokens.css. Anything bespoke -- named components, layouts,
 *   utility classes -- lives in the later sheets.
 *
 *   Coverage scope:
 *     - body + html: font family + size + line + bg + color
 *     - headings h1-h6: family + weight + scale (per Q8 italic-serif posture)
 *     - paragraph + lead + small + figcaption
 *     - link a: + hover + focus
 *     - inline em / strong / code / kbd / mark
 *     - blockquote + cite
 *     - hr
 *     - lists ul / ol / li
 *     - table / thead / tbody / th / td
 *     - form input / textarea / select / button (chrome font + focus)
 *
 *   Q8 typography posture:
 *     - body + display = Merriweather (serif)
 *     - chrome (nav, buttons, labels, small caps) = Lato (sans)
 *     - section titles + stat numbers = italic Merriweather (signature)
 *
 *   No class selectors in this file. Any rule that targets a named class
 *   belongs in components.css (or a deployment-specific brand file).
 * ============================================================================ */


/* --- Root html: respects A-/A/A+ scale set by nav.js -------------------- */
html {
  font-size: calc(16px * var(--fs-scale, 1));
}


/* --- Body baseline ------------------------------------------------------ */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-normal);
  transition: background var(--motion-slow) var(--easing-standard),
              color      var(--motion-slow) var(--easing-standard);
}


/* --- Headings ----------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text);
  font-weight: var(--weight-bold);
  line-height: var(--line-tight);
  margin: 0 0 var(--space-3) 0;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }


/* --- Paragraphs + prose chrome ----------------------------------------- */
p {
  margin: 0 0 var(--space-3) 0;
}
small {
  font-size: var(--text-sm);
  color: var(--text-soft);
}
figcaption {
  font-size: var(--text-sm);
  color: var(--text-faint);
  text-align: center;
  margin-top: var(--space-2);
}


/* --- Links -------------------------------------------------------------- */
a {
  color: var(--teal-deep);
  text-decoration: none;
  transition: color var(--motion-fast) var(--easing-standard);
}
a:hover {
  color: var(--coral);
}
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}


/* --- Inline semantic ---------------------------------------------------- */
em, i { font-style: italic; }
strong, b { font-weight: var(--weight-bold); }
mark {
  background: var(--gold-soft);
  color: var(--text);
  padding: 0 var(--space-1);
  border-radius: var(--radius-xs);
}
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--bg-strip);
  color: var(--text);
  padding: 1px var(--space-1);
  border-radius: var(--radius-xs);
}
kbd {
  border: 1px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule);
}
pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-strip);
  color: var(--text);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--rule);
  overflow-x: auto;
  line-height: var(--line-normal);
}
pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}


/* --- Blockquote --------------------------------------------------------- */
blockquote {
  margin: 0 0 var(--space-3) 0;
  padding: var(--space-2) var(--space-4);
  border-left: 3px solid var(--teal);
  color: var(--text-soft);
  font-style: italic;
}
blockquote cite {
  display: block;
  margin-top: var(--space-2);
  font-style: normal;
  font-size: var(--text-sm);
  color: var(--text-faint);
}


/* --- Horizontal rule ---------------------------------------------------- */
hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--space-5) 0;
}


/* --- Lists -------------------------------------------------------------- */
ul, ol {
  margin: 0 0 var(--space-3) 0;
  padding-left: var(--space-5);
}
li {
  margin: 0 0 var(--space-1) 0;
}
li > ul, li > ol {
  margin-top: var(--space-1);
  margin-bottom: 0;
}


/* --- Tables ------------------------------------------------------------- */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 var(--space-4) 0;
  font-size: var(--text-sm);
}
th, td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  font-family: var(--font-chrome);
  font-weight: var(--weight-bold);
  color: var(--text-soft);
  background: var(--bg-strip);
}
tbody tr:hover {
  background: var(--rule-soft);
}


/* --- Form elements ------------------------------------------------------ */
label {
  font-family: var(--font-chrome);
  font-weight: var(--weight-bold);
  color: var(--text);
  font-size: var(--text-sm);
  display: inline-block;
  margin-bottom: var(--space-1);
}
input, textarea, select {
  font-family: var(--font-chrome);
  font-size: var(--text-base);
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  line-height: var(--line-normal);
  transition: border-color var(--motion-fast) var(--easing-standard),
              box-shadow   var(--motion-fast) var(--easing-standard);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}
input::placeholder, textarea::placeholder {
  color: var(--text-faint);
}
textarea {
  resize: vertical;
  min-height: calc(var(--space-5) * 3);
}


/* --- Buttons (raw <button> default; named .btn classes in components.css) - */
button {
  font-family: var(--font-chrome);
  font-size: var(--text-base);
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}


/* --- Selection ---------------------------------------------------------- */
::selection {
  background: var(--teal-soft);
  color: var(--text);
}


/* --- Skip link target ---------------------------------------------------- */
:target {
  scroll-margin-top: calc(var(--nav-height) + var(--space-3));
}


/* End of base.css */
