/**
 * Compléments UX : transitions et survols là où le bundle n’en définit pas,
 * sans écraser les classes Tailwind existantes (couleurs hover: du header, etc.).
 */

/* Logo header — animation légère (respecte prefers-reduced-motion) */
@keyframes cursa-logo-glow {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(212, 175, 55, 0));
    transform: translateY(0);
  }
  50% {
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.22));
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  #root header img[alt="CURSA Private School Logo"] {
    animation: cursa-logo-glow 3.5s ease-in-out infinite;
    will-change: filter, transform;
  }
}

@media (hover: hover) and (pointer: fine) {
  #root button:not(:disabled),
  #root [role="button"] {
    transition-property: color, background-color, border-color, box-shadow, transform,
      opacity, filter;
    transition-duration: 0.2s;
    transition-timing-function: ease;
  }

  #root a[href] {
    transition-property: color, opacity, text-decoration-color, border-color;
    transition-duration: 0.2s;
    transition-timing-function: ease;
  }

  /* Contenu principal : images dans des liens (cartes, galeries) */
  #root main a[href] img,
  #root section a[href] img {
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  #root main a[href]:hover img,
  #root section a[href]:hover img {
    opacity: 0.94;
    transform: scale(1.02);
  }

  /* Pagination / pastilles (carrousels) : feedback tactile */
  #root button[aria-label^="Go to slide"]:hover {
    transform: scale(1.15);
  }

  /* Sélecteur de langue : pas de transform global sur ces boutons */
  #root [aria-label="Language"] button {
    transition-property: background-color, opacity, color, box-shadow, filter;
    transition-duration: 0.2s;
    transition-timing-function: ease;
  }

  /* Langue sélectionnée : contraste net + liseré doré (aria-pressed vient du bundle) */
  #root [aria-label="Language"] button[aria-pressed="true"] {
    background-color: rgba(212, 175, 55, 0.52);
    box-shadow:
      inset 0 0 0 1.5px rgba(255, 228, 160, 0.95),
      inset 0 0 14px rgba(212, 175, 55, 0.35);
  }

  #root [aria-label="Language"] button span[role="img"] {
    display: inline-block;
  }

  #root [aria-label="Language"] button[aria-pressed="true"] span[role="img"] {
    filter: drop-shadow(0 0 5px rgba(255, 240, 200, 0.85));
  }

  @media (prefers-reduced-motion: no-preference) {
    #root [aria-label="Language"] button[aria-pressed="true"] span[role="img"] {
      animation: cursa-lang-flag-pop 0.35s ease-out;
    }
  }

  @keyframes cursa-lang-flag-pop {
    0% {
      transform: scale(0.92);
      filter: drop-shadow(0 0 0 transparent);
    }
    70% {
      transform: scale(1.14);
    }
    100% {
      transform: scale(1);
      filter: drop-shadow(0 0 5px rgba(255, 240, 200, 0.85));
    }
  }
}
