/* ===== SISTEMA DE TIPOGRAFIA ERDERON ===== */
/* Arquivo: /mapa-erderon/assets/css/typography.css */
/* Fontes personalizadas e hierarquia tipográfica */

/* ===== 1. IMPORTAÇÃO DE FONTES ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600&display=swap');

/* ===== 2. VARIÁVEIS TIPOGRÁFICAS ===== */
:root {
    /* === FAMÍLIAS DE FONTE === */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Cinzel', 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
    
    /* === PESOS === */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    --font-weight-black: 900;
    
    /* === TAMANHOS === */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    --font-size-5xl: 3rem;      /* 48px */
    --font-size-6xl: 3.75rem;   /* 60px */
    
    /* === ALTURAS DE LINHA === */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
    
    /* === ESPAÇAMENTO === */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    --letter-spacing-widest: 0.1em;
}

/* ===== 3. CONFIGURAÇÃO BASE ===== */
html {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: var(--line-height-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-regular);
    color: var(--text-primary);
}

/* ===== 4. HIERARQUIA DE TÍTULOS ===== */
.text-display {
    font-family: var(--font-display);
    font-size: var(--font-size-6xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-h1 {
    font-family: var(--font-display);
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    text-transform: uppercase;
}

.text-h2 {
    font-family: var(--font-display);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-normal);
}

.text-h3 {
    font-family: var(--font-primary);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-snug);
    letter-spacing: var(--letter-spacing-normal);
}

.text-h4 {
    font-family: var(--font-primary);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
}

.text-h5 {
    font-family: var(--font-primary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-normal);
}

.text-h6 {
    font-family: var(--font-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-normal);
}

/* ===== 5. TEXTO CORRIDO ===== */
.text-body-lg {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    font-weight: var(--font-weight-regular);
}

.text-body {
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    font-weight: var(--font-weight-regular);
}

.text-body-sm {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    font-weight: var(--font-weight-regular);
}

.text-caption {
    font-size: var(--font-size-xs);
    line-height: var(--line-height-tight);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    opacity: 0.8;
}

/* ===== 6. TEXTO ESPECIAL ===== */
.text-mono {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    letter-spacing: var(--letter-spacing-normal);
}

.text-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    color: var(--text-muted);
}

.text-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: color 0.2s ease;
}

.text-link:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* ===== 7. APLICAÇÃO NOS COMPONENTES ===== */

/* === MARKERS === */
.info-title {
    font-family: var(--font-display) !important;
    font-size: var(--font-size-sm) !important;
    font-weight: var(--font-weight-bold) !important;
    letter-spacing: var(--letter-spacing-wider) !important;
    text-transform: uppercase !important;
    background: linear-gradient(135deg, #ffffff 0%, #e8e8e8 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.info-subtitle {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-xs) !important;
    font-weight: var(--font-weight-medium) !important;
    letter-spacing: var(--letter-spacing-widest) !important;
    text-transform: uppercase !important;
}

/* === SIDEBAR === */
.panel-title {
    font-family: var(--font-display) !important;
    font-size: var(--font-size-4xl) !important;
    font-weight: var(--font-weight-bold) !important;
    letter-spacing: var(--letter-spacing-tight) !important;
    text-transform: uppercase !important;
    line-height: var(--line-height-tight) !important;
}

.panel-subtitle {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-lg) !important;
    font-weight: var(--font-weight-medium) !important;
    letter-spacing: var(--letter-spacing-wider) !important;
    text-transform: uppercase !important;
}

.section-title {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-xl) !important;
    font-weight: var(--font-weight-bold) !important;
    letter-spacing: var(--letter-spacing-wide) !important;
    text-transform: uppercase !important;
}

.topic-label {
    font-family: var(--font-mono) !important;
    font-size: var(--font-size-xs) !important;
    font-weight: var(--font-weight-semibold) !important;
    letter-spacing: var(--letter-spacing-wider) !important;
    text-transform: uppercase !important;
}

.topic-value {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-base) !important;
    font-weight: var(--font-weight-medium) !important;
}

.description-text {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-base) !important;
    font-weight: var(--font-weight-regular) !important;
    line-height: var(--line-height-relaxed) !important;
}

.character-name {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-xs) !important;
    font-weight: var(--font-weight-semibold) !important;
    letter-spacing: var(--letter-spacing-wide) !important;
}

/* === CONTROLES === */
.control-btn {
    font-family: var(--font-primary) !important;
    font-weight: var(--font-weight-bold) !important;
}

.filter-btn {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-xs) !important;
    font-weight: var(--font-weight-semibold) !important;
    letter-spacing: var(--letter-spacing-wide) !important;
    text-transform: uppercase !important;
}

.search-input {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-base) !important;
    font-weight: var(--font-weight-regular) !important;
}

.search-input::placeholder {
    font-style: italic;
    opacity: 0.7;
}

/* === TEMA === */
.theme-toggle {
    font-family: var(--font-primary) !important;
    font-size: var(--font-size-sm) !important;
    font-weight: var(--font-weight-semibold) !important;
    letter-spacing: var(--letter-spacing-wide) !important;
}

/* ===== 8. ESTADOS ESPECIAIS ===== */
.text-gradient-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-success {
    background: linear-gradient(135deg, var(--accent-success), #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-warning {
    background: linear-gradient(135deg, var(--accent-warning), #f1c40f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-danger {
    background: linear-gradient(135deg, var(--accent-danger), #e55353);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 9. EFEITOS ESPECIAIS ===== */
.text-shadow-sm {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.text-shadow-lg {
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.text-glow {
    text-shadow: 
        0 0 5px currentColor,
        0 0 10px currentColor,
        0 0 15px currentColor;
}

.text-stroke {
    -webkit-text-stroke: 1px var(--text-primary);
    text-stroke: 1px var(--text-primary);
}

/* ===== 10. ANIMAÇÕES TIPOGRÁFICAS ===== */
@keyframes typewriter {
    0% { width: 0; }
    100% { width: 100%; }
}

.text-typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid currentColor;
    animation: typewriter 2s steps(40) 1s forwards,
               blink 1s infinite step-end;
}

@keyframes blink {
    0%, 50% { border-color: currentColor; }
    51%, 100% { border-color: transparent; }
}

.text-fade-in {
    opacity: 0;
    animation: fadeInText 1s ease-in-out forwards;
}

@keyframes fadeInText {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 11. RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    :root {
        --font-size-6xl: 2.5rem;   /* 40px */
        --font-size-5xl: 2rem;     /* 32px */
        --font-size-4xl: 1.75rem;  /* 28px */
        --font-size-3xl: 1.5rem;   /* 24px */
        --font-size-2xl: 1.25rem;  /* 20px */
    }
    
    .panel-title {
        font-size: var(--font-size-3xl) !important;
    }
    
    .panel-subtitle {
        font-size: var(--font-size-base) !important;
    }
    
    .section-title {
        font-size: var(--font-size-lg) !important;
    }
}

@media (max-width: 480px) {
    .filter-btn {
        font-size: var(--font-size-xs) !important;
        letter-spacing: var(--letter-spacing-normal) !important;
    }
    
    .theme-toggle {
        font-size: var(--font-size-xs) !important;
    }
}

/* ===== 12. ACESSIBILIDADE ===== */
@media (prefers-reduced-motion: reduce) {
    .text-typewriter,
    .text-fade-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===== 13. MODO DE LEITURA ===== */
.reading-mode {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-loose);
    max-width: 65ch;
    margin: 0 auto;
}

.reading-mode h1,
.reading-mode h2,
.reading-mode h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.reading-mode p {
    margin-bottom: 1rem;
}

/* ===== 14. UTILITÁRIOS ===== */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

.italic { font-style: italic; }
.not-italic { font-style: normal; }

.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }
.no-underline { text-decoration: none; }