/* ============================================================
   LEZIA — CSS per le pagine dei CORSI
   ============================================================ */

/* ------------------------------------------------------------
   HEADER DEL CORSO — card con icona, stats, progresso, pulsanti
   ------------------------------------------------------------ */
.corso-hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  background: linear-gradient(135deg, #F5F8FF 0%, #EEF2FF 60%, #E8EDFF 100%);
  border: 1px solid #E0E7FA;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.corso-hero-main {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 0;
}

.corso-hero-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  font-size: 1.75rem;
  box-shadow: 0 4px 12px rgba(46, 111, 242, .12);
}

.corso-hero-text { min-width: 0; }

.corso-hero-text .corso-reader-back {
  margin: 0 0 .2rem;
  font-size: .8rem;
}
.corso-hero-text .corso-reader-back a {
  color: #6B7A99;
  text-decoration: none;
}
.corso-hero-text .corso-reader-back a:hover { color: #2E6FF2; }

.corso-hero-text h1 {
  margin: 0 0 .2rem;
  font-size: 1.5rem;
  line-height: 1.2;
  color: #142850;
}

.corso-hero-text .corso-reader-subtitle {
  margin: 0;
  color: #566072;
  font-size: .9rem;
}

/* Stats + pulsanti a destra */
.corso-hero-stats {
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.corso-hero-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: .8rem;
}
.corso-hero-stat-label { color: #566072; font-weight: 500; }
.corso-hero-stat-percent { color: #142850; font-weight: 700; }

.corso-hero-progress {
  height: 7px;
  background: #E0E7FA;
  border-radius: 4px;
  overflow: hidden;
}
.corso-hero-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2E9F5C, #4CD07E);
  border-radius: 4px;
  transition: width .4s ease;
}

.corso-hero-stat-meta {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  color: #566072;
}
.corso-hero-stat-meta .icon-inline { vertical-align: middle; margin-right: .15rem; }
.corso-hero-stat-sep { color: #B8C2D9; }

/* Pulsanti dentro la card */
.corso-hero-actions {
  display: flex;
  gap: .4rem;
  margin-top: .35rem;
}
.corso-hero-actions .btn {
  flex: 1;
  padding: .4rem .6rem;
  font-size: .82rem;
  border-radius: 8px;
  white-space: nowrap;
}
.corso-hero-actions .btn.is-disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Avviso */
.corso-avviso { margin-bottom: 1rem; }

/* ------------------------------------------------------------
   LAYOUT — 2 colonne: indice + contenuto
   ------------------------------------------------------------ */
.corso-reader-layout-2col {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
}

/* Contenuto: leggermente più leggibile ma non troppo stretto */
.corso-reader-layout-2col .corso-content {
  max-width: 820px;
  min-width: 0;
}

/* L'indice resta sticky */
.corso-reader-layout-2col .corso-index {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding-right: .25rem;
}

/* Container più largo solo per i corsi */
.corso-reader .wrap {
  max-width: 1200px;
}

/* Barra azioni in fondo */
.corso-actions-bottom {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: 1rem 0 0;
  margin-top: 2rem;
  border-top: 1px solid #E3E8F0;
}
.corso-actions-bottom-left   { justify-self: start; }
.corso-actions-bottom-center { justify-self: center; }
.corso-actions-bottom-right  { justify-self: end; }

.btn.is-done {
  background: #2E9F5C !important;
  color: #fff !important;
  border-color: #2E9F5C !important;
  cursor: default;
}

/* ------------------------------------------------------------
   MOBILE
   ------------------------------------------------------------ */
@media (max-width: 900px) {
  .corso-reader-layout-2col {
    grid-template-columns: 1fr;
  }
  .corso-reader-layout-2col .corso-index {
    position: static;
    max-height: none;
    border: 1px solid #E3E8F0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  .corso-reader-layout-2col .corso-content {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .corso-hero-card {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  .corso-hero-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }
  .corso-hero-text h1 { font-size: 1.25rem; }
  .corso-hero-stats { min-width: 0; }
  .corso-actions-bottom {
    grid-template-columns: 1fr;
    gap: .5rem;
  }
  .corso-actions-bottom-left,
  .corso-actions-bottom-center,
  .corso-actions-bottom-right { justify-self: stretch; }
  .corso-actions-bottom .btn { width: 100%; }
}
/* Pulsanti dentro la card dell'header: forza colori leggibili */
.corso-hero-actions .btn-outline,
.corso-hero-actions .btn-outline:visited {
  background: #fff !important;
  color: #142850 !important;
  border: 1px solid #C9D3E5 !important;
  font-weight: 700;
  font-size: 1rem;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.corso-hero-actions .btn-outline:hover {
  background: #F0F4FF !important;
  border-color: #2E6FF2 !important;
  color: #2E6FF2 !important;
}
.corso-hero-actions .btn-outline.is-disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}