.grid-section {
  margin-top: 2.5rem;
}

.grid-title {
  margin: 0 0 1rem;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
}

.grid-container {
  padding: 1rem 1rem 1rem;
  background: var(--colorelogo);
  border-radius: var(--radius-md);
  border: var(--bordo-all);
      box-shadow: var(--shadow-soft);
}

.cards-wrapper {
  display: grid;
   grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1rem;
  width: 100%;
 }

@media (min-width: 1200px) {
  .cards-wrapper {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.content-card {
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: var(--grad-schede);
  border: var(--bordo-all);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  box-sizing: border-box;
}

.content-card a,
.content-card button {
  margin-top: auto;
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  text-align: left;
  color: var(--text-muted);
  width: 100%;
  border-bottom: 1px solid #79bfd4;
}

.card-body {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: start;
  min-height: 80px;
}

.icon-png {
  width: 80px;
  height: 80px;
  background-color: #01426d;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
  shape-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  filter: contrast(1.05) brightness(0.98);
  will-change: transform, mask-image, -webkit-mask-image;
}

.icon-png.original {
  background-color: transparent;
  -webkit-mask-image: none;
  mask-image: none;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.card-text p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: justify;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  padding-top: 0.1rem;
}

.card-footer a {
  color: var(--text-main);
  text-decoration: none !important;
}

.card-footer a:hover {
  color: var(--link-over);
  text-decoration: underline !important;
}


.read-more {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: bold;
  letter-spacing: 0.05em;
  transition: opacity 0.3s ease;
}

.read-more:hover {
  text-decoration: underline !important;
  opacity: 0.8;
  color: var(--danger) !important;
}


/* --- STILI ORIGINALI INVARIATI --- */
.table-container {
  margin: 1.5rem 0;
  border-radius: 8px;
  border: var(--bordo-all);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.table-container::-webkit-scrollbar {
  display: none;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(13, 37, 92, 0.2);
  color: #fff;
  table-layout: auto;
  min-width: 0;
}

.custom-table th,
.custom-table td {
  padding: 12px 15px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  border: 1px solid rgba(6, 106, 206, 0.3);
}

.custom-table th {
  background: rgba(48, 181, 185, 0.2);
  color: var(--text-main);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.custom-table td:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Le larghezze percentuali si attivano solo su schermi grandi */
@media (min-width: 601px) {
  .custom-table th:nth-child(1),
  .custom-table td:nth-child(1) {
    width: 30%;
  }

  .custom-table th:nth-child(2),
  .custom-table td:nth-child(2) {
    width: 35%;
  }

  .custom-table th:nth-child(3),
  .custom-table td:nth-child(3) {
    width: 35%;
  }
}

/* --- ADATTAMENTO MOBILE (Versione precedente corretta) --- */
@media (max-width: 600px) {
  .custom-table,
  .custom-table thead,
  .custom-table tbody,
  .custom-table tr, 
  .custom-table th, 
  .custom-table td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Testo centrato */
  .custom-table th,
  .custom-table td {
    text-align: center;
  }

  /* ELIMINAZIONE BORDI DUPLICATI */
  .custom-table th,
  .custom-table td {
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid rgba(6, 106, 206, 0.3);
  }

  /* Ripristina la linea superiore in cima alla prima cella th della tabella */
  .custom-table thead tr:first-child th:first-child {
    border-top: 1px solid rgba(6, 106, 206, 0.3);
  }

  /* CORREZIONE: Elimina lo spazio vuoto tra l'intestazione e i dati */
  .custom-table thead {
    margin-bottom: 0 !important;
  }
  .custom-table tbody {
    margin-top: 0 !important;
  }
}
