/* STILE BLOCCO TESTO HOMEPAGE */

.homepage-title {
  text-align: center;
}

.homepage-content {
  column-count: 2;
  column-gap: 40px;
  column-rule: 1px solid #e5e5e5;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
}

.homepage-content h1,
.homepage-content h2,
.homepage-content h3 {
  break-inside: avoid;
  color: #0b5fa4;
}

.homepage-content .cta {
  background: #0b5fa4;
  color: #fff;
  padding: 12px 18px;
  display: inline-block;
  text-decoration: none;
  border-radius: 4px;
}

/* Responsività */
@media (max-width: 768px) {
  .homepage-content {
    column-count: 1;
    column-gap: 0;
    column-rule: none;
  }
}

/* Box Approfondimento Blog */

#box-approfondimento {
   border: 1px solid #e8b92347;
   padding: 1.2em;
   border-radius: 8px;
   background: linear-gradient(135deg, #fff9e6 0%, #f5f0d6 100%);
   margin: 1.5em 0;
   box-shadow: 0 2px 8px rgba(232, 185, 35, 0.15);
   position: relative;
}


#box-approfondimento strong {
   color: #b8860b;
   font-weight: 500;
   display: inline-block;
   margin-bottom: 8px;
}

/* Box Curiosità Blog */
#box-curiosita {
   border: 1px solid #2196f347;
   padding: 1.2em;  /* ← AGGIUNGI QUESTA RIGA */
   border-radius: 8px;
   background: linear-gradient(135deg, #e6f7ff 0%, #d6eef5 100%);
   margin: 1.5em 0;
   box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
   position: relative;
}

#box-curiosita strong {
   color: #1565c0;
   font-weight: 500;
   display: inline-block;
   margin-bottom: 8px;
}

/* INDICE CONTENUTI BLOG */
.table-of-content, 
details.table-of-content {
  background: linear-gradient(135deg, #f8fafb 0%, #f1f5f7 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  margin: 20px 0;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

/* ===== TABLE OF CONTENT NORMALE (SEMPRE VISIBILE) ===== */
.table-of-content:not(details) {
  padding: 20px;
  max-width: 620px;
}

.table-of-content:not(details)::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4, #0891b2);
}

/* ===== TABLE OF CONTENT COLLASSABILE (DETAILS) ===== */
details.table-of-content {
  width: fit-content;
  min-width: 280px;
}

details.table-of-content[open] {
  width: auto;
  max-width: 620px;
}

/* Intestazione clickable - supporta sia summary diretto che con strong */
details.table-of-content > summary {
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  color: #0f172a;
  font-size: 1rem;
  list-style: none;
  user-select: none;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
  margin: 0;
}

/* Se c'è un strong dentro summary, mantiene lo stesso stile */
details.table-of-content > summary strong {
  font-weight: inherit;
}

/* Icona freccia */
details.table-of-content > summary::after {
  content: '▼';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  color: #64748b;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

details.table-of-content[open] > summary::after {
  content: '▲';
}

/* Hover effects per summary */
details.table-of-content > summary:hover {
  background: rgba(14, 165, 233, 0.05);
  transform: translateY(-1px);
}

details.table-of-content > summary:hover::after {
  color: #0ea5e9;
  transform: translateY(-50%) scale(1.1);
}

/* Rimuove triangolino nativo del browser */
details.table-of-content > summary::-webkit-details-marker {
  display: none;
}

/* Contenuto quando aperto - gestisce sia nav diretto che wrappato */
details.table-of-content > nav,
details.table-of-content > .toc-content,
details.table-of-content .table-of-content {
  padding: 0 18px 18px 18px;
}

/* Se c'è un nav.table-of-content dentro details, rimuove padding duplicato */
details.table-of-content nav.table-of-content {
  padding: 0 0 18px 0;
  margin: 0;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

details.table-of-content nav.table-of-content::before {
  display: none;
}

/* ===== STILI LISTE (CONDIVISI) ===== */
.table-of-content ul,
details.table-of-content ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.table-of-content li,
details.table-of-content li {
  margin: 0 0 4px 0;
  line-height: 1.3;
  position: relative;
}

.table-of-content li a,
details.table-of-content li a {
  text-decoration: none;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  word-break: break-word;
}

/* Pallini prima dei link */
.table-of-content li a::before,
details.table-of-content li a::before {
  content: '';
  width: 5px;
  height: 5px;
  background: #cbd5e1;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

/* Hover effects per i link */
.table-of-content li a:hover,
details.table-of-content li a:hover {
  background: rgba(14, 165, 233, 0.08);
  transform: translateX(2px);
}

.table-of-content li a:hover::before,
details.table-of-content li a:hover::before {
  background: #0ea5e9;
  transform: scale(1.2);
}

/* ===== SOTTOLISTE ===== */
.table-of-content ul ul,
details.table-of-content ul ul {
  margin-top: 2px;
  margin-bottom: 4px;
  padding-left: 14px;
  position: relative;
}

.table-of-content ul ul li a,
details.table-of-content ul ul li a {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 400;
  padding: 4px 10px;
}

.table-of-content ul ul li a::before,
details.table-of-content ul ul li a::before {
  width: 3px;
  height: 3px;
  background: #cbd5e1;
}

.table-of-content ul ul li a:hover,
details.table-of-content ul ul li a:hover {
  color: #334155;
}

/* ===== STILI SPECIFICI PER TITOLI PRINCIPALI ===== */
.table-of-content > ul > li > a,
details.table-of-content nav > ul > li > a,
details.table-of-content .toc-content > ul > li > a,
details.table-of-content .table-of-content > ul > li > a {
  color: #0073aa !important;
  font-size: 0.95rem !important;
  letter-spacing: -0.01em;
}

/* STILI SPECIFICI PER SOTTOTITOLI */
.table-of-content > ul > li > ul > li > a,
details.table-of-content nav > ul > li > ul > li > a,
details.table-of-content .toc-content > ul > li > ul > li > a,
details.table-of-content .table-of-content > ul > li > ul > li > a {
  color: #4a6f85 !important;
  font-size: 0.95rem !important;
  line-height: 1.3;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .table-of-content:not(details),
  details.table-of-content[open] {
    max-width: 100%;
    margin: 16px 0;
  }
  
  .table-of-content:not(details) {
    padding: 16px;
  }
  
  details.table-of-content {
    min-width: 200px;
  }
  
  details.table-of-content > nav,
  details.table-of-content > .toc-content,
  details.table-of-content .table-of-content {
    padding: 0 16px 16px 16px;
  }
  
  details.table-of-content nav.table-of-content {
    padding: 0 0 16px 0;
  }
  
  .table-of-content li a,
  details.table-of-content li a {
    font-size: 0.85rem;
    padding: 5px 8px;
  }
  
  .table-of-content ul ul,
  details.table-of-content ul ul {
    padding-left: 10px;
  }
  
  .table-of-content li a::before,
  details.table-of-content li a::before {
    margin-right: 8px;
  }
}