/* Toupty : cartes explicites et réutilisables. Contrat : documentation/modernisation/ACCUEIL-ET-CARTES.md */
.tp-cartes, .tp-cartes * { box-sizing: border-box; }
.tp-cartes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tp-cartes--quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tp-cartes .tp-carte {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 19px 10px 17px;
  border: 1px solid rgba(255, 255, 204, .25);
  border-radius: 13px;
  background: #ad3833;
  box-shadow: 0 3px 9px rgba(67, 18, 18, .12);
  text-align: center;
}
.tp-cartes .tp-carte-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 112px;
}
.tp-cartes .tp-carte-image img {
  display: block;
  max-width: 100%;
  max-height: 112px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.tp-cartes .tp-carte-libelle {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0;
  color: #00ffcc;
  font: 600 15px/1.45 Helvetica, Arial, sans-serif;
  text-align: center;
  overflow-wrap: break-word;
}
.tp-cartes .tp-carte:focus-within {
  border-color: #00ffcc;
  background: #b34037;
}
.tp-cartes a:focus-visible {
  outline: 3px solid #ffffcc;
  outline-offset: 4px;
  border-radius: 4px;
}
.tp-cartes .tp-carte-libelle:hover { color: #ffff99; text-decoration: underline; }
@media (hover: hover) and (pointer: fine) {
  .tp-cartes .tp-carte:hover { background: #b34037; border-color: #00ffcc; }
}
@media (prefers-reduced-motion: no-preference) {
  .tp-cartes .tp-carte { transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .tp-cartes .tp-carte:hover { transform: translateY(-4px); }
}
@media (max-width: 900px) {
  .tp-cartes--quatre { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .tp-cartes, .tp-cartes--quatre { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tp-cartes .tp-carte { padding: 14px 8px; }
  .tp-cartes .tp-carte-libelle { font-size: 14px; }
}
@media (max-width: 300px) {
  .tp-cartes, .tp-cartes--quatre { grid-template-columns: minmax(0, 1fr); }
}
