/* Page Thématiques : grille d'exemples (pictogramme + libellé) et note de fin avec prise de contact. */

.motifs-page .motifs-page__lead--after-head {
  margin: 0 auto clamp(2rem, 4.5vw, 3rem);
}

.themes {
  --sand: #a8761c;
  --sage: #4f7a66;
  --slate: var(--teal);
  width: min(100%, 72rem);
  margin-inline: auto;
}

.themes__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-card {
  --tint-rgb: var(--nature-sand-rgb);
  --tint-ink: var(--sand);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.75rem;
  min-height: 12rem;
  padding: 1.5rem 1.6rem 1.6rem;
  background: linear-gradient(165deg, rgba(var(--tint-rgb), 0.1) 0%, #fff 52%);
  border: 1px solid rgba(30, 41, 59, 0.08);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(30, 41, 59, 0.04), 0 14px 32px -18px rgba(30, 41, 59, 0.22);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.theme-card--sage { --tint-rgb: var(--nature-sage-rgb); --tint-ink: var(--sage); }
.theme-card--teal { --tint-rgb: var(--nature-teal-rgb); --tint-ink: var(--slate); }

/* Filet de couleur en haut de carte */
.theme-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, rgba(var(--tint-rgb), 0.85), rgba(var(--tint-rgb), 0.15));
}

.theme-card:hover {
  border-color: rgba(var(--tint-rgb), 0.35);
  box-shadow: 0 1px 2px rgba(30, 41, 59, 0.04), 0 18px 38px -18px rgba(var(--tint-rgb), 0.55);
}

.theme-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.theme-card__icon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 14px;
  background: rgba(var(--tint-rgb), 0.14);
  color: var(--tint-ink);
  transition: background 0.25s ease;
}
.theme-card:hover .theme-card__icon {
  background: rgba(var(--tint-rgb), 0.22);
}
.theme-card__icon svg {
  width: 1.75rem;
  height: 1.75rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-card__num {
  padding-top: 0.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1;
  color: rgba(var(--tint-rgb), 0.7);
}

.theme-card__text {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.1rem + 0.5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  hyphens: manual;
}

/* Note de fin : rappel que la liste n'est pas limitative, et prise de contact */
.themes-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2.5rem;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  padding: clamp(1.4rem, 3vw, 2rem) clamp(1.4rem, 3.5vw, 2.5rem);
  background: linear-gradient(110deg, #fff 0%, rgba(var(--nature-sand-rgb), 0.13) 100%);
  border: 1px solid rgba(var(--nature-sand-rgb), 0.28);
  border-radius: 18px;
}

.themes-note__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rose);
}

.themes-note__text {
  margin: 0;
  max-width: 34rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.6rem);
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
}

.themes-note__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.4rem;
  flex-shrink: 0;
}

.themes-note__link {
  font-weight: 600;
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: rgba(var(--accent-rgb), 0.35);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.18s ease, color 0.18s ease;
}
.themes-note__link:hover {
  color: var(--teal-deep);
  text-decoration-color: currentColor;
}

/* Apparition douce, carte après carte */
@media (prefers-reduced-motion: no-preference) {
  .theme-card {
    animation: theme-card-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(var(--i, 0) * 70ms + 80ms);
  }
  @keyframes theme-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
}

@media (max-width: 960px) {
  .themes__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .themes-note { flex-direction: column; align-items: flex-start; }
}

/* Téléphone : cartes en ligne (pictogramme à gauche), plus compactes */
@media (max-width: 600px) {
  .themes__grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .theme-card {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    min-height: 0;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: linear-gradient(100deg, rgba(var(--tint-rgb), 0.1) 0%, #fff 45%);
  }
  .theme-card::before { inset: 0 auto 0 0; width: 3px; height: auto; }
  .theme-card__num { display: none; }
  .theme-card__icon { width: 2.75rem; height: 2.75rem; border-radius: 12px; flex-shrink: 0; }
  .theme-card__icon svg { width: 1.4rem; height: 1.4rem; }
  .theme-card__text { font-size: 1.2rem; }
  .themes-note { padding: 1.4rem 1.25rem; }
  .themes-note__actions { width: 100%; }
  .themes-note__actions .btn-rdv { flex: 1 1 auto; text-align: center; }
}
