/* Styles personnalisés — Priorité absolue aux classes fr-* du DSFR. */

html {
  scroll-behavior: smooth;
}

.hero-section {
  background-image:
    linear-gradient(
      270.3deg,
      rgb(123 97 255 / 46%) 3.25%,
      rgb(123 97 255 / 63%) 55.33%,
      rgb(123 97 255 / 39%) 99.82%
    ),
    linear-gradient(0deg, #00006d, #00006d);
  color: white;
}

.hero-section h1,
.hero-section p {
  color: white;
}

/* Bouton secondaire sur fond sombre */
/* stylelint-disable selector-class-pattern */
.hero-section .fr-btn--secondary {
  color: white !important;
  box-shadow: inset 0 0 0 1px white !important;
  background-color: transparent !important;

  --hover-tint: rgb(255 255 255 / 10%);
}

.hero-section .fr-btn--secondary:hover {
  background-color: white !important;
  color: #00006d !important;
}
/* stylelint-enable selector-class-pattern */

.mission-number {
  font-size: 4rem;
  line-height: 1;
  font-weight: bold;
  color: #6a6af4;
  margin-bottom: 1rem;
}

.mission-banner {
  background-color: #6a6af4;
  color: white;
  border-radius: 0.5rem;
}

.mission-banner strong {
  color: white;
}

.align-center {
  text-align: center;
}

.text-justify {
  text-align: justify;
}

/* Compact markdown for small detail slots */
.markdown-inline p,
.markdown-inline ul {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.markdown-inline ul {
  padding-left: 1.5rem;
}

/* Style pour les citations Markdown (balise > avec classe fr-quote ajoutée via .eleventy.js) */
.fr-quote {
  text-align: left !important;
}

.fr-quote p {
  font-size: 1.25rem !important;
  line-height: 2rem !important;
  font-weight: 700 !important;
  color: var(--text-title-grey) !important;
  margin-bottom: 1rem !important;
}

.fr-quote p:last-child {
  margin-bottom: 0 !important;
}

/* stylelint-disable selector-class-pattern */

/* Ensure images in cards are not cropped (logos) */
.fr-card__img img {
  object-fit: contain !important;
  padding: 1rem;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

/* Improve pictograms visibility in Dark Mode */
[data-fr-theme="dark"] img[src*="pictograms"] {
  filter: invert(1) hue-rotate(180deg) brightness(1.2);
}

/* Fix Grist forms in Dark Mode */
[data-fr-theme="dark"] iframe[src*="grist"] {
  filter: invert(0.9) hue-rotate(180deg);
  background-color: transparent !important;
}

/* Ensure images with forced white background adapt to dark mode */
[data-fr-theme="dark"] img[style*="background-color: white"],
[data-fr-theme="dark"] .fr-card__img img:not([src*="pictograms"]) {
  background-color: #f6f6f6 !important; /* Fond clair pour que les logos foncés restent visibles */
  padding: 1rem;
  border-radius: 4px;
}

/* --- Equipe — Style épuré --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 3rem;
}

.team-grid article.team-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.team-avatar-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
  overflow: hidden;
  border-radius: 8px;
  background-color: var(--background-alt-grey);
  border: 1px solid transparent;
  transition: border-color 0.4s ease;
}

.team-grid article.team-item:hover .team-avatar-wrapper {
  border-color: var(--border-active-blue-france);
}

.team-grid article.team-item .team-avatar {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) !important;
  transition: all 0.4s ease-in-out !important;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.team-grid article.team-item:hover .team-avatar {
  filter: grayscale(0%) !important;
  transform: scale(1.08) translateZ(0) !important;
}

.team-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
  color: var(--text-title-grey);
}

.team-role {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-active-blue-france);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.team-description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-mention-grey);
  margin-bottom: 0;
}

/* --- Cards — Effet Premium au Hover --- */
.fr-card {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
}

.fr-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgb(0 0 91 / 15%) !important;
  z-index: 10;
}

/* Accentuation de la bordure au survol */
.fr-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-active-blue-france);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.fr-card:hover::before {
  opacity: 0.5;
}

/* Interaction sur le titre */
.fr-card:hover .fr-card__title a {
  color: var(--text-active-blue-france) !important;
}

/* Animation douce du logo */
.fr-card:hover .fr-card__img img {
  transform: scale(1.06);
}
