/**
 * Mobile Optimization - Smartphone UX Improvements
 * Versione 2.5.0 - Category Focus: Breadcrumbs, Hero Titles, Meta Fixes
 */

/* ===== RESET GLOBALE OVERFLOW ===== */
html,
body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-overflow-scrolling: touch;
}

* {
    box-sizing: border-box !important;
    max-width: 100% !important;
    word-wrap: break-word;
}

/* ===== CONTAINER RESPONSIVE ===== */
@media (max-width: 991px) {

    .container,
    .container-full,
    .site-content,
    .entry-content,
    .main-content,
    .site-main {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: hidden !important;
        display: block !important;
    }
}

/* ===== BREADCRUMBS MOBILE ===== */
@media (max-width: 768px) {
    .breadcrumbs {
        padding: 12px 0 !important;
        margin: 0 0 15px 0 !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #eee;
        background: #fdfdfd;
    }

    .breadcrumb-list {
        display: inline-flex !important;
        padding: 0 10px !important;
        list-style: none !important;
        margin: 0 !important;
    }

    .breadcrumb-item {
        font-size: 13px !important;
        display: inline-block !important;
    }

    .breadcrumb-separator {
        margin: 0 8px !important;
        color: #999;
    }
}

/* ===== HERO SECTION (TITOLI GIGANTI) ===== */
@media (max-width: 768px) {
    .hero-section {
        padding: 24px 15px !important;
        margin-bottom: 20px !important;
        text-align: center !important;
    }

    .hero-section h1 {
        font-size: 22px !important;
        /* Ridotto per Pixel 8 Pro */
        line-height: 1.3 !important;
        font-weight: 700 !important;
    }

    .archive-description,
    .category-description {
        font-size: 14px !important;
        margin-top: 10px !important;
    }
}

/* ===== HEADER & BRANDING ===== */
@media (max-width: 768px) {
    .site-branding {
        padding: 10px 0 !important;
    }

    .branding-logo img {
        max-height: 44px !important;
        margin-bottom: 8px;
    }

    .site-title {
        font-size: 16px !important;
    }

    .site-subtitle {
        font-size: 11px !important;
    }

    /* Social Icons Più Piccoli */
    .header-controls {
        padding-bottom: 15px !important;
    }

    .header-social-icons {
        gap: 15px !important;
    }

    .social-icon {
        width: 38px !important;
        height: 38px !important;
    }

    .social-icon svg {
        width: 22px !important;
        height: 22px !important;
    }
}

/* ===== CATEGORIE: CARD & LISTE ===== */
@media (max-width: 768px) {

    .category article,
    .archive article {
        margin-bottom: 20px !important;
        padding: 20px !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    }

    .category .entry-title,
    .archive .entry-title,
    .post-title {
        font-size: 19px !important;
        line-height: 1.4 !important;
        margin-bottom: 12px !important;
    }

    /* Meta in colonna */
    .entry-meta,
    .post-meta {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
        margin-bottom: 15px !important;
        font-size: 13px !important;
    }

    .entry-meta span,
    .post-meta span {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    /* Bottoni Full Width */
    .more-link,
    .attachment-download {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
        padding: 12px !important;
        border-radius: 6px !important;
        font-size: 15px !important;
        text-transform: none !important;
    }
}

/* ===== FIX ALLEGATI IN CATEGORIA ===== */
@media (max-width: 768px) {
    .post-attachments {
        margin-top: 15px !important;
        padding-top: 15px !important;
        border-top: 1px dashed #ddd !important;
    }

    .attachment-item {
        margin-bottom: 10px !important;
        padding: 12px !important;
        background: #f9f9f9 !important;
    }

    .attachment-name {
        font-size: 14px !important;
        margin-bottom: 8px !important;
        color: #333 !important;
    }
}

/* ===== SINGOLO ARTICOLO ===== */
@media (max-width: 768px) {
    .single .entry-content {
        font-size: 16px !important;
        line-height: 1.6 !important;
    }

    .single .entry-content h2 {
        font-size: 20px !important;
    }

    .single .entry-content h3 {
        font-size: 18px !important;
    }

    /* Navigazione articoli */
    .post-navigation .nav-links {
        display: flex !important;
        flex-direction: column !important;
    }
}

/* ===== PAGINAZIONE ===== */
@media (max-width: 768px) {

    .pagination,
    .nav-links {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
}

/* CSS FINAL KILLER FOR OVERFLOW */
.site,
.site-content,
.main-content,
article,
div,
section,
header,
footer {
    max-width: 100vw !important;
    box-sizing: border-box !important;
}