/* Typography styles */

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--line-height-heading);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  color: var(--color-text-primary);
}

h1 {
  font-size: 2.5rem;
  margin-top: var(--spacing-2xl);
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: 2rem;
  margin-top: var(--spacing-2xl);
}

h3 {
  font-size: 1.5rem;
  margin-top: var(--spacing-xl);
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
  font-weight: 600;
}

/* First element no top margin */
h1:first-child,
h2:first-child,
h3:first-child,
h4:first-child,
h5:first-child,
h6:first-child {
  margin-top: 0;
}

/* Paragraph */
p {
  margin-bottom: var(--spacing-lg);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
}

p:last-child {
  margin-bottom: 0;
}

/* Small text */
small,
.small {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

/* Strong and emphasis */
strong,
b {
  font-weight: 700;
  color: var(--color-text-primary);
}

em,
i {
  font-style: italic;
}

/* Link in text */
a {
  position: relative;
}

a:hover {
  text-decoration: underline;
}

/* Abbreviation */
abbr {
  text-decoration: underline dotted;
  cursor: help;
}

/* Mark/highlight */
mark {
  background-color: #fff3cd;
  padding: 2px 4px;
  border-radius: 2px;
}

/* Definition and deletion */
del {
  color: var(--color-text-secondary);
  text-decoration: line-through;
}

/* Superscript and subscript */
sup,
sub {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

/* Lead text (intro paragraph) */
.lead {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--spacing-xl);
}

/* Text utilities */
.text-large {
  font-size: var(--font-size-lg);
}

.text-small {
  font-size: var(--font-size-sm);
}

.text-muted {
  color: var(--color-text-secondary);
}

.text-accent {
  color: var(--color-accent);
}

/* Heading with subtitle */
.heading-with-subtitle h1 {
  margin-bottom: var(--spacing-sm);
}

.heading-with-subtitle .subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  font-weight: 400;
  font-style: italic;
  margin-bottom: var(--spacing-lg);
}
