/* ============================================================
   tooltip.css
   Estilos para tooltip de termos e tabela de glossário
   Instrução: adicionar em docs/css/ e referenciar
   no mkdocs.yml em extra_css
   ============================================================ */

/* Tooltip no hover sobre os termos */
.glossario-termo {
  position: relative;
  display: inline;
  border-bottom: 1px dotted var(--md-primary-fg-color);
  color: inherit;
  cursor: help;
}

.glossario-termo::after {
  content: attr(data-def);
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lightest);
  border-left: 3px solid var(--md-primary-fg-color);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--md-default-fg-color);
  width: 620px;
  white-space: normal;
  z-index: 100;
  pointer-events: none;
}

.glossario-termo:hover::after {
  display: block;
}

/* Tabela de glossário */
.glossario-tabela thead tr:first-child th {
  text-align: center;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ccc;
}

.glossario-tabela th:first-child,
.glossario-tabela td:first-child {
  border-right: 1px solid #ccc;
}


.md-typeset .glossario-tabela th:first-child,
.md-typeset .glossario-tabela td:first-child {
  border-right: 1px solid #ccc;
}

.md-typeset .glossario-tabela thead tr:first-child th {
  text-align: center;
  background-color: #f5f5f5;
}


table:has(th[colspan="2"]) {
  width: 100% !important;
  border-collapse: collapse !important;
  border: 1px solid #ccc !important;
}

table:has(th[colspan="2"]) th[colspan="2"] {
  text-align: center !important;
  background-color: #f5f5f5 !important;
  border-bottom: 1px solid #ccc !important;
  padding: 8px !important;
}

table:has(th[colspan="2"]) th:first-child,
table:has(th[colspan="2"]) td:first-child {
  border-right: 1px solid #ccc !important;
  padding: 8px !important;
}

table:has(th[colspan="2"]) th,
table:has(th[colspan="2"]) td {
  padding: 8px !important;
  border-bottom: 1px solid #ccc !important;
}

table:has(th[colspan="2"]) th {
  font-weight: bold !important;
}