/* Base theme */
body {
  font-family: Arial, sans-serif;
  background-color: #0d1117;
  color: #c9d1d9;
  margin: 0;
  padding: 20px;
  text-align: center;
}

h1 {
  margin: 0.3em 0 0.2em;
}

h2 {
  color: #58a6ff;
  margin-top: 0.8em;
}

table {
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 10px;
}

td {
  padding: 10px;
  vertical-align: top;
}

.badge-box {
  width: 200px;
  padding: 10px;
  border-radius: 8px;
  background-color: #161b22;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.badge-box img {
  width: 100px;
}

.badge-box span {
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

/* Certificati: stessa dimensione visiva */
.cert-img {
  width: 400px;
  height: 283px;              /* box uniforme per tutti */
  object-fit: contain;        /* mantiene proporzioni senza deformare */
  background-color: #161b22;  /* sfondo uniforme */
  border: 1px solid #30363d;  /* bordo in tema */
  border-radius: 5px;
  margin: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Hover/click feedback per immagini certificate */
a .cert-img:hover,
.cert-img:hover {
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(88, 166, 255, 0.6);
  cursor: pointer;
  border-color: #58a6ff;
}

/* Focus state accessibile quando l'immagine è linkata */
a:focus-visible .cert-img {
  outline: 2px solid #58a6ff;
  outline-offset: 3px;
}

/* Hover leggero sui badge (opzionale, coerente col tema) */
.badge-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

a {
  color: #58a6ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

hr {
  margin: 40px 0;
  border: 1px solid #30363d;
}

/* Migliorie tabelle */
.table-compact td {
  min-width: 220px;
}

/* Responsive tablet */
@media (max-width: 1024px) {
  .cert-img {
    width: 300px;
    height: 212px;
  }
  .badge-box {
    width: 180px;
  }
}

/* Responsive mobile */
@media (max-width: 768px) {
  table, tr, td {
    display: block;
    width: 100%;
  }
  .cert-img {
    width: 90%;
    max-width: 350px;
    height: 220px;
  }
  .badge-box {
    margin: 0 auto 20px;
    width: 220px;
  }
  .table-compact {
    border-spacing: 0;
  }
}

/* Riduci animazioni per chi preferisce meno movimento */
@media (prefers-reduced-motion: reduce) {
  .cert-img,
  .badge-box {
    transition: none;
  }
}
