/*------------------------------------------------------------------
[Typography - Tilda Design System]

Typographie pour AVANTI Frontend v2.0
Polices: Playfair Display (headings) + Roboto (body)
Fluide et responsive avec clamp()
-------------------------------------------------------------------*/

/* ==================== FONT IMPORTS ==================== */
/* Google Fonts - Playfair Display & Roboto */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;900&family=Roboto:wght@300;400;500;700&display=swap');

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

/* ==================== HEADINGS ==================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-black);
  letter-spacing: var(--letter-spacing-tight);
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-bold);
}

h3 {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-semibold);
}

h4 {
  font-size: var(--font-size-h4);
  font-weight: var(--font-weight-semibold);
}

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

h6 {
  font-size: var(--font-size-h6);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

/* ==================== PARAGRAPHS ==================== */
p {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  color: var(--color-text);
}

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

/* Lead paragraph (intro text) */
.lead {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-light);
}

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

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

/* ==================== TEXT UTILITIES ==================== */
/* Font Weights */
.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); }
.font-black { font-weight: var(--font-weight-black); }

/* Font Families */
.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Text Transform */
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

/* Line Heights */
.leading-tight { line-height: var(--line-height-tight); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }
.leading-loose { line-height: var(--line-height-loose); }

/* ==================== LINKS ==================== */
a {
  color: var(--color-light-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

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

/* Link variants */
.link-primary {
  color: var(--color-primary);
}

.link-primary:hover {
  color: var(--color-accent);
}

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

.link-accent:hover {
  color: var(--color-orange);
}

.link-underline {
  text-decoration: underline;
}

.link-no-underline {
  text-decoration: none;
}

.link-no-underline:hover {
  text-decoration: none;
}

/* ==================== LISTS ==================== */
ul, ol {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-xl);
}

ul ul,
ul ol,
ol ul,
ol ol {
  margin-bottom: 0;
}

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

/* Unstyled list */
.list-unstyled {
  padding-left: 0;
  list-style: none;
}

/* Inline list */
.list-inline {
  padding-left: 0;
  list-style: none;
}

.list-inline-item {
  display: inline-block;
  margin-right: var(--spacing-md);
}

.list-inline-item:last-child {
  margin-right: 0;
}

/* ==================== BLOCKQUOTES ==================== */
blockquote {
  margin: 0 0 var(--spacing-lg);
  padding: var(--spacing-lg);
  border-left: 4px solid var(--color-accent);
  background: var(--color-gray-light);
  font-size: clamp(1rem, 2vw, 1.125rem);
  font-style: italic;
  color: var(--color-text-light);
}

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

blockquote cite {
  display: block;
  margin-top: var(--spacing-sm);
  font-size: var(--font-size-small);
  font-style: normal;
  color: var(--color-text);
}

blockquote cite::before {
  content: '— ';
}

/* ==================== CODE & PRE ==================== */
code {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.875em;
  padding: 2px 6px;
  background: var(--color-gray-light);
  border-radius: var(--radius-sm);
  color: var(--color-orange);
}

pre {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: var(--font-size-small);
  padding: var(--spacing-md);
  background: var(--color-gray-light);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--spacing-lg);
}

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

/* ==================== TEXT COLORS ==================== */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-muted { color: var(--color-text-light); }
.text-white { color: var(--color-white); }
.text-black { color: var(--color-black); }

/* ==================== EMPHASIS ==================== */
strong, b {
  font-weight: var(--font-weight-bold);
}

em, i {
  font-style: italic;
}

mark {
  background: var(--color-accent);
  color: var(--color-black);
  padding: 2px 4px;
  border-radius: 2px;
}

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

ins {
  text-decoration: none;
  border-bottom: 2px solid var(--color-success);
}

/* ==================== HORIZONTAL RULE ==================== */
hr {
  margin: var(--spacing-2xl) 0;
  border: 0;
  border-top: 2px solid var(--color-gray-light);
}

/* ==================== DISPLAY UTILITIES ==================== */
.display-1 {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: var(--font-weight-black);
  line-height: 1.1;
}

.display-2 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: var(--font-weight-black);
  line-height: 1.1;
}

.display-3 {
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
}

.display-4 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: var(--font-weight-bold);
  line-height: 1.2;
}

/* ==================== TEXT OVERFLOW ==================== */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-wrap {
  white-space: normal;
}

.text-nowrap {
  white-space: nowrap;
}

.text-break {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* ==================== RESPONSIVE TYPOGRAPHY ==================== */
@media (max-width: 767px) {
  body {
    font-size: 0.875rem; /* 14px on mobile */
  }

  h1 { margin-bottom: var(--spacing-sm); }
  h2 { margin-bottom: var(--spacing-sm); }
  h3 { margin-bottom: var(--spacing-xs); }

  blockquote {
    padding: var(--spacing-md);
  }
}

/* ==================== PRINT TYPOGRAPHY ==================== */
@media print {
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  p, blockquote {
    orphans: 3;
    widows: 3;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}
