/* institutional-site.css */
/* * Reestruturado para "Hungry Stack" com Dark/Light Mode.
 * Foco: Variáveis CSS, Dark Mode padrão, transições suaves.
 * * Regras: 
 * - Nenhuma alteração no HTML/JS.
 * - Classes e IDs originais mantidos.
 * - Foco 100% no CSS.
 */

/* * ===================================================================
 * :root - Variáveis Globais (Dark Mode Padrão)
 * ===================================================================
 */
:root {
  /* Paleta de Cores (Dark Mode - Padrão) */
  --color-bg-primary: #181822;
  --color-bg-secondary: #262635;
  --color-accent: #7A4CFF;
  --color-text-primary: #C8C8D0;
  --color-text-high: #FFFFFF;
  --color-border: #333344; /* Borda sutil para dark mode */
  --color-overlay-bg: rgba(24, 24, 34, 0.7); /* Overlay para glassmorphism */
  
  /* Sombras (Dark Mode) */
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.3);

  /* Tipografia (Mantida) */
  --font-system: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* UI (Mantida) */
  --radius-card: 18px;       /* Borda arredondada para cards */
  --radius-btn: 30px;        /* Borda arredondada para botões */
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* * ===================================================================
 * Light Mode (Sobrescrita de Variáveis)
 * ===================================================================
 */
body.light-mode {
  /* Paleta de Cores (Light Mode) */
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #F0F0F0;
  /* --color-accent: #7A4CFF; (Mantido) */
  --color-text-primary: #333333;
  --color-text-high: #000000;
  --color-border: #d2d2d7; /* Borda clara (do estilo Apple) */
  --color-overlay-bg: rgba(255, 255, 255, 0.7); /* Overlay claro */

  /* Sombras (Light Mode) */
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* * ===================================================================
 * Reset Básico e Tipografia Global (Com Transições)
 * ===================================================================
 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-system);
  background-color: var(--color-bg-primary); /* USA VAR */
  color: var(--color-text-primary); /* USA VAR */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Transição de Tema */
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 {
  font-family: var(--font-system);
  color: var(--color-text-high); /* USA VAR */
  font-weight: 600;
  line-height: 1.3;
  transition: color 0.3s ease;
}

p {
  color: var(--color-text-primary); /* USA VAR */
  font-size: 1.05rem;
  transition: color 0.3s ease;
}

i {
  transition: color 0.3s ease;
}

/* * ===================================================================
 * Hero
 * ===================================================================
 */
.inst-hero {
  background: var(--color-bg-primary); /* USA VAR */
  padding: 80px 24px 72px 24px;
  text-align: center;
  transition: background-color 0.3s ease;
}

.inst-hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--color-text-high); /* USA VAR */
}

.inst-hero p {
  font-size: 1.25rem;
  margin-bottom: 32px;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.inst-hero .btn-primary {
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  padding: 13px 32px;
  background: var(--color-accent); /* USA VAR */
  color: var(--color-text-high); /* USA VAR (para contraste com acento) */
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition-smooth);
}

.inst-hero .btn-primary:hover {
  filter: brightness(1.1); /* Efeito agnóstico de tema */
  transform: translateY(-2px);
}

.inst-hero .btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.9); /* Efeito agnóstico de tema */
}

/* * ===================================================================
 * Pilares
 * ===================================================================
 */
.inst-pilares {
  background: var(--color-bg-primary); /* USA VAR (Fundo da página) */
  padding: 70px 24px;
  border-top: 1px solid var(--color-border); /* USA VAR */
  border-bottom: 1px solid var(--color-border); /* USA VAR */
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.pilares-grid {
  display: flex;
  gap: 34px;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.pilar-card {
  flex: 1;
  min-width: 220px;
  background: var(--color-bg-secondary); /* USA VAR (Card) */
  border: 1px solid var(--color-border); /* USA VAR */
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft); /* USA VAR */
  text-align: center;
  padding: 32px 24px;
  color: var(--color-text-primary); /* USA VAR */
  transition: var(--transition-smooth);
}

.pilar-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover); /* USA VAR */
}

.pilar-card i {
  font-size: 2.6rem;
  margin-bottom: 18px;
  color: var(--color-accent); /* USA VAR */
}

.pilar-card h3 {
  margin: 0 0 11px 0;
  color: var(--color-text-high); /* USA VAR */
  font-size: 1.2rem;
  font-weight: 600;
}

.pilar-card p {
  font-size: 1rem;
  color: var(--color-text-primary); /* USA VAR */
}

/* * ===================================================================
 * Blocos de Construção
 * ===================================================================
 */
.inst-blocos {
  background: var(--color-bg-primary); /* USA VAR */
  padding: 70px 24px;
  color: var(--color-text-high); /* USA VAR */
  transition: background-color 0.3s ease, color 0.3s ease;
}

.blocos-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 40px;
  color: var(--color-text-high); /* USA VAR */
  font-weight: 600;
}

.blocos-grid {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
}

.bloco-card {
  position: relative;
  flex: 1;
  min-width: 180px;
  max-width: 220px;
  background: var(--color-bg-secondary); /* USA VAR */
  border-radius: 14px;
  border: 1px solid var(--color-border); /* USA VAR */
  text-align: center;
  padding: 34px 18px 18px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-soft); /* USA VAR */
  overflow: hidden;
  margin-bottom: 6px;
  z-index: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.bloco-card i {
  font-size: 2rem;
  margin-bottom: 14px;
  color: var(--color-accent); /* USA VAR */
}

.bloco-title {
  display: block;
  font-size: 1.13rem;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--color-text-high); /* USA VAR */
}

/* Overlay com Efeito Glassmorphism (Temático) */
.bloco-overlay {
  position: absolute;
  left: 0; 
  top: 0;
  width: 100%;
  height: 100%;
  
  /* Efeito Glassmorphism */
  background: var(--color-overlay-bg); /* USA VAR */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  color: var(--color-text-high); /* USA VAR */
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 14px;
  text-align: center;
  font-size: 1.06rem;
  visibility: hidden;
  transition: opacity 0.38s, visibility 0.39s, backdrop-filter 0.38s, background-color 0.3s ease, color 0.3s ease;
}

.bloco-card.is-hovered {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover); /* USA VAR */
}

.bloco-card.is-hovered .bloco-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: blocoOverlayIn 0.49s; 
}

@keyframes blocoOverlayIn {
  from { opacity: 0; backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}

/* * ===================================================================
 * Fator Moderno
 * ===================================================================
 */
.inst-fator-moderno {
  background: var(--color-bg-secondary); /* USA VAR (Seção com fundo secundário) */
  color: var(--color-text-high); /* USA VAR */
  padding: 70px 24px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.fator-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 48px;
  color: var(--color-text-high); /* USA VAR */
  font-weight: 600;
}

.fator-items {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  max-width: 1000px;
  margin: 0 auto;
}

.fator-item {
  flex: 1;
  min-width: 240px;
  background: transparent; /* Mantido */
  border-radius: 0;
  text-align: center;
  padding: 10px;
  box-shadow: none;
  margin-bottom: 6px;
  transition: none;
}

.fator-item i {
  font-size: 2.7rem;
  margin-bottom: 15px;
  color: var(--color-accent); /* USA VAR */
}

.fator-item h3 {
  margin: 0 0 9px 0;
  color: var(--color-text-high); /* USA VAR */
  font-size: 1.15rem;
  font-weight: 600;
}

.fator-item p {
  font-size: 1rem;
  color: var(--color-text-primary); /* USA VAR */
}

/* * ===================================================================
 * CTA Final
 * ===================================================================
 */
.inst-cta-final {
  background: var(--color-accent); /* USA VAR */
  color: var(--color-text-high); /* USA VAR */
  text-align: center;
  padding: 70px 24px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.inst-cta-final h2 {
  font-size: 2.5rem;
  margin-bottom: 24px;
  font-weight: 700;
  color: var(--color-text-high); /* Garantindo a cor */
}

/* Botão Invertido */
.inst-cta-final .btn-primary {
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: var(--radius-btn);
  background: var(--color-bg-primary); /* USA VAR (Cor de fundo da página) */
  color: var(--color-accent); /* USA VAR (Cor de destaque) */
  border: none;
  transition: var(--transition-smooth);
}

.inst-cta-final .btn-primary:hover {
  background: var(--color-bg-secondary); /* USA VAR (Cor secundária da página) */
  color: var(--color-accent); /* USA VAR */
  transform: translateY(-2px);
}

/* * ===================================================================
 * Botão de Alternância de Tema (NOVO)
 * ===================================================================
 */
.theme-toggle-button {
  position: fixed;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: var(--color-text-primary); /* Cor padrão (Dark) */
  font-size: 1.5rem; /* Ajuste o tamanho do ícone */
  z-index: 1000;
  transition: color 0.3s ease, transform 0.3s ease;
}

.theme-toggle-button:hover {
  color: var(--color-accent);
  transform: scale(1.1);
}

/* A cor do botão é sobrescrita automaticamente pelas variáveis */
/* .light-mode .theme-toggle-button usará --color-text-primary do light mode */
/* Se precisar de cor de alto contraste no light mode, descomente abaixo */
/*
body.light-mode .theme-toggle-button {
  color: var(--color-text-high);
}
*/

/* * ===================================================================
 * Responsividade (Mantida)
 * ===================================================================
 */
@media (max-width: 1000px) {
  .pilares-grid, .fator-items, .blocos-grid {
    gap: 18px;
    padding: 0 16px;
  }
}

@media (max-width: 850px) {
  .pilares-grid, .fator-items, .blocos-grid {
    flex-direction: column;
    align-items: center;
  }
  
  .pilar-card, .fator-item, .bloco-card {
      max-width: 450px;
      width: 100%;
  }
}

@media (max-width: 600px) {
  .inst-hero h1 {
    font-size: 2.2rem;
  }
  
  .inst-cta-final h2 {
    font-size: 1.8rem;
  }
  
  .inst-hero p {
      font-size: 1.1rem;
  }

  .blocos-title, .fator-title {
    font-size: 1.6rem;
  }
  
  .inst-hero, .inst-pilares, .inst-blocos, .inst-fator-moderno, .inst-cta-final {
      padding: 50px 20px;
  }

  .theme-toggle-button {
    top: 10px;
    right: 10px;
    font-size: 1.3rem;
  }
}