/* ==========================================================================
   LEVIATHAN BLOG — stile unico degli articoli (levthn-core)
   Sostituisce gli snippet WPCode: CSS Blog, LEVIATHAN EDITORIAL BLOCKS,
   Rank Math Breadcrumb Injection, Reading Progress Bar, Advanced Post Last
   Update Meta, Blog FAQ Accordion. Caricato solo su articoli e archivi blog.
   Ordine = ordine di cascata degli snippet originali: non riordinare.
   Tema: Salient | Brand Color: #F92E07
   ========================================================================== */

/* ==========================================================================
   LEVIATHAN BLOG — Custom Styles
   Tema: Salient | Builder: WPBakery | Brand Color: #F92E07
   ========================================================================== */


/* === Indice dei Contenuti (TOC) === */

.box-indice-contenuti-styled {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 25px 30px !important;
    margin-bottom: 40px;
}

.box-indice-contenuti-styled .indice-titolo {
    font-family: 'Space Mono', monospace !important;
    font-size: 12px;
    color: #a0a0a0;
    font-weight: 400;
    text-transform: uppercase;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
}

.box-indice-contenuti-styled ul {
    list-style: none;
    padding-left: 0;
    margin: 0 0 10px 0 !important;
}

.box-indice-contenuti-styled li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 0;
}

.box-indice-contenuti-styled li a {
    text-decoration: none;
    color: #f0f0f0;
    font-size: 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.box-indice-contenuti-styled li a:hover {
    color: #F92E07;
    padding-left: 5px; /* Sottile feedback di movimento */
}

.box-indice-contenuti-styled li::before {
    content: '\25C6';
    position: absolute;
    left: 0;
    top: 0;
    font-size: 10px;
    color: #F92E07;
    transition: transform 0.3s ease;
}

.box-indice-contenuti-styled li:hover::before {
    transform: scale(1.3);
}


/* === Blog Archive === */

.blog-archive-header .container .span_12 p {
    font-size: min(max(calc(0.9vw), 16px), 20px);
    line-height: 1.7;
    margin-top: .5em;
}


/* === Author Bio === */

.container-wrap #author-bio #author-info p {
    line-height: 1.8em;
    font-size: 14px;
    max-width: 100%;
    opacity: .7;
}

.nectar-author-info-title {
    font-size: 20px !important;
}

.container-wrap #author-bio #author-info {
    width: 87% !important;
    vertical-align: middle;
    display: inline-block;
    padding-left: 30px;
}

#author-bio {
    padding: 30px !important;
    border: 1px solid rgba(228, 228, 228, 0.5) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03) !important;
}

.comment-wrap {
    padding: 20px 0;
    border-top: 1px solid #e4e4e4;
}


/* === Header Articolo === */

.featured-media-under-header h1 {
    text-transform: initial;
    letter-spacing: -0.03em;
    font-size: 48px !important;
    line-height: 125% !important;
    font-weight: 400;
}

.featured-media-under-header__featured-media:not([data-format="video"]):not([data-format="audio"]):not([data-has-img="false"]) {
    overflow: hidden !important;
    position: relative !important;
    padding-bottom: 30% !important;
    max-width: 750px !important;
    margin: 0 auto;
    border-radius: 10px !important;
}

.featured-media-under-header__featured-media:not([data-has-img="false"]) {
    margin-top: min(6vw, 40px) !important;
}

.main-content .featured-media-under-header {
    padding: min(6vw, 40px) 0 !important;
}

.featured-media-under-header__cat-wrap .meta-category a {
    line-height: 1 !important;
    padding: 7px 15px !important;
    margin-right: 15px !important;
    border-radius: 5px !important;
    font-family: "Space Mono", monospace !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
}

.featured-media-under-header__meta-wrap {
    color: #999;
    font-size: 13px !important;
}

.featured-media-under-header__meta-wrap>span:not(:first-child):not(.rich-snippet-hidden):before {
    content: "|";
    padding: 0 .5em;
}


/* Immagini e Media */
.post img,
.post .wpb_single_image {
    border-radius: 12px !important;
    transition: transform 0.4s ease, box-shadow 0.4s ease !important;
}

.post .wpb_single_image:hover img,
.post img:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1) !important;
}

/* === Contenuto Articolo === */

/* Capolettera Editorial (Drop Cap) */
.post > .wpb_row:first-of-type .wpb_text_column p:first-of-type::first-letter {
    color: #F92E07;
    float: left;
    font-size: 4.8rem;
    line-height: 1;
    margin: 0.1em 0.1em 0 0;
    font-weight: 700;
}

/* Paragrafi */
.post p {
    margin-bottom: 0 !important;
    padding-bottom: 0.5rem !important;
    line-height: 1.75 !important; /* Leggermente più arioso per premium feel */
    color: #333;
    font-weight: 300 !important;
}

/* Bold e Bold Técnico */
.post b,
.post strong {
    font-weight: 500 !important; /* Più incisivo */
}

/* Termini Tecnici / Codice Inline */
.post code, 
.post .monospace {
    font-family: 'Space Mono', monospace !important;
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #F92E07;
}

/* Liste */
.post ul,
.post ol {
    margin-top: 0.5rem !important;
    margin-bottom: 1.25rem !important;
    padding-left: 0.1em !important;
}

.post li {
    margin-bottom: 0.2rem !important;
    line-height: 1.7 !important;
}

.post h2 {
    font-size: clamp(2rem, 5vw + 1rem, 2.5rem) !important;
    line-height: 1.25 !important;
    margin-top: 4rem !important; /* Spazio maggiore sopra i capitoli */
    margin-bottom: 1.5rem !important;
    letter-spacing: -0.035em;
    position: relative;
}

/* Divisore sottile sopra gli H2 */
.post h2::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: 0;
    width: 40px;
    height: 2px;
    background: #999;
    opacity: 0.3;
}

/* Didascalie Immagini (Captions) */
.post .wp-caption-text, 
.post figcaption {
    font-size: 14px !important;
    font-style: italic !important;
    color: #888 !important;
    text-align: center !important;
    margin-top: 10px !important;
    margin-bottom: 20px !important;
    display: block;
}

.post h3 {
    font-size: clamp(1.5rem, 3vw + 1rem, 1.75rem) !important;
    line-height: 1.3 !important;
    margin-top: 2rem !important;
    margin-bottom: 0.75rem;
}

.post a {
    color: #F92E07;
    line-height: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(249, 46, 7, 0.5);
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.post a:hover {
    color: #cc2506;
    text-decoration-color: #cc2506;
}

.post blockquote {
    border-left: 4px solid #F92E07 !important;
    padding: 18px 24px !important;
    margin: 2rem 0 !important;
    background: #f9f9f9 !important;
    border-radius: 0 6px 6px 0;
}

.post blockquote p {
    margin-bottom: 0 !important;
}


/* === Desktop (≥1000px) === */

@media only screen and (min-width: 1000px) {

    body.single-post #ajax-content-wrap .container-wrap.no-sidebar .post-area,
    .single-post .featured-media-under-header__content {
        max-width: 750px;
    }

    .blog-archive-header .col.section-title p,
    .blog-archive-header .inner-wrap p {
        padding: 0 18%;
    }
}


/* === Tablet / Mobile (≤768px) === */

@media screen and (max-width: 768px) {
    .featured-media-under-header h1 {
        font-size: 32px !important;
        line-height: 120% !important;
        letter-spacing: -0.02em;
    }

    .featured-media-under-header__featured-media:not([data-format="video"]):not([data-format="audio"]):not([data-has-img="false"]) {
        padding-bottom: 50% !important;
        border-radius: 8px;
    }

    .featured-media-under-header__cat-wrap .meta-category a {
        font-size: 12px !important;
        padding: 5px 10px;
        margin-right: 8px;
    }

    .featured-media-under-header__meta-wrap {
        flex-wrap: wrap !important;
        font-size: 13px !important;
    }

    .post p {
        font-size: 1rem !important;
    }

    .post h2 {
        font-size: 2rem !important;
        margin-top: 2rem !important;
    }

    .post h3 {
        font-size: 1.6rem !important;
        margin-top: 1.5rem !important;
    }

    .post blockquote {
        padding: 14px 18px !important;
        margin: 1.5rem 0 !important;
    }

    .box-indice-contenuti-styled .indice-titolo {
        font-size: 11px !important;
        margin-bottom: 10px !important;
    }
}


/* === Mobile Small (≤480px) === */

@media screen and (max-width: 480px) {
    .featured-media-under-header h1 {
        font-size: 30px !important;
        line-height: 125% !important;
    }

    .featured-media-under-header__featured-media:not([data-format="video"]):not([data-format="audio"]):not([data-has-img="false"]) {
        padding-bottom: 60%;
    }

    .post h2 {
        font-size: 1.6rem !important;
    }

    .post h3 {
        font-size: 1.3rem !important;
    }
}


/* === Editorial blocks (moduli riutilizzabili) === */

:root {
    --lv-red: #F92E07;
    --lv-dark: #1a1a1a;
    --lv-gray-light: #f8f9fa;
    --lv-border: #e9ecef;
    --lv-text: #333;
    --lv-font-mono: 'Space Mono', monospace;
}

/* --- 1. DEFINITION BLOCK --- */
.lv-block-definition {
    border-left: 4px solid var(--lv-red);
    background: var(--lv-gray-light);
    padding: 24px 30px;
    margin: 40px 0;
    border-radius: 0 12px 12px 0;
}

.lv-block-definition::before {
    content: "DEFINIZIONE";
    display: block;
    font-family: var(--lv-font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--lv-red);
    margin-bottom: 12px;
    font-weight: 700;
}

.lv-block-definition p {
    margin: 0;
    font-size: 18px;
    line-height: 1.6;
}

/* --- 2. CHECKLIST BLOCK --- */
.lv-block-checklist {
    background: #fff;
    border: 1px solid var(--lv-border);
    padding: 25px 30px;
    border-radius: 12px;
    margin: 40px 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.lv-block-checklist h4 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 20px;
}

.lv-block-checklist ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.lv-block-checklist li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.lv-block-checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    background: var(--lv-red);
    mask: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='https://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    border-radius: 4px;
}

/* --- 3. ERROR/WARNING BLOCK --- */
.lv-block-warning {
    background: rgba(249, 46, 7, 0.05);
    border: 1px solid rgba(249, 46, 7, 0.2);
    padding: 24px 30px;
    border-radius: 12px;
    margin: 40px 0;
}

.lv-block-warning .title {
    font-family: var(--lv-font-mono);
    color: var(--lv-red);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    text-transform: uppercase;
}

.lv-block-warning .title::before {
    content: "!";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--lv-red);
    color: white;
    border-radius: 50%;
    font-family: inherit;
    font-size: 14px;
}

/* --- 4. PROS & CONS GRID --- */
.lv-block-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 40px 0;
}

.lv-column {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--lv-border);
}

.lv-column.pros {
    border-top: 4px solid #28a745;
    background: #fcfdfc;
}

.lv-column.cons {
    border-top: 4px solid var(--lv-red);
    background: #fdfcfc;
}

.lv-column .label {
    font-family: var(--lv-font-mono);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 15px;
    display: block;
    opacity: 0.7;
}

/* --- 5. CONCRETE EXAMPLE BLOCK --- */
.lv-block-example {
    border: 2px dashed var(--lv-border);
    padding: 30px;
    border-radius: 16px;
    margin: 40px 0;
    position: relative;
}

.lv-block-example::after {
    content: "ESEMPIO REALE";
    position: absolute;
    top: -10px;
    right: 30px;
    background: white;
    padding: 0 10px;
    font-family: var(--lv-font-mono);
    font-size: 10px;
    color: #999;
}

/* --- 6. OPERATIONAL NOTE (TIP) --- */
.lv-block-note {
    font-size: 16px;
    padding: 15px 25px;
    background: var(--lv-dark);
    color: #fff;
    border-radius: 8px;
    margin: 30px 0;
    position: relative;
    overflow: hidden;
}

.lv-block-note::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--lv-red);
}

.lv-block-note span {
    color: var(--lv-red);
    font-family: var(--lv-font-mono);
    font-weight: 700;
    margin-right: 10px;
}

/* =============================================
   7. CODE HIGHLIGHT BLOCK (Kinsta Style)
   ============================================= */

.lv-block-code {
    background: #000000 !important;
    border-radius: 8px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
    color: #ffffff !important;
    font-family: var(--lv-font-mono);
    font-size: 14px;
    border: 1px solid #333;
}

/* Corpo del codice */
.lv-block-code pre,
.lv-block-code code {
    margin: 0;
    padding: 10px;
    overflow-x: auto;
    line-height: 1.65;
    white-space: pre;
    word-break: normal;
    display: block;
    color: #ffffff !important;
    background: #000000 !important;
}

/* Sintassi pulita (Sottile) */
.lv-block-code .keyword { color: var(--lv-red); font-weight: 400; }
.lv-block-code .comment { color: #666; font-style: italic; }
.lv-block-code .string { color: #999; }
.lv-block-code .variable { color: #ccc; }

/* Mobile Adjustments */
@media screen and (max-width: 600px) {
    .lv-block-pros-cons {
        grid-template-columns: 1fr;
    }

    .lv-block-definition,
    .lv-block-checklist,
    .lv-block-warning,
    .lv-block-example,
    .lv-block-code {
        padding: 20px;
    }

    .lv-block-code pre {
        padding: 15px;
        font-size: 13px;
    }

    .lv-block-note {
        padding: 16px 20px 16px 26px;
    }
}


/* === Breadcrumb Rank Math (stampato lato server prima delle categorie) === */

.lev-breadcrumb-wrap {
    margin-bottom: 35px;
    padding-top: 10px;
    display: block;
    width: 100%;
}

.rank-math-breadcrumb,
.rank-math-breadcrumb * {
    font-size: 13px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: 1.4 !important;
}

.rank-math-breadcrumb p {
    margin: 0 !important;
    padding: 0 !important;
    color: #999 !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.rank-math-breadcrumb a {
    color: #999 !important;
    text-decoration: none !important;
    transition: color 0.3s ease;
}

/* Effetto underline Nectar */
.nectar-link-underline-effect a.accessed:not(:hover) {
    color: inherit;
    animation: nectar_ltr_line_animation_start .55s ease forwards;
}

.rank-math-breadcrumb .separator {
    margin: 0 8px !important;
    color: #ccc;
    opacity: 0.6;
    font-weight: 300 !important;
}

.rank-math-breadcrumb .last {
    color: #999;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

[data-header-color="dark"] .rank-math-breadcrumb *,
[data-header-color="dark"] .rank-math-breadcrumb a {
    color: rgba(255, 255, 255, 0.6) !important;
}

@media only screen and (max-width: 690px) {
    .rank-math-breadcrumb .last,
    .rank-math-breadcrumb .separator:last-of-type {
        display: none;
    }
}


/* === Meta «Aggiornato il» (testo e nota applicati da blog.js) === */

.featured-media-under-header__meta-wrap .meta-date.date.updated.lev-active {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-transform: none !important;
    font-style: normal !important;
    letter-spacing: normal !important;
}

.featured-media-under-header__meta-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    white-space: nowrap !important;
}

.featured-media-under-header__meta-wrap .meta-updated-label {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-style: normal !important;
    cursor: default;
}

.featured-media-under-header__meta-wrap .meta-updated-label[title] {
    cursor: help;
    border-bottom: 1px dotted rgba(0, 0, 0, 0.3);
}


/* === Barra di avanzamento lettura (scala con transform, nessun layout) === */

.lev-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 9999;
    pointer-events: none;
}

.lev-progress span {
    display: block;
    height: 100%;
    background: #F92E07;
    transform: scaleX(0);
    transform-origin: 0 50%;
    will-change: transform;
}


/* === FAQ accordion (markup generato da Blog::faq) === */

.blog-faq-title{font-size:1.4em;font-weight:300;margin:0 0 20px}
.blog-faq-accordion{border-top:1px solid #e5e5e5}
.blog-faq-item{border-bottom:1px solid #e5e5e5}
.blog-faq-item h3{font-size:1.35em !important;font-weight:300 !important; margin-top:10px !important;}
.blog-faq-question{
    display:flex;align-items:center;gap:16px;
    margin:0;padding:22px 0;cursor:pointer;
    font-size:1.25em;font-weight:500;color:#55585c;
    transition:color .2s ease;list-style:none;
}
.blog-faq-item.is-open .blog-faq-question{color:#e8491d}
.blog-faq-num{flex:0 0 auto}
.blog-faq-q-text{flex:1 1 auto; font-weight:300 !important;}
.blog-faq-icon{
    flex:0 0 auto;width:28px;height:28px;border-radius:50%;
    border:1px solid currentColor;position:relative;
}
.blog-faq-icon::before,.blog-faq-icon::after{
    content:"";position:absolute;background:currentColor;
    top:50%;left:50%;transform:translate(-50%,-50%);
}
.blog-faq-icon::before{width:12px;height:2px}
.blog-faq-icon::after{width:2px;height:12px;transition:transform .2s ease}
.blog-faq-item.is-open .blog-faq-icon::after{transform:translate(-50%,-50%) scaleY(0)}
.blog-faq-answer{
    max-height:0;overflow:hidden;
    transition:max-height .3s ease;
}
.blog-faq-answer-inner{padding:0 0 22px}
.blog-faq-answer-inner p:first-child{margin-top:0}
