/* ===================================
   TYPOGRAPHY - Base Text Styles
   ===================================
   
   Default styling for HTML typography elements.
   Professional, clean, not too airy.
*/

/* Body text */
body {
  font-family: var(--font-family-sans);
  font-size: var(--text-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--text-body);              /* Use body text color (#525252) */
  background-color: var(--bg-app);       /* Layer 1 background (#ebe9e6) */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings - tight, professional spacing */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

h1 {
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-lg);
}

h5 {
  font-size: var(--text-base);
}

h6 {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

/* Paragraphs - compact spacing */
p {
  margin-bottom: var(--space-3);
  line-height: var(--line-height-relaxed);
}

p:last-child {
  margin-bottom: 0;
}

/* Links - native HTML anchor styling */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-150) var(--easing-out);
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

a:focus-visible {
  outline: var(--border-width-2) solid var(--border-focus);
  outline-offset: var(--border-width-2);
  border-radius: var(--border-radius-sm);
}

/* Emphasis and strong */
em {
  font-style: italic;
}

strong, b {
  font-weight: var(--font-weight-semibold);
}

/* Small text */
small {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* Code and preformatted text - Layer 3 */
code {
  font-family: var(--font-family-mono);
  font-size: 0.9em;
  padding: var(--space-0_5) var(--space-1);
  background-color: var(--bg-panel);        /* Panel layer */
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
}

pre {
  font-family: var(--font-family-mono);
  font-size: var(--text-sm);
  line-height: var(--line-height-relaxed);
  padding: var(--space-3);
  background-color: var(--bg-panel);        /* Panel layer */
  border-radius: var(--border-radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-3);
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

/* Blockquotes - Layer 3 */
blockquote {
  padding: var(--space-3) var(--space-4);
  margin: var(--space-4) 0;
  border-left: var(--border-width-4) solid var(--color-primary);
  background-color: var(--bg-panel);        /* Panel layer */
  font-style: italic;
  color: var(--text-secondary);
}

/* Lists - compact spacing */
ul, ol {
  margin-bottom: var(--space-3);
  padding-left: var(--space-5);
}

ul {
  list-style: disc;
}

ol {
  list-style: decimal;
}

li {
  margin-bottom: var(--space-1);
  line-height: var(--line-height-normal);
}

li:last-child {
  margin-bottom: 0;
}

/* Nested lists */
ul ul, ol ol, ul ol, ol ul {
  margin-top: var(--space-1);
  margin-bottom: var(--space-1);
}

/* Horizontal rule */
hr {
  border: none;
  border-top: var(--border-width-1) solid var(--border-subtle);
  margin: var(--space-6) 0;
}

/* Mark/highlight */
mark {
  background-color: var(--color-warning-light);
  color: var(--text-primary);
  padding: var(--space-0_5) var(--space-1);
  border-radius: var(--border-radius-sm);
}

/* Abbreviations */
abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* Subscript and superscript */
sub, sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}
