/* ============================================================
   JUNTA DE FREGUESIA DA FUSETA — Banner de Consentimento
   Acompanha assets/js/consentimento.js. Carregar em todas as
   páginas públicas (nunca no /admin).
   ============================================================ */

/* Compensação da altura do banner: enquanto está aberto, o fim da página
   desce o suficiente para nada ficar tapado. O valor é medido em JavaScript. */
body { padding-bottom: var(--altura-consentimento, 0px); }

/* --- Barra fixa no fundo ---
   Não é um overlay: não escurece nem bloqueia a página. O cidadão tem de poder
   ler o sítio sem ser obrigado a decidir. */
.consentimento {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  background: var(--white);
  border-top: 3px solid var(--gold);
  box-shadow: 0 -6px 28px rgba(27, 63, 122, .16);
  transform: translateY(100%);
  transition: transform 320ms var(--ease-out);
}
.consentimento.visivel { transform: translateY(0); }

/* O atributo hidden tem de vencer o display do layout interno. */
.consentimento[hidden] { display: none !important; }

.consentimento-caixa {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.35rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.consentimento-caixa:focus { outline: none; }
.consentimento-caixa:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -4px;
}

.consentimento-texto-col { min-width: 0; }

.consentimento-titulo {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--navy);
  margin-bottom: .4rem;
}

.consentimento-texto {
  font-size: .875rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}
.consentimento-texto strong { color: var(--navy-dark); font-weight: 600; }
.consentimento-texto a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.consentimento-texto a:hover { color: var(--navy-dark); }

/* Aviso do recarregamento. Só aparece a quem já aceitou nesta página, que é o
   único caso em que recusar obriga a recarregar — avisar antes do clique evita
   apanhar alguém de surpresa a meio de uma leitura. */
.consentimento-aviso-recarga {
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--navy-dark);
  margin: .5rem 0 0;
}
.consentimento-aviso-recarga[hidden] { display: none; }

/* --- Botões ---
   Aceitar e Recusar são deliberadamente idênticos: mesmo tamanho, mesma cor,
   mesmo peso, mesmo estado de hover. Um "Recusar" apagado ao lado de um
   "Aceitar" destacado seria um padrão escuro e invalidaria o consentimento. */
.consentimento-botoes {
  display: flex;
  gap: .75rem;
  flex-shrink: 0;
}

.consentimento-btn {
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 8px;
  padding: .7rem 1.75rem;
  min-width: 130px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 120ms var(--ease-out);
}
.consentimento-btn:hover {
  background: var(--navy);
  color: var(--white);
}
.consentimento-btn:active { transform: scale(0.97); }

/* --- Botão "Definições de cookies" no rodapé --- */
.consentimento-abrir {
  font-family: inherit;
  font-size: .8rem;
  color: rgba(255, 255, 255, .7);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}
.consentimento-abrir:hover { color: var(--gold); }

/* --- Botão de reabertura dentro do conteúdo das páginas legais --- */
.consentimento-repor {
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 8px;
  padding: .7rem 1.5rem;
  margin: .5rem 0 1rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), transform 120ms var(--ease-out);
}
.consentimento-repor:hover { background: var(--navy); color: var(--white); }
.consentimento-repor:active { transform: scale(0.97); }

/* --- Responsivo --- */
@media (max-width: 860px) {
  .consentimento-caixa {
    flex-direction: column;
    align-items: stretch;
    gap: 1.1rem;
    padding: 1.2rem 1.25rem;
  }
  .consentimento-botoes { width: 100%; }
  .consentimento-btn { flex: 1; min-width: 0; padding: .75rem 1rem; }
}

@media (max-width: 400px) {
  .consentimento-titulo { font-size: 1rem; }
  .consentimento-texto { font-size: .84rem; }
}

@media (prefers-reduced-motion: reduce) {
  .consentimento { transition: none; }
  .consentimento-btn:active,
  .consentimento-repor:active { transform: none; }
}
