/*
 * Stili Dedicati per il Template Single Post
 * VERSIONE RESPONSIVE MIGLIORATA - Mobile-first con fix box prompt
 */

/* ==========================================================================
   1. HERO SECTION CON TITOLO FISSO E EFFETTO HOVER - RESPONSIVE
   ========================================================================== */
.article-main-wrapper {
    position: relative;
    z-index: 1;
}

.article-hero-with-title {
    position: relative;
    height: 100vh;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.4) 100%);
    transition: background 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* EFFETTO HOVER POTENTE */
.article-hero-with-title:hover .article-hero-image {
    transform: scale(1.05);
}

.article-hero-with-title:hover .article-hero-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.8) 100%);
}

.article-hero-with-title:hover .article-header-content {
    transform: translateY(-10px);
}

.article-hero-with-title:hover .article-header-content h1 {
    text-shadow: 0 4px 40px rgba(0,0,0,0.8);
    transform: scale(1.02);
}

.article-hero-with-title:hover .article-header-content .tag {
    background-color: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

/* Responsive per mobile */
@media (max-width: 767px) {
    .article-hero-with-title {
        height: 70vh;
        min-height: 70vh;
    }
}

/* ==========================================================================
   2. INTESTAZIONE ARTICOLO FISSA - COMPLETAMENTE RESPONSIVE
   ========================================================================== */
.article-header-fixed {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem; /* Mobile-first: padding ridotto */
    color: #ffffff;
    z-index: 3;
}

.article-header-content {
    text-align: center;
    width: 100%;
    max-width: 90%; /* Mobile: usa quasi tutta la larghezza */
    margin: 0 auto;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-header-content .tag {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.95);
    padding: 0.4rem 1rem; /* Mobile: padding ridotto */
    border-radius: 9999px;
    font-size: 0.875rem; /* Mobile: font più piccolo */
    font-weight: 700;
    margin-bottom: 1rem; /* Mobile: margine ridotto */
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-header-content h1 {
    font-size: 2rem; /* Mobile: molto più piccolo */
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 1rem;
    text-shadow: 0 2px 30px rgba(0,0,0,0.6);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-header-content .excerpt {
    font-size: 1rem; /* Mobile: molto più piccolo */
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 auto 1.5rem;
    text-shadow: 0 1px 20px rgba(0,0,0,0.5);
}

.article-header-content .meta {
    font-size: 0.875rem; /* Mobile: piccolo */
    opacity: 0.85;
}

/* Tablet */
@media (min-width: 768px) {
    .article-header-fixed {
        padding: 3rem 2rem;
    }
    
    .article-header-content {
        max-width: 80%; /* Tablet: un po' più largo */
    }
    
    .article-header-content .tag {
        font-size: 1rem;
        padding: 0.5rem 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .article-header-content h1 {
        font-size: 3.5rem; /* Tablet: dimensione intermedia */
        margin-bottom: 1.5rem;
    }
    
    .article-header-content .excerpt {
        font-size: 1.25rem;
        margin-bottom: 2rem;
    }
    
    .article-header-content .meta {
        font-size: 1rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .article-header-fixed {
        padding: 4rem 2rem;
    }
    
    .article-header-content {
        max-width: 85%; /* Desktop: molto più largo come richiesto */
    }
    
    .article-header-content h1 {
        font-size: 4.5rem; /* Desktop: grande ma non esagerato */
        letter-spacing: -0.04em;
    }
    
    .article-header-content .excerpt {
        font-size: 1.5rem;
        max-width: none; /* Rimuove il limite di larghezza */
        margin-bottom: 2.5rem;
    }
}

/* Desktop largo */
@media (min-width: 1280px) {
    .article-header-content {
        max-width: 90%; /* Desktop largo: ancora più largo */
    }
    
    .article-header-content h1 {
        font-size: 5rem; /* Desktop largo: font più grande */
    }
    
    .article-header-content .excerpt {
        font-size: 1.75rem;
    }
}

/* ==========================================================================
   3. CORPO ARTICOLO - LARGHEZZA OTTIMIZZATA PER DESKTOP
   ========================================================================== */
.article-body-container {
    background-color: var(--bg-color);
}

.article-body {
    width: 100%;
    max-width: 90%; /* Mobile: quasi tutta la larghezza */
    margin: 0 auto;
    padding: 3rem 1rem;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-color);
}

/* Tablet */
@media (min-width: 768px) {
    .article-body {
        max-width: 85%;
        padding: 4rem 2rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .article-body {
        max-width: 80%; /* Desktop: molto più largo come richiesto */
        padding: 5rem 0;
    }
}

/* Desktop largo */
@media (min-width: 1280px) {
    .article-body {
        max-width: 75%; /* Desktop largo: ancora più largo */
        padding: 6rem 0;
    }
}

.article-body h2 {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin: 3rem 0 1.5rem !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 1px solid var(--border-color) !important;
}

@media (min-width: 1024px) {
    .article-body h2 {
        font-size: 2rem !important;
        margin: 4rem 0 1.5rem !important;
    }
}

.article-body p, .article-body ul, .article-body blockquote {
    margin: 0 0 1.75em 0 !important;
}

.article-body a {
    color: var(--accent) !important;
    text-decoration: none !important;
    border-bottom: 1px solid var(--accent) !important;
    font-weight: 500 !important;
}

.article-body blockquote {
    border-left: 3px solid var(--accent) !important;
    padding-left: 1.5em !important;
    font-size: 1.2rem !important;
    font-style: italic !important;
    color: var(--text-secondary) !important;
}

.article-body ul {
    list-style: none !important;
    padding-left: 0 !important;
}

.article-body ul li {
    position: relative !important;
    padding-left: 1.75em !important;
    margin-bottom: 0.75em !important;
}

.article-body ul li::before {
    content: '•' !important;
    position: absolute !important;
    left: 0 !important;
    font-size: 1.2em !important;
    line-height: 1 !important;
    color: var(--accent) !important;
}

/*
 * NUOVA REGOLA: Stili per gli elenchi numerati (ol)
 */
.article-body ol {
    list-style: none !important;
    padding-left: 0 !important;
    counter-reset: ordered-list-counter; /* Inizializza un contatore */
}

.article-body ol li {
    position: relative !important;
    padding-left: 1.75em !important;
    margin-bottom: 0.75em !important;
    counter-increment: ordered-list-counter; /* Incrementa il contatore per ogni voce */
}

.article-body ol li::before {
    content: counter(ordered-list-counter) "." !important; /* Mostra il numero del contatore seguito da un punto */
    position: absolute !important;
    left: 0 !important;
    font-weight: 600 !important; /* Rendiamo il numero un po' più marcato */
    font-size: 1em !important;
    line-height: 1.8 !important; /* Allineamento verticale del numero */
    color: var(--accent) !important;
}


.article-body .wp-block-image img {
    width: 100%;
    height: auto;
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
    background-color: var(--border-color);
}

.article-body .wp-block-image figcaption {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    text-align: center;
}

/* DISABILITATO - Ora usiamo il wrapper automatico */
.article-body .is-style-prompt-ai {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
}
[data-theme="dark"] .is-style-prompt-ai {
    background: none !important;
    box-shadow: none !important;
    border: none !important;
}


/* ==========================================================================
   4. TOC BLOCK - STILE APPLE COMPLETAMENTE RINNOVATO
   ========================================================================== */
.article-body .toc-block {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(var(--card-bg), 0.8) 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    padding: 2rem;
    margin: 3rem auto;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .toc-block {
    background: linear-gradient(135deg, rgba(29,29,31,0.95) 0%, rgba(29,29,31,0.8) 100%);
    border: 1px solid rgba(66,66,69,0.6);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.article-body .toc-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    opacity: 0.3;
}

.article-body .toc-block h3 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 0 0 1.5rem !important;
    border: none !important;
    padding: 0 !important;
    color: var(--text-color) !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.article-body .toc-block h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(45deg, var(--accent), rgba(var(--accent), 0.6));
    border-radius: 2px;
    flex-shrink: 0;
}

.article-body .toc-block ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.article-body .toc-block ul li {
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
}

.article-body .toc-block ul li::before {
    display: none !important;
}

.article-body .toc-block ul li a {
    display: flex !important;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    background: rgba(var(--accent), 0.08);
    border: 1px solid rgba(var(--accent), 0.15);
    border-radius: 12px;
    font-weight: 500 !important;
    font-size: 0.95rem;
    border-bottom: none !important;
    color: var(--text-color) !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.article-body .toc-block ul li a::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.article-body .toc-block ul li a:hover {
    background: rgba(var(--accent), 0.12) !important;
    border-color: rgba(var(--accent), 0.3);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(var(--accent), 0.15);
}

.article-body .toc-block ul li a:hover::before {
    background: var(--accent);
    opacity: 1;
    transform: scale(1.2);
}

[data-theme="dark"] .article-body .toc-block ul li a {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .article-body .toc-block ul li a:hover {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.2);
}

/* ==========================================================================
   5. ANIMAZIONI CORPO ARTICOLO (MANTENUTE)
   ========================================================================== */
.animated-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.animated-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   6. SEZIONE CONDIVISIONE (ADATTATA)
   ========================================================================== */
.share-section {
    padding: 5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-color);
}
.share-section-container { max-width: 760px; margin: 0 auto; text-align: center; }
.share-content h3 { font-size: 1.5rem; font-weight: 700; margin: 0 0 2rem 0; }
.social-links { display: flex; justify-content: center; gap: 2rem; }
.social-link { color: var(--text-color); opacity: 0.7; transition: all 0.2s ease; }
.social-link:hover { transform: scale(1.1); }
.social-icon { width: 28px; height: 28px; }
.social-linkedin:hover { color: #0A66C2; }
.social-whatsapp:hover { color: #25D366; }
.social-email:hover { color: var(--accent); }
[data-theme="dark"] .social-twitter:hover { color: #e7e9ea; }
[data-theme="light"] .social-twitter:hover { color: #000000; }

/*
 * NUOVA REGOLA: Riduce lo spazio verticale sotto i paragrafi nel corpo dell'articolo
 */
.article-body p {
    margin-bottom: 0.85em !important;
}



/*
 * ========================================================================
 * STILI PER BLOCCHI PROMPT AI - VERSIONE AUTOMATICA CON BARRA E PULSANTE
 * ========================================================================
 */

/* Wrapper principale del prompt */
.prompt-ai-wrapper {
    position: relative;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
}

/* Assicura che il blocco codice originale non abbia bordi/sfondi duplicati */
.prompt-ai-wrapper .wp-block-code {
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* CRITICO: Rimuove completamente lo stile del wp-block-code negli articoli */
.article-body .prompt-ai-wrapper .wp-block-code {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.article-body .prompt-ai-wrapper .is-style-prompt-ai {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* MA il pre dentro deve avere padding */
.article-body .prompt-ai-wrapper .is-style-prompt-ai.wp-block-code,
.article-body .prompt-ai-wrapper pre.is-style-prompt-ai {
    padding: 0 !important;
}

.article-body .prompt-ai-wrapper pre.is-style-prompt-ai > pre,
.article-body .prompt-ai-wrapper .wp-block-code.is-style-prompt-ai > pre {
    padding: 2.5rem 2.25rem !important;
}

/* Barra superiore grigia scura */
.prompt-ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background-color: #3a3a3c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .prompt-ai-header {
    background-color: #48484a;
}

/* Testo "Prompt Completo" */
.prompt-ai-title {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #f5f5f7;
    letter-spacing: 0.01em;
}

/* Pulsante copia (solo icona) */
.prompt-ai-copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #f5f5f7;
}

.prompt-ai-copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.prompt-ai-copy-btn:active {
    transform: translateY(0);
}

.prompt-ai-copy-btn.copied {
    background-color: rgba(52, 199, 89, 0.2);
    border-color: rgba(52, 199, 89, 0.4);
    color: #34c759;
}

.prompt-ai-copy-btn svg {
    width: 18px;
    height: 18px;
}

/* Stile del blocco pre dentro il wrapper */
.prompt-ai-wrapper .wp-block-code > pre,
.prompt-ai-wrapper pre,
.prompt-ai-wrapper .wp-block-code pre,
.article-body .prompt-ai-wrapper pre,
.tutorial-content-area .prompt-ai-wrapper pre {
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 2.5rem 2.25rem !important;
    background-color: #1d1d1f !important;
    overflow-x: auto;
    border: none !important;
    box-shadow: none !important;
}

[data-theme="light"] .prompt-ai-wrapper .wp-block-code > pre,
[data-theme="light"] .prompt-ai-wrapper pre,
[data-theme="light"] .prompt-ai-wrapper .wp-block-code pre,
[data-theme="light"] .article-body .prompt-ai-wrapper pre,
[data-theme="light"] .tutorial-content-area .prompt-ai-wrapper pre {
    background-color: #2c2c2e !important;
}

.prompt-ai-wrapper code,
.prompt-ai-wrapper .wp-block-code code,
.article-body .prompt-ai-wrapper code,
.tutorial-content-area .prompt-ai-wrapper code {
    color: #f5f5f7 !important;
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 0.9375rem !important;
    line-height: 1.75 !important;
    letter-spacing: 0.01em !important;
}


/* Regole specifiche FORZATE per articoli */
.article-body .prompt-ai-wrapper pre,
.article-body .prompt-ai-wrapper .wp-block-code pre,
.article-body .prompt-ai-wrapper .wp-block-code > pre,
.article-body .prompt-ai-wrapper .is-style-prompt-ai pre,
.article-body .is-style-prompt-ai .prompt-ai-wrapper pre {
    padding: 2.5rem 2.25rem !important;
    margin: 0 !important;
    background-color: #1d1d1f !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

[data-theme="light"] .article-body .prompt-ai-wrapper pre,
[data-theme="light"] .article-body .prompt-ai-wrapper .wp-block-code pre,
[data-theme="light"] .article-body .prompt-ai-wrapper .wp-block-code > pre,
[data-theme="light"] .article-body .prompt-ai-wrapper .is-style-prompt-ai pre,
[data-theme="light"] .article-body .is-style-prompt-ai .prompt-ai-wrapper pre {
    background-color: #2c2c2e !important;
}

/* Forza anche il code dentro */
.article-body .prompt-ai-wrapper code,
.article-body .prompt-ai-wrapper pre code {
    padding: 0 !important;
    background: none !important;
}


/* Responsive mobile */
@media (max-width: 768px) {
    .prompt-ai-wrapper {
        margin: 1.5rem -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .prompt-ai-header {
        padding: 0.625rem 1rem;
    }
    
    .prompt-ai-title {
        font-size: 0.8125rem;
    }
    
    .prompt-ai-copy-btn {
        width: 30px;
        height: 30px;
    }
    
    .prompt-ai-copy-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .prompt-ai-wrapper .wp-block-code > pre,
    .prompt-ai-wrapper pre {
        padding: 2rem 1.5rem !important;
    }
    
    .prompt-ai-wrapper code {
        font-size: 0.8125rem !important;
    }
}


/* ==========================================================================
   STILI GLOBALI PER GALLERIE (ARTICOLI E TUTORIAL)
   ========================================================================== */

/* GALLERY SCROLLABILE CON CONTROLLI E INDICATORI */
.article-body .wp-block-gallery.is-style-scrollable,
.tutorial-content-area .wp-block-gallery.is-style-scrollable {
    position: relative !important;
    margin: 2rem auto !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    background: rgba(0,0,0,0.05) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
    padding-bottom: 3rem !important;
}

.article-body .wp-block-gallery.is-style-scrollable .blocks-gallery-grid,
.tutorial-content-area .wp-block-gallery.is-style-scrollable .blocks-gallery-grid {
    display: flex !important;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.article-body .wp-block-gallery.is-style-scrollable .blocks-gallery-grid::-webkit-scrollbar,
.tutorial-content-area .wp-block-gallery.is-style-scrollable .blocks-gallery-grid::-webkit-scrollbar {
    display: none !important;
}

.article-body .wp-block-gallery.is-style-scrollable .wp-block-image,
.tutorial-content-area .wp-block-gallery.is-style-scrollable .wp-block-image {
    flex-shrink: 0 !important;
    width: 100% !important;
    margin: 0 !important;
}

.article-body .wp-block-gallery.is-style-scrollable .wp-block-image img,
.tutorial-content-area .wp-block-gallery.is-style-scrollable .wp-block-image img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    border-radius: 0 !important;
}

/* Controlli navigazione Gallery */
.gallery-nav-btn {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(255,255,255,0.9) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    z-index: 10 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease !important;
    opacity: 0.8 !important;
    color: #333 !important;
    font-size: 18px !important;
}

.gallery-nav-btn:hover {
    opacity: 1 !important;
    background-color: rgba(255,255,255,1) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.gallery-nav-prev { left: 10px !important; }
.gallery-nav-next { right: 10px !important; }

/* Indicatori Gallery (pallini) */
.gallery-indicators {
    position: absolute !important;
    bottom: 1rem !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 0.5rem !important;
    z-index: 10 !important;
}

.gallery-indicator {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.5) !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.gallery-indicator.active {
    background: rgba(255,255,255,1) !important;
    transform: scale(1.2) !important;
}

/* GALLERY GRID (AFFIANCATE) */
.article-body .wp-block-gallery.is-style-grid-2,
.tutorial-content-area .wp-block-gallery.is-style-grid-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1rem !important;
}

.article-body .wp-block-gallery.is-style-grid-3,
.tutorial-content-area .wp-block-gallery.is-style-grid-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem !important;
}

@media (max-width: 768px) {
    .article-body .wp-block-gallery.is-style-grid-3,
    .tutorial-content-area .wp-block-gallery.is-style-grid-3 {
        grid-template-columns: 1fr !important;
    }
    
    .article-body .wp-block-gallery.is-style-grid-2,
    .tutorial-content-area .wp-block-gallery.is-style-grid-2 {
        grid-template-columns: 1fr !important;
    }
}

/* STILE GLOBALE PER IMMAGINI ARROTONDATE */
.article-body .wp-block-image img,
.tutorial-content-area .wp-block-image img {
    border-radius: 16px !important; /* Angoli arrotondati in stile Apple */
}