/* ==========================================================================
   Copiato dal blog di xmag.it (SITO_XMAG 2022/css/blog-cards.css): stessa grafica.
   1) "Continua a leggere" negli articoli (.related-section .blog-entry)
   copertina a tutta larghezza, data/meta arancione, titolo scuro,
   sollevamento al passaggio del mouse.
   data-reveal sulla scheda: compare quando entra nello schermo (js/reveal.js)
   ========================================================================== */

.related-section .blog-entry {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
    background: #fff;
    border: 1px solid #f1ece6;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 12px 30px -18px rgba(16, 42, 67, .35);
    transition: opacity .8s ease, transform .6s cubic-bezier(.2, .8, .2, 1), box-shadow .45s ease;
}

    .related-section .blog-entry:hover {
        transform: translateY(-6px);
        box-shadow: 0 24px 44px -22px rgba(239, 127, 54, .5);
    }

/* copertina: lo stile inline del contenitore ha un raggio proprio, qui lo azzero */
.related-section .blog-entry > div:first-child {
    position: relative;
    border-radius: 0 !important;
    background: #f7f9fc;
}

    .related-section .blog-entry > div:first-child::before {
        content: "";
        position: absolute;
        inset: 55% 0 0;
        z-index: 1;
        background: linear-gradient(to top, rgba(20, 16, 12, .4), rgba(20, 16, 12, 0));
        pointer-events: none;
    }

    .related-section .blog-entry > div:first-child img {
        transition: transform .6s cubic-bezier(.2, .8, .2, 1);
    }

.related-section .blog-entry:hover > div:first-child img {
    transform: scale(1.06);
}

.related-section .blog-entry .text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 22px 24px 24px !important;
    text-align: left;
}

/* "Articolo in evidenza", "Novità" */
.blog-entry .text .badge.badge-dark {
    align-self: flex-start;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #21c6db;
    background: #e6f9fb;
    border-radius: 30px;
    padding: 5px 12px;
    margin-bottom: 12px !important;
}

.related-section .blog-entry .text .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-bottom: 8px;
}

    .related-section .blog-entry .text .meta > div,
    .related-section .blog-entry .text .meta > div a {
        margin: 0;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .08em;
        text-transform: uppercase;
        color: #ef7f36;
    }

        /* sul sito net le icone sono di icomoon (icon-), su xmag.it di ionicons (ion-) */
        .related-section .blog-entry .text .meta [class^="ion-"],
        .related-section .blog-entry .text .meta [class^="icon-"] {
            color: #21c6db;
            font-size: 14px;
        }

.related-section .blog-entry .text .heading {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -.01em;
    margin: 0 0 10px;
}

    .related-section .blog-entry .text .heading a {
        color: #2f2f35;
        transition: color .25s ease;
    }

.related-section .blog-entry:hover .text .heading a {
    color: #ef7f36;
}

/* "Leggi l'articolo": la freccia si allontana al passaggio del mouse */
.related-section .blog-entry .text .read {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    align-self: flex-start;
    margin-top: auto;
    padding-top: 6px;
    font-size: 14.5px;
    font-weight: 500;
    color: #ef7f36;
    transition: gap .25s ease;
}

.related-section .blog-entry:hover .text .read {
    gap: 8px;
}

/* comparsa allo scroll */
.blog-entry[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
}

    .blog-entry[data-reveal].is-in {
        opacity: 1;
        transform: none;
    }

.related-section .row > :nth-child(2) .blog-entry[data-reveal]:not(.is-settled) {
    transition-delay: .12s;
}

.related-section .row > :nth-child(3) .blog-entry[data-reveal]:not(.is-settled) {
    transition-delay: .24s;
}

.related-section .blog-entry[data-reveal].is-in:hover {
    transform: translateY(-6px);
}

@media (max-width: 767.98px) {
    .related-section .blog-entry {
        border-radius: 18px;
        margin-bottom: 24px;
    }

    .related-section .blog-entry .text {
        padding: 18px 18px 20px !important;
    }
}


/* ==========================================================================
   2) Pagina Blog (blog.html, #blogGrid): griglia "a rivista"
   - griglia a 6 colonne: scheda normale = 2 colonne, .post--wide = 4 (orizzontale),
     .post--featured e striscia finale = tutta la riga
   - tablet: scheda normale = metà riga, solo featured e .post--wide-tab orizzontali
   - con un filtro attivo (.is-filtered) tutte le schede tornano normali
   - ogni argomento ha il suo colore (--cat)
   ========================================================================== */

[data-cat="ai"]          { --cat: #8b5cf6; --cat-soft: rgba(139, 92, 246, .45); --cat-tint: #f4f0fe; }
[data-cat="sviluppo"]    { --cat: #3b6fe0; --cat-soft: rgba(59, 111, 224, .45); --cat-tint: #eef3fd; }
[data-cat="azienda"]     { --cat: #f2a516; --cat-soft: rgba(242, 165, 22, .45); --cat-tint: #fef6e6; }

.blog-list.ftco-section {
    padding-top: 36px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-flow: row dense;
    gap: 34px 30px;
}

    .blog-grid > * {
        grid-column: span 2;
        min-width: 0;
    }

    .blog-grid > .post--wide { grid-column: span 4; }
    .blog-grid > .post--featured,
    .blog-grid > .blog-cta-strip { grid-column: 1 / -1; }
    .blog-grid.is-filtered > .post { grid-column: span 2; }
    .blog-grid.is-filtered > .blog-cta-strip { display: none; }

/* --- scheda --- */
.post {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #f1ece6;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 12px 30px -18px rgba(16, 42, 67, .35);
    transition: opacity .8s ease, transform .6s cubic-bezier(.2, .8, .2, 1), box-shadow .45s ease;
}

    /* barra colorata dell'argomento */
    .post::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        z-index: 3;
        background: var(--cat);
    }

    .post:hover {
        transform: translateY(-6px);
        box-shadow: 0 28px 50px -24px var(--cat-soft);
    }

.post-cover {
    position: relative;
    display: block;
    aspect-ratio: 1672 / 941;
    overflow: hidden;
    background: #f7f9fc;
}

    .post-cover::before {
        content: "";
        position: absolute;
        inset: 55% 0 0;
        z-index: 1;
        background: linear-gradient(to top, rgba(20, 16, 12, .45), rgba(20, 16, 12, 0));
        pointer-events: none;
    }

    .post-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
        transition: transform .6s cubic-bezier(.2, .8, .2, 1);
    }

.post:hover .post-cover img {
    transform: scale(1.06);
}

/* pillola dell'argomento sulla copertina */
.cat-tag {
    position: absolute;
    left: 16px;
    bottom: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    color: #fff;
    background: var(--cat);
    border-radius: 30px;
    padding: 5px 13px 5px 11px;
    box-shadow: 0 8px 18px -8px var(--cat);
}

    .cat-tag [class^="ion-"],
    .cat-tag [class^="icon-"] {
        font-size: 16px;
        line-height: 1;
    }

.post-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 24px 26px 26px;
    text-align: left;
}

/* "Articolo in evidenza" e "Nuovo" */
.post-flag,
.post-new {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    border-radius: 30px;
    padding: 5px 12px;
    margin-bottom: 14px;
}

.post-flag {
    color: #e5702a;
    background: #fff1e6;
}

.post-new {
    color: #fff;
    background: linear-gradient(90deg, #faa752, #ff8000);
    box-shadow: 0 6px 14px -8px rgba(255, 128, 0, .8);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #8a8a93;
}

    .post-meta [class^="ion-"],
    .post-meta [class^="icon-"] {
        color: var(--cat);
        font-size: 15px;
        margin-right: 5px;
        vertical-align: -1px;
    }

.post-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.01em;
    margin: 0 0 12px;
}

    .post-title a {
        color: #2f2f35;
        transition: color .25s ease;
    }

.post:hover .post-title a {
    color: #ef7f36;
}

/* parola chiave nel titolo: grassetto arancione con fascia pesca (stile del sito) */
.post-title mark.kw {
    font-weight: 700;
    color: #e5702a;
    background: linear-gradient(transparent 62%, #fde3cc 62%);
    padding: 0 2px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.post-excerpt {
    font-size: 15px;
    line-height: 1.7;
    color: #5f5f68;
    margin: 0 0 18px;
}

/* "Nell'articolo": i punti trattati, nel colore dell'argomento */
.post-points {
    background: var(--cat-tint);
    border-radius: 16px;
    padding: 14px 18px 12px;
    margin-bottom: 20px;
}

.post-points-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--cat);
    margin-bottom: 8px;
}

.post-points ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.post-points li {
    position: relative;
    padding-left: 22px;
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.5;
    color: #3d3d44;
}

    .post-points li::before {
        content: "";
        position: absolute;
        left: 4px;
        top: 3px;
        width: 6px;
        height: 11px;
        border: solid var(--cat);
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
    }

/* "Leggi l'articolo": la freccia si allontana al passaggio del mouse */
.post-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-top: auto;
    font-size: 15px;
    font-weight: 600;
    color: #ef7f36;
    transition: gap .25s ease;
}

    .post-read:hover { color: #d9681f; }

.post:hover .post-read {
    gap: 12px;
}

/* Le copertine contengono testo e logo: non vanno mai ritagliate,
   restano sempre in 16:9 intere. */

/* ordine nella scheda: testo, poi "Nell'articolo", poi "Leggi l'articolo".
   .post-main (schede larghe) raggruppa il testo; in colonna singola "si scioglie" */
.post-main { display: contents; }
.post-body > .post-points { order: 1; }
.post-read { order: 2; }

/* --- in evidenza: copertina intera a sinistra, testo a destra,
       i punti dell'articolo su una fascia sotto --- */
.post--featured > .post-points {
    margin: 0 20px 22px;
}

/* tablet: in evidenza verticale, punti su due colonne */
@media (min-width: 768px) and (max-width: 991.98px) {
    .blog-grid:not(.is-filtered) > .post--featured .post-title {
        font-size: 24px;
    }

    .blog-grid:not(.is-filtered) > .post--featured > .post-points ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 24px;
    }

    .blog-grid:not(.is-filtered) > .post--featured > .post-points li {
        margin: 0;
    }
}

@media (min-width: 992px) {
    .blog-grid:not(.is-filtered) > .post--featured {
        display: grid;
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
        align-items: center;
    }

        .blog-grid:not(.is-filtered) > .post--featured .post-cover {
            margin: 28px 0 24px 28px;
            border-radius: 16px;
            box-shadow: 0 18px 36px -22px rgba(16, 42, 67, .55);
        }

        .blog-grid:not(.is-filtered) > .post--featured .post-body {
            padding: 30px 40px 24px 38px;
        }

        .blog-grid:not(.is-filtered) > .post--featured .post-title {
            font-size: 28px;
            line-height: 1.28;
        }

        .blog-grid:not(.is-filtered) > .post--featured .post-excerpt {
            font-size: 16px;
        }

        .blog-grid:not(.is-filtered) > .post--featured .post-read {
            margin-top: 0;
        }

        .blog-grid:not(.is-filtered) > .post--featured > .post-points {
            grid-column: 1 / -1;
            margin: 0 28px 28px;
            padding: 18px 24px 16px;
        }

            .blog-grid:not(.is-filtered) > .post--featured > .post-points ul {
                display: grid;
                grid-template-columns: repeat(4, minmax(0, 1fr));
                gap: 8px 28px;
            }

            .blog-grid:not(.is-filtered) > .post--featured > .post-points li {
                margin: 0;
            }
}

/* --- schede larghe: copertina intera in alto, sotto testo e punti su due colonne --- */
@media (min-width: 992px) {
    .blog-grid:not(.is-filtered) > .post--wide .post-body {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        gap: 0 28px;
        align-items: start;
        padding: 26px 30px 28px;
    }

    .blog-grid:not(.is-filtered) > .post--wide .post-main {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .blog-grid:not(.is-filtered) > .post--wide .post-points {
        margin-bottom: 0;
    }

    .blog-grid:not(.is-filtered) > .post--wide .post-title {
        font-size: 22px;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .blog-grid:not(.is-filtered) > .post--wide-tab .post-body {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
        gap: 0 26px;
        align-items: start;
    }

    .blog-grid:not(.is-filtered) > .post--wide-tab .post-main {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .blog-grid:not(.is-filtered) > .post--wide-tab .post-points {
        margin-bottom: 0;
    }
}

/* --- striscia finale "Proponi un argomento" --- */
.blog-cta-strip {
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 32px 38px;
    border-radius: 22px;
    background: linear-gradient(120deg, #fff4ea 0%, #fde3cc 100%);
    border: 1px solid #fbd9bb;
    text-decoration: none;
    box-shadow: 0 12px 30px -20px rgba(239, 127, 54, .6);
    transition: opacity .8s ease, transform .6s cubic-bezier(.2, .8, .2, 1), box-shadow .45s ease;
}

    .blog-cta-strip:hover {
        text-decoration: none;
        transform: translateY(-4px);
        box-shadow: 0 24px 44px -22px rgba(239, 127, 54, .6);
    }

.blog-cta-ic {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    font-size: 34px;
    color: #fff;
    background: linear-gradient(135deg, #fbb468, #ef7f36);
    box-shadow: 0 10px 22px -10px rgba(239, 127, 54, .9);
}

.blog-cta-copy {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-cta-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #e5702a;
}

.blog-cta-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #2f2f35;
}

.blog-cta-text {
    font-size: 15px;
    line-height: 1.6;
    color: #6b6b73;
}

.blog-cta-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 99px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(90deg, #faa752, #ff8000);
    box-shadow: 0 8px 18px -8px rgba(255, 128, 0, .8);
    transition: gap .25s ease;
}

.blog-cta-strip:hover .blog-cta-btn {
    gap: 12px;
}

/* --- comparsa allo scroll --- */
.post[data-reveal],
.blog-cta-strip[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
}

    .post[data-reveal].is-in,
    .blog-cta-strip[data-reveal].is-in {
        opacity: 1;
        transform: none;
    }

    .post[data-reveal].is-in:hover {
        transform: translateY(-6px);
    }

    .blog-cta-strip[data-reveal].is-in:hover {
        transform: translateY(-4px);
    }

/* --- tablet: due colonne --- */
@media (max-width: 991.98px) {
    .blog-grid {
        gap: 28px 24px;
    }

        .blog-grid > *,
        .blog-grid > .post--wide,
        .blog-grid.is-filtered > .post {
            grid-column: span 3;
        }

        .blog-grid > .post--featured,
        .blog-grid > .post--wide-tab,
        .blog-grid > .blog-cta-strip {
            grid-column: 1 / -1;
        }

        .blog-grid.is-filtered > .post--featured,
        .blog-grid.is-filtered > .post--wide-tab {
            grid-column: span 3;
        }
}

/* --- telefono: una colonna --- */
@media (max-width: 767.98px) {
    .blog-list.ftco-section {
        padding-top: 24px;
    }

    .blog-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

        .blog-grid > *,
        .blog-grid > .post--wide,
        .blog-grid > .post--wide-tab,
        .blog-grid > .post--featured,
        .blog-grid.is-filtered > .post {
            grid-column: 1 / -1;
        }

    .post {
        border-radius: 18px;
    }

    .post-body {
        padding: 20px 20px 22px;
    }

    .post-title {
        font-size: 19px;
    }

    .blog-cta-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 26px 22px;
    }

    .blog-cta-title {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-entry[data-reveal], .post[data-reveal], .blog-cta-strip[data-reveal] { opacity: 1; transform: none; }
    .related-section .blog-entry, .related-section .blog-entry > div:first-child img,
    .post, .post-cover img, .blog-cta-strip { transition: none; }
}
