/* Theme Switch per Blog HTML */
.switch {
  font-size: 14px;
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  display: inline-block;
  width: 3.5em;
  height: 3.5em;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
  z-index: 9999;
  cursor: pointer;
  border: 3px solid rgba(139, 92, 246, 0.8);
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #2a2a2a;
  transition: 0.4s;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.8em;
  width: 1.8em;
  border-radius: 50%;
  transition: 0.4s;
  transition-timing-function: cubic-bezier(0.81, -0.04, 0.38, 1.5);
  box-shadow: inset 10px -5px 0px 0px #fff;
}

.switch input:checked + .slider {
  background-color: #00a6ff;
}

.switch input:checked + .slider:before {
  box-shadow: inset 18px -5px 0px 18px #ffcf48;
}

.star {
  background-color: #fff;
  border-radius: 50%;
  position: absolute;
  width: 4px;
  transition: all 0.4s;
  height: 4px;
}

.star_1 {
  left: 60%;
  top: 25%;
}

.star_2 {
  left: 50%;
  top: 55%;
}

.star_3 {
  left: 70%;
  top: 45%;
}

.switch input:checked ~ .slider .star {
  opacity: 0;
}

.cloud {
  width: 2.5em;
  position: absolute;
  bottom: -0.3em;
  left: -0.2em;
  opacity: 0;
  transition: all 0.4s;
}

.switch input:checked ~ .slider .cloud {
  opacity: 1;
}

/* Negli articoli su desktop: 64px sopra il cerchio sommario */
.article-page .switch {
  width: 64px;
  height: 64px;
  font-size: 18px;
  left: 1rem;
  bottom: 6rem; /* Sopra il cerchio sommario che è a 1rem */
}


/* Responsive */
@media (max-width: 768px) {
  .switch {
    bottom: 1.5rem;
    left: 1.5rem;
    font-size: 13px;
  }
  
  /* Articoli: theme toggle nell'header al centro su mobile */
  .article-page .switch {
    position: fixed;
    top: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    bottom: auto;
    width: 52px;
    height: 52px;
    font-size: 15px;
    z-index: 10000;
  }
}

@media (max-width: 480px) {
  .switch {
    bottom: 1rem;
    left: 1rem;
    font-size: 12px;
  }
  
  .article-page .switch {
    top: 1rem;
    width: 48px;
    height: 48px;
    font-size: 14px;
  }
}

/* Padding minimo article body */
.article-body {
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.article-body > *:first-child {
  margin-top: 0 !important;
}

.article-body > *:last-child {
  margin-bottom: 0 !important;
}

/* Spazio minimo recommended articles */
.recommended-articles {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}
