/* 
 * Typography - Inter & Playfair Display 
 * Définition des polices et styles typographiques
 */

/* Inter Font Family */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-semibold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-semibold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Playfair Display Font Family - Using system serif as fallback */

:root {
    /* Polices */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-neutral-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Titres */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-neutral-900);
    margin-top: 0;
    margin-bottom: 1rem;
}

h1, .h1 { 
    font-size: 3rem;      /* 48px */
    line-height: 1.1;
}

h2, .h2 { 
    font-size: 2.25rem;   /* 36px */
}

h3, .h3 { 
    font-size: 1.875rem;  /* 30px */
}

h4, .h4 { 
    font-size: 1.5rem;    /* 24px */
}

h5, .h5 { 
    font-size: 1.25rem;   /* 20px */
}

h6, .h6 { 
    font-size: 1.125rem;  /* 18px */
}

/* Classes utilitaires typographiques */
.font-sans { 
    font-family: var(--font-sans); 
}

.font-display { 
    font-family: var(--font-display); 
}

.text-display {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.text-subtitle {
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--color-neutral-600);
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-neutral-900);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--color-neutral-600);
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

/* Poids de police */
.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Tailles de texte */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }

/* Alignement */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Transformations */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.normal-case { text-transform: none; }

/* Espacement des lettres */
.tracking-tight { letter-spacing: -0.05em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

/* Décorations */
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }
.no-underline { text-decoration: none; }

/* Liens */
a {
    color: var(--color-primary-600);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--color-primary-700);
}

a:focus {
    outline: 2px solid var(--color-primary-600);
    outline-offset: 2px;
}

/* Paragraphes */
p {
    margin-top: 0;
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

.lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--color-neutral-700);
}

/* Listes */
ul, ol {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

ul li, ol li {
    margin-bottom: 0.5rem;
}

/* Lecteur d'écran uniquement */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Accessibilité - lien de saut */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary-600);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1, .h1 { font-size: 2.25rem; }      /* 36px */
    h2, .h2 { font-size: 1.875rem; }     /* 30px */
    h3, .h3 { font-size: 1.5rem; }       /* 24px */
    h4, .h4 { font-size: 1.25rem; }      /* 20px */
    
    .text-display { font-size: 1.875rem; }
    .text-subtitle { font-size: 1.125rem; }
    .section-title { font-size: 1.875rem; }
    .section-subtitle { font-size: 1rem; }
}

@media (max-width: 480px) {
    h1, .h1 { font-size: 1.875rem; }     /* 30px */
    h2, .h2 { font-size: 1.5rem; }       /* 24px */
    
    .text-display { font-size: 1.5rem; }
}

/* Balance du texte pour de meilleurs retours à la ligne */
.text-balance {
    text-wrap: balance;
}

/* Prevent orphans */
.text-pretty {
    text-wrap: pretty;
}

/* Troncature */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
