/**
 * ==============================================================================
 * PHM TECH — DESIGN TOKENS OFICIAIS (PALETA & VARIÁVEIS GLOBAIS)
 * Padrão Arquitetural de Engenharia de Software: Separação de Design Tokens
 * 
 * Este arquivo define EXCLUSIVAMENTE variáveis CSS (:root) e tokens de design.
 * Não contém seletores de layout, garantindo 0% de acoplamento e 0% de risco
 * de conflito ao ser compartilhado por todos os sistemas do ecossistema.
 * ==============================================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400;1,6..72,600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   1. MODO CLARO (PADRÃO / LIGHT THEME)
   ========================================================================== */
:root, [data-theme="light"] {
  /* Paleta Institucional */
  --navy:              #0b1e3d;
  --navy-deep:         #081426;
  --blue:              #123b72;
  --blue-light:        #1a529a;
  --teal:              #0d9488;
  --teal-light:        #2dd4bf;
  --teal-soft:         #f0fdfa;
  --gold:              #d4a853;
  --gold-light:        #e6bc6a;
  
  /* Superfícies e Fundos */
  --bg:                #f8fafc;
  --surface:           #ffffff;
  --surface-soft:      #f1f5f9;
  --surface-muted:     #e2e8f0;

  /* Assinatura Editorial Técnico & Humanista */
  --editorial-paper:         #faf8f5;
  --editorial-paper-subtle:  #f3eee6;
  --editorial-ink:           #111827;
  --editorial-rule:          rgba(15, 23, 42, 0.08);
  --editorial-rule-strong:   rgba(15, 23, 42, 0.16);
  
  /* Textos e Contraste */
  --text:              #1e293b;
  --text-soft:         #334155;
  --text-muted:        #64748b;
  --text-light:        #94a3b8;
  --text-inverse:      #ffffff;

  /* Bordas e Linhas */
  --line:              #e2e8f0;
  --line-strong:       #cbd5e1;
  --line-focus:        #0d9488;

  /* Tipografia */
  --font-heading:      'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:         'JetBrains Mono', 'Fira Code', monospace;
  --font-editorial:    'Newsreader', Georgia, 'Times New Roman', serif;

  /* Geometria & Espaçamento */
  --container-max:     1360px;
  --radius-sm:         6px;
  --radius-md:         10px;
  --radius-lg:         16px;
  --radius-pill:       999px;

  /* Sombras */
  --shadow-xs:         0 1px 3px rgba(11, 30, 61, 0.05);
  --shadow-sm:         0 2px 8px rgba(11, 30, 61, 0.06);
  --shadow-md:         0 6px 18px rgba(11, 30, 61, 0.08);
  --shadow-lg:         0 12px 32px rgba(11, 30, 61, 0.10);
  
  /* Transições Suaves */
  --transition:        all 0.2s ease-in-out;

  /* Aliases Prefixados (Padrão Design System Robusto) */
  --phm-navy:          var(--navy);
  --phm-blue:          var(--blue);
  --phm-teal:          var(--teal);
  --phm-gold:          var(--gold);
  --phm-bg:            var(--bg);
  --phm-surface:       var(--surface);
  --phm-text:          var(--text);
  --phm-line:          var(--line);

  /* Aliases semânticos para os novos componentes do portal */
  --color-bg:          var(--bg);
  --color-surface:     var(--surface);
  --color-text:        var(--text);
  --color-muted:       var(--text-muted);
  --color-primary:     var(--blue);
  --color-accent:      var(--teal);
  --color-success:     #15803d;
  --color-warning:     #b45309;
  --color-danger:      #b91c1c;
  --focus-ring:        0 0 0 3px var(--line-focus);
}

/* ==========================================================================
   2. MODO SÉPIA (LEITURA CONFORTÁVEL / PAPEL & ÂMBAR)
   ========================================================================== */
[data-theme="sepia"] {
  --navy:              #3c2817;
  --navy-deep:         #2b1b0d;
  --blue:              #78401a;
  --blue-light:        #9a5223;
  --teal:              #b45309;
  --teal-light:        #d97706;
  --teal-soft:         #fcf5e5;
  --gold:              #c28422;
  --gold-light:        #dfa23a;
  
  --bg:                #f5eee1;
  --surface:           #fbf7ee;
  --surface-soft:      #eae1cf;
  --surface-muted:     #ded2bd;

  /* Assinatura Editorial Técnico & Humanista */
  --editorial-paper:         #f7f0e3;
  --editorial-paper-subtle:  #ede3ce;
  --editorial-ink:           #2e2116;
  --editorial-rule:          rgba(60, 40, 23, 0.10);
  --editorial-rule-strong:   rgba(60, 40, 23, 0.20);
  
  --text:              #2e2116;
  --text-soft:         #463425;
  --text-muted:        #75604e;
  --text-light:        #9e8773;
  --text-inverse:      #ffffff;

  --line:              #dfd4bf;
  --line-strong:       #cfc0a6;
  --line-focus:        #b45309;

  --shadow-xs:         0 1px 3px rgba(60, 40, 23, 0.05);
  --shadow-sm:         0 2px 8px rgba(60, 40, 23, 0.06);
  --shadow-md:         0 6px 18px rgba(60, 40, 23, 0.08);
  --shadow-lg:         0 12px 32px rgba(60, 40, 23, 0.10);
}

/* ==========================================================================
   3. MODO ESCURO (NOTURNO / MIDNIGHT BLUE)
   ========================================================================== */
[data-theme="dark"] {
  --navy:              #f8fafc;
  --navy-deep:         #ffffff;
  --blue:              #38bdf8;
  --blue-light:        #7dd3fc;
  --teal:              #2dd4bf;
  --teal-light:        #5eead4;
  --teal-soft:         #132e35;
  --gold:              #fbbf24;
  --gold-light:        #fde68a;
  
  --bg:                #091122;
  --surface:           #0f1d38;
  --surface-soft:      #16284d;
  --surface-muted:     #1e3a6d;

  /* Assinatura Editorial Técnico & Humanista */
  --editorial-paper:         #0c172d;
  --editorial-paper-subtle:  #122244;
  --editorial-ink:           #f8fafc;
  --editorial-rule:          rgba(255, 255, 255, 0.08);
  --editorial-rule-strong:   rgba(255, 255, 255, 0.16);
  
  --text:              #e2e8f0;
  --text-soft:         #cbd5e1;
  --text-muted:        #94a3b8;
  --text-light:        #64748b;
  --text-inverse:      #091122;

  --line:              #1e293b;
  --line-strong:       #334155;
  --line-focus:        #38bdf8;

  --shadow-xs:         0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-sm:         0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md:         0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg:         0 12px 32px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   4. ACESSIBILIDADE DE TIPOGRAFIA (ESCALA DE TAMANHO DE FONTE)
   ========================================================================== */
html[data-font-size="sm"],
html[data-font-size="small"] {
  font-size: 14.5px !important;
}

html[data-font-size="normal"],
html:not([data-font-size]) {
  font-size: 16px;
}

html[data-font-size="lg"],
html[data-font-size="large"] {
  font-size: 17.5px !important;
}

html[data-font-size="xl"] {
  font-size: 19px !important;
}
