/*
 * styles.css
 *
 * Este arquivo contém os estilos do site da campanha “Unir para Transformar”.
 * Foi criado com foco em responsividade e acessibilidade, utilizando
 * variáveis CSS para facilitar a manutenção das cores e espaçamentos.
 */

/* Variáveis de cores e tipografia */
:root {
  --primary-color: #073763; /* Azul escuro institucional */
  --secondary-color: #e3242b; /* Vermelho vibrante inspirado na identidade visual */
  --neutral-dark: #333333;
  --neutral-light: #f3f4f6;
  --white: #ffffff;
  --font-family: 'Poppins', sans-serif;
  --max-content-width: 1200px;
}

/* Reset básico e tipografia global */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--neutral-dark);
  background-color: var(--white);
  line-height: 1.6;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Acesso rápido para leitores de tela */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--secondary-color);
  color: var(--white);
  padding: 0.75rem 1rem;
  z-index: 1000;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* Container padrão para centralizar conteúdo */
.container {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Navegação */
.site-header {
  background-color: var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  /*
   * Barra de navegação fixa no topo. Retornamos o comportamento sticky
   * conforme solicitado pelo usuário para que o cabeçalho flutue
   * sobre o conteúdo quando a página é rolada.
   */
  position: sticky;
  top: 0;
  z-index: 999;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

.brand-title {
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--primary-color);
}

/* Menu de navegação */
.nav-menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-menu li a {
  color: var(--neutral-dark);
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-menu li a:hover,
.nav-menu li a.active {
  color: var(--secondary-color);
}

/* Botão de menu mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--neutral-dark);
  position: relative;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

/* Quando menu está aberto, transforma hambúrguer em X */
.nav-toggle.open .hamburger {
  transform: rotate(45deg);
}
.nav-toggle.open .hamburger::before {
  top: 0;
  transform: rotate(90deg);
}
.nav-toggle.open .hamburger::after {
  opacity: 0;
}

/* Hero section */
.hero {
  position: relative;
  height: 70vh;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero.small-hero {
  height: 50vh;
  min-height: 280px;
}

.hero-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.hero-overlay {
  text-align: center;
  color: var(--white);
  padding: 2rem;
  background: rgba(7, 55, 99, 0.6);
  border-radius: 8px;
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

/* Botões */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  text-align: center;
  transition: background-color 0.3s ease;
}

.primary-btn {
  background-color: var(--secondary-color);
  color: var(--white);
}
/* Ajustes de hover: como funções como darken() não são suportadas em CSS puro,
   escolhemos manualmente cores ligeiramente mais escuras para o efeito hover. */
.primary-btn:hover {
  background-color: #c41c23;
}

.secondary-btn {
  background-color: var(--primary-color);
  color: var(--white);
}
.secondary-btn:hover {
  background-color: #052a4f;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.light-bg {
  background-color: var(--neutral-light);
}

.section h2 {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  color: var(--primary-color);
  text-align: center;
}

/* About */
.about p {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

/* Axes grid */
.axes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.axis-card {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.axis-card .icon-wrapper {
  font-size: 2.5rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.axis-card h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.axis-card p {
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  color: var(--neutral-dark);
}

.card-link {
  margin-top: auto;
  color: var(--secondary-color);
  font-weight: 600;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

/* Candidate summary grid */
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.candidate-card {
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.candidate-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.candidate-card h3 {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.candidate-card .position {
  font-size: 0.9rem;
  color: var(--secondary-color);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.candidate-card .bio {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.social-links a {
  font-size: 1.3rem;
  margin: 0 0.5rem;
  color: var(--primary-color);
  transition: color 0.2s ease;
}

.social-links a:hover {
  color: var(--secondary-color);
}

/* Support / contact forms */
.support-form,
.contact-form-section form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.form-group {
  flex: 1 1 200px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: var(--font-family);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(227, 36, 43, 0.2);
}

.form-success {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--primary-color);
}

.hidden {
  display: none;
}

/* Footer */
.site-footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-column {
  flex: 1 1 200px;
}

.footer-column h4 {
  margin-bottom: 1rem;
  font-weight: 600;
}

.footer-column p,
.footer-column ul {
  font-size: 0.9rem;
  line-height: 1.4;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column ul li {
  margin-bottom: 0.5rem;
}

.footer-column ul li a {
  color: var(--white);
  transition: color 0.2s ease;
}

.footer-column ul li a:hover {
  color: var(--secondary-color);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  padding-top: 1rem;
  font-size: 0.8rem;
}

.social-list {
  list-style: none;
  display: flex;
  gap: 0.75rem;
  padding: 0;
}

.social-list li a {
  color: var(--white);
  font-size: 1.3rem;
}

.social-list li a:hover {
  color: var(--secondary-color);
}

/* Page specific: Plan accordions */
.axis-detail {
  margin-bottom: 1.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: var(--white);
  overflow: hidden;
}

.axis-detail summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background-color: var(--neutral-light);
  font-weight: 600;
}

.axis-detail summary:hover {
  background-color: #e8eaed;
}

.axis-detail[open] summary {
  background-color: var(--neutral-light);
}

.axis-heading {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.icon-indicator {
  font-size: 1rem;
  color: var(--secondary-color);
  margin-left: 0.75rem;
  /* animação para girar o ícone ao abrir o acordeão */
  transition: transform 0.3s ease;
}

/* Quando o acordeão estiver aberto, gira o ícone em 180 graus */
.axis-detail[open] .icon-indicator i {
  transform: rotate(180deg);
}

.axis-detail .axis-content {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid #ddd;
  animation: fadeIn 0.3s ease;
}

.axis-content ul {
  margin-left: 1.25rem;
  list-style: disc;
  margin-top: 0.5rem;
  line-height: 1.5;
  font-size: 0.95rem;
}

.axis-content ul li + li {
  margin-top: 0.5rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Candidate detail pages */
.candidate-section {
  padding: 4rem 0;
}

.candidate-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
}

.candidate-photo-wrapper {
  flex: 1 1 280px;
  text-align: center;
}

.candidate-detail-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
}

.candidate-info {
  flex: 2 1 400px;
}

.candidate-info h2 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.candidate-number {
  color: var(--secondary-color);
  font-weight: 700;
  font-size: 1.4rem;
}

.candidate-info h3 {
  font-size: 1.2rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.candidate-info p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* Contact page */
.contact-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.contact-info,
.contact-map {
  flex: 1 1 300px;
}

.contact-map img {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.map-link {
  position: relative;
  display: inline-block;
}

.map-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: rgba(7, 55, 99, 0.7);
  color: var(--white);
  font-size: 0.85rem;
  text-align: center;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Responsividade */
@media (max-width: 768px) {
  .nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--white);
    flex-direction: column;
    align-items: flex-start;
    width: 250px;
    max-height: 0;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: max-height 0.3s ease;
  }
  .nav-menu.open {
    max-height: 400px;
  }
  .nav-menu li {
    width: 100%;
    padding: 0.75rem 1rem;
  }
  .nav-toggle {
    display: block;
  }
  .footer-content {
    flex-direction: column;
  }
  .candidate-detail {
    flex-direction: column;
  }
  .candidate-photo-wrapper,
  .candidate-info {
    flex: 1 1 100%;
    text-align: center;
  }
  .candidate-info {
    margin-top: 1rem;
  }
  .candidate-info h2,
  .candidate-info h3 {
    text-align: center;
  }
  .contact-container {
    flex-direction: column;
  }
  .contact-info,
  .contact-map {
    flex: 1 1 100%;
  }
}

/* === Correção de responsividade da imagem de banner === */
.hero {
  position: relative;
  height: auto;           /* altura automática conforme a imagem */
  min-height: 0;          /* remove limite mínimo */
  display: block;
  overflow: visible;
  margin: 0;
  padding: 0;
}

.hero.small-hero {
  height: auto;
  min-height: 0;
}

.hero-img {
  position: static;       /* deixa de ser absoluta */
  width: 100%;            /* ocupa 100% da largura do dispositivo */
  height: auto;           /* ajusta automaticamente a altura */
  object-fit: contain;    /* mantém proporção sem cortar */
  display: block;
}

@media (max-width: 768px) {
  .hero-img {
    width: 100vw;
    height: auto;
  }
}
