/**
 * Typography System - Just Dev It
 * Sistema tipográfico optimizado para legibilidad y jerarquía visual
 */

/* ===== IMPORTACIÓN DE FUENTES ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Manrope:wght@200;300;400;500;600;700;800&family=Fira+Code:wght@400;500;600&display=swap');

/* ===== ESTILOS BASE ===== */
body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: var(--leading-normal);
    color: var(--color-neutral-lightest);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== HEADINGS ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-neutral-lightest);
    margin-bottom: var(--space-6);
}

h1 {
    font-size: var(--text-6xl);
    font-weight: var(--font-extrabold);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--text-5xl);
    font-weight: var(--font-bold);
    letter-spacing: -0.01em;
}

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

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

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

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

/* ===== PÁRRAFOS ===== */
p {
    margin-bottom: var(--space-6);
    color: var(--color-neutral-light);
    line-height: var(--leading-relaxed);
}

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

/* Lead paragraph - Texto destacado */
.lead {
    font-size: var(--text-xl);
    font-weight: var(--font-regular);
    color: var(--color-neutral-lighter);
    line-height: var(--leading-relaxed);
}

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

a:hover {
    color: var(--color-brand-accent);
}

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

/* ===== LISTAS ===== */
ul, ol {
    margin-bottom: var(--space-6);
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
    color: var(--color-neutral-light);
}

ul[role="list"],
ol[role="list"] {
    list-style: none;
    padding-left: 0;
}

/* ===== UTILIDADES TIPOGRÁFICAS ===== */

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

.font-secondary {
    font-family: var(--font-secondary);
}

.font-mono {
    font-family: var(--font-mono);
}

/* Font Weights */
.font-light { font-weight: var(--font-light); }
.font-regular { font-weight: var(--font-regular); }
.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); }

/* Text Colors */
.text-primary { color: var(--color-neutral-lightest); }
.text-secondary { color: var(--color-neutral-light); }
.text-muted { color: var(--color-neutral-medium); }
.text-brand { color: var(--color-brand-primary); }
.text-accent { color: var(--color-brand-secondary); }

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

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

/* Letter Spacing */
.tracking-tight { letter-spacing: -0.05em; }
.tracking-normal { letter-spacing: 0em; }
.tracking-wide { letter-spacing: 0.05em; }

/* ===== EFECTOS ESPECIALES ===== */

/* Gradient Text */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.gradient-text-secondary {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Text Glow Effect */
.text-glow {
    text-shadow: 0 0 20px rgba(155, 97, 164, 0.5),
                 0 0 40px rgba(155, 97, 164, 0.3);
}

/* Truncate Text */
.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;
}

/* ===== BLOCKQUOTES ===== */
blockquote {
    border-left: 4px solid var(--color-brand-primary);
    padding-left: var(--space-6);
    margin: var(--space-8) 0;
    font-style: italic;
    color: var(--color-neutral-lighter);
}

/* ===== CODE ===== */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: var(--space-1) var(--space-2);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--color-brand-secondary);
}

pre code {
    display: block;
    padding: var(--space-4);
    overflow-x: auto;
    border-radius: var(--radius-md);
}

/* ===== STRONG & EMPHASIS ===== */
strong, b {
    font-weight: var(--font-bold);
    color: var(--color-neutral-lightest);
}

em, i {
    font-style: italic;
}

/* ===== SMALL TEXT ===== */
small {
    font-size: var(--text-sm);
    color: var(--color-neutral-medium);
}

/* ===== MARK / HIGHLIGHT ===== */
mark {
    background-color: rgba(155, 97, 164, 0.2);
    color: var(--color-brand-accent);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 768px) {
    body {
        font-size: var(--text-base);
    }
    
    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }
    h3 { font-size: var(--text-2xl); }
    h4 { font-size: var(--text-xl); }
    h5 { font-size: var(--text-lg); }
    h6 { font-size: var(--text-base); }
}

/* ===== SELECTION ===== */
::selection {
    background-color: var(--color-brand-primary);
    color: white;
}

::-moz-selection {
    background-color: var(--color-brand-primary);
    color: white;
}
