/* ============================================================================
   FENAJUD DESIGN SYSTEM v2.0
   ============================================================================
   Baseado no planejamento estratégico de redesign.
   Stack: CSS3 puro com variáveis nativas (CSS Custom Properties)
   
   METODOLOGIA:
   - CUBE CSS: Composition + Utility + Block + Exception
   - Design Tokens centralizados em :root
   - Componentes desacoplados e reutilizáveis
   ============================================================================ */


/* ============================================================================
   1. DESIGN TOKENS (:root)
   ============================================================================ */

:root {
  /* === CORES: BASE ESCURA SOFISTICADA === */
  --void:            #050505;
  --obsidian:        #0F0F0F;
  --graphite:        #1A1A1A;
  --charcoal:        #2D2D2D;
  --slate:           #4A4A4A;
  --ash:             #8A8A8A;
  
  /* === CORES: BASE CLARA PREMIUM === */
  --ivory:           #FAFAF9;
  --pearl:           #F0EFEA;
  --mist:            #E8E8E6;
  --fog:             #9A9A98;
  --smoke:           #6B6B69;
  
  /* === CORES: VERMELHO FENAJUD ESTRATÉGICO === */
  --fenajud-red:     #D22630;
  --fenajud-red-dark:#A81D25;
  --fenajud-red-dim: rgba(210, 38, 48, 0.08);
  --fenajud-red-glow:rgba(210, 38, 48, 0.25);
  --fenajud-red-light: rgba(210, 38, 48, 0.12);
  
  /* === CORES: ACENTOS === */
  --warm-gold:       #C9A96E;
  --success:         #2D8A4E;
  --white:           #FFFFFF;
  --black:           #000000;
  
  /* === GRADIENTES === */
  --gradient-hero:   linear-gradient(180deg, rgba(5,5,5,0) 0%, rgba(5,5,5,0.85) 100%);
  --gradient-card:   linear-gradient(180deg, rgba(5,5,5,0) 40%, rgba(5,5,5,0.9) 100%);
  --gradient-red:    linear-gradient(135deg, #D22630 0%, #8B1A21 100%);
  --gradient-dark:   linear-gradient(180deg, #0A0A0A 0%, #141414 100%);
  
  /* === TIPOGRAFIA === */
  --font-display:    'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:       'JetBrains Mono', 'SFMono-Regular', 'Menlo', monospace;
  
  /* === ESCALA TIPOGRÁFICA (Major Third 1.25) === */
  --text-xs:         0.6875rem;  /* 11px */
  --text-sm:         0.75rem;    /* 12px */
  --text-base:       0.875rem;   /* 14px */
  --text-md:         1rem;       /* 16px */
  --text-lg:         1.125rem;   /* 18px */
  --text-xl:         1.25rem;    /* 20px */
  --text-2xl:        1.5rem;     /* 24px */
  --text-3xl:        1.875rem;   /* 30px */
  --text-4xl:        2.25rem;    /* 36px */
  --text-5xl:        3rem;       /* 48px */
  --text-6xl:        3.75rem;    /* 60px */
  --text-hero:       clamp(2.5rem, 5vw, 4.5rem);
  --text-section:    clamp(1.75rem, 3vw, 2.5rem);
  
  /* === ESPAÇAMENTO RÍTMICO (base 8px) === */
  --space-1:         4px;
  --space-2:         8px;
  --space-3:         12px;
  --space-4:         16px;
  --space-5:         20px;
  --space-6:         24px;
  --space-8:         32px;
  --space-10:        40px;
  --space-12:        48px;
  --space-16:        64px;
  --space-20:        80px;
  --space-24:        96px;
  --space-32:        128px;
  
  /* === CONTAINER === */
  --container-max:   1280px;
  --container-pad:   20px;
  --container-pad-md:32px;
  --container-pad-lg:48px;
  
  /* === BORDAS === */
  --radius-sm:       6px;
  --radius-md:       8px;
  --radius-lg:       12px;
  --radius-xl:       16px;
  --radius-full:     9999px;
  
  /* === SOMBRAS === */
  --shadow-1:  0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.08);
  --shadow-2:  0 4px 6px rgba(0,0,0,0.03), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-3:  0 8px 16px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-4:  0 16px 32px rgba(0,0,0,0.06), 0 8px 16px rgba(0,0,0,0.10);
  --shadow-5:  0 24px 48px rgba(0,0,0,0.08), 0 12px 24px rgba(0,0,0,0.12);
  --glow-red:  0 0 0 3px var(--fenajud-red-dim), 0 8px 24px var(--fenajud-red-glow);
  
  /* === EASINGS === */
  --ease-out-expo:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart:   cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
  --ease-spring:      cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* === DURAÇÕES === */
  --duration-fast:    150ms;
  --duration-normal:  300ms;
  --duration-slow:    500ms;
  --duration-dramatic:800ms;
  
  /* === Z-INDEX SCALE === */
  --z-base:     0;
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-fixed:    300;
  --z-modal:    400;
  --z-popover:  500;
  --z-tooltip:  600;
}


/* ============================================================================
   2. RESET & BASE
   ============================================================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--obsidian);
  background-color: var(--ivory) !important;
  overflow-x: hidden;
}

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

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-normal) var(--ease-out-quart);
}

ul, ol {
  list-style: none;
}

address {
  font-style: normal;
}

::selection {
  background-color: var(--fenajud-red);
  color: var(--white);
}

:focus-visible {
  outline: 2px solid var(--fenajud-red);
  outline-offset: 2px;
}


/* ============================================================================
   3. UTILITÁRIOS GLOBAIS (Composition Layer)
   ============================================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--container-pad-md);
  }
}

@media (min-width: 1024px) {
  .container {
    padding-inline: var(--container-pad-lg);
  }
}

/* === Seções === */
.section {
  padding-block: var(--space-16);
}

.section--lg {
  padding-block: var(--space-24);
}

.section--xl {
  padding-block: var(--space-32);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-20);
  }
  .section--lg {
    padding-block: var(--space-24);
  }
  .section--xl {
    padding-block: var(--space-32);
  }
}

/* === Backgrounds === */
.bg-void       { background-color: var(--void); }
.bg-obsidian   { background-color: var(--obsidian); }
.bg-graphite   { background-color: var(--graphite); }
.bg-ivory      { background-color: var(--ivory); }
.bg-pearl      { background-color: var(--pearl); }
.bg-gradient-dark { background: var(--gradient-dark); }

/* === Text Colors === */
.text-white    { color: var(--white); }
.text-ash      { color: var(--ash); }
.text-fog      { color: var(--fog); }
.text-smoke    { color: var(--smoke); }
.text-red      { color: var(--fenajud-red); }

/* === Typography Utilities === */
.font-display  { font-family: var(--font-display); }
.font-body     { font-family: var(--font-body); }
.font-mono     { font-family: var(--font-mono); }

/* === Screen Reader Only === */
.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;
}


/* ============================================================================
   4. COMPONENTES BASE
   ============================================================================ */

/* === 4.1 Section Header === */
.section-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
}

@media (min-width: 768px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
  }
}

.section-header__title {
  font-family: var(--font-display);
  font-size: var(--text-section);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--obsidian);
  font-size: 1.975em;
  margin-bottom: 30px;
}

.section-header__title--light {
  color: var(--white);
}

.section-header__line {
  width: 48px;
  height: 3px;
  background: var(--fenajud-red);
  margin-top: var(--space-3);
  border-radius: var(--radius-full);
}

.section-header__line--center {
  margin-inline: auto;
}

.section-header__subtitle {
  font-size: var(--text-base);
  color: var(--fog);
  margin-top: var(--space-2);
  max-width: 480px;
}

.section-header__subtitle--light {
  color: var(--ash);
}

.section-header__action {
  flex-shrink: 0;
}

/* === 4.2 Tag / Label === */
.tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fenajud-red);
  line-height: 1;
}

.tag--light {
  color: var(--white);
  background: rgba(255,255,255,0.15);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.tag--pill {
  background: var(--fenajud-red-dim);
  color: var(--fenajud-red);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
}

/* === 4.3 Botões === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  transition: all var(--duration-normal) var(--ease-out-quart);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn--primary {
  background: var(--fenajud-red);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(210, 38, 48, 0.3);
}

.btn--primary:hover {
  background: var(--fenajud-red-dark);
  box-shadow: 0 6px 24px rgba(210, 38, 48, 0.4);
  transform: translateY(-1px);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--secondary {
  background: transparent;
  color: var(--obsidian);
  border: 1.5px solid var(--obsidian);
}

.btn--secondary:hover {
  background: var(--obsidian);
  color: var(--white);
}

.btn--secondary-light {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.3);
}

.btn--secondary-light:hover {
  background: var(--white);
  color: var(--obsidian);
  border-color: var(--white);
}

.btn--ghost {
  background: transparent;
  color: var(--fenajud-red);
  padding-inline: var(--space-2);
}

.btn--ghost:hover {
  color: var(--fenajud-red-dark);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn--full {
  width: 100%;
}

.btn svg {
  flex-shrink: 0;
  transition: transform var(--duration-normal) var(--ease-out-quart);
}

.btn:hover svg {
  transform: translateX(3px);
}

/* === 4.4 Cards === */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-out-quart),
              box-shadow var(--duration-normal) var(--ease-out-quart);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-4);
}

.card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out-quart);
}

.card:hover .card__media img {
  transform: scale(1.05);
}

.card__body {
  padding: var(--space-5);
}

.card__tag {
  margin-bottom: var(--space-2);
}

.card__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--obsidian);
  transition: color var(--duration-normal) var(--ease-out-quart);
}

.card:hover .card__title {
  color: var(--fenajud-red);
}

.card__excerpt {
  font-size: var(--text-base);
  color: var(--smoke);
  line-height: 1.6;
  margin-top: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--fog);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--space-3);
}

/* Card variant: Cinematic (image fills entire card) */
.card--cinematic {
  position: relative;
  border-radius: var(--radius-lg);
}

.card--cinematic .card__media {
  aspect-ratio: 16 / 10;
}

.card--cinematic .card__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  transition: background var(--duration-normal) var(--ease-out-quart);
}

.card--cinematic:hover .card__media::after {
  background: linear-gradient(180deg, rgba(5,5,5,0.2) 0%, rgba(5,5,5,0.95) 100%);
}

.card--cinematic .card__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-6);
  background: transparent;
}

.card--cinematic .card__title {
  color: var(--white);
  font-size: var(--text-xl);
}

.card--cinematic:hover .card__title {
  color: var(--white);
}

.card--cinematic .card__meta {
  color: rgba(255,255,255,0.7);
}

/* Card variant: Pearl */
.card--pearl {
  background: var(--pearl);
  border-radius: var(--radius-lg);
}

/* === 4.5 Inputs === */
.input {
  width: 100%;
  background: var(--graphite);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  color: var(--white);
  font-size: var(--text-md);
  outline: none;
  transition: border-color var(--duration-normal) var(--ease-out-quart),
              box-shadow var(--duration-normal) var(--ease-out-quart);
  box-shadow:
    inset 2px 2px 6px rgba(0,0,0,0.5),
    inset -1px -1px 4px rgba(255,255,255,0.05);
}

.input::placeholder {
  color: rgba(255,255,255,0.35);
}

.input:focus {
  border-color: var(--fenajud-red);
  box-shadow:
    inset 2px 2px 6px rgba(0,0,0,0.5),
    inset -1px -1px 4px rgba(255,255,255,0.05),
    0 0 0 3px var(--fenajud-red-dim);
}

.input--light {
  background: var(--white);
  border-color: var(--mist);
  color: var(--obsidian);
  box-shadow: none;
}

.input--light::placeholder {
  color: var(--fog);
}

.input--light:focus {
  border-color: var(--fenajud-red);
  box-shadow: 0 0 0 3px var(--fenajud-red-dim);
}

/* === 4.6 Link "Ver mais" === */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fenajud-red);
  transition: gap var(--duration-normal) var(--ease-out-quart);
}

.link-arrow:hover {
  gap: var(--space-3);
}

.link-arrow--light {
  color: var(--white);
}

.link-arrow svg {
  flex-shrink: 0;
}


/* ============================================================================
   5. ANIMAÇÕES & MOTION
   ============================================================================ */

/* === Scroll Reveal Base === */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity var(--duration-slow) var(--ease-out-quart),
              transform var(--duration-slow) var(--ease-out-quart);
}

[data-reveal="revealed"] {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal="stagger"] {
  transition-delay: var(--stagger, 0ms);
}

/* === Stagger Delays === */
.stagger-1  { --stagger: 80ms; }
.stagger-2  { --stagger: 160ms; }
.stagger-3  { --stagger: 240ms; }
.stagger-4  { --stagger: 320ms; }
.stagger-5  { --stagger: 400ms; }
.stagger-6  { --stagger: 480ms; }

/* === Hero Text Reveal (clip-path) === */
@keyframes heroReveal {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0;
  }
  to {
    clip-path: inset(0 0% 0 0);
    opacity: 1;
  }
}

.animate-hero-text {
  animation: heroReveal var(--duration-dramatic) var(--ease-out-expo) forwards;
}

/* === Fade Up === */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeUp var(--duration-slow) var(--ease-out-quart) forwards;
}

/* === Scale In === */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-in {
  animation: scaleIn var(--duration-slow) var(--ease-out-quart) forwards;
}

/* === Count Up Placeholder === */
@keyframes countPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* === Reading Progress Bar === */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--fenajud-red);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* === Magnetic Button Effect (CSS-only approximation) === */
.btn--magnetic {
  transition: transform var(--duration-fast) var(--ease-out-quart);
}

.btn--magnetic:hover {
  transform: scale(1.02);
}

/* === Underline Animation for Links === */
.link-underline {
  position: relative;
}

.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--duration-normal) var(--ease-out-quart);
}

.link-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}


/* ============================================================================
   6. RESPONSIVE UTILITIES
   ============================================================================ */

.hide-mobile {
  display: none;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: initial;
  }
  .hide-desktop {
    display: none;
  }
}

@media (min-width: 1024px) {
  .hide-tablet {
    display: none;
  }
}

/* ============================================================================
   7. ACCESSIBILITY
   ============================================================================ */

/* Skip Link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  padding: var(--space-3) var(--space-6);
  background: var(--fenajud-red);
  color: var(--white);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: top var(--duration-fast) var(--ease-out-quart);
  outline: none;
}

.skip-link:focus {
  top: 0;
}
