/* ============================================================
   ABREU E PEREIRA, LDA.
   Folha de estilos — campos de cor, sem serifa

   Conceito
   --------
   A página não é um documento que se lê a scroll: é uma entrada.
   Três painéis a ecrã inteiro, um por frente de trabalho, que se
   abrem ao passar o rato. O resto da página é escuro, e só a
   secção de contactos é clara — o momento de luz fica para o fim.

   Cor por frente:
     Transporte    → preto
     Recrutamento  → laranja queimado
     Restauração   → vermelho

   Sobre fundo escuro, a cor cheia da frente não serve para
   pormenores finos (o preto desaparece). Cada frente tem por isso
   um par: --X para os campos de cor, --X-luz para traços e números.

   Índice
   ------
   01. Fichas e medidas
   02. Base
   03. Barra superior
   04. Marca
   05. Entrada — três painéis
   06. A casa
   07. Fichas das áreas
   08. Contactos (bloco claro)
   09. Rodapé
   10. Entrada em cena
   11. Responsivo
   12. Movimento reduzido e impressão
   ============================================================ */


/* ===== 01. FICHAS E MEDIDAS ============================== */

:root {
  /* Escuro dominante */
  --breu:    #0f1113;
  --breu-2:  #16191c;
  --breu-3:  #1e2226;

  /* Claro (secção "A casa" e contactos) */
  --osso:    #ece7dd;
  --osso-2:  #ded7c9;
  --osso-rot: #6d6a63;   /* rótulos sobre o claro     */
  --osso-txt: #4f4c47;   /* texto corrido sobre claro */

  /* Texto */
  --claro:   #f2efe9;
  --meio:    #8d9298;
  --escuro:  #14161a;

  /* Frentes — campo de cor */
  --t: #0b0c0e;   /* transporte   — preto            */
  --r: #a8431f;   /* recrutamento — laranja queimado */
  --f: #8f1420;   /* restauração  — vermelho         */

  /* Frentes — versão legível sobre o escuro */
  --t-luz: #9aa3ac;
  --r-luz: #e07a3c;
  --f-luz: #e0505c;

  /* Laranja do logótipo — acento transversal */
  --marca: #ff7a18;

  /* Tipo */
  --tipo: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Medidas */
  --barra-h: 4.5rem;
  --pe-h:    3.25rem;
  --marge:   clamp(1.25rem, 5vw, 4.5rem);

  --mov: cubic-bezier(0.16, 1, 0.3, 1);
}


/* ===== 02. BASE ========================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--barra-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-top: var(--barra-h);
  background: var(--breu);
  color: var(--claro);
  font-family: var(--tipo);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* Os estilos de autor ganham sempre ao `display:none` que o browser dá
   ao atributo [hidden]. Sem esta linha, o texto de reserva da marca
   ficava ao lado do logótipo depois da troca. */
[hidden] { display: none !important; }

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.025em; line-height: 1.05; }
p { margin: 0; }
address { font-style: normal; }

::selection { background: var(--marca); color: var(--escuro); }

:focus-visible {
  outline: 2px solid var(--claro);
  outline-offset: 2px;
}

.atalho {
  position: absolute; top: -200px; left: 1rem; z-index: 300;
  background: var(--claro); color: var(--escuro);
  padding: 0.7rem 1.1rem; font-size: 0.85rem; font-weight: 600;
}
.atalho:focus { top: calc(var(--barra-h) + 0.5rem); }

/* Rótulo pequeno em maiúsculas — usado em vários sítios */
.rotulo,
.linha-rot,
.ficha-lista dt,
.obra {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}


/* ===== 03. BARRA SUPERIOR ================================ */

.barra {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  height: var(--barra-h);
  background: var(--breu);
  border-bottom: 1px solid var(--breu-3);
}

.barra-in {
  height: 100%;
  padding-inline: var(--marge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.barra-dir {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.obra {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--meio);
  white-space: nowrap;
}
.obra-luz {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--marca);
  animation: bater 2.6s var(--mov) infinite;
}
@keyframes bater {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

.barra-mail {
  font-size: 0.88rem;
  color: var(--claro);
  padding-bottom: 2px;
  border-bottom: 1px solid #3a4046;
  transition: border-color 0.3s var(--mov);
}
.barra-mail:hover { border-color: var(--claro); }


/* ===== 04. MARCA ========================================= */
/*
   Dois estados:
   (a) sem ficheiro  → mostra-se .marca-txt (sigla + nome)
   (b) com ficheiro  → o script revela .marca-img e esconde o texto
   A troca é automática. Ver images/LEIA-ME.md
*/

/* Encolhe antes de empurrar a barra: em ecrãs estreitos é preferível
   um logótipo mais pequeno do que o selo "Em construção" cortado. */
.marca { display: inline-flex; align-items: center; flex: 0 1 auto; min-width: 0; }

/* O logótipo é um bloco largo (símbolo + nome). A altura manda; a
   largura máxima evita que empurre a barra em ecrãs estreitos. */
.marca-img {
  height: 2.8rem;
  width: auto;
  max-width: min(100%, 15rem);
  object-fit: contain;
  object-position: left center;
}

.marca-txt {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.mt-sigla {
  display: grid;
  place-items: center;
  width: 2.1rem; height: 2.1rem;
  flex: none;
  background: var(--claro);
  color: var(--escuro);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mt-nome {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}


/* ===== 05. ENTRADA — TRÊS PAINÉIS ======================== */

.entrada {
  display: flex;
  flex-wrap: wrap;
  background: var(--breu);
}

.frente {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: calc(100svh - var(--barra-h) - var(--pe-h));
  min-height: 26rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: var(--claro);
  border-right: 1px solid rgba(0, 0, 0, 0.28);
  transition: flex-grow 0.75s var(--mov), background-color 0.5s var(--mov);
}
.frente:last-of-type { border-right: 0; }

.frente[data-f="t"] { background: var(--t); }
.frente[data-f="r"] { background: var(--r); }
.frente[data-f="f"] { background: var(--f); }

/* O painel preto não se separa dos vizinhos por uma linha preta:
   a divisória passa a ser um fio claro, do lado dele. */
.frente[data-f="t"] { border-right-color: rgba(255, 255, 255, 0.09); }

/* Textura discreta, para os campos de cor não ficarem chapados */
.frente::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(80% 55% at 50% 0%, rgba(255, 255, 255, 0.14), transparent 70%),
    radial-gradient(70% 50% at 50% 100%, rgba(0, 0, 0, 0.3), transparent 70%);
  pointer-events: none;
}

/* No preto, a mesma textura seria um borrão cinzento: rebaixa-se a
   luz de cima e aprofunda-se a sombra de baixo. */
.frente[data-f="t"]::before {
  background:
    radial-gradient(80% 55% at 50% 0%, rgba(255, 255, 255, 0.07), transparent 70%),
    radial-gradient(70% 50% at 50% 100%, rgba(0, 0, 0, 0.5), transparent 70%);
}

.f-num {
  position: relative;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  opacity: 0.62;
}

.f-corpo {
  position: relative;
  display: block;
}

.f-nome {
  display: block;
  font-size: clamp(1.55rem, 2.6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.f-desc,
.f-ir {
  display: block;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--mov), transform 0.5s var(--mov);
}

.f-desc {
  margin-top: 1.1rem;
  max-width: 34ch;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.82);
}

.f-ir {
  margin-top: 1.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.f-ir .seta {
  display: inline-block;
  margin-left: 0.35rem;
  transition: transform 0.35s var(--mov);
}

/* Painel aberto — por rato, teclado ou toque */
.frente:hover,
.frente:focus-visible,
.frente.aberta {
  flex-grow: 2.4;
}
.frente:hover .f-desc,
.frente:focus-visible .f-desc,
.frente.aberta .f-desc,
.frente:hover .f-ir,
.frente:focus-visible .f-ir,
.frente.aberta .f-ir {
  opacity: 1;
  transform: none;
  transition-delay: 0.12s;
}
.frente:hover .f-ir .seta { transform: translateX(5px); }

.entrada-pe {
  flex: 0 0 100%;
  height: var(--pe-h);
  padding-inline: var(--marge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--breu-3);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--meio);
  white-space: nowrap;
  overflow: hidden;
}


/* ===== 06. A CASA ======================================== */

/* Bloco claro. A mudança de fundo já separa das fichas escuras que
   se seguem — não leva risco em baixo. */
.casa {
  background: var(--osso);
  color: var(--escuro);
  padding: clamp(4.5rem, 11vw, 9rem) var(--marge);
}
.casa .rotulo    { color: var(--osso-rot); }
.casa .texto-corr { color: var(--osso-txt); }

.col-dupla {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  max-width: 78rem;
}

.rotulo {
  color: var(--meio);
  padding-top: 0.6rem;
}

.col-texto { max-width: 44rem; }

.titulao {
  font-size: clamp(1.9rem, 4.4vw, 3.4rem);
  margin-bottom: 2rem;
}

.texto-grande {
  font-size: clamp(1.08rem, 1.7vw, 1.32rem);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.texto-corr {
  color: var(--meio);
  margin-bottom: 1.1rem;
  max-width: 62ch;
}
.texto-corr:last-child { margin-bottom: 0; }


/* ===== 07. FICHAS DAS ÁREAS ============================== */

.ficha {
  padding: clamp(3rem, 7vw, 5.5rem) var(--marge);
  border-bottom: 1px solid var(--breu-3);
  background: var(--breu);
  transition: background-color 0.5s var(--mov);
}
.ficha:hover { background: var(--breu-2); }

.ficha[data-f="t"] { --cor: var(--t-luz); }
.ficha[data-f="r"] { --cor: var(--r-luz); }
.ficha[data-f="f"] { --cor: var(--f-luz); }

.ficha-in {
  max-width: 78rem;
  border-left: 3px solid var(--cor);
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
}

.ficha-topo {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.ficha-n {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--cor);
  flex: none;
}

.ficha-nome {
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
}

.ficha-grelha {
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.ficha-texto {
  color: var(--meio);
  max-width: 62ch;
  font-size: 1.02rem;
}

.ficha-lista { margin: 0; }
.ficha-lista > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.7rem;
  border-bottom: 1px solid var(--breu-3);
}
.ficha-lista > div:first-child { border-top: 1px solid var(--breu-3); }
.ficha-lista dt { color: var(--meio); flex: none; }
.ficha-lista dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: right;
}


/* ===== 08. CONTACTOS (bloco claro) ======================= */

.contacto {
  background: var(--osso);
  color: var(--escuro);
  padding: clamp(4rem, 10vw, 8rem) var(--marge);
}

.contacto-in {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  max-width: 78rem;
  align-items: start;
}

.contacto-tit {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.06;
}
.sublinha {
  box-shadow: inset 0 -0.14em 0 var(--marca);
}

.contacto-lista {
  border-top: 1px solid var(--osso-2);
}

.linha {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--osso-2);
  transition: padding-left 0.4s var(--mov);
}
a.linha:hover { padding-left: 0.7rem; }

.linha-rot { color: var(--osso-rot); }

.linha-val {
  font-size: clamp(1.02rem, 1.8vw, 1.25rem);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.linha-ac {
  font-size: 1.1rem;
  transition: transform 0.35s var(--mov);
}
a.linha:hover .linha-ac { transform: translateX(5px); }

.linha-off { color: var(--osso-rot); }
.linha-off .linha-val { font-weight: 500; }
.linha-nota {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}


/* ===== 09. RODAPÉ ======================================== */

.rodape {
  background: var(--breu);
  padding: clamp(2.5rem, 6vw, 4rem) var(--marge) 2rem;
}

.rodape-in {
  max-width: 78rem;
  margin-inline: auto;
  display: grid;
  gap: 2.25rem;
  justify-items: center;
  text-align: center;
}

.marca-pe .mt-sigla { background: var(--claro); color: var(--escuro); }
.marca-pe .marca-img {
  height: 3.2rem;
  max-width: min(100%, 19rem);
  object-position: center;
}

.rodape-fim {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.75rem 2.25rem;
  font-size: 0.82rem;
  color: var(--meio);
}
/* Telefone ainda por confirmar — fica esbatido, sem link */
.rodape-tel { opacity: 0.65; }

.rodape-topo { transition: color 0.25s var(--mov); }
.rodape-topo:hover { color: var(--claro); }


/* ===== 10. ENTRADA EM CENA =============================== */

/* Os painéis sobem à chegada, um a seguir ao outro */
.frente {
  animation: subir 0.9s var(--mov) both;
}
.frente:nth-of-type(1) { animation-delay: 0.05s; }
.frente:nth-of-type(2) { animation-delay: 0.14s; }
.frente:nth-of-type(3) { animation-delay: 0.23s; }

@keyframes subir {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}

/* Secções que aparecem ao entrar no ecrã.
   A classe .anim é posta pelo próprio script — sem JavaScript nada
   fica escondido, o conteúdo é servido visível. */
.anim {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s var(--mov), transform 0.8s var(--mov);
}
.anim.vis {
  opacity: 1;
  transform: none;
}


/* ===== 11. RESPONSIVO ==================================== */

@media (max-width: 1080px) {
  .col-dupla { grid-template-columns: 1fr; }
  .rotulo { padding-top: 0; }
  .ficha-grelha { grid-template-columns: 1fr; }
  .ficha-lista { max-width: 26rem; }
  .contacto-in { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  /* Os painéis passam a bandas empilhadas, sempre abertas */
  .frente {
    flex: 1 1 100%;
    height: auto;
    min-height: 0;
    padding-block: clamp(1.75rem, 6vw, 2.5rem);
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.28);
  }
  .frente[data-f="t"] { border-bottom-color: rgba(255, 255, 255, 0.09); }
  .frente:last-of-type { border-bottom: 0; }
  .f-num { margin-bottom: 1.25rem; }
  .f-desc, .f-ir { opacity: 1; transform: none; }
  .f-desc { font-size: 0.92rem; }

  .entrada-pe { height: auto; padding-block: 1rem; font-size: 0.66rem; }
  .pe-meio { display: none; }

  .linha { grid-template-columns: 5.5rem 1fr auto; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .barra-mail { display: none; }
  .mt-nome { font-size: 0.82rem; }
  .marca-img { height: 1.7rem; }
  .marca-pe .marca-img { height: 2.6rem; }
  .obra { font-size: 0.6rem; letter-spacing: 0.12em; }
  .barra-in { gap: 0.9rem; }
  .linha { grid-template-columns: 1fr auto; }
  .linha-rot { grid-column: 1 / -1; margin-bottom: 0.15rem; }
}


/* ===== 12. MOVIMENTO REDUZIDO E IMPRESSÃO ================ */

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

  .frente { animation: none; }
  .f-desc, .f-ir { opacity: 1; transform: none; }
  .anim { opacity: 1; transform: none; }
}

@media print {
  body { background: #fff; color: #000; padding-top: 0; }
  .barra, .entrada-pe, .rodape-topo { display: none; }
  .frente { height: auto; min-height: 0; color: #000; background: #fff !important; }
  .frente::before { display: none; }
  .f-desc, .f-ir { opacity: 1; transform: none; }
  .anim { opacity: 1 !important; transform: none !important; }
  .ficha, .casa { background: #fff; color: #000; }
  .contacto { background: #fff; }
  .texto-corr, .ficha-texto, .rotulo { color: #333; }
}
