

/* ========================================
   CATALOGO E SCHEDE PROGETTO ISISLab
======================================== */


/* ========================================
   PAGINA CATALOGO
======================================== */

.projects-page {
  max-width: 1200px;
  margin: 0 auto;
}


/* ========================================
   INTRODUZIONE
======================================== */

.projects-intro {
  margin-bottom: 2rem;
}

.projects-intro h1,
.project-detail h1 {
  margin-bottom: .5rem;
}

.projects-intro p {
  color: #64748b;
  font-size: 1.08rem;
}


/* ========================================
   FILTRI CATALOGO
======================================== */

.projects-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
  background: #f5f8fa;
  border: 1px solid #dce3e8;
  border-radius: 14px;
}

.project-search-control,
.project-filter-control {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  min-width: 0;
}

.project-search-control {
  grid-column: 1 / -1;
}

.projects-filters label {
  font-weight: 650;
  color: #334155;
}

.projects-filters input[type="search"],
.projects-filters select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: .7rem .85rem;
  border: 1px solid #cbd5df;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font: inherit;
}

.projects-filters input:focus,
.projects-filters select:focus {
  outline: 2px solid #24547a;
  outline-offset: 2px;
  border-color: #24547a;
}

.projects-clear {
  justify-self: start;
  align-self: end;
  min-height: 46px;
  padding: .55rem 1rem;
  border: 1px solid #9aa9b7;
  border-radius: 8px;
  background: #fff;
  color: #243447;
  font: inherit;
  cursor: pointer;
  transition: background .18s ease;
}

.projects-clear:hover {
  background: #eaf0f4;
}

.projects-count {
  margin: 1.2rem 0;
  color: #64748b;
}


/* ========================================
   GRUPPI E GRIGLIA PROGETTI
======================================== */

.project-year-group {
  margin: 2rem 0 2.5rem;
}

.project-year-heading {
  margin: 0 0 1rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid #d8e0e6;
  font-size: 1.8rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}


/* ========================================
   CARD PROGETTO
======================================== */

.project-card {
  --program-color: #64748b;

  min-width: 0;
  overflow: hidden;
  border: 1px solid #d8e0e6;
  border-left: 6px solid var(--program-color);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 2px 7px rgb(15 23 42 / 5%);
  transition: transform .18s ease, box-shadow .18s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgb(15 23 42 / 10%);
}

.project-card-link {
  display: flex;
  height: 100%;
  flex-direction: column;
  padding: 1.2rem;
  color: inherit;
  text-decoration: none;
}

.project-card-link:hover {
  color: inherit;
  text-decoration: none;
}


/* ========================================
   LOGHI NELLE CARD
   Due loghi sopra, terzo centrato sotto
======================================== */

.project-card-logos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 78px;
  align-items: center;
  justify-items: center;
  gap: 8px 20px;
  width: 100%;
  min-height: 165px;
  margin-bottom: 12px;
  padding: 8px 12px;
  box-sizing: border-box;
}

.project-card-logos img {
  display: block;
  width: 100%;
  max-width: 150px;
  height: 75px;
  min-width: 0;
  object-fit: contain;
  object-position: center;
  justify-self: center;
}

/* Terzo logo centrato */

.project-card-logos img:nth-child(3) {
  grid-column: 1 / -1;
  max-width: 190px;
  height: 65px;
}

/* Un solo logo */

.project-card-logos img:only-child {
  grid-column: 1 / -1;
  max-width: 210px;
  height: 100px;
}

/* Due loghi affiancati */

.project-card-logos img:first-child:nth-last-child(2),
.project-card-logos img:first-child:nth-last-child(2) ~ img {
  max-width: 175px;
  height: 90px;
}


/* ========================================
   CONTENUTO CARD
======================================== */

.project-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.project-card h3 {
  margin: .2rem 0 .6rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.project-subtitle {
  margin: 0 0 .55rem;
  color: #475569;
  font-weight: 550;
}

.project-summary {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 1rem;
  color: #64748b;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}


/* ========================================
   TAG E CATEGORIE
======================================== */

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .2rem 0 .8rem;
}

.project-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: .32rem .65rem;
  border: 1px solid #d4dbe2;
  border-radius: 999px;
  font-size: .84rem;
  line-height: 1.25;
}

/* Programma di finanziamento */

.project-program {
  border-color: var(--program-color, #64748b);
  color: var(--program-color, #64748b);
  font-weight: 700;
}

/* Categorie colorate */

.project-type {
  border-color: var(--type-color, #64748b);
  background: color-mix(in srgb, var(--type-color, #64748b) 10%, white);
  color: var(--type-color, #64748b);
  font-weight: 600;
}


/* ========================================
   FOOTER CARD
======================================== */

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-top: auto;
  padding-top: .5rem;
  color: #64748b;
  font-size: .88rem;
}

.project-read-more {
  color: #24547a;
  font-weight: 650;
}

.projects-no-results {
  padding: 1.5rem;
  border: 1px dashed #aab7c4;
  border-radius: 10px;
  color: #64748b;
  text-align: center;
}


/* ========================================
   DETTAGLIO PROGETTO
======================================== */

.project-detail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 15px 50px;
}

.project-detail-header {
  margin-bottom: 30px;
  text-align: center;
}

.project-detail-header h1 {
  margin: 20px 0 10px;
  line-height: 1.2;
}

.project-detail-subtitle {
  margin-bottom: 20px;
  color: #64748b;
  font-size: 1.1rem;
}


/* ========================================
   LOGHI PROGETTO
======================================== */

/* ========================================
   LOGHI PROGETTO - PAGINA DETTAGLIO
======================================== */

.project-detail-logos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  max-width: 100%;
  margin: 10px auto 30px;
}

.project-detail-logos img {
  display: block;
  width: 100%;
  height: 120px;
  padding: 10px;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
}


/* ========================================
   RIQUADRO UNICO DELL'INTERO PROGETTO
======================================== */

.project-main-box {
  width: 100%;
  box-sizing: border-box;
  margin: 25px 0;
  padding: 35px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 3px 12px rgb(15 23 42 / 5%);
}


/* ========================================
   INFORMAZIONI PRINCIPALI
======================================== */

.project-information {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 15px;
  margin: 30px 0;
}

.project-info-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.project-info-label {
  color: #64748b;
  font-size: .85rem;
}

.project-info-tile strong {
  color: #263449;
  font-size: 1rem;
  line-height: 1.5;
}


/* ========================================
   BLOCCO DESCRITTIVO INTERNO
   Nessun secondo riquadro bianco
======================================== */

.project-description-box {
  margin: 25px 0 0;
  padding: 25px 0 0;
  background: transparent;
  border: 0;
  border-top: 1px solid #e2e8f0;
  border-radius: 0;
  box-shadow: none;
  line-height: 1.75;
}

/* Titolo e descrizione */

.project-description-intro p {
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.75;
}

/* Contenuto Markdown */

.project-description-content p {
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.75;
}

/* Separazione tra descrizione e contenuto */

.project-description-content.has-intro {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

/* Titoli */

.project-description-box h2 {
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.project-description-content h2:not(:first-child) {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.project-description-content h3,
.project-description-content h4 {
  text-align: left;
}

/* Elenchi */

.project-description-content ul,
.project-description-content ol,
.project-description-content li,
.project-description-section ul,
.project-description-section ol,
.project-description-section li {
  text-align: left;
}

/* Immagini */

.project-description-box img {
  max-width: 100%;
  height: auto;
}


/* ========================================
   PARTNER E COLLEGAMENTI
======================================== */

.project-description-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.project-description-section h2 {
  margin: 0 0 18px;
}

.project-detail-links a {
  overflow-wrap: anywhere;
}


/* ========================================
   NAVIGAZIONE
======================================== */

.project-detail-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 35px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.project-detail-navigation a {
  font-weight: 650;
}


/* ========================================
   ELEMENTI NASCOSTI
======================================== */

[hidden] {
  display: none !important;
}


/* ========================================
   RESPONSIVE - TABLET
======================================== */

@media (max-width: 950px) {

  .projects-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}


/* ========================================
   RESPONSIVE - SMARTPHONE
======================================== */

@media (max-width: 650px) {

  .projects-filters {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .project-search-control {
    grid-column: auto;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-information {
    grid-template-columns: 1fr;
  }

  /* Riquadro unico */

  .project-main-box {
    padding: 20px;
  }

  .project-description-box {
    padding-top: 20px;
  }

  /* Loghi nelle card */

  .project-card-logos {
    grid-auto-rows: 65px;
    min-height: 140px;
    gap: 6px 12px;
    padding: 5px;
  }

  .project-card-logos img {
    max-width: 115px;
    height: 62px;
  }

  .project-card-logos img:nth-child(3) {
    max-width: 155px;
    height: 55px;
  }

  .project-card-logos img:only-child {
    max-width: 165px;
    height: 80px;
  }

  .project-card-logos img:first-child:nth-last-child(2),
  .project-card-logos img:first-child:nth-last-child(2) ~ img {
    max-width: 140px;
    height: 72px;
  }

 
  /* Loghi nella scheda - mobile */

  .project-detail-logos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .project-detail-logos img {
    height: 85px;
    padding: 5px;
  }

}

/* ========================================
   LEGENDA CATEGORIE A COMPARSA
======================================== */

.project-legend {
  margin: -0.5rem 0 1.2rem;
}

.project-legend summary {
  display: inline-block;
  padding: .55rem .9rem;
  border: 1px solid #d4dbe2;
  border-radius: 8px;
  color: #24547a;
  font-weight: 650;
  cursor: pointer;
  background: #fff;
}

.project-legend summary:hover {
  background: #f5f8fa;
}

.project-legend-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .8rem 1.2rem;
  margin-top: .8rem;
  padding: 1rem 1.2rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.project-legend-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: #334155;
  font-size: .9rem;
}

.project-legend-dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}


/* Menu personalizzato del programma di finanziamento */

.project-program-native {
  display: none !important;
}

.project-program-dropdown {
  position: relative;
  width: 100%;
}

.project-program-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-program-chevron {
  margin-left: 10px;
  color: #64748b;
}

.project-program-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 100;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.10);
}

.project-program-options[hidden] {
  display: none;
}

.project-program-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #334155;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-program-option:hover,
.project-program-option.selected {
  background: #f1f5f9;
}

.project-program-color {
  flex: 0 0 3px;
  width: 3px;
  height: 19px;
  border-radius: 2px;
  background: var(--program-option-color, #64748b);
}
