/* ── Dettaglio Progetto ── */
.pd { font-family: sans-serif; }

/* Hero */
.pd-hero {
  background: #f0f4f8;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Avatar iniziali */
.pd-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: #B5D4F4;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  color: #0C447C;
  flex-shrink: 0;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
}

.pd-hero-body { flex: 1; min-width: 0; }

/* Badge fase */
.pd-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.pd-badge--fase-1,
.pd-badge--finanziato { background: #E6F1FB; color: #185FA5; }
.pd-badge--fase-2,
.pd-badge--in-corso   { background: #FEF3E2; color: #854F0B; }
.pd-badge--concluso   { background: #E8F5E9; color: #2E7D32; }

/* Titolo e claim */
.pd-title {
  font-size: 28px; font-weight: 900;
  color: #0d1f30;
  line-height: 1.2;
  margin: 0 0 6px;
}
.pd-claim {
  font-size: 15px;
  color: #5a6a78;
  margin: 0 0 12px;
  line-height: 1.6;
}

/* Tag */
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-tag {
  font-size: 11px; font-weight: 500;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid #d0d8e0;
  color: #5a6a78;
}
.pd-tag--blue   { background: #E6F1FB; color: #0C447C; border-color: #B5D4F4; }
.pd-tag--amber  { background: #FAEEDA; color: #633806; border-color: #FAC775; }

/* Grid principale */
.pd-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 768px) {
  .pd-grid { grid-template-columns: 1fr; }
  .pd-hero { flex-direction: column; align-items: center; text-align: center; }
  .pd-tags { justify-content: center; }
}

/* Colonna principale */
.pd-main { display: flex; flex-direction: column; gap: 14px; }

.pd-main  {
  position: relative;
  overflow: hidden; /* oppure overflow: clip */
}

/* Card */
.pd-card {
  background: #ffffff;
  border: 0.5px solid #e5e5e3;
  border-radius: 12px;
  padding: 18px 20px;
  box-sizing: border-box;
  /* Fix Chrome */
  position: relative;
  z-index: 0;
  transform: translateZ(0);
  will-change: transform;
}
.pd-card-title {
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9a9892;
  margin: 0 0 10px;
}
.pd-card p, .pd-card div {
  font-size: 14px;
  color: #0d1f30;
  line-height: 1.7;
}

/* Sidebar */
.pd-sidebar { display: flex; flex-direction: column; gap: 14px; }

/* Info row */
.pd-info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 0.5px solid #e5e5e3;
}
.pd-info-row:last-child { border-bottom: none; }
.pd-info-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: #f0f4f8;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.pd-info-label {
  font-size: 11px; color: #9a9892;
  margin: 0 0 2px;
}
.pd-info-value {
  font-size: 13px; font-weight: 600;
  color: #0d1f30;
  margin: 0;
}

.field-item {
  font-weight: 600;
}

/* Galleria */
.pd-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-gallery img {
  width: calc(33% - 6px);
  border-radius: 8px;
  object-fit: cover;
  aspect-ratio: 4/3;
}

/* Grid team */
.pd-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

/* Card singolo membro */
.team-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0f4f8;
  border-radius: 10px;
  padding: 12px;
}

/* Avatar */
.team-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #B5D4F4;
  color: #0C447C;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
}

/* Nome e ruolo */
.team-name {
  font-size: 14px;
  font-weight: 700;
  color: #0d1f30;
  margin: 0 0 2px;
}
.team-role {
  font-size: 12px;
  color: #5a6a78;
  margin: 0;
}

/* Lista documenti */
.pd-docs-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Singolo documento */
.pd-doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid #e5e5e3;
}
.pd-doc-item:last-child { border-bottom: none; }

/* Icona documento */
.pd-doc-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: #E6F1FB;
  color: #185FA5;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* Corpo: nome + dimensione */
.pd-doc-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pd-doc-link {
  font-size: 13px;
  font-weight: 600;
  color: #0d1f30;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd-doc-link:hover { color: #185FA5; text-decoration: underline; }
.pd-doc-size {
  font-size: 11px;
  color: #9a9892;
}

/* Bottone download */
.pd-doc-download {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 0.5px solid #e5e5e3;
  display: flex; align-items: center; justify-content: center;
  color: #5a6a78;
  font-size: 16px;
  flex-shrink: 0;
  text-decoration: none;
  transition: all .15s;
}
.pd-doc-download:hover {
  background: #E6F1FB;
  border-color: #B5D4F4;
  color: #185FA5;
}




/* ═══════════════════════════════════════════════════════════════
   CAROUSEL - Stili corretti
   ═══════════════════════════════════════════════════════════════ */

/* Container principale */
.pd-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 12px;
}

/* Track scorrevole */
.pd-carousel-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #B5D4F4 transparent;
  -webkit-overflow-scrolling: touch;
}

.pd-carousel-track::-webkit-scrollbar {
  height: 6px;
}

.pd-carousel-track::-webkit-scrollbar-track {
  background: transparent;
}

.pd-carousel-track::-webkit-scrollbar-thumb {
  background: #B5D4F4;
  border-radius: 3px;
}

/* Singolo item - DIMENSIONI CORRETTE */
.pd-carousel-item {
  flex: 0 0 200px;  /* Larghezza fissa, più piccola */
  scroll-snap-align: start;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: scale(0.96);
  background: #f0f4f8; /* Fallback se img non carica */
}

/* immagine attiva */
.pd-carousel-item.active {
  opacity: 1;
  transform: scale(1);
  filter: brightness(1.05);
border: solid red 2px;
}

.pd-carousel-track {
  align-items: center;
}

.pd-carousel-item:hover {
  transform: scale(1.03);
}

.pd-carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay con caption */
.pd-carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 8px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pd-carousel-item:hover .pd-carousel-overlay {
  opacity: 1;
}

.pd-carousel-caption {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
}

/* Badge contatore */
.pd-carousel-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

/* ═══════════════════════════════════════════════════════════════
   CONTROLLI CAROUSEL - Footer corretto
   ═══════════════════════════════════════════════════════════════ */

.pd-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0;
}

/* Dots */
.pd-carousel-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pd-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d0d8e0;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  margin: 0;
}

.pd-carousel-dot.active {
  width: 20px;
  border-radius: 4px;
  background: #0C447C;
}

/* Frecce */
.pd-carousel-arrows {
  display: flex;
  gap: 6px;
  padding-left: 10px;
  padding-right: 10px;
}

.pd-carousel-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f4f8;
  border: none;
  color: #0C447C;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.pd-carousel-arrow:hover {
  background: #0C447C;
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   MINI THUMBNAILS
   ═══════════════════════════════════════════════════════════════ */

.pd-carousel-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.pd-carousel-thumbs::-webkit-scrollbar {
  display: none;
}

.pd-carousel-thumb {
  flex: 0 0 49px;
  height: 38px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  scroll-snap-align: start;
}

.pd-carousel-thumb.active,
.pd-carousel-thumb:hover {
  opacity: 1;
  border-color: #0C447C;
}

.pd-carousel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ══════════════════════════════════════════════════
   LIGHTBOX — immagine a dimensioni reali
   ══════════════════════════════════════════════════ */
.pd-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}
.pd-lightbox.active { display: flex; }

/* Wrap immagine: occupa tutto lo spazio disponibile */
.lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  /*overflow: hidden;*/
  overflow: visible;
}

/* Immagine: dimensioni reali, ridimensionata solo se necessario */
.lightbox-img {
  /*max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;*/
  max-width: 95vw;
  max-height: 85vw;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 16px; right: 20px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

.lightbox-caption {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-family: sans-serif;
  margin: 0;
  text-align: center;
  max-width: 600px;
}

.pd-lightbox-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}
.pd-lightbox-nav button {
  background: rgba(255,255,255,.15);
  border: none; color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  transition: background .15s;
}
.pd-lightbox-nav button:hover { background: rgba(255,255,255,.3); }

.lightbox-counter {
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-family: sans-serif;
  min-width: 60px;
  text-align: center;
}

/* Thumbnails */
.pd-lightbox-thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90vw;
  flex-shrink: 0;
}
.pd-lightbox-thumbs img {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: .45;
  border: 2px solid transparent;
  transition: opacity .15s, border-color .15s;
}
.pd-lightbox-thumbs img:hover { opacity: .75; }
.pd-lightbox-thumbs img.active {
  opacity: 1;
  border-color: #fff;
}

.progetto-video {
  margin: 1.5rem 0;
}

.progetto-video__label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
  margin: 0 0 10px;
}

.progetto-video__card {
  border: 0.5px solid var(--color-border-secondary);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(24, 95, 165, 0.10);
  background: var(--color-background-primary);
}

.progetto-video__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.progetto-video__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.progetto-video__footer {
	padding: 12px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-top: 0.5px solid var(--color-border-tertiary);
	font-size: 13px;

    	background-color: rgba(31,36,51, 0.5);
	color: #ffffff;
  	font-weight: bold;
}

/* Responsive */
@media (max-width: 600px) {
  .pd-lightbox { padding: 12px; gap: 8px; }
  .pd-lightbox-thumbs { display: none; }
  .pd-lightbox-nav button { padding: 6px 14px; font-size: 18px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .pd-carousel-item {
    flex: 0 0 160px;
  }
  
  .pd-carousel-overlay {
    opacity: 1;
    padding: 20px 6px 6px;
  }
  
  .pd-carousel-caption {
    font-size: 11px;
  }
  
  .pd-carousel-thumbs {
    display: none;
  }
}

@media (max-width: 480px) {
  .pd-carousel-item {
    flex: 0 0 140px;
    aspect-ratio: 1;
  }
}