/*
 * Blog Fixes - Link Oro + Mobile Ottimizzazioni
 * Scoped solo per pagine blog/articoli
 */

/* ========================================
   PUNTO 1: LINK ORO NEI CONTENUTI
======================================== */

/* Link nei contenuti articoli singoli */
.single-post .entry-content a,
.single-post .ve-single-content a {
    color: #B28E3A;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.single-post .entry-content a:hover,
.single-post .ve-single-content a:hover {
    color: #8b6d2c;
    text-decoration: none;
}

/* Link negli excerpt delle card blog */
.ve-blog-archive .ve-card-excerpt a,
.ve-blog-grid .ve-card-excerpt a {
    color: #B28E3A;
    text-decoration: underline;
}

.ve-blog-archive .ve-card-excerpt a:hover {
    color: #8b6d2c;
}

/* Link "Vedi anche" e simili */
.ve-related-excerpt a,
.entry-content .read-more {
    color: #B28E3A !important;
}

/* LINK ORO NEI COMMENTI */
.ve-comments-area a,
.ve-comment-author a,
.comment-reply-link,
.comment-meta a {
    color: #B28E3A !important;
    text-decoration: none !important;
}

.ve-comments-area a:hover,
.ve-comment-author a:hover,
.comment-reply-link:hover,
.comment-meta a:hover {
    color: #8b6d2c !important;
    text-decoration: underline !important;
}

/* Esclusione: NON toccare titoli card e bottoni */
.ve-card-title a,
.ve-related-card-title a,
.ve-related-readmore,
button, .button, .btn {
    /* mantieni colori originali */
}


/* ========================================
   PUNTO 4A: FIX OVERFLOW MOBILE
======================================== */

@media (max-width: 768px) {
    
    /* Previeni scroll orizzontale AGGRESSIVO */
    html {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* TUTTO DENTRO IL VIEWPORT */
    *:not(figure):not(figure *):not(.wp-block-image):not(.wp-block-image *):not(svg):not(svg *) {
        max-width: 100vw !important;
    }
    
    /* ICONE GUTENBERG: FIX DRASTICO */
    figure img,
    .wp-block-image img,
    figure.wp-block-image img {
        max-width: none !important;
        width: auto !important;
        height: auto !important;
        display: inline-block !important;
    }
    
    /* Container blog */
    .ve-blog-archive-wrapper {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 73px 10px 40px 10px !important;  /* ABBASSATO +4px (era 69px) */
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    .ve-blog-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 5px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* Titolo "Blog" ANCORA PIÙ IN BASSO */
    .ve-blog-page-title {
        font-size: 28px !important;
        margin: 0 0 25px 0 !important;
        padding: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    /* Grid blog: 1 colonna */
    .ve-blog-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 25px !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    /* Card STRETTE */
    .ve-blog-card {
        width: calc(100% - 20px) !important;
        max-width: calc(100vw - 40px) !important;
        margin: 0 10px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        box-sizing: border-box !important;
    }
    
    .ve-card-image-wrapper,
    .ve-card-image-wrapper img {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* BADGE */
    .ve-card-badge,
    .ve-single-badge {
        padding: 7px 13px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        bottom: 10px !important;
        right: 10px !important;
        border-radius: 8px !important;
    }
    
    .ve-card-content {
        padding: 15px !important;
        box-sizing: border-box !important;
    }
    
    .ve-card-title,
    .ve-card-excerpt {
        width: 100% !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* DATA BLOG/ARTICOLO: PIÙ GRANDE + SINISTRA */
    .ve-card-meta,
    .ve-single-meta {
        font-size: 18px !important;  /* AUMENTATO da 16px */
        text-align: left !important;  /* SINISTRA */
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
    
    /* Articoli singoli */
    .ve-single-wrapper {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 69px 10px 30px 10px !important;  /* ABBASSATO +4px (era 65px) */
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    .ve-single-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 5px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    .ve-single-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
    }
    
    .ve-single-content p,
    .ve-single-content h1,
    .ve-single-content h2,
    .ve-single-content h3,
    .ve-single-content li {
        width: 100% !important;
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Immagini articolo MA NON FIGURE */
    .ve-single-content img:not(figure img):not(figure.wp-block-image img):not(.wp-block-image img) {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* ARTICOLI CORRELATI: TESTO MOLTO GRANDE */
    .ve-related-posts {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 30px 10px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* TITOLO "ARTICOLI CORRELATI": 1.5x PIÙ GRANDE */
    .ve-related-title {
        font-size: 28px !important;  /* 1.5x di 22px */
        text-align: center !important;
        margin-bottom: 20px !important;
        font-weight: 700 !important;
    }
    
    .ve-related-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 5px !important;
        box-sizing: border-box !important;
    }
    
    .ve-related-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        box-sizing: border-box !important;
    }
    
    /* Immagine correlata */
    .ve-related-image-wrapper {
        height: 110px !important;
        padding-top: 0 !important;
        position: relative !important;
    }
    
    .ve-related-image {
        width: 100% !important;
        height: 110px !important;
        object-fit: cover !important;
        position: static !important;
    }
    
    /* Contenuto correlato PIÙ GRANDE */
    .ve-related-content {
        padding: 10px !important;
    }
    
    /* TITOLO CORRELATI: MOLTO GRANDE */
    .ve-related-card-title {
        font-size: 17px !important;  /* AUMENTATO da 15px */
        line-height: 1.3 !important;
        margin-bottom: 8px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        font-weight: 600 !important;
    }
    
    .ve-related-card-title a {
        font-size: 17px !important;
    }
    
    /* TESTO CORRELATI: MOLTO PIÙ GRANDE + 4 RIGHE */
    .ve-related-excerpt {
        font-size: 15px !important;  /* AUMENTATO da 13px */
        line-height: 1.5 !important;
        margin-bottom: 8px !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 4 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
    
    /* DATA CORRELATI: PIÙ GRANDE */
    .ve-related-meta {
        font-size: 13px !important;  /* AUMENTATO da 10px */
        margin-top: 6px !important;
        text-align: left !important;
    }
    
    .ve-related-readmore {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    /* Badge correlati */
    .ve-related-badge {
        font-size: 9px !important;
        padding: 3px 8px !important;
        border-radius: 6px !important;
        bottom: 8px !important;
        right: 8px !important;
    }
    
    /* TITOLI SEZIONI COMMENTI: 1.5x PIÙ GRANDI */
    .ve-comment-intro-title {
        font-size: 28px !important;  /* 1.5x di 20px */
        font-weight: 700 !important;
    }
    
    .ve-comment-reply-title {
        font-size: 28px !important;  /* 1.5x di 20px */
        font-weight: 700 !important;
    }
    
    .ve-comments-title {
        font-size: 26px !important;  /* 1.5x di 18px */
        font-weight: 700 !important;
    }
}
