html {
  scroll-behavior: smooth;
}

.hero-page {
  max-width: 900px;

  padding: 0px 24px 32px;

  text-align: center;

  border-radius: 20px;

  background: linear-gradient(145deg, rgba(236, 243, 251, 0.9), white);

  box-shadow: var(--shadow-soft);

  margin-bottom: 48px;
}

.pathologies {
  width: min(1400px, 100%);
  max-width: 950px;

  margin: auto;

  padding: 0 24px 16px;
}

.pathologies h1 {
  text-align: center;

  margin: var(--space-l) 0 var(--space-m);
}

.pathologies ul {
  display: flex;

  flex-wrap: wrap;

  justify-content: center;

  gap: 14px;

  margin-top: 28px;

  padding: 0;

  list-style: none;
}

.pathologies a {
  position: relative;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  padding: 14px 20px;

  border-radius: 14px;

  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.95),
    rgba(240, 246, 250, 0.92)
  );

  border: 1px solid rgba(30, 97, 133, 0.1);

  text-decoration: none;

  color: var(--primary);

  font-family: "Operetta", sans-serif;
  font-weight: 700;

  font-size: 1.15rem;

  letter-spacing: 1px;

  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);

  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    background 0.28s ease;
}

.pathologies a:hover {
  transform: translateY(-4px);

  background: linear-gradient(145deg, var(--primary), rgb(38, 118, 160));

  color: var(--secondary);

  box-shadow: 0 14px 28px rgba(30, 97, 133, 0.18);
}

.card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 8px 10px;
  backdrop-filter: blur(10px);
}

.cards {
  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));

  gap: 20px;

  align-items: stretch;
}

.card {
  container-type: inline-size;
  z-index: 0;
  position: relative;
  display: flex;
  flex-direction: column;

  min-height: 360px;
  height: 100%;

  border-radius: 24px;
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);

  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    opacity 0.3s ease; /* fusionné depuis le 3e bloc */

  text-align: center;
  animation: fadeUp 0.7s ease both;
  cursor: pointer;
  padding-bottom: 12px;

  /* fusionné depuis le 3e bloc, SANS margin-top: auto */
  line-height: 1.7;
  color: rgb(5, 67, 98);
  opacity: 0.78;
}

.card-media {
  overflow: hidden; /* ← le rognage se fait UNIQUEMENT ici désormais */
  border-radius: 24px 24px 0 0; /* coins arrondis seulement en haut, comme avant visuellement */
}

.card:hover {
  opacity: 1;
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.16);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card img {
  width: 100%;

  height: 240px;

  object-fit: contain;

  display: block;

  padding: 20px;

  filter: brightness(0.82) saturate(0.9) contrast(1.08) hue-rotate(-45deg);

  transition:
    transform 0.5s ease,
    filter 0.45s ease;
}

.card:hover img {
  transform: scale(1.05);

  filter: brightness(1) saturate(1) contrast(1);
}

.card h3 {
  margin: 12px 4px 6px;
  text-align: center;
  font-size: clamp(0.85rem, 9cqw, 1.5rem);
  color: var(--primary);
  line-height: 1.2;
}

.card::before {
  content: "";

  position: absolute;

  inset: 0;

  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.04),
    transparent
  );

  pointer-events: none;
}

@media (max-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card {
    min-height: 240px;
    text-align: center;
  }

  .card img {
    height: 120px;
    padding: 8px;
  }

  .card-content {
    padding: 0 6px 8px; /* resserré encore un peu plus qu'en desktop */
  }

  .card h3 {
    font-size: clamp(0.7rem, 10cqw, 0.9rem);
    margin: 8px 4px;
    text-align: center;
    line-height: 1.2;
  }

  .card {
    font-size: 0.8rem;
    line-height: 1.35;
    margin: 0 8px 10px;
  }

  .pathologies {
    padding: 0 16px 32px;
  }
}
