/* ============================================================
   global.css
   Estilos globais e variáveis CSS do projeto A História de Jesus
   ============================================================ */

/* ---- Variáveis CSS (Design Tokens) ---- */
:root {
  /* Paleta de Cores */
  --color-primary: #2C3E50;        /* Azul escuro - cor principal */
  --color-primary-dark: #233a50;   /* Azul muito escuro */
  --color-primary-light: #3D5166;  /* Azul médio */
  --color-secondary: #8B6914;      /* Dourado escuro */
  --color-secondary-light: #C9A84C; /* Dourado claro */
  --color-accent: #D4A017;         /* Âmbar */
  --color-accent-light: #F0C850;   /* Âmbar claro */

  /* Backgrounds */
  --color-bg-primary: #F8F5F0;     /* Branco quente - fundo principal */
  --color-bg-secondary: #EDE8DF;   /* Creme - fundo secundário */
  --color-bg-dark: #1A1A2E;        /* Azul muito escuro - seções escuras */
  --color-bg-card: #FFFFFF;        /* Branco - cards */

  /* Textos */
  --color-text-primary: #2C2C2C;   /* Quase preto */
  --color-text-secondary: #5C5C5C; /* Cinza escuro */
  --color-text-light: #8C8C8C;     /* Cinza médio */
  --color-text-white: #FFFFFF;     /* Branco */
  --color-text-gold: #C9A84C;      /* Dourado */

  /* Bordas */
  --color-border: #DDD5C8;         /* Borda sutil */
  --color-border-gold: #C9A84C;    /* Borda dourada */

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  --shadow-gold: 0 4px 16px rgba(201, 168, 76, 0.25);

  /* Tipografia */
  --font-serif: 'Playfair Display', 'Georgia', serif;
  --font-sans: 'Open Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Courier New', monospace;

  /* Tamanhos de Fonte */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-md: 1.125rem;   /* 18px */
  --text-lg: 1.25rem;    /* 20px */
  --text-xl: 1.5rem;     /* 24px */
  --text-2xl: 1.875rem;  /* 30px */
  --text-3xl: 2.25rem;   /* 36px */
  --text-4xl: 3rem;      /* 48px */
  --text-5xl: 3.75rem;   /* 60px */

  /* Espaçamentos */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transições */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
  --transition-slow: 500ms ease;

  /* Z-index */
  --z-below: -1;
  --z-base: 0;
  --z-raised: 10;
  --z-overlay: 100;
  --z-modal: 200;
  --z-toast: 300;
  --z-tooltip: 400;

  /* Breakpoints (usados como referência nos comentários) */
  /* --bp-sm: 640px */
  /* --bp-md: 768px */
  /* --bp-lg: 1024px */
  /* --bp-xl: 1280px */
  /* --bp-2xl: 1536px */

  /* Container */
  --container-max: 1200px;
  --container-padding: var(--space-6);
}

/* ---- Reset e Normalize ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---- Elementos Base ---- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-secondary-light);
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---- Classes Utilitárias ---- */

/* Visibilidade */
.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;
}

.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

/* Texto */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-primary   { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-light     { color: var(--color-text-light); }
.text-white     { color: var(--color-text-white); }
.text-gold      { color: var(--color-text-gold); }

.font-serif { font-family: var(--font-serif); }
.font-sans  { font-family: var(--font-sans); }

.font-normal  { font-weight: 400; }
.font-medium  { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold    { font-weight: 700; }

/* Backgrounds */
.bg-primary   { background-color: var(--color-bg-primary); }
.bg-secondary { background-color: var(--color-bg-secondary); }
.bg-dark      { background-color: var(--color-bg-dark); }
.bg-white     { background-color: var(--color-bg-card); }

/* Display */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.flex-wrap   { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Largura */
.w-full  { width: 100%; }
.w-auto  { width: auto; }
.max-w-container { max-width: var(--container-max); margin-inline: auto; }

/* Bordas */
.border { border: 1px solid var(--color-border); }
.border-gold { border: 1px solid var(--color-border-gold); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Sombras */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Posicionamento */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

/* Separador decorativo */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-8) 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.divider-gold::before,
.divider-gold::after {
  background: linear-gradient(to right, transparent, var(--color-secondary-light), transparent);
}

/* Linhas ornamentais */
.ornament {
  text-align: center;
  color: var(--color-secondary-light);
  font-size: var(--text-xl);
  letter-spacing: 0.5em;
  user-select: none;
}

/* Botões Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-secondary);
  color: var(--color-text-white);
  border-color: var(--color-secondary);
}

.btn-primary:hover {
  background-color: var(--color-secondary-light);
  border-color: var(--color-secondary-light);
  color: var(--color-text-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-secondary);
  border-color: var(--color-secondary);
}

.btn-outline:hover {
  background-color: var(--color-secondary);
  color: var(--color-text-white);
  transform: translateY(-2px);
}

.btn-white {
  background-color: var(--color-text-white);
  color: var(--color-primary);
  border-color: var(--color-text-white);
}

.btn-white:hover {
  background-color: var(--color-bg-secondary);
  border-color: var(--color-bg-secondary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* Cards Base */
.card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-body {
  padding: var(--space-6);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.badge-gold {
  background-color: rgba(201, 168, 76, 0.15);
  color: var(--color-secondary);
  border: 1px solid rgba(201, 168, 76, 0.30);
}

.badge-primary {
  background-color: rgba(44, 62, 80, 0.10);
  color: var(--color-primary);
  border: 1px solid rgba(44, 62, 80, 0.20);
}

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-secondary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Animações de entrada */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.animate-fade-in    { animation: fadeIn 0.5s ease forwards; }
.animate-fade-in-up { animation: fadeInUp 0.6s ease forwards; }
.animate-slide-left { animation: slideInLeft 0.6s ease forwards; }
.animate-slide-right { animation: slideInRight 0.6s ease forwards; }

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-secondary-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-secondary);
}

/* Seleção de texto */
::selection {
  background-color: rgba(201, 168, 76, 0.25);
  color: var(--color-primary-dark);
}

/* Focus visível acessível */
:focus-visible {
  outline: 2px solid var(--color-secondary-light);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Print */
@media print {
  .no-print { display: none !important; }
}

/* Botão Download Imagem*/
.btn-download-imagem {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--color-secondary);
    border-radius: var(--radius-full);
    background: rgba(201, 168, 76, 0.08);
    color: var(--color-primary-dark);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.btn-download-imagem:hover {
    background: rgba(201, 168, 76, 0.20);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-download-imagem i {
    color: var(--color-secondary);
}

/* ============================================================ */
/* Responsividade de Fontes (global.css) */
/* ============================================================ */

@media (max-width: 768px) {
  /* Ajustes para telas de tablet e mobile */

  /* Reduzir o tamanho da fonte base para um melhor aproveitamento do espaço */
  html {
    font-size: 90%; /* Reduz a fonte base em 10% */
  }

  /* Ajustes para títulos principais (h1) */
  h1, .page-hero__title {
    font-size: var(--text-4xl); /* De 3.5rem para 2.5rem */
  }

  /* Ajustes para títulos de seção (h2) */
  h2, .section-title {
    font-size: var(--text-3xl); /* De 2.5rem para 2rem */
  }

  /* Ajustes para subtítulos (h3) */
  h3 {
    font-size: var(--text-2xl); /* De 2rem para 1.75rem */
  }

  /* Ajustes para parágrafos maiores ou textos de destaque */
  .lead-text {
    font-size: var(--text-lg); /* De 1.25rem para 1.125rem */
  }

  /* Ajustes para o subtítulo do logo no navbar */
  .navbar__logo-subtitle {
    font-size: var(--text-xs); /* De 0.875rem para 0.75rem */
  }

  /* Ajustes para o texto do hero principal */
  .home-hero__subtitle {
    font-size: var(--text-xl); /* De 1.5rem para 1.25rem */
  }
}

@media (max-width: 480px) {
  /* Ajustes mais agressivos para telas de celular pequenas */

  html {
    font-size: 85%; /* Reduz ainda mais a fonte base */
  }

  h1, .page-hero__title {
    font-size: var(--text-3xl); /* De 2.5rem para 2rem */
  }

  h2, .section-title {
    font-size: var(--text-2xl); /* De 2rem para 1.75rem */
  }

  h3 {
    font-size: var(--text-xl); /* De 1.75rem para 1.5rem */
  }

  .home-hero__subtitle {
    font-size: var(--text-lg); /* De 1.25rem para 1.125rem */
  }
}