/* STILI RESPONSIVE PER ARTICOLO */

/* Menu hamburger per dispositivi mobili */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  padding: 0;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* Stili per la navigazione - Indicatore pagina corrente */
.main-nav .current-page {
  color: var(--color-muted);
  position: relative;
  cursor: default;
  pointer-events: none;
  font-weight: 700;
}

.main-nav .current-page::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 3.5px;
  background-color: var(--color-muted);
}

.nav-close {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: #333;
  cursor: pointer;
  z-index: 1001;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.nav-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
  transform: scale(1.1);
}

.nav-close span {
  line-height: 1;
  display: block;
  margin-top: -2px;
}

/* Media queries per la responsività */
@media (max-width: 1024px) {

  /* iPad e tablet */
  .container {
    padding: 15px;
  }

  .jolly-btn {
    padding: 10px 20px;
    margin-left: 0.25rem;
  }

  .cards-grid {
    grid-template-columns: repeat(1fr);
    gap: 20px;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-sub {
    font-size: 1.2rem;
  }

  /* Articolo container tablet */
  .article-container {
    flex-direction: column;
  }

  .article-toc {
    display: none;
  }

  .toc-toggle {
    display: block;
  }

  .article-toc.mobile-active {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    max-width: none;
    max-height: none;
    padding: 2rem;
  }

  .article-toc.mobile-active .toc-content {
    background: rgba(255, 255, 255, 0.95);
    max-width: 400px;
    margin: 0 auto;
    max-height: 80vh;
    overflow-y: auto;
    backdrop-filter: blur(5px);
  }

  .article-content {
    max-height: none;
    overflow-y: visible;
    order: 2;
  }

  .article-sidebar {
    max-width: 100%;
    order: 3;
  }

  .comments-section {
    order: 4;
  }
}

@media (max-width: 768px) {

  /* Dispositivi mobili */

  .jolly-btn {
    padding: 0.25rem 0.5rem;
    margin-left: 1rem;
    font-size: 0.75rem;
  }

  .site-title {
    font-size: 22px;
  }

  .brand img {
    width: 40px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-close {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 50%;
    height: 100vh;
    background: linear-gradient(135deg, rgb(254, 199, 81) 0%, rgb(106, 178, 230) 100%);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    padding-top: 80px;
  }

  .main-nav a {
    font-weight: 700;
  }

  .main-nav.active {
    right: 0;
  }

  .main-nav ul {
    flex-direction: column;
    padding: 0 20px;
  }

  .main-nav li {
    margin: 15px 0;
  }

  .header-inner {
    position: relative;
  }

  .articoli {
    border-top-left-radius: 100px;
    border-top-right-radius: 25px;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 100px;
    border-bottom: 25px solid #f9f9f9;
    border-top: 25px solid #f9f9f9;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-sub {
    font-size: 1rem;
  }

  .chi-siamo-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .chi-illu img {
    margin-bottom: 75px;
    margin-top: 50px;
    margin-left: auto;
    margin-right: auto;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .footer-socials {
    justify-content: center;
  }

  .footer-socials a img {
    width: 50px !important;
    margin: 0 10px;
  }

  /* Overlay per chiudere il menu */
  .nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
  }

  .nav-overlay.active {
    display: block;
  }

  /* Articolo mobile */
  .article-header h1 {
    font-size: 2rem;
  }

  .article-content h2 {
    padding-top: 4rem;
    margin-top: -3rem;
  }

  .article-content h3 {
    padding-top: 4rem;
    margin-top: -3rem;
  }

  .toc-toggle {
    top: 100px;
    right: 15px;
    width: 45px;
    height: 45px;
  }

  .comment-header {
    flex-direction: column;
  }

  .comment-date {
    margin-top: 0.25rem;
  }

  .comment-form {
    padding: 1rem;
  }

  /* Responsive per le risposte */
  .comment-reply {
    margin-left: 1rem;
  }

  .comment-reply .comment-reply {
    margin-left: 0.8rem;
  }

  .footnote-popup {
    width: 95%;
    max-height: 70vh;
  }

  .footnote-header {
    padding: 1rem;
  }

  .footnote-header h3 {
    font-size: 1.3rem;
  }

  .footnote-body {
    padding: 1.5rem;
  }

  .footnote-close {
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }

  .back-to-top img {
    width: 25px;
    height: 25px;
  }
}

@media (max-width: 480px) {

  /* Smartphone più piccoli */
  .container {
    padding: 0 15px;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .site-title {
    font-size: 15px;
    line-height: normal;
  }

  .brand img {
    width: 35px;
  }

  .btn.cta {
    margin-top: 0.75rem;
  }

  /* Articolo smartphone */
  .article-content {
    padding: 1rem;
  }

  .info-box {
    padding: 1rem;
  }

  .comments-container {
    padding: 0 0.5rem;
  }

  .footnote-popup {
    width: 98%;
    max-height: 80vh;
  }

  .footnote-body {
    padding: 1rem;
  }

}