/**
 * PSSS Lexique Tooltips - Styles
 * Conforme à la charte graphique PSSS
 * Compatible WordPress/DIVI
 */

/* === TERMES AVEC TOOLTIP === */

.lexique-term {
  position: relative;
  color: #1A2332; /* Bleu nuit PSSS */
  font-weight: 500;
  cursor: help;
  border-bottom: 1px dotted #D4AF37; /* Or byzantin */
  transition: all 0.2s ease;
}

.lexique-term:hover {
  color: #D4AF37; /* Or byzantin */
  border-bottom-style: solid;
}

/* Icône discrète après le terme */
.lexique-term::after {
  content: "📘";
  font-size: 0.7em;
  margin-left: 2px;
  opacity: 0.6;
  vertical-align: super;
}

/* === TOOLTIP CONTAINER === */

.psss-tooltip {
  position: absolute;
  z-index: 10000;
  max-width: 400px;
  min-width: 300px;
  background: #FFFFFF;
  border: 2px solid #D4AF37; /* Or byzantin */
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(26, 35, 50, 0.15);
  opacity: 0;
  transition: opacity 0.2s ease;
  font-family: 'Source Serif Pro', Georgia, serif;
  font-size: 14px;
  line-height: 1.6;
}

/* === HEADER DU TOOLTIP === */

.psss-tooltip-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, #1A2332 0%, #2F3640 100%);
  border-radius: 6px 6px 0 0;
  color: #FFFFFF;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 2px solid #D4AF37;
}

/* === BODY DU TOOLTIP === */

.psss-tooltip-body {
  padding: 16px;
  color: #2F3640; /* Gris anthracite */
  background: #FAF9F6; /* Blanc cassé */
}

/* === FOOTER DU TOOLTIP === */

.psss-tooltip-footer {
  padding: 10px 16px;
  background: #FFFFFF;
  border-top: 1px solid #E5E5E5;
  border-radius: 0 0 6px 6px;
  text-align: right;
}

.psss-tooltip-link {
  display: inline-block;
  color: #D4AF37; /* Or byzantin */
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.psss-tooltip-link:hover {
  color: #1A2332; /* Bleu nuit */
  transform: translateX(3px);
}

/* === RESPONSIVE MOBILE === */

@media (max-width: 768px) {
  .psss-tooltip {
    max-width: calc(100vw - 40px);
    min-width: 280px;
    font-size: 13px;
  }
  
  .psss-tooltip-header {
    font-size: 14px;
    padding: 10px 14px;
  }
  
  .psss-tooltip-body {
    padding: 14px;
  }
  
  .psss-tooltip-footer {
    padding: 8px 14px;
  }
}

/* === ANIMATION D'ENTRÉE === */

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.psss-tooltip[style*="opacity: 1"] {
  animation: tooltipFadeIn 0.2s ease;
}

/* === ACCESSIBILITÉ === */

/* Focus visible pour navigation clavier */
.lexique-term:focus {
  outline: 2px solid #D4AF37;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Assurer contraste suffisant (WCAG AA) */
@media (prefers-contrast: high) {
  .psss-tooltip {
    border-width: 3px;
  }
  
  .lexique-term {
    border-bottom-width: 2px;
  }
}

/* Mode sombre (si activé par l'utilisateur) */
@media (prefers-color-scheme: dark) {
  .psss-tooltip-body {
    background: #2F3640;
    color: #FAF9F6;
  }
  
  .psss-tooltip-footer {
    background: #1A2332;
    border-top-color: #404040;
  }
}

/* === PRINT (désactiver tooltips à l'impression) === */

@media print {
  .lexique-term::after {
    display: none;
  }
  
  .psss-tooltip {
    display: none !important;
  }
  
  .lexique-term {
    border-bottom: none;
    color: inherit;
    font-weight: inherit;
  }
}