/* ============================================
   ARQUIVO GENEALÓGICO DA FAMÍLIA GONTIJO
   style.css - Arquivo Central de Estilos
   ============================================ */

/* ============================================
   1. VARIÁVEIS E RESET
   ============================================ */

:root {
  /* Cores Principais - Azul Royal */
  --azul-escuro: #1a3a5c;
  --azul-medio: #2a5298;
  --azul-claro: #e8f0fe;
  --azul-gradiente: linear-gradient(135deg, #1a3a5c 0%, #2a5298 100%);
  
  /* Cores Secundárias - Dourado */
  --dourado: #c9a84c;
  --dourado-claro: #e8d5a3;
  --dourado-fundo: #faf3e0;
  
  /* Cores Neutras */
  --branco: #ffffff;
  --bege: #f5f2ed;
  --cinza-claro: #e8e4de;
  --cinza: #7a7a7a;
  --texto: #1a1a1a;
  --texto-claro: #4a4a4a;
  
  /* Cores de Destaque (mantidas) */
  --vermelho-borgonha: #8b1a1a;
  --vermelho-borgonha-hover: #6b1414;
  
  /* Sombras */
  --sombra-leve: 0 2px 8px rgba(26, 58, 92, 0.12);
  --sombra-media: 0 8px 24px rgba(26, 58, 92, 0.18);
  --sombra-forte: 0 14px 34px rgba(26, 58, 92, 0.22);
  
  /* Tipografia */
  --fonte-principal: Georgia, serif;
  --fonte-secundaria: 'Times New Roman', Times, serif;
  
  /* Espaçamentos */
  --espaco-padrao: 20px;
  --espaco-grande: 40px;
  
  /* Altura do header fixo */
  --header-height: 70px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ============================================
   2. ESTILOS BASE
   ============================================ */

body {
  font-family: var(--fonte-principal);
  background: var(--bege);
  color: var(--texto);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.65;
  background-image: 
    radial-gradient(circle at 15% 0%, rgba(201, 168, 76, 0.08), transparent 28rem),
    linear-gradient(180deg, #f0ece4 0%, var(--bege) 42%, #ebe5d6 100%);
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--vermelho-borgonha);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.2s ease;
}

a:hover {
  color: var(--vermelho-borgonha-hover);
}

h1, h2, h3, h4 {
  color: var(--azul-escuro);
  letter-spacing: 0;
}

p {
  color: var(--texto-claro);
  line-height: 1.7;
}

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

/* ============================================
   3. HEADER E MENU - ESTILO "REALEZA"
   ============================================ */

header {
  background: linear-gradient(135deg, #0f1f33 0%, #1a3a5c 50%, #2a5298 100%);
  padding: 12px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  border-bottom: 3px solid #c9a84c;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  height: var(--header-height);
  flex-wrap: nowrap; /* Impede quebra do header */
}

.logo {
  font-size: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0; /* Impede a logo de encolher */
}

.logo::before {
  content: "🏛️ Arquivo Genealógico Gontijo";
  font-size: 1.1rem;
  font-weight: 700;
  color: #f0e6c8;
  text-shadow: 0 2px 12px rgba(201, 168, 76, 0.3);
  letter-spacing: 1px;
}

/* Menu de Navegação */
nav {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: nowrap; /* Impede quebra do menu */
}

nav a {
  font-size: 0.85rem; /* REDUZIDO de 1.05rem para 0.85rem */
  font-weight: 600;
  padding: 8px 12px; /* REDUZIDO */
  color: #e8dcc8;
  text-transform: uppercase;
  letter-spacing: 0.8px; /* REDUZIDO */
  position: relative;
  transition: all 0.3s ease;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap; /* Impede quebra de texto */
}

nav a:hover {
  color: #f5e8c8;
  background: rgba(201, 168, 76, 0.15);
  text-shadow: 0 0 20px rgba(201, 168, 76, 0.3);
  transform: translateY(-2px);
}

/* Linha dourada que aparece por baixo no hover */
nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #c9a84c, #f0d68a, #c9a84c);
  transition: all 0.4s ease;
  transform: translateX(-50%);
  border-radius: 2px;
}

nav a:hover::after {
  width: 60%;
}

/* Link ativo (página atual) */
nav a[aria-current="page"],
nav a.active-link {
  color: #f5e8c8;
  background: rgba(201, 168, 76, 0.12);
  border-bottom: 2px solid #c9a84c;
}

nav a[aria-current="page"]::after,
nav a.active-link::after {
  width: 60%;
}


/* Menu Mobile */
.menu-icon {
  font-size: 1.5em;
  cursor: pointer;
  display: none;
  color: var(--dourado);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: 4px;
  padding: 4px 10px;
}

/* ============================================
   4. FOOTER – estilo premium com toque dourado
   ============================================ */

.footer {
    background: linear-gradient(135deg, #0f1f33 0%, #1a3a5c 60%, #2a5298 100%);
    color: #e8dcc8;
    border-top: 3px solid var(--dourado);
    padding: 30px 40px 18px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    max-width: 1120px;
    margin: 0 auto 16px auto;
    gap: 20px;
}

.footer-brand {
    flex: 1 1 260px;
}

.footer-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f0e6c8;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-shadow: 0 1px 8px rgba(201, 168, 76, 0.2);
}

.footer-copy {
    font-size: 0.9rem;
    color: #c9bda8;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    justify-content: flex-end;
}

.footer-links a {
    color: #e8dcc8;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 4px 0;
    border-bottom: 1px solid transparent;
}

.footer-links a:hover {
    color: var(--dourado);
    border-bottom-color: var(--dourado);
    transform: translateY(-1px);
}

.footer-bottom {
    border-top: 1px solid rgba(201, 168, 76, 0.25);
    padding-top: 14px;
    text-align: center;
    max-width: 1120px;
    margin: 0 auto;
}

.footer-bottom p {
    font-size: 0.8rem;
    color: #a09682;
    margin: 0;
}

/* Responsividade */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    .footer-links {
        justify-content: center;
    }
    .footer {
        padding: 24px 20px 16px;
    }
}

/* ============================================
   5. HERO (Página Inicial)
   ============================================ */

.hero {
  background-image: url('../img/fundo-genealogia-gontijo.png');
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 130px 24px 86px;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(26, 58, 92, 0.78), rgba(26, 58, 92, 0.50) 58%, rgba(26, 58, 92, 0.65));
  z-index: 1;
}

.hero h1,
.hero p,
.hero a {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 4.15rem);
  color: var(--dourado);
  text-shadow: 0 3px 16px rgba(0,0,0,0.8), 0 1px 2px rgba(0,0,0,0.9);
  max-width: 980px;
  line-height: 1.08;
}

.hero p {
  color: var(--dourado-claro);
  margin: 20px 0;
  font-size: 1.2em;
  max-width: 760px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.65);
}

.hero a {
  padding: 14px 32px;
  background: var(--dourado);
  color: var(--azul-escuro);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 6px 16px rgba(201, 168, 76, 0.35);
}

.hero a:hover {
  background: #dbb85a;
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.45);
}

/* ============================================
   6. SEÇÕES DA PÁGINA INICIAL
   ============================================ */

.sobre,
.linhagens,
.inventarios,
.testamentos,
.inquisicao {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 60px 40px;
  text-align: center;
}

.sobre h2,
.linhagens h2,
.inventarios h2,
.testamentos h2,
.inquisicao h2 {
  font-size: 2em;
  margin-bottom: 20px;
  color: var(--azul-escuro);
}

.sobre p,
.linhagens p {
  max-width: 1100px;
  margin: 0 auto 16px auto;
  text-align: left;
  font-size: 1.1em;
  line-height: 1.7;
  color: var(--texto-claro);
}

.linhagens {
  background: rgba(26, 58, 92, 0.04) !important;
  border-top: 2px solid var(--dourado-claro) !important;
  border-bottom: 2px solid var(--dourado-claro) !important;
}

.linhagem-container {
  display: grid;
  gap: 12px;
  max-width: 1080px;
  margin: 35px auto 0 auto;
  text-align: left;
}

.link-linhagem-principal {
  padding: 14px 18px;
  background: var(--branco);
  border: 1px solid var(--cinza-claro);
  border-left: 4px solid var(--azul-medio);
  border-radius: 4px;
  text-decoration: none !important;
  color: var(--azul-escuro);
  font-weight: 600;
  font-size: 1.05em;
  transition: all 0.3s ease;
  box-shadow: var(--sombra-leve);
}

.link-linhagem-principal:hover {
  background: var(--azul-claro);
  transform: translateX(4px);
  border-left-color: var(--dourado);
}

.link-subramo {
  margin-left: 30px !important;
  padding: 12px 16px;
  background: var(--branco);
  border: 1px solid var(--cinza-claro);
  border-left: 4px solid var(--dourado);
  border-radius: 4px;
  text-decoration: none !important;
  color: var(--texto-claro);
  font-weight: 500;
  font-size: 0.98em;
  transition: all 0.3s ease;
  box-shadow: var(--sombra-leve);
}

.link-subramo:hover {
  background: var(--dourado-fundo);
  transform: translateX(4px);
}

/* ============================================
   7. TABELAS
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--branco);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--sombra-leve);
}

th {
  background: var(--azul-gradiente);
  color: var(--dourado-claro);
  padding: 14px 16px;
  font-weight: 600;
  text-align: left;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--cinza-claro);
  vertical-align: middle;
}

tr:nth-child(even) {
  background-color: #faf8f5;
}

tr:hover {
  background-color: var(--azul-claro);
}

/* Estilo específico para a tabela de documentos */
#tabelaDocumentos {
  width: min(1120px, 100%);
  margin: 0 auto;
}

#tabelaDocumentos th,
#tabelaDocumentos td {
  height: 38px !important;
  padding: 6px 8px !important;
  vertical-align: middle !important;
  line-height: 1.2 !important;
  font-family: var(--fonte-principal) !important;
  font-size: 15px !important;
}

/* ============================================
   8. BOTÕES E COMPONENTES
   ============================================ */

.btn-nota,
.btn-close,
.btn-nota-destaque,
button[type="submit"] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px !important;
  border: 0;
  border-radius: 4px !important;
  background: var(--azul-medio) !important;
  color: var(--branco) !important;
  font-family: var(--fonte-principal);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--sombra-leve);
  line-height: 1.15;
  white-space: nowrap;
}

.btn-nota:hover,
.btn-close:hover,
.btn-nota-destaque:hover,
button[type="submit"]:hover {
  background: var(--azul-escuro) !important;
  transform: translateY(-2px);
  box-shadow: var(--sombra-media);
}

.btn-nota-destaque {
  background: var(--dourado) !important;
  color: var(--azul-escuro) !important;
}

.btn-nota-destaque:hover {
  background: #dbb85a !important;
}

/* ============================================
   9. CARDS E CONTAINERS
   ============================================ */

.card-destaque-historico,
.linha-direta,
.secao-historica,
details,
form {
  background: var(--branco) !important;
  border: 1px solid var(--cinza-claro) !important;
  border-radius: 6px !important;
  box-shadow: var(--sombra-leve);
  padding: 24px 28px;
  margin: 20px auto;
}

.card-destaque-historico,
.linha-direta,
.secao-historica {
  border-left: 5px solid var(--dourado) !important;
}

.secao-historica h2,
.card-destaque-historico h3 {
  color: var(--azul-escuro);
  margin-bottom: 16px;
}

/* ============================================
   10. MODAIS
   ============================================ */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.65);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-box {
  background: var(--branco);
  padding: 30px;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  border: 2px solid var(--dourado);
  box-shadow: var(--sombra-forte);
}

.modal-box h3 {
  color: var(--azul-escuro);
  margin-bottom: 15px;
}

.modal-box p {
  margin-bottom: 20px;
  color: var(--texto-claro);
}

/* ============================================
   11. ÁRVORE GENEALÓGICA (Página Especial)
   ============================================ */

.genealogy-tree-page main {
  max-width: none !important;
  width: 100%;
  margin: 0 !important;
  padding: 104px 24px 16px !important;
}

.tree-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
}

.tree-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
}

.tree-intro,
.tree-panel,
.tree-empty,
.generation {
  background: rgba(255,253,248,0.95);
  border: 1px solid var(--cinza-claro);
  border-radius: 6px;
  box-shadow: var(--sombra-leve);
}

.tree-intro {
  padding: 24px 28px;
}

.tree-kicker {
  color: var(--dourado);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.tree-intro h1 {
  color: var(--azul-escuro) !important;
  font-size: clamp(1.65rem, 2.4vw, 2.7rem);
  line-height: 1.08;
  margin: 8px 0 12px;
}

.tree-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.tree-stat {
  border: 1px solid var(--cinza-claro);
  background: var(--dourado-fundo);
  border-radius: 4px;
  padding: 10px 12px;
}

.tree-stat strong {
  display: block;
  color: var(--azul-escuro);
  font-size: 1.35rem;
}

.tree-stat span {
  color: var(--cinza);
  font-size: 0.82rem;
}

.tree-panel {
  padding: 20px 22px;
}

.tree-panel label {
  display: block;
  font-weight: 700;
  color: var(--azul-escuro);
  margin-bottom: 8px;
}

.tree-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

#personSelect {
  width: 100%;
  min-height: 46px;
  border: 2px solid var(--cinza-claro);
  background: var(--branco);
  color: var(--texto);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: var(--fonte-principal);
  transition: border-color 0.3s ease;
}

#personSelect:focus {
  outline: none;
  border-color: var(--dourado);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
}

.tree-action {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 4px;
  background: var(--azul-medio);
  color: var(--branco);
  font-family: var(--fonte-principal);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tree-action:hover {
  background: var(--azul-escuro);
}

.tree-hint {
  margin-top: 10px;
  color: var(--cinza);
  font-size: 0.92rem;
}

.tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--cinza-claro);
  border-radius: 999px;
  background: var(--branco);
  font-size: 0.9rem;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 2px solid var(--dourado);
  background: var(--dourado-fundo);
}

.legend-swatch.judeu {
  border-color: #1e90ff;
  background: #e8f4ff;
}

.legend-swatch.colonial {
  border-color: var(--vermelho-borgonha);
  background: #fceaea;
}

.legend-swatch.royal {
  border-color: #0033a0;
  background: #e6f0ff;
}

.tree-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--cinza);
}

#tree {
  padding: 0 !important;
  display: grid;
  gap: 18px;
}

.generation {
  padding: 16px 18px !important;
  display: block !important;
  margin: 0 !important;
}

.generation::before {
  display: none !important;
}

.generation-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--dourado-claro);
  padding-bottom: 10px;
}

.generation-title {
  color: var(--azul-escuro);
  font-weight: 700;
  font-size: 1.08rem;
}

.generation-meta {
  color: var(--cinza);
  font-size: 0.9rem;
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.person {
  width: auto !important;
  min-height: 188px;
  height: auto !important;
  margin: 0 !important;
  padding: 14px !important;
  display: grid !important;
  gap: 6px;
  border-radius: 6px !important;
  border: 1px solid var(--cinza-claro) !important;
  background: var(--branco) !important;
  box-shadow: var(--sombra-leve) !important;
  font-size: 0.92rem !important;
}

.person strong {
  font-size: 1rem !important;
  color: var(--azul-escuro);
  line-height: 1.25;
}

.person-years {
  color: var(--dourado);
  font-weight: 700;
}

.person-row {
  color: var(--texto-claro);
  font-size: 0.86rem;
}

.person-row span {
  display: block;
  color: var(--cinza);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
}

.person.dourado {
  background: var(--dourado-fundo) !important;
  border-color: var(--dourado) !important;
}

.person.azul_royal {
  background: var(--azul-claro) !important;
  border-color: var(--azul-medio) !important;
}

.person.azul_judeu {
  background: #e8f4ff !important;
  border-color: #1e90ff !important;
}

.person.vermelho_borgonha {
  background: #fceaea !important;
  border-color: var(--vermelho-borgonha) !important;
}

/* ============================================
   12. PÁGINA DE CONTATO
   ============================================ */

body.contato-page main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: calc(var(--header-height) + 20px) auto 0 !important;
  padding: 18px 18px 20px !important;
}

body.contato-page h1 {
  margin-bottom: 18px !important;
  color: var(--azul-escuro);
}

body.contato-page form.contact-form-grid {
  width: min(740px, calc(100% - 32px)) !important;
  display: grid !important;
  grid-template-columns: minmax(220px, 0.85fr) minmax(250px, 1.15fr);
  gap: 18px !important;
  align-items: start;
  padding: 24px 28px !important;
  background: var(--branco) !important;
  border: 1px solid var(--cinza-claro) !important;
  border-radius: 6px !important;
  box-shadow: var(--sombra-leve);
}

body.contato-page label {
  display: block;
  margin: 0 0 7px !important;
  font-weight: 600;
  color: var(--azul-escuro);
  line-height: 1.2;
}

body.contato-page input,
body.contato-page textarea {
  width: 100%;
  padding: 10px 12px !important;
  margin: 0 0 14px !important;
  border: 2px solid var(--cinza-claro);
  border-radius: 4px;
  font-family: var(--fonte-principal);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

body.contato-page input:focus,
body.contato-page textarea:focus {
  outline: none;
  border-color: var(--dourado);
}

body.contato-page input {
  min-height: 40px;
}

body.contato-page textarea {
  min-height: 150px;
  resize: vertical;
  margin-bottom: 0 !important;
}

body.contato-page button[type="submit"] {
  min-height: 42px;
  padding: 9px 24px !important;
  margin-top: 3px !important;
}

body.contato-page .footer {
  padding: 16px 40px !important;
}

/* ============================================
   13. PÁGINAS DE RAMOS E TRONCOS
   ============================================ */

/* Container para páginas de ramos e troncos - igual ao politicadeprivacidade */
body.ramo-page main,
body.tronco-page main,
body[class*="ramo_"] main,
body[class*="tronco_"] main {
  width: min(1120px, calc(100% - 56px)) !important;
  max-width: 1120px !important;
  margin: calc(var(--header-height) + 40px) auto 58px !important;
  padding: 40px 48px !important;
  background: var(--branco) !important;
  border: 1px solid var(--cinza-claro) !important;
  border-radius: 6px !important;
  box-shadow: var(--sombra-media) !important;
}

body.ramo-page main h1,
body.tronco-page main h1,
body[class*="ramo_"] main h1,
body[class*="tronco_"] main h1 {
  max-width: 980px;
  margin-left: auto !important;
  margin-right: auto !important;
  color: var(--azul-escuro);
  text-align: center;
}

body.ramo-page main p,
body.tronco-page main p,
body[class*="ramo_"] main p,
body[class*="tronco_"] main p,
body.ramo-page main li,
body.tronco-page main li,
body[class*="ramo_"] main li,
body[class*="tronco_"] main li {
  color: var(--texto-claro);
}

/* Classe para o subtitulo dos ramos */
body.ramo-page .subtitulo,
body.tronco-page .subtitulo,
body[class*="ramo_"] .subtitulo,
body[class*="tronco_"] .subtitulo {
  text-align: center;
  max-width: 950px;
  margin: 0 auto 45px auto;
  color: var(--cinza);
  line-height: 1.8;
  font-size: 1.08em;
}

/* Container de texto histórico dentro dos ramos */
body.ramo-page .texto-historico,
body.tronco-page .texto-historico,
body[class*="ramo_"] .texto-historico,
body[class*="tronco_"] .texto-historico {
  max-width: 1100px;
  margin: 0 auto 60px auto;
  line-height: 1.9;
  color: var(--texto);
}

body.ramo-page .texto-historico h2,
body.tronco-page .texto-historico h2,
body[class*="ramo_"] .texto-historico h2,
body[class*="tronco_"] .texto-historico h2 {
  color: var(--azul-escuro);
  margin-top: 40px;
  margin-bottom: 14px;
  font-size: 1.5em;
}

body.ramo-page .texto-historico p,
body.tronco-page .texto-historico p,
body[class*="ramo_"] .texto-historico p,
body[class*="tronco_"] .texto-historico p {
  margin-bottom: 18px;
  text-align: justify;
}

/* Cards de geração */
.geracao {
  margin-bottom: 50px;
}

.geracao-titulo {
  text-align: center;
  margin-bottom: 24px;
  color: var(--azul-escuro);
  font-size: 1.35em;
  font-weight: bold;
}

.grade {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 10px;
}

.card {
  background: var(--branco);
  border: 1px solid var(--cinza-claro);
  border-top: 4px solid var(--azul-medio);
  border-radius: 8px;
  width: 165px;
  min-width: 165px;
  padding: 12px 10px;
  text-align: center;
  transition: all 0.25s ease;
  box-shadow: var(--sombra-leve);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-media);
}

.card h3 {
  font-size: 0.95em;
  color: var(--azul-escuro);
  margin-bottom: 8px;
  line-height: 1.35;
}

.datas {
  font-size: 0.85em;
  color: var(--cinza);
  margin-bottom: 10px;
}

.documentos {
  margin-top: 8px;
  font-size: 0.82em;
  line-height: 1.5;
}

.documentos a {
  display: block;
  color: var(--vermelho-borgonha);
  font-weight: bold;
  transition: all 0.25s ease;
}

.documentos a:hover {
  color: var(--vermelho-borgonha-hover);
  transform: scale(1.03);
}

/* Menus retráteis */
.container-retratil {
  max-width: 700px;
  margin: 30px auto;
  padding: 0 10px;
}

.menu-filhos {
  background: var(--branco);
  border: 1px solid var(--cinza-claro);
  border-top: 4px solid var(--azul-medio);
  border-radius: 8px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.menu-filhos[open] {
  box-shadow: var(--sombra-media);
}

.menu-filhos summary {
  padding: 14px 20px;
  font-size: 1em;
  font-weight: bold;
  color: var(--azul-escuro);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.menu-filhos summary::after {
  content: '➔';
  font-size: 0.8em;
  color: var(--azul-medio);
  transition: transform 0.3s ease;
}

.menu-filhos[open] summary::after {
  transform: rotate(90deg);
}

.menu-filhos summary::-webkit-details-marker {
  display: none;
}

.lista-filhos {
  padding: 10px 20px 20px 20px;
  border-top: 1px dashed var(--cinza-claro);
}

.filho-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.95em;
  border-bottom: 1px solid #f1f5f9;
}

.filho-item:last-child {
  border-bottom: none;
}

.filho-nome {
  color: var(--texto);
}

.filho-datas {
  color: var(--cinza);
  font-size: 0.9em;
  margin-left: 5px;
}

.filho-doc a {
  color: var(--vermelho-borgonha);
  text-decoration: none;
  font-weight: bold;
  transition: all 0.25s ease;
}

.filho-doc a:hover {
  color: var(--vermelho-borgonha-hover);
}

/* Fontes Históricas */
.fontes-secao {
  background-color: #f9f8f6;
  border-left: 4px solid var(--azul-medio);
  padding: 20px;
  margin-top: 40px;
  border-radius: 0 4px 4px 0;
}

.fontes-secao h3 {
  color: var(--azul-escuro);
  margin-bottom: 15px;
  font-size: 1.2em;
}

.fontes-secao ul {
  margin-left: 30px;
  margin-bottom: 18px;
  font-size: 1.05em;
}

.fontes-secao li {
  line-height: 1.3;
  margin-bottom: 4px;
  text-align: justify;
}

/* Transcrições */
.transcricao-box {
  background-color: var(--dourado-fundo);
  border-left: 4px solid var(--dourado);
  padding: 15px 20px;
  margin: 20px 0;
  font-style: italic;
  color: var(--texto-claro);
}

.fonte-documento {
  font-size: 0.85em;
  font-weight: bold;
  color: var(--cinza);
  margin-top: 5px;
  display: block;
}

/* ============================================
   14. DOCUMENTOS IFRAMES
   ============================================ */

.doc-imagem-container {
  text-align: center;
  margin: 20px 0 40px 0;
}

.doc-imagem {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--cinza-claro);
  box-shadow: var(--sombra-leve);
  border-radius: 4px;
}

.doc-legenda {
  font-size: 0.85em;
  color: var(--cinza);
  margin-top: 8px;
  font-style: italic;
}

.doc-legenda a {
  color: var(--vermelho-borgonha);
  font-weight: bold;
}

.doc-legenda a:hover {
  text-decoration: underline;
}

.pdf-viewer-section {
  max-width: 820px;
  margin: 45px auto;
  padding: 28px 25px;
  background-color: var(--dourado-fundo);
  border: 1px solid var(--dourado);
  border-radius: 10px;
  box-shadow: var(--sombra-media);
  text-align: center;
}

.pdf-viewer-section h3 {
  color: var(--azul-escuro);
  margin-bottom: 22px;
  font-size: 1.45em;
}

.pdf-container {
  position: relative;
  width: 100%;
  margin: 0 auto 25px;
  border: 1px solid var(--cinza-claro);
  border-radius: 6px;
  overflow: hidden;
  background-color: #f8f6f0;
  box-shadow: var(--sombra-leve);
}

.pdf-frame {
  width: 100%;
  height: 620px;
  border: none;
  display: block;
}

.pdf-source {
  margin-top: 12px;
  font-size: 0.96em;
  line-height: 1.5;
  color: var(--texto-claro);
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.pdf-source a {
  color: var(--azul-escuro);
  text-decoration: underline;
  font-weight: 500;
}

.pdf-source a:hover {
  color: var(--vermelho-borgonha);
}

/* ============================================
   15. POLÍTICA DE PRIVACIDADE
   ============================================ */

body.politicadeprivacidade-page main,
body.politica-page main {
  width: min(1120px, calc(100% - 56px)) !important;
  max-width: 1120px !important;
  margin: calc(var(--header-height) + 40px) auto 58px !important;
  padding: 40px 48px !important;
  background: var(--branco) !important;
  border: 1px solid var(--cinza-claro) !important;
  border-radius: 6px !important;
  box-shadow: var(--sombra-media) !important;
}

body.politicadeprivacidade-page main h1,
body.politica-page main h1 {
  text-align: center;
  color: var(--azul-escuro);
  margin-bottom: 10px;
  font-size: 2.2em;
}

body.politicadeprivacidade-page .subtitulo-data,
body.politica-page .subtitulo-data {
  text-align: center;
  font-style: italic;
  color: var(--cinza);
  margin-bottom: 40px;
  font-size: 0.95em;
}

body.politicadeprivacidade-page .diretriz-principal,
body.politica-page .diretriz-principal {
  background: var(--dourado-fundo);
  border-left: 4px solid var(--dourado);
  padding: 20px;
  margin-bottom: 35px;
  border-radius: 0 6px 6px 0;
}

body.politicadeprivacidade-page .diretriz-principal h2,
body.politica-page .diretriz-principal h2 {
  color: var(--vermelho-borgonha);
  font-size: 1.3em;
  margin-bottom: 8px;
}

body.politicadeprivacidade-page .diretriz-principal p,
body.politica-page .diretriz-principal p {
  font-size: 1.1em;
  line-height: 1.6;
  color: var(--texto);
}

body.politicadeprivacidade-page h3,
body.politica-page h3 {
  color: var(--azul-escuro);
  font-size: 1.4em;
  margin-top: 30px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--azul-escuro);
  padding-bottom: 4px;
}

body.politicadeprivacidade-page p,
body.politica-page p {
  font-size: 1.05em;
  line-height: 1.7;
  color: var(--texto);
  margin-bottom: 16px;
  text-align: justify;
}

body.politicadeprivacidade-page ul,
body.politica-page ul {
  margin-left: 25px;
  margin-bottom: 20px;
  font-size: 1.05em;
  color: var(--texto);
}

body.politicadeprivacidade-page li,
body.politica-page li {
  margin-bottom: 8px;
}

body.politicadeprivacidade-page .contato-bloco,
body.politica-page .contato-bloco {
  background: var(--bege);
  padding: 20px;
  border-radius: 6px;
  margin-top: 40px;
  text-align: center;
}

body.politicadeprivacidade-page .contato-bloco a,
body.politica-page .contato-bloco a {
  color: var(--azul-medio);
  font-weight: bold;
  text-decoration: underline;
}

/* ============================================
   16. RESPONSIVIDADE
   ============================================ */

@media (max-width: 1200px) {
  header {
    padding: 12px 24px;
  }
  
  nav a {
    font-size: 0.78rem;
    padding: 6px 10px;
    letter-spacing: 0.5px;
  }
  
  .logo::before {
    font-size: 1rem;
  }
}

@media (max-width: 1024px) {
  header {
    padding: 12px 20px;
  }
  
  nav a {
    font-size: 0.75rem;
    padding: 6px 8px;
    letter-spacing: 0.3px;
  }
  
  .tree-hero {
    grid-template-columns: 1fr;
  }
  
  .tree-stats {
    grid-template-columns: 1fr;
  }
  
  .tree-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  header {
    padding: 12px 16px;
    justify-content: space-between;
  }
  
  .logo::before {
    font-size: 0.9rem;
    content: "🏛️ Gontijo"; /* Versão mais curta no mobile */
  }
  
  nav {
    display: none;
    flex-direction: column;
    background: linear-gradient(135deg, #0f1f33 0%, #1a3a5c 100%);
    position: absolute;
    right: 16px;
    left: 16px;
    top: 62px;
    box-shadow: var(--sombra-forte);
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid var(--dourado);
  }
  
  nav.active {
    display: flex;
  }
  
  nav a {
    font-size: 0.95rem;
    padding: 12px 16px;
    letter-spacing: 0.5px;
    text-transform: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  
  nav a:last-child {
    border-bottom: 0;
  }
  
  nav a::after {
    display: none;
  }
  
  .menu-icon {
    display: block;
  }
  
  .hero {
    min-height: 70vh;
    padding: 100px 16px 60px;
  }
  
  .hero h1 {
    font-size: 1.8rem;
  }
  
  .sobre,
  .linhagens,
  .inventarios,
  .testamentos,
  .inquisicao {
    padding: 40px 16px;
  }
  
  main {
    padding: 16px !important;
  }
  
  body.contato-page form.contact-form-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    width: min(480px, calc(100vw - 32px)) !important;
    padding: 20px 22px !important;
  }
  
  body.contato-page textarea {
    min-height: 120px;
  }
  
  body.ramo-page main,
  body.tronco-page main,
  body[class*="ramo_"] main,
  body[class*="tronco_"] main,
  body.politicadeprivacidade-page main,
  body.politica-page main {
    width: min(100% - 28px, 1120px) !important;
    margin-top: calc(var(--header-height) + 30px) !important;
    padding: 24px 18px !important;
  }
  
  .person-grid {
    grid-template-columns: 1fr;
  }
  
  .grade {
    justify-content: flex-start;
  }
  
  .pdf-frame {
    height: 420px;
  }
  
  .tabela-inventarios,
  .tabela-testamentos {
    min-width: 100%;
  }
  
  .link-subramo {
    margin-left: 18px !important;
  }
  
  .footer {
    padding: 20px 16px;
  }
  
  .footer p {
    font-size: 0.85rem;
  }
  
  .footer a {
    font-size: 0.85rem;
  }
  
  #tabelaDocumentos {
    width: 100%;
  }
  
  #tabelaDocumentos th,
  #tabelaDocumentos td {
    font-size: 13px !important;
    padding: 4px 6px !important;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .logo::before {
    font-size: 0.8rem;
    content: "🏛️ Gontijo";
  }
  
  .card {
    width: 140px;
    min-width: 140px;
  }
  
  .pdf-frame {
    height: 320px;
  }
  
  .tree-intro h1 {
    font-size: 1.4rem !important;
  }
  
  #tabelaDocumentos th,
  #tabelaDocumentos td {
    font-size: 11px !important;
    padding: 3px 4px !important;
  }
}

/* ============================================
   17. UTILITÁRIOS E AJUSTES FINOS
   ============================================ */

/* Melhor contraste para tabelas */
th a {
  color: var(--dourado-claro);
}

th a:hover {
  color: var(--branco);
}

/* Espaçamento para iframes */
iframe {
  max-width: 100%;
}

/* Ajuste para popups */
#popupPalmira,
#popupManoel1715,
#popupAntonioMariz,
#popupLinaNogueira,
#popupFranciscaRomana {
  background: var(--branco) !important;
  border: 2px solid var(--dourado) !important;
  border-radius: 10px !important;
  box-shadow: var(--sombra-forte) !important;
}

/* Estilos para o botão de limpar na árvore */
.tree-action.clear {
  background: var(--cinza);
}

.tree-action.clear:hover {
  background: #666;
}

/* Suavização de scroll para seções com âncora */
section[id] {
  scroll-margin-top: 80px;
}

/* ============================================
   18. PÁGINA DE FOTOS
   ============================================ */

body.fotos-page main {
  width: min(1120px, calc(100% - 56px)) !important;
  max-width: 1120px !important;
  margin: calc(var(--header-height) + 40px) auto 58px !important;
  padding: 40px 48px !important;
  background: var(--branco) !important;
  border: 1px solid var(--cinza-claro) !important;
  border-radius: 6px !important;
  box-shadow: var(--sombra-media) !important;
}

body.fotos-page main h1 {
  text-align: center;
  color: var(--azul-escuro);
  margin-bottom: 30px;
  font-size: 2em;
}

body.fotos-page table {
  width: 100%;
  border-collapse: collapse;
  background: var(--branco);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--sombra-leve);
}

body.fotos-page th {
  background: var(--azul-gradiente);
  color: var(--dourado-claro);
  padding: 14px 16px;
  font-weight: 600;
  text-align: left;
}

body.fotos-page td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--cinza-claro);
  vertical-align: middle;
}

body.fotos-page tr:nth-child(even) {
  background-color: #faf8f5;
}

body.fotos-page tr:hover {
  background-color: var(--azul-claro);
}

@media (max-width: 768px) {
  body.fotos-page main {
    width: min(100% - 28px, 1120px) !important;
    margin-top: calc(var(--header-height) + 30px) !important;
    padding: 24px 18px !important;
  }
  
  body.fotos-page table {
    font-size: 0.85rem;
  }
  
  body.fotos-page th,
  body.fotos-page td {
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  body.fotos-page table {
    font-size: 0.7rem;
  }
  
  body.fotos-page th,
  body.fotos-page td {
    padding: 4px 6px;
  }
}

/* ============================================
   19. NOTA DE DESTAQUE (Tronco João Lopes de Elvas)
   ============================================ */

.nota-destaque-container {
    max-width: 950px;
    margin: 10px auto 50px auto;
    padding: 0 10px;
}

.nota-destaque {
    background: #fdf8f0;
    border: 2px solid #c9a84c;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(201, 168, 76, 0.25);
    overflow: hidden;
}

.nota-destaque-header {
    background: linear-gradient(135deg, #c9a84c, #b8943a);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #a07d2e;
}

.nota-destaque-icone {
    font-size: 1.6em;
    line-height: 1;
}

.nota-destaque-header h3 {
    color: #1a1a1a;
    font-size: 1.2em;
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 700;
}

.nota-destaque-corpo {
    padding: 24px 28px;
}

.nota-destaque-corpo p {
    color: #3a3a3a;
    line-height: 1.8;
    font-size: 1.02em;
    margin-bottom: 16px;
}

.nota-destaque-corpo p:last-child {
    margin-bottom: 0;
}

.nota-destaque-corpo strong {
    color: #7f1d1d;
}

@media (max-width: 768px) {
    .nota-destaque-header {
        padding: 12px 16px;
    }
    
    .nota-destaque-header h3 {
        font-size: 1em;
    }
    
    .nota-destaque-corpo {
        padding: 18px 16px;
    }
    
    .nota-destaque-corpo p {
        font-size: 0.95em;
    }
}

/* ============================================
   20. LINK DE NAVEGAÇÃO (Troncos)
   ============================================ */

.link-navegacao {
    text-align: center;
    margin-top: 25px;
    font-weight: bold;
    font-size: 1.1em;
}

.link-navegacao a {
    color: #7f1d1d;
    text-decoration: none;
    transition: all 0.3s ease;
}

.link-navegacao a:hover {
    color: #a02222;
    text-decoration: underline;
}

/* ============================================
   21. DOCUMENTOS JPG (estilo ramo_francisca)
   ============================================ */

.doc-imagem-container {
    text-align: center;
    margin: 20px 0 40px 0;
}

.doc-imagem {
    max-width: 80%;
    height: auto;
    border: 1px solid #d9d9d9;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    border-radius: 4px;
}

.doc-legenda {
    font-size: 0.85em;
    color: #555;
    margin-top: 8px;
    font-style: italic;
}

.doc-legenda a {
    color: #8b1a1a;
    font-weight: bold;
}

.doc-legenda a:hover {
    text-decoration: underline;
}

/* ============================================
   22. DESCRIÇÃO GERAÇÃO
   ============================================ */

.descricao-geracao {
    max-width: 700px;
    margin: 0 auto 25px auto;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1em;
    line-height: 1.7;
    color: #444;
}

/* ============================================
   23. INFOGRAFIA GENEALÓGICA (Tronco Antônio Bicudo)
   ============================================ */

.infografia-genealogica {
    max-width: 1100px;
    margin: 30px auto 20px;
    background: #f9f8f6;
    border: 1px solid #d9d9d9;
    border-top: 5px solid #2c3e50;
    border-radius: 8px;
    padding: 30px 25px 25px;
}

.infografia-genealogica h2 {
    text-align: center;
    color: var(--azul-escuro);
    margin-bottom: 8px;
    font-size: 1.7em;
}

.infografia-genealogica .sub {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
    font-style: italic;
}

.infografia-svg {
    width: 100%;
    height: auto;
    max-height: 920px;
    display: block;
    margin: 0 auto;
    background: #fcfaf7;
    border-radius: 6px;
}

/* Estilos para os elementos SVG da árvore genealógica */
.box {
    fill: #f5f2ed;
    stroke: #2c3e50;
    stroke-width: 2;
}

.line {
    stroke: #2c3e50;
    stroke-width: 2;
}

.text-main {
    font-family: Georgia, serif;
    font-size: 15px;
    font-weight: bold;
    fill: #1a3a5c;
}

.text-info {
    font-family: Georgia, serif;
    font-size: 12px;
    fill: #4a4a4a;
}

.text-marriage {
    font-family: Georgia, serif;
    font-size: 13px;
    font-weight: bold;
    fill: #8b1a1a;
}

/* Versão responsiva para o SVG */
@media (max-width: 768px) {
    .infografia-genealogica {
        margin: 20px auto 10px;
        padding: 20px 15px 15px;
    }
    
    .infografia-svg {
        max-height: 880px;
    }
}

@media (max-width: 480px) {
    .infografia-genealogica {
        padding: 18px 12px 12px;
    }
    
    .text-main {
        font-size: 13.5px;
    }
    
    .text-info {
        font-size: 10px;
    }
    
    .text-marriage {
        font-size: 11.5px;
    }
}

/* ============================================
   24. DATATABLES - CAMPO DE BUSCA PERSONALIZADO
   ============================================ */

/* Wrapper principal - mesma largura e centralização da tabela */
.dataTables_wrapper {
    width: min(1120px, 100%);
    margin: 20px auto 0 auto; /* distanciamento do menu e centralizado */
    overflow-x: auto;
    position: relative;
}

/* Container da busca - alinhado à direita DENTRO do wrapper */
.dataTables_wrapper .dataTables_filter {
    float: right;
    text-align: right;
    margin-bottom: 16px;
    padding: 6px 14px;
    background: var(--dourado-fundo);
    border-radius: 6px;
    border: 1px solid var(--dourado-claro);
    box-shadow: var(--sombra-leve);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    max-width: 100%;
}

/* Label "Busca" */
.dataTables_wrapper .dataTables_filter label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--fonte-principal);
    font-weight: 600;
    color: var(--azul-escuro);
    font-size: 0.9rem;
    margin: 0;
    cursor: default;
    white-space: nowrap;
}

/* Texto "Busca" personalizado (esconde o "Search:") */
.dataTables_wrapper .dataTables_filter label::before {
    content: "🔍 Busca:";
    font-weight: 600;
    color: var(--azul-escuro);
    margin-right: 2px;
    font-size: 0.9rem;
}

.dataTables_wrapper .dataTables_filter label span {
    display: none;
}

/* Campo de input */
.dataTables_wrapper .dataTables_filter label input {
    display: inline-block;
    padding: 5px 12px;
    border: 2px solid var(--cinza-claro);
    border-radius: 4px;
    font-family: var(--fonte-principal);
    font-size: 0.9rem;
    background: var(--branco);
    color: var(--texto);
    width: 180px;
    min-width: 120px;
    max-width: 100%;
    transition: all 0.3s ease;
    outline: none;
    min-height: 32px;
    box-sizing: border-box;
}

.dataTables_wrapper .dataTables_filter label input:focus {
    border-color: var(--dourado);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.2);
    width: 220px;
}

.dataTables_wrapper .dataTables_filter label input::placeholder {
    color: var(--cinza);
    font-style: italic;
    font-size: 0.8rem;
}

/* Select "Mostrar X registros" */
.dataTables_wrapper .dataTables_length {
    float: left;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--texto-claro);
}

.dataTables_wrapper .dataTables_length label {
    font-family: var(--fonte-principal);
}

.dataTables_wrapper .dataTables_length select {
    padding: 4px 8px;
    border: 2px solid var(--cinza-claro);
    border-radius: 4px;
    font-family: var(--fonte-principal);
    font-size: 0.9rem;
    background: var(--branco);
    color: var(--texto);
    outline: none;
    transition: border-color 0.3s ease;
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--dourado);
}

/* Informações de paginação */
.dataTables_wrapper .dataTables_info {
    float: left;
    padding-top: 12px;
    font-size: 0.85rem;
    color: var(--cinza);
    clear: left;
}

.dataTables_wrapper .dataTables_paginate {
    float: right;
    padding-top: 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 3px 10px;
    margin: 0 2px;
    border: 1px solid var(--cinza-claro);
    border-radius: 4px;
    background: var(--branco);
    color: var(--azul-escuro);
    font-family: var(--fonte-principal);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--azul-claro);
    border-color: var(--azul-medio);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--azul-gradiente);
    color: var(--branco);
    border-color: var(--azul-medio);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Limpeza dos floats */
.dataTables_wrapper::after {
    content: "";
    display: table;
    clear: both;
}

/* ============================================
   RESPONSIVIDADE DO DATATABLES
   ============================================ */

@media (max-width: 768px) {
    .dataTables_wrapper .dataTables_filter {
        float: none;
        display: flex;
        justify-content: center;
        width: 100%;
        padding: 6px 12px;
        margin-bottom: 12px;
        box-sizing: border-box;
    }
    
    .dataTables_wrapper .dataTables_filter label {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        white-space: normal;
    }
    
    .dataTables_wrapper .dataTables_filter label input {
        width: 100%;
        max-width: 250px;
        min-width: 140px;
    }
    
    .dataTables_wrapper .dataTables_filter label input:focus {
        width: 100%;
        max-width: 280px;
    }
    
    .dataTables_wrapper .dataTables_length {
        float: none;
        text-align: center;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .dataTables_wrapper .dataTables_info {
        float: none;
        text-align: center;
        width: 100%;
        padding-top: 8px;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
        width: 100%;
        padding-top: 8px;
    }
}

@media (max-width: 480px) {
    .dataTables_wrapper {
        margin-top: 12px;
    }
    
    .dataTables_wrapper .dataTables_filter {
        padding: 4px 8px;
        border-radius: 4px;
    }
    
    .dataTables_wrapper .dataTables_filter label {
        font-size: 0.8rem;
    }
    
    .dataTables_wrapper .dataTables_filter label::before {
        font-size: 0.8rem;
        content: "🔍 Busca:";
    }
    
    .dataTables_wrapper .dataTables_filter label input {
        font-size: 0.8rem;
        padding: 4px 8px;
        min-height: 28px;
        min-width: 100px;
    }
    
    .dataTables_wrapper .dataTables_filter label input:focus {
        width: 100%;
        max-width: 200px;
    }
    
    .dataTables_wrapper .dataTables_length select {
        font-size: 0.8rem;
        padding: 2px 6px;
    }
    
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        padding: 2px 8px;
        font-size: 0.75rem;
    }
}

/* ============================================
   25. LEGENDA DOS DOCUMENTOS
   ============================================ */

.legenda-documentos {
    width: min(1120px, 100%);
    max-width: 1120px;
    margin: 32px auto 48px;   /* 32px acima, 48px abaixo */
    font-style: italic;
    text-align: center;
    padding: 0 16px;
    box-sizing: border-box;
    color: var(--texto-claro);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* Responsivo para telas menores */
@media (max-width: 768px) {
    .legenda-documentos {
        margin: 24px auto 36px;  /* um pouco menos em mobile */
        padding: 0 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .legenda-documentos {
        margin: 18px auto 28px;
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

/* ============================================
   FIM DO ARQUIVO
   ============================================ */