/* =========================================
   STYLE RESPONSIVE - Media Queries
   Per tutte le pagine del sito
   ========================================= */

/* 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-x {
    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-x:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

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

/* =========================================
   MEDIA QUERY: 1024px (Tablet)
   ========================================= */
@media (max-width: 1024px) {

    .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;
        line-height: 1.2rem;
    }

    .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;
    }

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

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

    .contact-form {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }

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

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

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

    /* Featured article grid */
    .featured-main {
        border-radius: 50px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        gap: 5px;
    }

    .intermezzo1 p {
        font-size: 1.05rem;
    }

    /* Articoli page */
    .articles-container {
        padding: 30px 0;
    }

    .article-category-side.category-linguistica {
        padding: 30px;
    }

    .article-category-side.category-logopedia {
        padding: 30px;
    }
}

/* =========================================
   MEDIA QUERY: 768px (Mobile)
   ========================================= */
@media (max-width: 768px) {

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

    .site-title a {
        font-size: 20px;
    }

    .brand img {
        width: 40px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-close-x {
        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;
    }

    .card-img {
        height: 150px;
        width: 100%;
        object-fit: cover;
    }

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

    .hero-sub {
        font-size: 1rem;
        line-height: 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;
    }

    /* Homepage hero */
    .hero-main {
        padding: 80px 0 60px;
    }

    .section-header h2 {
        font-size: 2.5rem;
    }

    .rubrica-header {
        flex-direction: column;
        text-align: center;
    }

    .rubrica-icon {
        margin-right: auto;
        margin-left: auto;
        margin-bottom: 20px;
    }

    .rubrica-text h2 {
        font-size: 2.5rem;
    }

    .pausa-card {
        border-radius: 50px;
    }

    .pausa-header h2 {
        font-size: 2.5rem;
    }

    .modern-grid {
        display: grid;
        grid-template-columns: 1fr;
    }

    .modern-card {
        border-radius: 50px;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-box {
        padding: 30px 20px;
    }

    /* Mosaic grid */
    .mosaic-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        min-height: auto;
    }

    .featured-main,
    .featured-side,
    .article-small {
        grid-column: 1;
        grid-row: auto;
    }

    .featured-main h3 {
        font-size: 1.5rem;
    }

    .featured-main p {
        font-size: 1.05rem;
    }

    .featured-main .card-image {
        height: 250px;
    }

    .featured-main .primo-piano {
        height: 200px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 10px;
    }

    .stat-body h3 {
        font-size: 3rem;
    }

    .intermezzo1 h3 {
        font-size: 2rem;
    }

    .intermezzo1 p {
        font-size: 1.15rem;
    }

    .pausa-card-proposta {
        border-radius: 100px;
    }

    /* Articoli page */
    .articles-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .search-filters {
        flex-direction: column;
    }

    .search-bar {
        min-width: 85%;
    }

    .article-content {
        flex-direction: column;
    }

    .article-category-side {
        padding: 20px;
    }

    .article-category-side.category-linguistica {
        padding: 20px;
    }

    .article-category-side.category-logopedia {
        padding: 20px;
    }

    .article-category-side h3 {
        font-size: 1.75rem;
    }

    .article-details-side {
        padding: 20px;
    }

    .article-details-side h4 {
        font-size: 2rem;
    }

    /* Team page */
    .team-hero h1 {
        font-size: 3rem;
    }

    .team-hero p {
        font-size: 1.1rem;
    }

    .team-container {
        padding: 0 1rem;
    }

    .team-section {
        padding: 1.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .team-interno-grid {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 2fr));
        gap: 20px;
    }

    .collaborators-list {
        grid-template-columns: 1fr;
    }

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

    .social-links {
        flex-direction: column;
        align-items: center;
    }

    .social-icon {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }

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

    .footer-socials {
        justify-content: center;
        margin-top: 20px;
    }

    .footer-socials a img {
        width: 15% !important;
        /* Modifica per mobile: le icone social sono un po' più grandi */
    }

    .article-card-compact {
        flex-direction: column;
    }

    .compact-left {
        width: 100%;
        flex-direction: row;
        padding: 25px;
        gap: 15px;
    }

    .compact-cat {
        font-size: 1.75rem;
    }

    .compact-date {
        font-size: 0.9rem;
    }

    .compact-right {
        padding: 15px;
    }

    .compact-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .compact-tags {
        margin-top: 5px;
    }

    .rubric-tabs {
        flex-direction: column;
        align-items: stretch;
    }

}

/* =========================================
   MEDIA QUERY: 480px (Small Smartphone)
   ========================================= */
@media (max-width: 480px) {

    .container {
        padding: 0 15px;
    }

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

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

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

    .brand img {
        width: 35px;
    }

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

    /* Articoli page */

    .article-card-compact {
        flex-direction: column;
    }

    .compact-left {
        width: 100%;
        flex-direction: row;
        padding: 25px;
        gap: 15px;
    }

    .compact-cat {
        font-size: 1.75rem;
    }

    .compact-right {
        padding: 15px;
    }

    .compact-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .compact-tags {
        margin-top: 5px;
    }

    .article-category-side {
        margin-top: 15px;
        padding: 20px;
    }

    .article-category-side.category-linguistica {
        padding: 30px;
    }

    .article-category-side.category-logopedia {
        padding: 30px;
    }

    .article-category-side h3 {
        font-size: 1.5rem;
    }

    .article-details-side h4 {
        font-size: 2rem;
    }

    .btn.article {
        padding: 8px 20px;
        font-size: 1.15rem;
    }

    /* Team page */
    .team-hero {
        padding: 3rem 0 2rem;
    }

    .team-hero h1 {
        font-size: 2.5rem;
    }

    .team-card {
        padding: 1.5rem;
    }
}