/* Sistema visual partilhado com 50hz.aprecisa343.com */
/* Letras alojadas no próprio site (licença SIL OFL 1.1, ver /fontes) */
@font-face { font-family: "Source Serif 4"; src: url("/fontes/source-serif-4-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fontes/source-serif-4-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/fontes/source-sans-3-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/fontes/source-sans-3-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --fundo: #FAF8F3;
  --fundo-cartao: #FFFFFF;
  --fundo-suave: #F1EEE6;
  --texto: #1F2933;
  --texto-2: #52606D;
  --texto-3: #7B8794;
  --linha: #E3DED3;
  --destaque: #B23A2E;

  /* Cores reservadas às fontes de energia (Painel 50 Hz) */
  --solar: #E0A526;
  --eolica: #1F7A7A;
  --hidrica: #2E6FB0;
  --armazenamento: #3B8C4A;
  --gas: #6B7280;
  --nuclear: #6A4C9C;
  --espanha: #E07A5F;

  /* Semáforo */
  --verde: #2F855A;
  --ambar: #D69E2E;
  --vermelho: #C53030;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", Roboto, Arial, sans-serif;
  --largura: 1080px;
  --raio: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--texto); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.salto { position: absolute; left: -9999px; }
.salto:focus { left: 16px; top: 16px; background: var(--texto); color: var(--fundo); padding: 8px 12px; z-index: 10; }

.contentor { max-width: var(--largura); margin: 0 auto; padding: 0 20px; }

/* Cabeçalho e menu */
.topo {
  position: sticky; top: 0; z-index: 5;
  background: var(--fundo);
  border-bottom: 1px solid var(--linha);
}
.topo .contentor { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.marca { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; text-decoration: none; }
.menu-botao {
  background: none; border: 1px solid var(--linha); border-radius: var(--raio);
  font: inherit; font-size: .95rem; padding: 6px 12px; cursor: pointer; color: var(--texto);
}
.menu { display: none; }
.menu.aberto {
  display: flex; flex-direction: column;
  position: absolute; top: 60px; left: 0; right: 0;
  background: var(--fundo); border-bottom: 1px solid var(--linha); padding: 8px 20px 16px;
}
.menu a { text-decoration: none; padding: 10px 0; color: var(--texto-2); }
.menu a:hover, .menu a[aria-current="page"] { color: var(--texto); }
.menu a[aria-current="page"] { font-weight: 600; }

@media (min-width: 760px) {
  .menu-botao { display: none; }
  .menu, .menu.aberto { display: flex; flex-direction: row; gap: 28px; position: static; padding: 0; border: 0; background: none; }
  .menu a { padding: 0; }
}

/* Secções */
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--linha); }
.titulo-seccao { margin-bottom: 28px; }
.titulo-seccao p { color: var(--texto-2); max-width: 60ch; }

.abertura { padding: 64px 0 48px; }
.abertura .lema { font-size: clamp(1.1rem, 2.6vw, 1.35rem); color: var(--texto-2); max-width: 46ch; }

/* Onda de 50 Hz */
.onda { width: 100%; height: 56px; overflow: hidden; margin-bottom: 20px; }
.onda svg { width: 200%; height: 100%; animation: deslizar 8s linear infinite; }
.onda path { fill: none; stroke: var(--texto); stroke-width: 1.5; }
@keyframes deslizar { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .onda svg { animation: none; } html { scroll-behavior: auto; } }

/* Destaque do painel */
.painel {
  background: var(--fundo-cartao);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 28px 24px;
}
.painel .etiqueta { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texto-3); margin-bottom: 8px; }
.painel p { color: var(--texto-2); max-width: 56ch; }

/* Botões */
.botao {
  display: inline-block; text-decoration: none;
  background: var(--texto); color: var(--fundo);
  padding: 11px 20px; border-radius: var(--raio);
  font-weight: 600; font-size: .98rem;
}
.botao:hover { background: #000; }
.botao-2 {
  display: inline-block; text-decoration: none;
  border: 1px solid var(--texto); color: var(--texto);
  padding: 9px 16px; border-radius: var(--raio);
  font-weight: 600; font-size: .92rem;
}
.botao-2:hover { background: var(--fundo-suave); }

/* Grelhas e cartões */
.grelha { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grelha-3 { grid-template-columns: repeat(3, 1fr); } .grelha-2 { grid-template-columns: repeat(2, 1fr); } }
.cartao {
  background: var(--fundo-cartao);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 22px 20px;
  display: flex; flex-direction: column;
}
.cartao p { color: var(--texto-2); flex: 1; }
.cartao .botao-2 { align-self: flex-start; }

/* Capas tipográficas (substituem as imagens até haver capas) */
.capa {
  aspect-ratio: 2 / 3;
  background: var(--texto);
  color: var(--fundo);
  border-radius: 3px;
  padding: 18px 16px;
  display: flex; flex-direction: column; justify-content: space-between;
  margin-bottom: 18px;
  max-width: 200px;
}
.capa .t { font-family: var(--serif); font-size: 1.15rem; line-height: 1.25; }
.capa .a { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.capa.c2 { background: #3E2A28; }
.capa.c3 { background: #1F3A47; }
.meta { font-size: .88rem; color: var(--texto-3); margin-bottom: 10px; }

/* Campos por preencher */
.por-preencher {
  display: inline-block; font-size: .8rem; font-family: var(--sans);
  background: #FFF4D6; color: #7A4F00; border: 1px dashed #D69E2E;
  padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle;
}
.bloco-preencher {
  background: #FFF4D6; color: #7A4F00; border: 1px dashed #D69E2E;
  padding: 12px 14px; border-radius: var(--raio); font-size: .95rem;
}

/* Texto longo */
.texto-longo { max-width: 68ch; }
.texto-longo p { color: var(--texto); }

/* Rodapé */
.rodape { border-top: 1px solid var(--linha); padding: 32px 0 40px; font-size: .9rem; color: var(--texto-2); }
.rodape p { margin: 0 0 .4em; }
.rodape a { color: var(--texto-2); }
.cartao .por-preencher { align-self: flex-start; margin: 8px 0 0; }
.voltar-grupo { background: #7C1821; font-size: .85rem; }
.voltar-grupo a { color: #F6F3E4; text-decoration: none; display: inline-block; padding: 6px 0; }
.voltar-grupo a:hover { text-decoration: underline; }
