/* Generali */
body {
  background-color: #f9f9f9;
  color: #333;
  font-family: "Times New Roman", Times, serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  font-size: 90%;
}

/* Footer */
footer {
  background-color: #333;
  color: white;
  font-size: 0.9rem;
  margin-top: 2rem;
  padding: 1rem;
  text-align: center;
}

/* Header */
header {
  background: linear-gradient(to right, #222, #444);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  color: white;
  padding: 1rem 2rem;
}

#Biografia p {
  font-size: 12pt;
}




header h1 {
  font-size: 2.2rem;
  margin: 0;
}

/* Main */
main {
  background: white;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.05);
  margin: auto;
  max-width: 1000px;
  padding: 2rem;
}

main h2 {
  border-bottom: 2px solid #ccc;
  color: #222;
  font-size: 2rem;
  margin-bottom: 1rem;
  margin-top: 2rem;
  padding-bottom: 0.5rem;
}

main h3 {
  color: #222;
  font-size: 1.6rem;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

main img[alt^="Ritratto"] {
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  float: right;
  margin: 0 0 20px 20px;
  width: 240px;
}

/* Navbar */
nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin-top: 1rem;
  padding: 0;
}

nav a {
  background-color: #555;
  border-radius: 5px;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition: background-color 0.3s;
}

nav a.active {
  background-color: #0077cc;
}

nav a:hover {
  background-color: #888;
}

.video-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.video-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 1rem;
  width: 320px;
  text-align: center;
}

.video-card iframe {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.video-card p {
  font-weight: bold;
  color: #222;
}

/* Card Orizzontale - Canale Principale */
.channel-horizontal {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 2rem auto;
  padding: 1rem;
  max-width: 800px;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.channel-horizontal:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.channel-horizontal a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.channel-logo {
  width: 120px;
  height: 120px;
  border-radius: 60px;
  object-fit: cover;
  margin-right: 1.5rem;
  flex-shrink: 0;
}

.channel-info {
  flex: 1;
}

.channel-info h3 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: #000000;
}

.channel-info p {
  margin: 0;
  font-size: 1rem;
  color: #333;
}

/* Channel Card Ridotta */
.channel-card {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 800px;
  height: 80px;
  margin: 1rem auto 2rem auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  overflow: hidden;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.channel-card:hover {
  background-color: rgba(0,0,0,0.05);
}

.channel-card a {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
  padding: 0 1rem;
}

.channel-thumb {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  margin-right: 1rem;
}

.channel-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.channel-card p {
  margin: 0;
  font-weight: bold;
  font-size: 1rem;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Figure e immagini */
figure {
  display: block;
  text-align: center;
  margin: 20px auto;
}

figure img.ritratto {
  display: block;
  margin: 0 auto;
  max-width: 250px;
  width: 100%;
  height: auto;
}

figure figcaption {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-style: italic;
  color: #555;
}

figure.ritratto-box {
  float: right;
  margin: 0 0 20px 20px;
  text-align: center;
  width: 240px;
}

figure.ritratto-box img {
  display: block;
  margin: 0 auto;
  width: 240px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

figure.ritratto-box figcaption {
  margin-top: 6px;
  font-size: 14px;
  font-style: italic;
  color: #555;
}

/* IDEE CARD (nuovo layout) */
.idee-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Card chiusa: deve “sembrare una card” */
.idee-card {
  display: grid;
  grid-template-columns: 1fr auto;   /* testo a sinistra, immagine a destra */
  grid-template-rows: auto auto;     /* riga 1: titolo+immagine, riga 2: contenuto */
  column-gap: 16px;
  row-gap: 10px;
  align-items: end;                   /* allinea il titolo alla base dell’immagine */
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 16px;
  width: 100%;
  cursor: pointer;
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}

.idee-card:hover {
  border-color: rgba(0,0,0,0.18);
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
  transform: translateY(-1px);
}

/* Titolo: in riga 1, colonna sinistra, allineato in basso */
.idee-card h3 {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  align-self: end; /* baseline del titolo ≈ base dell’immagine */
}

/* Immagine “standard” (img diretto dentro .idee-card) */
.idee-card > img {
  grid-column: 2;
  grid-row: 1;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  transition: width .25s ease, height .25s ease, transform .25s ease;
}

/* Variante “setting multistrato”: immagine avvolta in .card-right */
/* ==== FIX SPECIFICO: IDEE > "Setting multistrato" (immagine + didascalia) ==== */

/* 1) Assicura che il contenitore a destra sia sempre visibile e a destra */
.idee-card .card-right {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  /* annulla eventuali vecchie regole tipo display:none/position:absolute */
  position: static !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 2) Assicura che l'immagine sia mostrata e con dimensioni corrette */
.idee-card .card-right img {
  display: block !important;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0;
  /* annulla possibili eredità che la nascondono */
  max-width: none !important;
  max-height: none !important;
  transform: none !important;
}

/* 3) In stato espanso, l'immagine cresce un po' */
.idee-card.expanded .card-right img {
  width: 130px;
  height: 130px;
}

/* 4) Didascalia: mostrala solo quando la card è espansa, sotto l'immagine */
.idee-card .card-right .didascalia-img,
.idee-card .card-right .didascalia,
.idee-card .card-right figcaption {
  display: none;
  font-size: 12px;
  line-height: 1.2;
  color: #666;
  text-align: center;
  max-width: 140px; /* evita righe troppo lunghe, resta sotto l'immagine */
}
.idee-card.expanded .card-right .didascalia-img,
.idee-card.expanded .card-right .didascalia,
.idee-card.expanded .card-right figcaption {
  display: block;
}

/* 5) Allineamento del titolo alla base dell'immagine a destra */
.idee-card {
  display: grid;
  grid-template-columns: 1fr auto;  /* testo a sinistra, immagine a destra */
  grid-template-rows: auto auto;    /* riga1 titolo+immagine, riga2 contenuto */
  column-gap: 16px;
  row-gap: 10px;
  align-items: end;                  /* aggancia in basso la riga 1 */
}
.idee-card h3 {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  align-self: end;
}

/* 6) Contenuto collassato sotto (resta full width) */
.idee-card .idee-content {
  grid-column: 1 / -1;
  grid-row: 2;
  overflow: hidden;
  max-height: 0;
  padding: 0;
  transition: max-height .35s ease, padding .2s ease;
}
.idee-card.expanded .idee-content {
  max-height: 1800px;
  padding-top: 8px;
}
.tabella-didattica {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.tabella-didattica th,
.tabella-didattica td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}

.tabella-didattica th {
  background-color: #f5f5f5;
  font-weight: bold;
}

/* Caption immagine compatta */
.img-with-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: 15px;
  flex-shrink: 0;
}

.img-with-caption img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.didascalia-img {
  font-size: 0.9rem;
  color: #888;
  margin-top: 4px;
  font-style: italic;
  text-align: center;
  line-height: 1;
}

/* Card a due lati */
.card-left {
  flex: 1;
}

.card-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-left: 15px;
  flex-shrink: 0;
}

.card-right img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.card-right .didascalia-img {
  font-size: 0.7rem;
  color: #888;
  margin-top: 4px;
  font-style: italic;
  line-height: 1;
  text-align: center;
}

.idee-card.expanded .card-right {
  display: none;
}

