/* ==========================================================================
   Hospital do Ursinho - LAPUPE / UPE
   style.css - base: variaveis, reset, tipografia, layout geral
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variaveis
   Cores da identidade visual da LAPUPE / UPE.
   Verificacao de contraste (WCAG):
     --azul   #00477D  sobre #FFFFFF  -> 9.6:1  (AAA)
     --amarelo #DFB301 sobre #00477D  -> 4.8:1  (AA) - usar texto azul sobre amarelo
     --amarelo #DFB301 sobre #FFFFFF  -> 1.9:1  (invisivel) - nunca usar como texto no branco
     --cinza   #E4E4E4 sobre #00477D  -> 7.5:1  (AAA)
   -------------------------------------------------------------------------- */
:root {
  /* Cores institucionais */
  --azul: #00477D;
  --azul-escuro: #00325A;
  --azul-claro: #1668A8;
  --amarelo: #DFB301;
  --amarelo-claro: #F2C94C;
  --cinza: #E4E4E4;
  --cinza-claro: #F4F6F8;
  --branco: #FFFFFF;
  --texto: #0F2A40;
  --texto-suave: #4A5C6B;

  /* Cores funcionais */
  --sucesso: #1B8A5A;
  --sucesso-claro: #E6F4ED;
  --erro: #B3261E;

  /* Tipografia */
  --fonte-titulo: "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
  --fonte-texto: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Espacamento */
  --esp-1: 0.25rem;
  --esp-2: 0.5rem;
  --esp-3: 0.75rem;
  --esp-4: 1rem;
  --esp-5: 1.5rem;
  --esp-6: 2rem;
  --esp-7: 3rem;
  --esp-8: 4rem;
  --esp-9: 6rem;

  /* Formas */
  --raio-sm: 8px;
  --raio: 16px;
  --raio-gr: 24px;
  --raio-full: 999px;

  /* Sombras */
  --sombra-sm: 0 2px 6px rgba(0, 71, 125, 0.08);
  --sombra: 0 6px 20px rgba(0, 71, 125, 0.12);
  --sombra-gr: 0 14px 40px rgba(0, 71, 125, 0.18);

  /* Movimento */
  --transicao: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --transicao-lenta: 420ms cubic-bezier(0.34, 1.3, 0.64, 1);

  /* Layout */
  --largura-max: 1180px;
  --altura-cabecalho: 76px;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--altura-cabecalho) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--fonte-texto);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--texto);
  background-color: var(--branco);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

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

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

a {
  color: var(--azul);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--fonte-titulo);
  font-weight: 700;
  line-height: 1.2;
  color: var(--azul);
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.625rem); }

p {
  text-wrap: pretty;
}

/* Foco visivel e consistente (acessibilidade) */
:focus-visible {
  outline: 3px solid var(--amarelo);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   3. Utilitarios
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--largura-max);
  margin-inline: auto;
  padding-inline: var(--esp-5);
}

.pular-para-conteudo {
  position: absolute;
  top: -100px;
  left: var(--esp-4);
  z-index: 999;
  padding: var(--esp-3) var(--esp-5);
  background-color: var(--azul);
  color: var(--branco);
  font-weight: 700;
  border-radius: 0 0 var(--raio) var(--raio);
  transition: top var(--transicao);
}

.pular-para-conteudo:focus {
  top: 0;
  text-decoration: none;
}

/* Estado inicial dos elementos animados (JS adiciona .visivel ao entrar) */
.revelar {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.revelar.visivel {
  opacity: 1;
  transform: none;
}

/* Respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .revelar {
    opacity: 1;
    transform: none;
  }
}
