/* Styles modernes pour le sous-titre avec pastilles */

.modern-subtitle {
  font-family: var(--body-font);
  font-size: 1.5rem;
  line-height: 1.6;
  color: var(--text-color);
  margin-top: -0.5rem; /* Ajoute un espace négatif pour rapprocher du titre */
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 0.7s var(--easing) forwards;
  animation-delay: 1.2s; /* Animation plus rapide pour accompagner le titre */
  max-width: 100%;
  width: 100%;
}

/* Ajustements pour mobile */
@media screen and (max-width: 768px) {
  .modern-subtitle {
    font-size: 1.3rem;
    line-height: 1.5;
    padding: 0 var(--spacing-sm); /* Même marge que le titre */
    text-align: left;
    margin-left: 0;
    margin-right: auto;
    max-width: 100%;
  }
}

/* Style pour le nouveau design des mots clés du sous-titre */
.subtitle-highlight {
  position: relative;
  display: inline-block;
  font-weight: 800;
  color: #7C89FF;
  padding: 5px 12px;
  border-radius: 30px;
  background-color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  transform: rotate(-2deg);
  z-index: 2;
  margin: 0 2px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  white-space: nowrap;
}

/* Animation d'entrée pour les éléments du sous-titre */
@keyframes subtitlePopIn {
  0% {
    transform: rotate(-2deg) scale(0.8);
    opacity: 0;
  }
  50% {
    transform: rotate(-2deg) scale(1.05);
  }
  70% {
    transform: rotate(-2deg) scale(0.95);
  }
  100% {
    transform: rotate(-2deg) scale(1);
    opacity: 1;
  }
}

/* Animation de flottement */
@keyframes subtitleFloat {
  0% {
    transform: rotate(-2deg) translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  }
  50% {
    transform: rotate(-2deg) translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  }
  100% {
    transform: rotate(-2deg) translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
  }
}

/* Animation au survol */
.subtitle-highlight:hover {
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

/* Animation d'entrée du sous-titre */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation séquentielle des éléments du sous-titre */
.subtitle-highlight:nth-of-type(1) {
  animation: subtitlePopIn 0.8s forwards;
  animation-delay: 1.7s;
  opacity: 0;
}

.subtitle-highlight:nth-of-type(2) {
  animation: subtitlePopIn 0.8s forwards;
  animation-delay: 1.9s;
  opacity: 0;
}

.subtitle-highlight:nth-of-type(3) {
  animation: subtitlePopIn 0.8s forwards;
  animation-delay: 2.1s;
  opacity: 0;
}

/* Responsive styles */
@media screen and (max-width: 768px) {
  .modern-subtitle {
    font-size: 1.1rem;
    line-height: 1.8;
  }
  
  .pill {
    padding: 0.15rem 0.6rem;
    margin: 0.1rem;
  }
}

@media screen and (max-width: 480px) {
  .modern-subtitle {
    font-size: 1rem;
    line-height: 1.8;
  }
}
