/* =================================================================
   FOOTER 100 ANOS do site - todas as paginas (php_100anos/footer.php)
   Independente da pasta 100anos/ (que outra equipa pode substituir):
   classes proprias (.rp-footer*), fontes e imagem em php_100anos/assets/.
   As regras de base vieram do 100anos/css/styles.css (FOOTER) em out/2026;
   daqui em diante o design do footer do site mantem-se aqui.
   ================================================================= */

@font-face {
  font-family: "RP Fragment Sans";
  src: url("assets/fonts/PPFragment-SansLight.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "RP Fragment Sans";
  src: url("assets/fonts/PPFragment-SansRegular.otf") format("opentype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "RP Fragment";
  src: url("assets/fonts/PPFragment-SerifRegular.otf") format("opentype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens e base, so dentro do footer ---------- */
.rp-footer {
  --bg: #faf7f3;
  --ink: #1b1b1b;
  --gray: #444444;
  --gray-soft: #8c8880;
  --line: rgba(27, 27, 27, 0.14);
  --font-serif:
    "RP Fragment", "Hoefler Text", "Big Caslon", Georgia, "Times New Roman",
    serif;
  --font-sans:
    "RP Fragment Sans", "Helvetica Neue", "Inter", Helvetica, Arial, system-ui,
    sans-serif;
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --pad-x: 1.5rem;
  --maxw: 1280px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: normal;
  color: var(--ink);
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
@media (min-width: 1280px) {
  .rp-footer {
    --pad-x: 2.5rem;
  }
}
/* :where() mantem estas bases abaixo das regras .rp-footer__* a seguir;
   anulam a tipografia global do main.css do site (Montserrat, cor, letter-spacing) */
.rp-footer :where(*),
.rp-footer :where(*)::before,
.rp-footer :where(*)::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.rp-footer :where(a, p, h2, label, input, address, span) {
  color: inherit;
  font-family: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-decoration: none;
}
.rp-footer :where(img) {
  display: block;
  max-width: 100%;
  height: auto;
}
.rp-footer :where(button) {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
}
.rp-footer__container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.rp-footer__statement {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}
/* entrada ao aparecer no ecra (footer.php) */
.rp-footer__reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
}
.rp-footer__reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .rp-footer__reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- vindo de 100anos/css/styles.css: FOOTER ---------- */
.rp-footer {
  position: relative;
  background: var(--bg);
  border-top: 1px solid var(--line);
  overflow: hidden; /* clip the bleeding centennial mark */
  padding-block: clamp(3rem, 7vw, 5.5rem) 1.75rem;
}
/* the "100" centennial mark, bleeding off the right edge */
.rp-footer__logo {
  position: absolute;
  top: auto;
  bottom: 1rem;
  right: -54px;
  height: 200px;
  width: auto;
  opacity: 0.12; /* faint watermark on small screens */
  z-index: 0;
  pointer-events: none;
}
.rp-footer__inner {
  position: relative;
  z-index: 1;
}
.rp-footer__statement {
  font-size: clamp(1.9rem, 3.4vw, 3rem); /* ~48px at 1440, as designed */
  text-transform: uppercase;
  margin-bottom: clamp(3rem, 9vw, 6rem);
}

.rp-footer__body {
  display: flex;
  flex-direction: column;
  gap: clamp(2.75rem, 7vw, 4rem);
  margin-bottom: clamp(3rem, 7vw, 5rem);
}
.rp-footer__links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 420px;
}
.rp-footer__col {
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 4vw, 2.5rem);
}
.rp-footer__group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.rp-footer__group a,
.rp-footer__group address {
  font-style: normal;
  font-size: var(--fs-body);
  color: var(--ink);
  width: fit-content;
  transition: color 0.25s var(--ease);
}
.rp-footer__group a:hover {
  color: var(--gray);
}
.rp-footer__label {
  font-size: var(--fs-sm);
  color: var(--gray-soft);
  margin-bottom: 0.35rem;
}
.rp-footer__muted {
  color: var(--gray-soft);
}

/* newsletter: link para a pagina de subscricao (como no footer do site) */
.rp-footer__news-link {
  display: inline-block;
  font-size: clamp(1.3rem, 1.7vw, 1.5rem); /* ~24px, como o titulo da newsletter no design */
  letter-spacing: -0.01em;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.2rem;
  transition:
    color 0.25s var(--ease),
    border-color 0.25s var(--ease);
}
.rp-footer__news-link:hover {
  color: var(--gray);
  border-color: var(--gray);
}
/* Projetos Cofinanciados: por baixo da newsletter, como no footer do site */
.rp-footer__news-more {
  display: block;
  width: fit-content;
  margin-top: 1.5rem;
  font-size: var(--fs-body);
  color: var(--ink);
  transition: color 0.25s var(--ease);
}
.rp-footer__news-more:hover {
  color: var(--gray);
}

.rp-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  /* no hairline in the design; the © column ends with the newsletter block,
     clear of the bleeding centennial mark */
  max-width: 64rem;
  font-size: 0.8125rem;
  color: var(--gray-soft);
}
.rp-footer__bottom a:hover {
  color: var(--ink);
}

/* ---------- vindo de 100anos/css/styles.css: RESPONSIVE ---------- */
@media (min-width: 768px) {
  .rp-footer__body {
    flex-direction: row;
    align-items: flex-start;
    gap: clamp(3rem, 9vw, 9rem);
  }
  .rp-footer__links {
    max-width: none;
    flex: 0 0 auto;
    grid-template-columns: repeat(3, auto); /* 3 colunas: os links do footer do site */
  }
  .rp-footer__col {
    min-width: 150px;
  }
  .rp-footer__logo {
    top: clamp(2rem, 5vw, 4.5rem);
    bottom: auto;
    right: clamp(-90px, -5vw, -50px);
    height: clamp(360px, 42vw, 560px);
    opacity: 1;
  }
}
@media (max-width: 767px) {
  .rp-footer__statement {
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }
  .rp-footer__links {
    grid-template-columns: 1fr;
    max-width: none;
    gap: clamp(1.75rem, 4vw, 2.5rem);
  }
  /* empilhado, a coluna sem titulo segue a de cima sem linha em branco */
  .rp-footer__label--spacer {
    display: none;
  }
}

/* ---------- do site ---------- */
/* footer__bottom: Politica de Privacidade + Canal de denuncias */
.rp-footer__bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}

/* paginas do site (fora da home): o site usa viewport a 0.8 (index.php) e o footer foi
   desenhado para escala 1: em mobile compensa-se para ficar do mesmo tamanho que na home */
@media (max-width: 767px) {
  .rp-footer--site {
    zoom: 1.25;
  }
  /* o tamanho da frase depende da largura (vw), que a escala 0.8 tambem muda: 8vw x 0.8 */
  .rp-footer--site .rp-footer__statement {
    font-size: clamp(1.9rem, 6.4vw, 2.6rem);
  }
}

/* botao "voltar ao topo" do site (#arrowGoUp, fixo a 60px da direita no index.php):
   ficava por cima da marca 100 do footer; passa para a esquerda dela.
   Largura visivel da marca = altura x 293/561 (proporcoes da imagem) + o right (negativo)
   de .rp-footer__logo, menos 8px (o botao entra 8px na marca).
   Em mobile (telefone) fica encostado a direita, mesmo por cima da marca (ai quase transparente) */
@media (min-width: 768px) {
  body #arrowGoUp {
    right: calc(clamp(360px, 42vw, 560px) * 0.5223 + clamp(-90px, -5vw, -50px) - 8px) !important;
  }
}
@media (max-width: 767px) {
  body #arrowGoUp {
    right: 10px !important; /* a caixa tem 50px e o icone 40px: o icone fica a 20px da margem */
  }
}

/* links do footer: linha por baixo no hover, igual a do menu (nav.css .rp-nav__menu a::after).
   O link da newsletter ja tem a sua linha (border-bottom) */
.rp-footer__group a,
.rp-footer__news-more,
.rp-footer__bottom a {
  position: relative;
}
.rp-footer__group a::after,
.rp-footer__news-more::after,
.rp-footer__bottom a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.rp-footer__group a:hover::after,
.rp-footer__news-more:hover::after,
.rp-footer__bottom a:hover::after {
  transform: scaleX(1);
}
