/* ============================================================
   GLOBAL.CSS — Reset, CSS Variables, Tipografia Global
   Visões de Riqueza — Blog de Finanças Pessoais
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400&family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;1,14..32,300;1,14..32,400&display=swap');

/* ============================================================
   DESIGN TOKENS (CSS Custom Properties)
   ============================================================ */
:root {
  /* --- Cores: Fundos --- */
  --clr-bg:          #f8fafc;
  --clr-bg-2:        #f1f5f9;
  --clr-bg-card:     #ffffff;
  --clr-bg-card-2:   #f8fafc;
  --clr-bg-elevated: #e2e8f0;

  /* --- Cores: Azul (Primário) --- */
  --clr-gold:        #378add;
  --clr-gold-light:  #5ba0e8;
  --clr-gold-pale:   #dbeafe;
  --clr-gold-dark:   #2859c5;
  --clr-gold-muted:  rgba(55, 138, 221, 0.10);
  --clr-gold-border: rgba(55, 138, 221, 0.30);
  --clr-gold-glow:   rgba(55, 138, 221, 0.20);

  /* --- Cores: Texto --- */
  --clr-text:        #1e293b;
  --clr-text-2:      #475569;
  --clr-text-muted:  #94a3b8;
  --clr-text-dark:   #ffffff;

  /* --- Cores: UI --- */
  --clr-border:      rgba(0, 0, 0, 0.08);
  --clr-border-2:    rgba(0, 0, 0, 0.14);

  /* --- Categorias --- */
  --clr-cat-invest:    #2859c5;
  --clr-cat-poupanca:  #059669;
  --clr-cat-plano:     #7c3aed;
  --clr-cat-mindset:   #ea580c;

  /* --- Tipografia: Famílias --- */
  --ff-serif: 'Montserrat', system-ui, -apple-system, sans-serif;
  --ff-sans:  'Inter', system-ui, -apple-system, sans-serif;

  /* --- Tipografia: Escala --- */
  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   1.125rem;
  --fs-xl:   1.25rem;
  --fs-2xl:  1.5rem;
  --fs-3xl:  1.875rem;
  --fs-4xl:  2.25rem;
  --fs-5xl:  3rem;
  --fs-6xl:  3.75rem;
  --fs-7xl:  4.5rem;

  /* --- Espaçamento --- */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;
  --sp-32: 8rem;

  /* --- Border Radius --- */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-2xl:  24px;
  --r-full: 9999px;

  /* --- Sombras --- */
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.16);
  --shadow-xl:   0 16px 64px rgba(0,0,0,0.20);
  --shadow-gold: 0 4px 24px rgba(55,138,221,0.25);

  /* --- Transições --- */
  --t-fast:   150ms ease;
  --t-normal: 260ms ease;
  --t-slow:   420ms ease;
  --t-spring: 320ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* --- Layout --- */
  --max-w:         1280px;
  --max-w-article: 860px;
  --header-h:      72px;
  --sidebar-w:     300px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--clr-text);
  background-color: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

/* ============================================================
   TIPOGRAFIA GLOBAL
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ff-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--clr-text);
}

h1 { font-size: var(--fs-5xl); letter-spacing: -0.025em; }
h2 { font-size: var(--fs-4xl); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-3xl); }
h4 { font-size: var(--fs-2xl); }
h5 { font-size: var(--fs-xl);  font-family: var(--ff-sans); font-weight: 600; }
h6 { font-size: var(--fs-lg);  font-family: var(--ff-sans); font-weight: 600; }

p {
  color: var(--clr-text-2);
  line-height: 1.8;
}

strong, b {
  font-weight: 600;
  color: var(--clr-text);
}

/* ============================================================
   ACESSIBILIDADE
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--clr-gold);
  outline-offset: 3px;
}

::selection {
  background-color: var(--clr-gold-muted);
  color: var(--clr-gold-dark);
}

/* ============================================================
   SCROLLBAR PERSONALIZADA
   ============================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--clr-bg-2); }
::-webkit-scrollbar-thumb {
  background: var(--clr-bg-elevated);
  border-radius: var(--r-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--clr-gold); }

/* ============================================================
   UTILITÁRIOS
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-gold   { color: var(--clr-gold); }
.text-center { text-align: center; }
.font-serif  { font-family: var(--ff-serif); }
.font-sans   { font-family: var(--ff-sans); }
.italic      { font-style: italic; }

/* Linha decorativa */
.gold-bar {
  display: block;
  height: 2px;
  width: 48px;
  border-radius: var(--r-full);
  background-color: var(--clr-gold);
}

.gold-bar--center {
  margin: 0 auto;
  width: 100px;
  background: linear-gradient(90deg, transparent, var(--clr-gold), transparent);
}

/* Responsividade mobile */
@media (max-width: 480px) {
  h1 { font-size: var(--fs-4xl); }
  h2 { font-size: var(--fs-3xl); }
  h3 { font-size: var(--fs-2xl); }
}
