/**
 * Typography - BookConnect
 * Styles typographiques cohérents pour tout le site
 */

/* ===== POLICES DE BASE ===== */
body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TITRES ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
}

h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

/* ===== PARAGRAPHES ===== */
p {
  margin-bottom: var(--spacing-md);
  color: var(--color-text-secondary);
}

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

/* ===== LIENS ===== */
a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover, a:focus {
  color: var(--color-hover);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ===== TEXTE SPÉCIALISÉ ===== */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.leading-tight { line-height: var(--line-height-tight); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }

/* ===== COULEURS DE TEXTE ===== */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }
.text-white { color: var(--color-text-white); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-accent); }
.text-info { color: var(--color-info); }

/* ===== CITATIONS ===== */
blockquote {
  border-left: 4px solid var(--color-secondary);
  padding-left: var(--spacing-lg);
  margin: var(--spacing-lg) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

cite {
  font-style: normal;
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

cite::before {
  content: "— ";
}

/* ===== CODE ===== */
code {
  font-family: var(--font-family-mono);
  font-size: 0.875em;
  background-color: var(--color-bg-tertiary);
  padding: 0.125rem 0.25rem;
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
}

pre {
  background-color: var(--color-bg-tertiary);
  padding: var(--spacing-md);
  border-radius: var(--border-radius-md);
  overflow-x: auto;
  margin: var(--spacing-md) 0;
}

pre code {
  background: none;
  padding: 0;
}

/* ===== LISTES ===== */
ul, ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

li {
  margin-bottom: var(--spacing-sm);
}

ul li {
  list-style-type: disc;
}

ol li {
  list-style-type: decimal;
}

/* ===== LISTES SANS PUCE ===== */
.list-unstyled {
  list-style: none;
  padding-left: 0;
}

.list-unstyled li {
  margin-bottom: 0;
}

/* ===== TEXTE EN LIGNE ===== */
mark {
  background-color: #FFF3CD;
  padding: 0.125rem 0.25rem;
  border-radius: var(--border-radius-sm);
}

del {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

ins {
  text-decoration: underline;
  color: var(--color-success);
}

abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 768px) {
  h1 { font-size: var(--font-size-3xl); }
  h2 { font-size: var(--font-size-2xl); }
  h3 { font-size: var(--font-size-xl); }
}

@media (min-width: 1200px) {
  body {
    font-size: 1.0625rem; /* 17px pour plus de confort */
  }
}
