/**
 * ===================================================================
 * TYPOGRAPHY.CSS - Sistema tipográfico
 * ===================================================================
 * Estilos globales de tipografía para todo el sitio
 */

/* Configuración base del body */
body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-relaxed);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   HEADINGS
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-dark);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: var(--text-5xl);
    font-weight: var(--font-extrabold);
}

h2 {
    font-size: var(--text-4xl);
    font-weight: var(--font-extrabold);
}

h3 {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
}

h4 {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
}

h5 {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
}

h6 {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
}

/* Responsive headings */
@media (max-width: 768px) {
    h1 {
        font-size: var(--text-4xl);
    }
    
    h2 {
        font-size: var(--text-3xl);
    }
    
    h3 {
        font-size: var(--text-2xl);
    }
}

/* ============================================
   PÁRRAFOS Y TEXTO
   ============================================ */

p {
    margin-bottom: var(--space-md);
    color: var(--text-gray);
}

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

/* ============================================
   ENLACES
   ============================================ */

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-base) var(--transition-ease);
}

a:hover {
    color: var(--primary-dark);
}

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

/* ============================================
   LISTAS
   ============================================ */

ul, ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-lg);
}

ul li, ol li {
    margin-bottom: var(--space-sm);
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

/* ============================================
   TEXTO ENFATIZADO
   ============================================ */

strong, b {
    font-weight: var(--font-bold);
    color: var(--text-dark);
}

em, i {
    font-style: italic;
}

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

mark {
    background-color: var(--warning-light);
    padding: 0.125rem 0.25rem;
}

/* ============================================
   CÓDIGO
   ============================================ */

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background-color: var(--bg-gray);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    color: var(--text-dark);
}

pre {
    background-color: var(--bg-dark);
    color: var(--bg-white);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--space-md);
}

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

/* ============================================
   BLOCKQUOTES
   ============================================ */

blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: var(--space-lg);
    margin: var(--space-lg) 0;
    font-style: italic;
    color: var(--text-gray);
}

/* ============================================
   CLASES UTILITARIAS DE TEXTO
   ============================================ */

/* Tamaños */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-5xl { font-size: var(--text-5xl); }

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

/* Colores */
.text-primary { color: var(--primary-color); }
.text-accent { color: var(--accent-color); }
.text-dark { color: var(--text-dark); }
.text-gray { color: var(--text-gray); }
.text-light { color: var(--text-light); }
.text-white { color: var(--bg-white); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }

/* Alineación */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Transformación */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

/* Decoración */
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }
.no-underline { text-decoration: none; }

/* Truncar texto */
.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;
}

/* Espaciado entre letras */
.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    body {
        font-size: 14px;
    }
}
