/* ==========================================================================
   Merca Contabilidade e Consultoria
   Folha de estilo única do site institucional.
   Cores retiradas da logotipo original: navy #3A587C, amarelo #FDCB29.
   ========================================================================== */

:root {
  /* Cor */
  --tinta:        #16283C;   /* navy profundo: fundos escuros e títulos */
  --azul:         #3A587C;   /* azul da marca */
  --azul-medio:   #5E7CA3;
  --azul-vidro:   rgba(22, 40, 60, .82);
  --amarelo:      #FDCB29;   /* amarelo da marca */
  --papel:        #EDF0F4;   /* cinza-azulado claro */
  --papel-fundo:  #F7F9FB;
  --branco:       #FFFFFF;
  --corpo:        #46586C;   /* texto corrido */
  --linha:        #D3DBE4;

  /* Tipografia */
  --fonte:        'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fonte-titulo: 'Archivo Narrow', 'Archivo', system-ui, sans-serif;

  /* Ritmo */
  --largura:      1180px;
  --gutter:       clamp(1.25rem, 4vw, 3rem);
  --secao:        clamp(4rem, 9vw, 7.5rem);
}

/* --------------------------------------------------------------- Base --- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  background: var(--branco);
  color: var(--corpo);
  font-family: var(--fonte);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--azul); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--tinta); }

:focus-visible {
  outline: 3px solid var(--amarelo);
  outline-offset: 3px;
}

/* ------------------------------------------------------- Tipografia --- */

h1, h2, h3, h4 {
  font-family: var(--fonte-titulo);
  color: var(--tinta);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.04;
  margin: 0 0 .6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 6.2vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.18; }
h4 { font-size: 1.0625rem; letter-spacing: 0; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

.prosa { max-width: 62ch; }
.prosa p + p { margin-top: 0; }

.chamada {
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  line-height: 1.55;
  color: var(--tinta);
}

/* Marca de abertura de seção: o entalhe triangular do símbolo da Merca. */
.entalhe {
  width: 34px;
  height: 34px;
  background: var(--amarelo);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  margin-bottom: 1.4rem;
  flex: none;
}
.entalhe--azul { background: var(--azul); }

/* ----------------------------------------------------------- Layout --- */

.envelope {
  width: 100%;
  max-width: var(--largura);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.secao { padding-block: var(--secao); }
.secao--papel  { background: var(--papel-fundo); }
.secao--escura { background: var(--tinta); color: #C4D0DD; }
.secao--escura h2,
.secao--escura h3,
.secao--escura h4 { color: var(--branco); }
.secao--compacta { padding-block: clamp(3rem, 6vw, 4.5rem); }

.cabeca-secao { margin-bottom: clamp(2.25rem, 4vw, 3.25rem); }
.cabeca-secao .prosa { margin-top: 1rem; }

/* Duas colunas: texto + apoio visual */
.duo {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (min-width: 60em) {
  .duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .duo--texto-maior { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}

/* ----------------------------------------------------------- Botões --- */

.botao {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .95rem 1.6rem;
  font-family: var(--fonte);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

.botao--principal { background: var(--amarelo); color: var(--tinta); }
.botao--principal:hover { background: var(--branco); color: var(--tinta); }

.botao--contorno { background: transparent; color: var(--branco); border-color: rgba(255,255,255,.55); }
.botao--contorno:hover { background: var(--branco); color: var(--tinta); border-color: var(--branco); }

.botao--escuro { background: var(--tinta); color: var(--branco); }
.botao--escuro:hover { background: var(--azul); color: var(--branco); }

.botao svg { width: 1.1em; height: 1.1em; fill: currentColor; }

.grupo-botoes { display: flex; flex-wrap: wrap; gap: .85rem; }

/* --------------------------------------------------------- Cabeçalho --- */

.topo {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--branco);
  border-bottom: 1px solid var(--linha);
}

.topo__interno {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.75rem;
}

.topo__logo { margin-right: auto; display: block; line-height: 0; }
.topo__logo img { width: clamp(122px, 17vw, 158px); }

.menu {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.1rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a {
  font-family: var(--fonte-titulo);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--tinta);
  text-decoration: none;
  padding-block: .4rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.menu a:hover { border-bottom-color: var(--amarelo); }
.menu a[aria-current="page"] { border-bottom-color: var(--azul); }

.topo__acao { display: none; }
@media (min-width: 68em) { .topo__acao { display: inline-flex; } }

/* Botão hambúrguer */
.hamburguer {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 9px;
  background: none;
  border: 0;
  cursor: pointer;
}
.hamburguer span {
  display: block;
  height: 2px;
  background: var(--tinta);
  transition: transform .22s ease, opacity .18s ease;
}
.hamburguer[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburguer[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburguer[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 56em) { .hamburguer { display: none; } }
@media (max-width: 55.99em) {
  .menu {
    display: none;
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem var(--gutter) 1.5rem;
    background: var(--branco);
    border-bottom: 1px solid var(--linha);
    box-shadow: 0 18px 30px -22px rgba(22,40,60,.5);
  }
  .menu[data-aberto="true"] { display: flex; }
  .menu a {
    display: block;              /* para o separador ocupar a linha inteira */
    padding-block: .95rem;
    border-bottom: 1px solid var(--linha);
    font-size: 1.1rem;
  }
  .menu li:last-child a { border-bottom: 0; }
  .menu a:hover, .menu a[aria-current="page"] { border-bottom-color: var(--amarelo); }
}

/* ------------------------------------------------------------- Hero --- */

.hero {
  position: relative;
  background: var(--tinta);
  color: var(--branco);
  overflow: hidden;
  isolation: isolate;
}

.hero__foto {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 28% center;
  opacity: .38;
  z-index: -2;
}

.hero::after { /* entalhe da marca, em escala arquitetônica */
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: clamp(90px, 13vw, 190px);
  aspect-ratio: 1;
  background: var(--amarelo);
  clip-path: polygon(0 0, 0 100%, 100% 100%);
  z-index: -1;
}

/* O bloco de texto vive dentro do .envelope, então herda a margem do container
   e fica alinhado ao logotipo do cabeçalho — não centralizado. */
.hero__interno { padding-block: clamp(5rem, 15vw, 10.5rem); }
.hero__texto { max-width: 46rem; }

.hero h1 { color: var(--branco); margin-bottom: .5em; }

.hero__linha {
  font-size: clamp(1.08rem, 2.1vw, 1.32rem);
  line-height: 1.55;
  color: #D7E1EC;
  max-width: 40rem;
  margin-bottom: 2.4rem;
}

/* Hero interno das páginas secundárias */
.capa {
  background: var(--tinta);
  color: var(--branco);
  position: relative;
  overflow: hidden;
}
.capa__interno { padding-block: clamp(3.5rem, 8vw, 6rem); }
.capa h1 { color: var(--branco); font-size: clamp(2.1rem, 5vw, 3.4rem); margin-bottom: .35em; }
.capa p { color: #C6D3E0; max-width: 55ch; margin: 0; font-size: 1.1rem; }
.capa::after {
  content: '';
  position: absolute;
  right: 0; top: 0;
  width: clamp(70px, 9vw, 130px);
  aspect-ratio: 1;
  background: var(--amarelo);
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

/* -------------------------------------------------- Trilha de migalhas --- */

.migalhas { font-size: .9rem; margin-bottom: 1.2rem; color: #9FB2C6; }
.migalhas a { color: #C6D3E0; text-decoration: none; }
.migalhas a:hover { color: var(--amarelo); }
.migalhas span { padding-inline: .45rem; }

/* --------------------------------------------------------- Serviços --- */

.servicos { display: grid; gap: 1px; background: var(--linha); border-block: 1px solid var(--linha); }

.servico {
  background: var(--branco);
}
.servico > summary {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.6rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--fonte-titulo);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  font-weight: 700;
  color: var(--tinta);
}
.servico > summary::-webkit-details-marker { display: none; }
.servico > summary:hover { color: var(--azul); }

/* Os ícones da Merca são line-art navy+amarelo sobre fundo transparente:
   ficam ilegíveis em cima de um tile escuro, então vão direto no fundo claro. */
.servico__icone {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
}
.servico__icone img { width: 52px; height: 52px; object-fit: contain; }

.servico__mais {
  margin-left: auto;
  flex: none;
  width: 26px;
  height: 26px;
  position: relative;
}
.servico__mais::before,
.servico__mais::after {
  content: '';
  position: absolute;
  inset: 50% 0 auto 0;
  height: 2px;
  background: var(--azul);
  transition: transform .22s ease;
}
.servico__mais::after { transform: rotate(90deg); }
.servico[open] .servico__mais::after { transform: rotate(0deg); }

.servico__lista {
  margin: 0 0 1.9rem;
  padding: 0 0 0 calc(52px + 1.1rem);
  list-style: none;
  display: grid;
  gap: .55rem;
  max-width: 60rem;
}
.servico__lista li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--corpo);
}
.servico__lista li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .62em;
  width: 9px;
  height: 9px;
  background: var(--amarelo);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.servico__nota {
  margin: 0 0 1.9rem;
  padding-left: calc(52px + 1.1rem);
  max-width: 60ch;
}

/* Resumo dos serviços na home */
.resumo-servicos {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.resumo-servico { display: flex; gap: 1rem; align-items: flex-start; }
.resumo-servico__icone {
  flex: none;
  width: 50px; height: 50px;
}
.resumo-servico__icone img { width: 50px; height: 50px; object-fit: contain; }
.resumo-servico h3 { margin: .15rem 0 .3rem; font-size: 1.08rem; }
.resumo-servico p { font-size: .96rem; margin: 0; }

/* --------------------------------------------------- Quem atendemos --- */

.segmentos {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
}

.segmento__figura {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--azul);
  margin-bottom: 1.15rem;
  overflow: hidden;
}
.segmento__figura img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  opacity: .45;
}
.segmento__figura .ic {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 62px; height: 62px;
}
.segmento__figura .ic svg,
.segmento__figura .ic img { width: 100%; height: 100%; filter: none; opacity: 1; }
.segmento h3 { margin-bottom: .45rem; }
.segmento p { font-size: .99rem; margin: 0; }

/* Faixa compacta de segmentos (home).
   Flex em vez de grid: com 9 itens um grid deixaria células vazias visíveis. */
.faixa-segmentos { display: flex; flex-wrap: wrap; gap: .75rem; }
.faixa-segmento {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, .22);
  text-decoration: none;
  color: #D2DDE9;
  font-family: var(--fonte-titulo);
  font-size: 1rem;
  font-weight: 600;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.faixa-segmento img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.faixa-segmento:hover { background: var(--azul); border-color: var(--azul); color: var(--branco); }

/* ------------------------------------------------------ Depoimentos --- */

.depoimentos {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.depoimento { display: flex; flex-direction: column; }
.depoimento blockquote {
  margin: 0 0 1.5rem;
  font-family: var(--fonte-titulo);
  font-size: clamp(1.08rem, 1.8vw, 1.22rem);
  font-weight: 500;
  line-height: 1.42;
  color: var(--tinta);
}
.depoimento__titulo { color: var(--azul); display: block; margin-bottom: .55rem; font-weight: 700; }
.depoimento figcaption {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-top: auto;
  padding-top: 1.2rem;
  border-top: 1px solid var(--linha);
}
.depoimento img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
/* Quando o cliente se identifica pela marca e não por um retrato, o logotipo
   inteiro precisa caber no círculo. */
.depoimento img.marca-cliente { object-fit: contain; background: var(--branco); border: 1px solid var(--linha); }
.depoimento cite { font-style: normal; font-weight: 600; color: var(--tinta); display: block; line-height: 1.3; }
.depoimento small { color: var(--corpo); font-size: .9rem; }

/* --------------------------------------------------------- Clientes --- */

.clientes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: center;
}
.clientes img {
  width: 100%;
  max-height: 62px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .62;
}

/* ------------------------------------------ Identidade / Missão etc. --- */

.identidade {
  display: grid;
  gap: clamp(2rem, 4vw, 3.25rem);
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.pilar__icone {
  width: 56px; height: 56px;
  object-fit: contain;
  margin-bottom: 1.1rem;
}
.pilar h3 { margin-bottom: .5rem; }
.pilar p { font-size: .99rem; margin: 0; }

/* ---------------------------------------------------------- Galeria --- */

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: .75rem;
}
.galeria img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* ------------------------------------------------------------- CTA --- */

.chamada-consultoria {
  background: var(--azul);
  color: var(--branco);
}
.chamada-consultoria .envelope {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(2.75rem, 6vw, 4.25rem);
}
.chamada-consultoria__texto { flex: 1 1 26rem; }
.chamada-consultoria h2 { color: var(--branco); margin-bottom: .35em; }
.chamada-consultoria p { color: #DCE6F1; margin: 0; max-width: 46ch; }

/* --------------------------------------------------------- Contato --- */

.contatos {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.75rem);
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}
.contato h3 { margin-bottom: .3rem; font-size: 1.05rem; }
.contato__horario { display: block; font-size: .88rem; color: var(--azul-medio); margin-bottom: .5rem; }
.contato__valor {
  font-family: var(--fonte-titulo);
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--tinta);
  text-decoration: none;
  display: block;
  width: fit-content;
}
/* Quando o bloco tem mais de um número, eles empilham com respiro entre si. */
.contato__valor + .contato__valor { margin-top: .45rem; }
.contato__valor:hover { color: var(--azul); }
.secao--escura .contato__valor { color: var(--branco); }
.secao--escura .contato__valor:hover { color: var(--amarelo); }
.secao--escura .contato__horario { color: #8FA6BD; }

.mapa {
  border: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  filter: grayscale(.35);
}

/* ------------------------------------------------------------ Redes --- */

/* `.rodape ul` é mais específico que `.redes`, então a lista de redes precisa
   ser requalificada aqui — senão os ícones empilham em coluna no rodapé. */
.redes,
.rodape .redes { display: flex; flex-wrap: wrap; gap: .75rem; list-style: none; margin: 0; padding: 0; }
.redes a,
.rodape .redes a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  color: var(--branco);
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.redes a:hover,
.rodape .redes a:hover { background: var(--amarelo); border-color: var(--amarelo); color: var(--tinta); }
.redes svg { width: 19px; height: 19px; fill: currentColor; }

/* ---------------------------------------------------------- Rodapé --- */

.rodape { background: var(--tinta); color: #A9BCCF; font-size: .96rem; }
.rodape__grade {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  padding-block: clamp(3rem, 6vw, 4.5rem);
}
.rodape h4 {
  font-family: var(--fonte-titulo);
  color: var(--branco);
  font-size: .95rem;
  letter-spacing: .04em;
  margin-bottom: 1rem;
}
.rodape ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.rodape a { color: #A9BCCF; text-decoration: none; }
.rodape a:hover { color: var(--amarelo); }
.rodape__logo { width: 150px; margin-bottom: 1.25rem; }
/* Razões sociais + CNPJ das empresas do grupo: ajuda buscadores e plataformas
   (Facebook/Meta, Google) a confirmar a titularidade do domínio. */
.rodape__empresas {
  border-top: 1px solid rgba(255,255,255,.13);
  padding-block: 1.5rem;
}
.rodape__empresas h4 { margin-bottom: .85rem; }
.rodape__empresas ul {
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: .85rem 2rem;
}
.rodape__empresas li { display: grid; gap: .2rem; }
.rodape__razao { color: var(--branco); font-size: .84rem; letter-spacing: .02em; }
.rodape__cnpj { font-size: .85rem; color: #8399AF; }

.rodape__base {
  border-top: 1px solid rgba(255,255,255,.13);
  padding-block: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
  font-size: .88rem;
  color: #8399AF;
}

/* --------------------------------------------- WhatsApp flutuante --- */

.zap {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 70;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, .45);
  transition: transform .18s ease, background-color .18s ease;
}
.zap:hover { background: #1FB855; color: #fff; transform: translateY(-2px); }
.zap svg { width: 30px; height: 30px; fill: currentColor; }

/* ------------------------------------------------- Utilidades / A11y --- */

.pula-para-conteudo {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--amarelo);
  color: var(--tinta);
  padding: .85rem 1.35rem;
  font-weight: 600;
  z-index: 100;
}
.pula-para-conteudo:focus { left: 0; }

.so-leitor-tela {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .topo, .zap, .chamada-consultoria, .hero__foto { display: none !important; }
  body { color: #000; }
}
