.carousel-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  background: #f9f9f9;
  padding: 20px 0;
}

.carousel-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  animation: scrollCarousel 40s linear infinite;
  width: max-content;
  min-width: 100vw;
}

@keyframes scrollCarousel {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.carousel-track > * {
  flex: 0 0 auto;
  width: 320px;
  height: 480px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* BANNER */
.banner-box {
  width: 320px;
  height: 480px;
  padding: 0;
  border: none;
  box-sizing: border-box;
  flex-shrink: 0;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

.banner-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}

/* CARD PROFILO */
.profile-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 16px;
/*  width: 100%; */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s ease;
}

.profile-card:hover {
  transform: scale(1.02);
}

.carousel-photo {
  width: 100%;
  max-width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #4a90e2;
  margin-bottom: 12px;
}

.button-link {
  background-color: #4a90e2;
  color: white;
  padding: 10px 14px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  margin-top: 10px;
}

.button-link:hover {
  background-color: #357ABD;
}

/* LIKE/FOLLOW */
.like-follow-block {
  margin-top: 10px;
  text-align: center;
}

.like-follow-block span {
  display: inline-block;
  margin: 6px 0;
  font-size: 15px;
  font-weight: bold;
}

.like-btn,
.follow-btn {
  margin: 5px 4px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
  transition: background 0.3s, transform 0.2s;
  background: linear-gradient(45deg, #4a90e2, #357ABD);
  color: white;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.like-btn:hover,
.follow-btn:hover {
  background: linear-gradient(45deg, #357ABD, #2c6ecb);
  transform: translateY(-1px);
}

.like-btn:disabled,
.follow-btn:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- Descrizione: max 2 righe con ellissi + tipografia elegante --- */
.public-profile-card .worker-desc,
.profile-card .worker-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* Safari/Chrome/Edge */
  line-clamp: 2;              /* sintassi nuova (progressive) */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;

  /* fallback “visivo” se il browser ignora line-clamp */
  line-height: 1.35;
  max-height: calc(1.35em * 2);

  /* Tipografia più adatta alla descrizione */
  font: 500 0.95rem/1.35 ui-serif, Georgia, "Times New Roman", serif;
  letter-spacing: .1px;
  color: #1f2937;

  /* Testo ben formattato: giustificato con ultima riga centrata */
  text-align: justify;
  text-align-last: center;

  /* Migliora spezzatura e gestione parole lunghe */
  hyphens: auto;
  word-break: break-word;

  /* Centra otticamente il blocco dentro la card */
  margin: 6px auto 0;
  max-width: 90%;
}

/* --- Mantieni i bottoni sempre in basso, anche con testi lunghi --- */
.public-profile-card,
.profile-card {
  display: flex;
  flex-direction: column;
}

.public-profile-card .like-follow-block,
.profile-card  .like-follow-block {
  margin-top: auto;
}

/* MOBILE E TABLET */
@media (max-width: 768px) {
  .carousel-track > * {
    width: 85vw;
    max-width: 360px;
    min-width: 280px;
    height: 480px;
    margin-right: 16px;
  }

  .banner-box {
    width: 85vw;
    height: 480px;
  }

  .like-btn,
  .follow-btn {
    width: 100%;
    font-size: 16px;
  }

  .banner-box img {
    border-radius: 14px;
    height: 100%;
    object-fit: cover;
  }
}

/* Forza layout colonna senza distribuire lo spazio tra i figli */
.profile-card {
  justify-content: flex-start; /* sovrascrive l’eventuale space-between ereditato */
}

/* Ancorare il blocco bottoni in fondo alla card */
.profile-card .interactions {
  margin-top: auto;   /* questo spinge il wrapper dei bottoni in basso */
  width: 100%;
}

/* Descrizione: 2 righe con ellissi + tipografia/impaginazione */
.profile-card .worker-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;

  /* fallback visuale se line-clamp non è supportato */
  line-height: 1.35;
  max-height: calc(1.35em * 2);

  /* tipografia più elegante */
  font: 500 0.95rem/1.35 ui-serif, Georgia, "Times New Roman", serif;
  letter-spacing: .1px;
  color: #1f2937;

  /* buona resa del testo */
  text-align: justify;
  text-align-last: center;
  hyphens: auto;
  word-break: break-word;

  /* centratura ottica dentro la card */
  margin: 6px auto 0;
  max-width: 90%;
}

/* Avatar circolare con cornice blu nelle card del carosello */
.public-profile-card .worker-avatar,
.profile-card .worker-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 8px auto 10px;
  border: 8px solid #4a90e2;
  box-shadow: 0 0 8px rgba(74,144,226,0.35);
}