/* ============================================================
   Associação Machuvane — base.css
   Estilos partilhados por todas as páginas: reset, tokens,
   cabeçalho/navegação responsiva (com menu hambúrguer),
   rodapé, botões e tipografia base.
   Este ficheiro deve ser importado ANTES do CSS específico
   de cada página, para que este último possa sobrepor-se.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Mulish:wght@400;500;600;700;800&display=swap");

:root{
  --verde: #2e7d32;
  --verde-escuro: #1b5e20;
  --castanho: #4e3730;
  --dourado: #f8ba5e;
  --dourado-suave: #fce3b8;
  --texto: #33302c;
  --texto-suave: #6b6259;
  --cinza-claro: #f6f4f0;
  --branco: #ffffff;
  --sombra: 0 6px 20px rgba(46, 34, 20, 0.12);
  --sombra-forte: 0 10px 30px rgba(46, 34, 20, 0.22);
  --raio: 14px;
  --raio-pequeno: 8px;
  --fonte-titulo: "Fraunces", Georgia, "Times New Roman", serif;
  --fonte-corpo: "Mulish", "Segoe UI", Arial, sans-serif;
  --largura-max: 1200px;
}

*, *::before, *::after{
  box-sizing: border-box;
}

html{
  scroll-behavior: smooth;
}

body{
  margin: 0;
  font-family: var(--fonte-corpo);
  color: var(--texto);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  background-color: var(--branco);
}

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

a{
  color: inherit;
}

ul{
  margin: 0;
  padding: 0;
}

a:focus-visible,
button:focus-visible{
  outline: 3px solid var(--verde-escuro);
  outline-offset: 2px;
}

@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;
  }
}

/* ---------- Cabeçalho / Navegação ---------- */

#header{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--dourado);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
}

.cabecalho-wrapper{
  max-width: var(--largura-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  position: relative;
}

.logo-link{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img{
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-texto{
  display: none;
  font-family: var(--fonte-titulo);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--castanho);
  white-space: nowrap;
}

@media (min-width: 600px){
  .logo-texto{ display: inline; }
}

#cabecalho{
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

#cabecalho li{
  margin: 0;
}

.nav-link{
  display: inline-block;
  color: var(--castanho);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--raio-pequeno);
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.nav-link:hover,
.nav-link:focus-visible{
  background-color: var(--verde-escuro);
  color: var(--branco);
}

.nav-link.ativo{
  background-color: var(--castanho);
  color: var(--branco);
}

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-toggle span{
  display: block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background-color: var(--castanho);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

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

@media (max-width: 900px){
  .nav-toggle{ display: flex; }

  #cabecalho{
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background-color: var(--dourado);
    max-height: 0;
    overflow: hidden;
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.10);
    transition: max-height 0.3s ease;
  }

  #cabecalho.aberto{
    max-height: 480px;
  }

  .nav-link{
    display: block;
    padding: 14px 24px;
    border-radius: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }
}

/* ---------- Contentor geral ---------- */

#corpo,
.corpo-secao{
  max-width: var(--largura-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Tipografia ---------- */

h1{
  font-family: var(--fonte-titulo);
  color: var(--branco);
  text-align: center;
  font-size: clamp(2.1rem, 6vw, 4.2rem);
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
  margin: 0;
}

h2{
  font-family: var(--fonte-titulo);
  color: var(--castanho);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0 0 14px;
}

h3{
  font-family: var(--fonte-titulo);
  color: var(--castanho);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 10px;
}

p, li{
  font-family: var(--fonte-corpo);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 15px;
  text-align: left;
  color: var(--texto);
}

hr{
  border: none;
  border-top: 3px solid var(--dourado);
  width: 70px;
  margin: 8px 0 26px;
}

.subtitulo-heroi{
  margin-top: 6px;
  color: var(--dourado);
  font-size: clamp(0.85rem, 2vw, 1.25rem);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* ---------- Botões ---------- */

.botao{
  display: inline-block;
  background-color: var(--verde);
  color: var(--branco) !important;
  padding: 12px 28px;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 700;
  font-family: var(--fonte-corpo);
  box-shadow: var(--sombra);
  transition: background-color 0.25s ease, transform 0.2s ease;
}

.botao:hover,
.botao:focus-visible{
  background-color: var(--verde-escuro);
  transform: translateY(-2px);
}

.botao-container{
  display: flex;
  justify-content: flex-end;
  margin: 24px 0;
}

@media (max-width: 600px){
  .botao-container{
    justify-content: center;
  }
}

/* ---------- Rodapé ---------- */

#fim{
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
  background-color: var(--dourado);
  color: var(--castanho);
  padding: 44px 20px 34px;
}

.fim1{
  width: 280px;
  text-align: center;
}

.fim1 p, .fim1 li{
  text-align: center;
  color: var(--castanho);
}

.fim1 p b{
  font-family: var(--fonte-titulo);
  font-size: 1.1rem;
}

.fim1 ul{
  list-style: none;
}

.fim1 ul li{
  margin-bottom: 6px;
}

.fim1 a{
  text-decoration: none;
  font-weight: 700;
  color: var(--castanho);
  transition: color 0.2s ease;
}

.fim1 a:hover{
  color: var(--verde-escuro);
}

@media (max-width: 768px){
  #fim{
    flex-direction: column;
    align-items: center;
  }

  .fim1{
    width: 100%;
    max-width: 320px;
  }
}

.fim2{
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  justify-content: center;
  padding: 16px 20px;
  background-color: var(--castanho);
  color: var(--dourado-suave);
}

.fim3{
  text-align: center;
}

.fim3 p{
  margin: 4px 0;
  font-size: 0.9rem;
  color: var(--dourado-suave);
  text-align: center;
}

.fim3 a{
  color: #ffd894;
  text-decoration: underline;
}

/* ---------- Componentes partilhados ---------- */

/* Cartões de notícia (usados na página inicial e em Notícias) */
.noticias{
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}

.noticia-link{
  text-decoration: none;
  color: inherit;
  display: block;
}

.noticia{
  width: 340px;
  max-width: 100%;
  border: 1px solid #e6e0d6;
  border-radius: var(--raio);
  overflow: hidden;
  padding: 0 0 16px;
  box-shadow: var(--sombra);
  text-align: center;
  color: var(--texto);
  font-weight: 700;
  background-color: var(--branco);
  transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
}

.noticia img{
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: 14px;
}

.noticia p{
  padding: 0 16px;
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
}

.noticia-link:hover .noticia,
.noticia-link:focus-visible .noticia{
  transform: translateY(-4px);
  box-shadow: var(--sombra-forte);
  color: var(--verde-escuro);
}

/* Lista de áreas com ícone (página inicial) */
.lista-areas{
  list-style: none;
  margin: 0 0 20px;
}

.lista-areas li{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

/* Imagens de destaque responsivas (galerias, retratos) */
.foto-destaque{
  width: 100%;
  max-width: 380px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  margin: 0 auto;
}

/* Ícones pequenos (contactos, listas, botões de secção).
   Necessário porque a regra global "img{height:auto}" acima
   ignora o atributo height="" do HTML — sem isto, qualquer
   ícone aparece no tamanho real do ficheiro (enorme). */
.icone{
  display: inline-block;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}

.icone-20{ height: 20px; }
.icone-25{ height: 25px; }
.icone-30{ height: 30px; }
.icone-35{ height: 35px; }
