/* Homepage: hero piattaforma (Community, Lavoro, Bandi, Turni) — usato solo da index.php root */

.home-platform-hero--below {
  padding-top: 28px;
  padding-bottom: 40px;
  margin-top: 0;
}

.home-platform-hero {
  position: relative;
  padding: 48px 6% 32px;
  min-height: 100svh;
  /* stesso "glass panel" della sezione planning */
  background: var(--glass-bg);
  backdrop-filter: blur(calc(var(--glass-blur) * 1.5));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) * 1.5));
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  overflow-x: clip;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding-bottom: 70px;
}

.home-platform-hero__head {
  max-width: 1100px;
  margin: 0 auto 28px;
  text-align: center;
}

.home-platform-hero__head h1,
.home-platform-hero__head h2 {
  font-size: clamp(1.65rem, 3.2vw, 2.65rem);
  font-weight: 800;
  line-height: 1.15;
  color: #0a1628;
  margin: 0 0 12px;
}

.home-platform-hero__head h1 .hph-accent,
.home-platform-hero__head h2 .hph-accent {
  display: inline-block;
  background: linear-gradient(90deg, #001d73, #0066cc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-platform-hero__lead {
  font-size: clamp(1rem, 1.35vw, 1.15rem);
  line-height: 1.55;
  color: #3a4556;
  max-width: 42rem;
  margin: 0 auto 20px;
}

.home-platform-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.hph-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  color: #142032;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hph-cta:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
}

/* nessun CTA "selezionato": tutti uguali */
.hph-cta--primary {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.45);
  color: #142032;
}

.hph-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #5a6570;
  letter-spacing: 0.02em;
}

.hph-scroll-hint i {
  animation: hphBounce 1.6s ease-in-out infinite;
}

@keyframes hphBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(5px);
  }
}

.home-platform-scroller {
  max-width: 1080px;
  margin: 0 auto;
  /* sempre completamente visibile nell'altezza dello schermo */
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  overflow-x: clip;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.home-platform-scroller .hph-nav {
  /* riusa stile .carousel-btn da carousel_offerte.css; qui solo posizione sopra lo slider */
  z-index: 6;
}

.home-platform-scroller .carousel-btn.prev.hph-nav {
  left: clamp(12px, 2.4vw, 28px);
}

.home-platform-scroller .carousel-btn.next.hph-nav {
  right: clamp(12px, 2.4vw, 28px);
}

.home-platform-scroller .carousel-btn.hph-nav {
  /* più in basso rispetto al centro */
  top: 58%;
  position: absolute;
}

.hph-slide-track {
  height: 100%;
  display: flex;
  /* N pannelli: default 4; con loop JS diventa 8 (4 + clone) */
  width: calc(var(--hph-loop-panels, 4) * 100%);
  transform: translate3d(var(--hph-track-x, 0%), 0, 0);
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.hph-slide-track.hph-slide-track--instant {
  transition: none !important;
}

.hph-slide-track.is-dragging {
  transition: none;
  cursor: grabbing;
}

.home-platform-strip {
  min-height: 100%;
  padding: 18px 10px 18px;
  border-bottom: none;
}

.hph-slide {
  flex: 0 0 calc(100% / var(--hph-loop-panels, 4));
  height: 100%;
  display: flex;
  align-items: center;
}

.home-platform-strip__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px 28px;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.home-platform-strip__label h2,
.home-platform-strip__label h3 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 3.3vw, 2.6rem);
  font-weight: 800;
  color: #0a1628;
  letter-spacing: -0.02em;
}

.hph-slide-title {
  overflow: hidden;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.hph-slide-title > span {
  display: inline-block;
  max-width: 100%;
  /* deve poter andare a capo quando è lungo (es. due parole) */
  white-space: normal;
  animation: hphTitleSlide 3.4s ease-in-out infinite alternate;
}

@keyframes hphTitleSlide {
  from {
    transform: translateX(0px);
  }
  to {
    transform: translateX(18px);
  }
}

.home-platform-strip__label p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #5a6570;
}

.hph-strip-link {
  display: inline-flex;
  margin-top: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0066cc;
  text-decoration: none;
  align-items: center;
  gap: 6px;
}

.hph-strip-link:hover {
  text-decoration: underline;
}

/* Preview: deve confondersi nello sfondo, senza box/pannello */
.hph-preview {
  border-radius: 16px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: hidden;
  min-height: 240px;
}

.hph-preview--blend .hph-preview__bar {
  display: none;
}

.hph-preview__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #f6f8fc, #eef3f9);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hph-preview__body {
  padding: 0;
}

/* Carosello verticale continuo */
.hph-vscroll {
  position: relative;
  height: min(58vh, 520px);
  width: 100%;
  overflow: hidden;
}

.hph-vscroll-track {
  display: grid;
  gap: 12px;
  padding: 6px 2px 6px;
  animation: hphVScroll 12s linear infinite;
}

.hph-vscroll-track--fast {
  animation-duration: 8.5s;
}

.hph-vscroll-track--slow {
  animation-duration: 14.5s;
}

.hph-vscroll-track--shift {
  animation-duration: 9.5s;
}

/* Pausa UX: hover (pointer fine), focus su link/card, touch (classe da JS) */
.hph-vscroll:focus-within .hph-vscroll-track {
  animation-play-state: paused;
}

@media (hover: hover) and (pointer: fine) {
  .hph-vscroll:hover .hph-vscroll-track {
    animation-play-state: paused;
  }
}

.hph-vscroll.hph-vscroll--paused .hph-vscroll-track {
  animation-play-state: paused;
}

@keyframes hphVScroll {
  from {
    transform: translateY(0%);
  }
  to {
    transform: translateY(-50%);
  }
}

/* Card flottanti ordinate (stile vetro come hero) */
.hph-float-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 14px 14px;
  border-radius: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(calc(var(--glass-blur) * 1.2));
  -webkit-backdrop-filter: blur(calc(var(--glass-blur) * 1.2));
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  transform: translateZ(0);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hph-float-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.hph-float-card__title {
  font-weight: 800;
  font-size: 0.98rem;
  color: #0f172a;
  line-height: 1.25;
}

.hph-float-card__meta {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #64748b;
}

/* Offerte home: titolo e prezzo stessa scala tipografica */
.hph-float-card--home-offer .hph-float-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.hph-float-card--home-offer .hph-float-card__head .hph-float-card__title,
.hph-float-card--home-offer .hph-float-card__head .hph-float-card__price {
  font-weight: 800;
  font-size: 0.98rem;
  color: #0f172a;
  line-height: 1.25;
}

.hph-float-card--home-offer .hph-float-card__title {
  flex: 1 1 140px;
  min-width: 0;
}

.hph-float-card--home-offer .hph-float-card__price {
  flex: 0 0 auto;
  white-space: nowrap;
}

.hph-float-card__meta--stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.hph-float-card__meta--stack .hph-float-card__meta-line {
  display: block;
  width: 100%;
}

/* Dots: minimali come carosello offerte (.carousel-indicators / .indicator) */
.hph-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  margin-top: 0;
  z-index: 6;
}

/* Pallini "base" grigini per contrasto (senza toccare il carosello offerte) */
.home-platform-hero .hph-dots .indicator {
  background-color: #d1d5db;
  margin-bottom: 10px;
}

.home-platform-hero .hph-dots .indicator.active {
  background-color: #004a99;
}

.hph-fake-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f5;
  font-size: 0.88rem;
}

.hph-fake-row:last-child {
  border-bottom: none;
}

a.hph-fake-row--link:hover {
  background: rgba(0, 102, 204, 0.05);
}

.hph-fake-row strong {
  display: block;
  color: #1e293b;
  font-weight: 650;
  margin-bottom: 4px;
}

.hph-fake-meta {
  font-size: 0.78rem;
  color: #64748b;
}

.hph-fake-pill {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 102, 204, 0.1);
  color: #0066cc;
}

.hph-fake-pill--amber {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

/* Community list */
.hph-community-row {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f5;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.hph-community-row:last-child {
  border-bottom: none;
}

.hph-community-row:hover {
  background: rgba(0, 102, 204, 0.04);
}

.hph-community-row__title {
  font-weight: 650;
  font-size: 0.9rem;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 4px;
}

.hph-community-row__meta {
  font-size: 0.75rem;
  color: #64748b;
}

.hph-empty {
  font-size: 0.88rem;
  color: #64748b;
  padding: 8px 0;
}

/* Shifts mini grid (richiamo demo planning) */
.hph-shift-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.hph-shift-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.hph-shift-cell.is-on {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(22, 163, 74, 0.35);
}

.hph-shift-cell.is-night {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(37, 99, 235, 0.35);
}

.hph-shift-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: #64748b;
}

.hph-shift-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hph-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
}

.hph-dot.is-on {
  background: rgba(34, 197, 94, 0.45);
  border-color: rgba(22, 163, 74, 0.5);
}

.hph-dot.is-night {
  background: rgba(59, 130, 246, 0.45);
  border-color: rgba(37, 99, 235, 0.5);
}

@media (max-width: 900px) {
  .home-platform-hero {
    padding: 36px 16px 24px;
  }

  .home-platform-scroller {
    overflow: hidden;
  }

  .home-platform-strip {
    min-height: 100%;
    padding: 18px 12px 22px;
  }

  .home-platform-strip__inner {
    grid-template-columns: 1fr;
    gap: 14px;
    max-width: 560px;
    width: 100%;
    padding: 0 6px;
  }

  .hph-preview {
    order: 2;
  }

  .home-platform-strip__label {
    order: 1;
  }

  .hph-scroll-hint {
    display: none;
  }

  .hph-slide-track {
    width: calc(var(--hph-loop-panels, 4) * 100%);
    transition-duration: 540ms;
  }

  .hph-vscroll {
    height: min(46vh, 420px);
  }

  .home-platform-scroller .carousel-btn.hph-nav {
    top: 74%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hph-scroll-hint i {
    animation: none;
  }

  .hph-vscroll-track,
  .hph-slide-title > span {
    animation: none;
  }
}
