/* ============================================================
   Policlínica Santa Fé — folha de estilos
   Paleta: azul profundo (fachada) + vermelho (logo [S]) + papel
   Tipografia: Fraunces (títulos) + Archivo (texto)
   ============================================================ */

:root {
  --azul-950: #0d1533;
  --azul-900: #131e4a;
  --azul-800: #1b2a68;
  --azul-700: #24378a;
  --azul-100: #dde3f5;
  --vermelho: #d5372e;
  --vermelho-escuro: #b02a23;
  --papel: #f7f4ee;
  --papel-2: #efeae0;
  --branco: #ffffff;
  --tinta: #1a2340;
  --tinta-suave: #4a5372;
  --verde-whats: #1a8a2c;

  --fonte-titulo: "Fraunces", Georgia, serif;
  --fonte-texto: "Archivo", "Segoe UI", sans-serif;

  --raio: 14px;
  --sombra: 0 20px 50px -20px rgba(13, 21, 51, 0.35);
  --transicao: 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------- base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ---------- barra de rolagem ---------- */
/* Chrome / Edge / Safari */
::-webkit-scrollbar { width: 13px; height: 13px; }

::-webkit-scrollbar-track { background: var(--papel-2); }

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--azul-700), var(--azul-900));
  border-radius: 999px;
  border: 3px solid var(--papel-2); /* cria a folga em volta do pegador */
}

::-webkit-scrollbar-thumb:hover {
  background: var(--vermelho);
}

::-webkit-scrollbar-thumb:active {
  background: var(--vermelho-escuro);
}

/* Firefox */
@supports (-moz-appearance: none) {
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--azul-800) var(--papel-2);
  }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

html, body { overflow-x: clip; }

body {
  font-family: var(--fonte-texto);
  color: var(--tinta);
  background: var(--papel);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: min(1160px, 92%);
  margin-inline: auto;
}

h1, h2, h3 {
  font-family: var(--fonte-titulo);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }

h1 em, h2 em {
  font-style: italic;
  font-weight: 600;
  color: var(--vermelho);
}

/* rótulo de seção com colchetes — eco da marca [S] */
.rotulo {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--tinta-suave);
  margin-bottom: 1rem;
}

.rotulo__colchete {
  color: var(--vermelho);
  font-weight: 700;
  font-size: 1.05em;
}

.rotulo--claro { color: var(--azul-100); }

.secao-cabecalho {
  max-width: 640px;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

section { padding: clamp(4rem, 8vw, 7rem) 0; }

/* ---------- animação de revelação ---------- */
/* só esconde se o JS carregou (html.js) — sem JS, tudo fica visível */
html.js .revelar {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .revelar { opacity: 1; transform: none; transition: none; }
  .faixa__trilho { animation: none !important; }
}

/* ---------- botões ---------- */
.botao {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform var(--transicao), box-shadow var(--transicao), background var(--transicao);
}

.botao svg { width: 20px; height: 20px; fill: currentColor; flex: none; }

.botao--primario {
  background: var(--vermelho);
  color: var(--branco);
  box-shadow: 0 12px 28px -12px rgba(213, 55, 46, 0.6);
}

.botao--primario:hover {
  background: var(--vermelho-escuro);
  transform: translateY(-2px);
}

.botao--contorno {
  border: 2px solid var(--azul-800);
  color: var(--azul-800);
}

.botao--contorno:hover {
  background: var(--azul-800);
  color: var(--branco);
  transform: translateY(-2px);
}

.botao--claro {
  background: var(--branco);
  color: var(--azul-900);
}

.botao--claro:hover { transform: translateY(-2px); }

/* ============================================================
   TOPO
   ============================================================ */
.topo {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.topo.rolado {
  border-bottom-color: rgba(26, 35, 64, 0.08);
  box-shadow: 0 8px 30px -18px rgba(13, 21, 51, 0.25);
}

.topo__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 0;
}

/* marca */
.marca {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.marca__logo {
  height: 50px;
  width: auto;
  display: block;
}

/* navegação */
.nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}

.nav a {
  text-decoration: none;
  color: var(--tinta);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}

.nav a:not(.nav__fone)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: var(--vermelho);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav a:not(.nav__fone):hover::after { transform: scaleX(1); }

.nav__fone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: var(--azul-900);
  color: var(--branco) !important;
  font-weight: 600;
  transition: background var(--transicao);
}

.nav__fone svg { width: 16px; height: 16px; fill: currentColor; }
.nav__fone:hover { background: var(--vermelho); }

.topo__hamburguer {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.topo__hamburguer span {
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: var(--azul-900);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.topo__hamburguer.aberto span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.topo__hamburguer.aberto span:nth-child(2) { opacity: 0; }
.topo__hamburguer.aberto span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: clamp(3rem, 6vw, 5.5rem) 0 0;
  position: relative;
  overflow: hidden;
}

/* textura de fundo sutil */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 85% 10%, rgba(36, 55, 138, 0.08), transparent),
    radial-gradient(ellipse 40% 40% at 10% 90%, rgba(213, 55, 46, 0.05), transparent);
  pointer-events: none;
}

.hero__grade {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  position: relative;
}

.hero__sub {
  font-size: 1.12rem;
  color: var(--tinta-suave);
  margin: 1.4rem 0 2rem;
  max-width: 34rem;
}

.hero__acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.8rem;
}

.hero__selos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--tinta-suave);
}

.hero__selos li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hero__selos li::before {
  content: "✚";
  color: var(--vermelho);
  font-size: 0.75rem;
}

/* foto do hero em arco */
.hero__foto {
  position: relative;
  margin: 0;
}

.hero__foto img {
  width: 100%;
  height: clamp(340px, 44vw, 520px);
  object-fit: cover;
  border-radius: 260px 260px var(--raio) var(--raio);
  box-shadow: var(--sombra);
}

/* colchetes decorativos ecoando a marca */
.hero__foto::before,
.hero__foto::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 90px;
  border: 5px solid var(--vermelho);
  z-index: 2;
}

.hero__foto::before {
  left: -16px;
  top: 42%;
  border-right: none;
}

.hero__foto::after {
  right: -16px;
  top: 22%;
  border-left: none;
}

.hero__badge {
  position: absolute;
  left: -14px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--azul-900);
  color: var(--branco);
  padding: 1rem 1.5rem;
  border-radius: var(--raio);
  box-shadow: var(--sombra);
}

.hero__badge-numero {
  font-family: var(--fonte-titulo);
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1;
}

.hero__badge-numero sup { color: var(--vermelho); font-size: 0.55em; }

.hero__badge-texto {
  font-size: 0.82rem;
  line-height: 1.3;
  opacity: 0.85;
}

/* faixa de especialidades rolante */
.faixa {
  margin-top: clamp(3rem, 6vw, 5rem);
  background: var(--azul-900);
  color: var(--papel);
  overflow: hidden;
  padding: 0.85rem 0;
}

.faixa__trilho {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: max-content;
  animation: rolar 40s linear infinite;
  font-family: var(--fonte-titulo);
  font-style: italic;
  font-size: 1.05rem;
  white-space: nowrap;
}

.faixa__trilho i {
  font-style: normal;
  color: var(--vermelho);
  font-size: 0.8rem;
}

@keyframes rolar {
  to { transform: translateX(-50%); }
}

/* ============================================================
   SOBRE
   ============================================================ */
.sobre__grade {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}

.sobre__foto img {
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  height: 100%;
  object-fit: cover;
}

.sobre__conteudo p { color: var(--tinta-suave); margin-bottom: 1rem; }
.sobre__conteudo h2 { margin-bottom: 1.4rem; }

.numeros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2.2rem;
  padding-top: 2rem;
  border-top: 2px solid var(--papel-2);
}

.numeros__item dt {
  font-family: var(--fonte-titulo);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--vermelho);
  line-height: 1;
}

.numeros__item dd {
  font-size: 0.85rem;
  color: var(--tinta-suave);
  margin-top: 0.3rem;
}

/* ============================================================
   ESPECIALIDADES (seção escura)
   ============================================================ */
.especialidades {
  background:
    radial-gradient(ellipse 70% 60% at 15% 0%, rgba(36, 55, 138, 0.55), transparent),
    var(--azul-950);
  color: var(--papel);
}

.especialidades h2 { color: var(--branco); }

.cartoes {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.1rem;
}

.cartao {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--raio);
  padding: 1.7rem 1.5rem;
  transition: transform var(--transicao), background var(--transicao), border-color var(--transicao);
  position: relative;
  overflow: hidden;
}

.cartao::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--vermelho);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.cartao:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.cartao:hover::before { transform: scaleX(1); }

.cartao svg {
  width: 34px;
  height: 34px;
  fill: var(--vermelho);
  margin-bottom: 1rem;
}

.cartao h3 {
  font-size: 1.18rem;
  color: var(--branco);
  margin-bottom: 0.5rem;
}

.cartao p {
  font-size: 0.92rem;
  color: rgba(247, 244, 238, 0.72);
  line-height: 1.55;
}

.cartao--destaque {
  background: rgba(213, 55, 46, 0.14);
  border-color: rgba(213, 55, 46, 0.4);
}

/* ============================================================
   CORPO CLÍNICO
   ============================================================ */
.medicos {
  list-style: none;
  counter-reset: medico;
  border-top: 2px solid var(--papel-2);
}

.medico {
  counter-increment: medico;
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 1.15rem 0.5rem;
  border-bottom: 2px solid var(--papel-2);
  transition: background var(--transicao), padding-left var(--transicao);
}

.medico::before {
  content: "[" counter(medico, decimal-leading-zero) "]";
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--vermelho-escuro);
  letter-spacing: 0.05em;
}

.medico:hover {
  background: var(--branco);
  padding-left: 1rem;
}

.medico strong {
  font-family: var(--fonte-titulo);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 600;
}

.medico span {
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tinta-suave);
  text-align: right;
}

.corpo__nota {
  margin-top: 1.6rem;
  font-size: 0.92rem;
  color: var(--tinta-suave);
  font-style: italic;
}

/* ============================================================
   VACINAS
   ============================================================ */
.vacinas { background: var(--papel-2); }

.vacinas__grade {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
}

.vacinas__conteudo h2 { margin-bottom: 1.2rem; }
.vacinas__conteudo > p { color: var(--tinta-suave); margin-bottom: 1.4rem; }

.vacinas__lista {
  list-style: none;
  margin-bottom: 2rem;
}

.vacinas__lista li {
  padding: 0.55rem 0 0.55rem 1.8rem;
  position: relative;
  font-weight: 500;
}

.vacinas__lista li::before {
  content: "✚";
  position: absolute;
  left: 0;
  color: var(--vermelho);
  font-weight: 700;
}

.vacinas__foto img {
  border-radius: 260px 260px var(--raio) var(--raio);
  box-shadow: var(--sombra);
  height: clamp(340px, 40vw, 480px);
  width: 100%;
  object-fit: cover;
}

/* ============================================================
   LABORATÓRIO
   ============================================================ */
.laboratorio {
  background:
    radial-gradient(ellipse 50% 80% at 90% 50%, rgba(213, 55, 46, 0.18), transparent),
    var(--azul-900);
  color: var(--papel);
  padding: clamp(3rem, 6vw, 4.5rem) 0;
}

.laboratorio h2 { color: var(--branco); margin-bottom: 0.9rem; }

.laboratorio__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
}

.laboratorio__inner > div { max-width: 620px; }
.laboratorio__inner p { color: rgba(247, 244, 238, 0.78); }
.laboratorio .botao { flex: none; }

/* ============================================================
   ESTRUTURA / GALERIA
   ============================================================ */
.galeria {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.galeria__item {
  margin: 0;
  position: relative;
  border-radius: var(--raio);
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 10px 30px -18px rgba(13, 21, 51, 0.35);
}

.galeria__item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.galeria__item:hover img { transform: scale(1.06); }

.galeria__item:focus-visible {
  outline: 3px solid var(--vermelho);
  outline-offset: 3px;
}

.galeria__item figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2rem 1.1rem 0.9rem;
  background: linear-gradient(transparent, rgba(13, 21, 51, 0.85));
  color: var(--branco);
  font-size: 0.9rem;
  font-weight: 600;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(13, 21, 51, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 80vh;
  border-radius: var(--raio);
}

.lightbox__legenda {
  color: var(--papel);
  margin-top: 1rem;
  font-size: 0.95rem;
}

.lightbox__fechar {
  position: absolute;
  top: 1.2rem;
  right: 1.6rem;
  background: none;
  border: none;
  color: var(--branco);
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.lightbox__fechar:hover { opacity: 1; }

/* ============================================================
   CONVÊNIOS
   ============================================================ */
.convenios {
  background: var(--papel);
  text-align: center;
}

.convenios__inner {
  max-width: 620px;
}

.convenios h2 { margin-bottom: 1.1rem; }
.convenios p { color: var(--tinta-suave); margin-bottom: 1.8rem; }

/* ============================================================
   CONTATO
   ============================================================ */
.contato { background: var(--papel-2); }

.contato__grade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}

.contato__info h2 { margin-bottom: 2rem; }

.contato__bloco {
  margin-bottom: 1.8rem;
  font-style: normal;
}

.contato__bloco h3 {
  font-size: 0.85rem;
  font-family: var(--fonte-texto);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--vermelho-escuro);
  margin-bottom: 0.5rem;
}

.contato__bloco address { font-style: normal; }

.contato__bloco p { color: var(--tinta-suave); margin-bottom: 0.6rem; }

.contato__bloco a {
  color: var(--azul-800);
  font-weight: 600;
  text-decoration: none;
}

.contato__bloco a:hover { text-decoration: underline; }

.contato__mapa {
  position: sticky;
  top: 100px;
  border-radius: var(--raio);
  overflow: hidden;
  box-shadow: var(--sombra);
}

.contato__mapa iframe {
  width: 100%;
  height: 480px;
  border: 0;
  display: block;
}

/* ============================================================
   RODAPÉ
   ============================================================ */
.rodape {
  background: var(--azul-950);
  color: rgba(247, 244, 238, 0.75);
}

.rodape__grade {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding: clamp(3rem, 5vw, 4.5rem) 0;
}

.rodape__logo {
  width: 240px;
  height: auto;
  display: block;
  margin-bottom: 1.2rem;
}

.rodape__coluna h4 {
  color: var(--branco);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 1rem;
}

.rodape__coluna a {
  display: block;
  color: rgba(247, 244, 238, 0.75);
  text-decoration: none;
  margin-bottom: 0.55rem;
  transition: color 0.2s ease;
}

.rodape__coluna a:hover { color: var(--vermelho); }

.rodape__coluna p { font-size: 0.92rem; margin-top: 0.8rem; }

.rodape__base {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.2rem 0;
  font-size: 0.85rem;
}

/* ============================================================
   WHATSAPP FLUTUANTE
   ============================================================ */
.whats-flutuante {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--verde-whats);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px -10px rgba(26, 138, 44, 0.6);
  transition: transform var(--transicao);
}

.whats-flutuante:hover { transform: scale(1.1); }

.whats-flutuante svg {
  width: 30px;
  height: 30px;
  fill: var(--branco);
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 960px) {
  .hero__grade,
  .sobre__grade,
  .vacinas__grade,
  .contato__grade {
    grid-template-columns: 1fr;
  }

  .sobre__foto { order: 2; }
  .vacinas__foto img { height: 320px; border-radius: var(--raio); }
  .hero__foto img { height: 380px; border-radius: 200px 200px var(--raio) var(--raio); }

  .laboratorio__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .galeria { grid-template-columns: repeat(2, 1fr); }
  .contato__mapa { position: static; }
  .contato__mapa iframe { height: 360px; }
  .medico { grid-template-columns: 2.6rem 1fr; }
  .medico span { grid-column: 2; text-align: left; }
}

@media (max-width: 720px) {
  .topo__hamburguer { display: flex; }

  .marca__logo { height: 40px; }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--papel);
    border-bottom: 1px solid rgba(26, 35, 64, 0.1);
    box-shadow: 0 24px 40px -20px rgba(13, 21, 51, 0.3);
    max-height: 0;
    overflow: hidden;
    visibility: hidden; /* tira os links fechados da ordem de tabulação */
    transition: max-height 0.4s ease, visibility 0s 0.4s;
  }

  .nav.aberto {
    max-height: 420px;
    visibility: visible;
    transition: max-height 0.4s ease, visibility 0s;
  }

  .nav a {
    width: 100%;
    padding: 1rem 4%;
    border-top: 1px solid rgba(26, 35, 64, 0.06);
  }

  .nav a:not(.nav__fone)::after { display: none; }

  .nav a.nav__fone {
    border-radius: 0;
    justify-content: center;
    margin: 0.5rem 4% 1rem;
    width: 92%;
  }

  .galeria { grid-template-columns: 1fr; }
  .galeria__item img { height: 220px; }
  .numeros { grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
  .hero__badge { left: 8px; bottom: 12px; padding: 0.8rem 1.1rem; }
  .hero__foto::before, .hero__foto::after { display: none; }
}
