/* ARTICLE — STRUTTURA E COMPORTAMENTI FISSI
 * Layout di immagini e gallery, Play, video/audio, HTML embedded, colonne,
 * indici, accordion e altri componenti. Include i breakpoint funzionali.
 * Per colori, font, bordi e formattazione del testo usare article-custom.css.
 * Le icone SVG e gli stati di apertura/chiusura fanno parte della struttura.
 */

/* Articolo */
.article.article {
    overflow: hidden;
    position: relative;
    width: 100%;

    & * {
        scroll-margin-top: var(--margin-scroll-top, 80px);
    }

    .img_left::before,
    .img_right::before,
    .img_left::after,
    .img_right::after {
        position: relative;
        display: block;
        overflow: hidden;
        visibility: hidden;
        clear: both;
        width: 100%;
        height: 0;
        content: " ";
    }

    /* Valori comuni dei blocchi */
    p,
    ul,
    ol,
    blockquote,
    pre,
    table,
    [data-image-block],
    .editor-image-block,
    [data-columns-block],
    .editor-columns,
    [data-html-block],
    .editor-html-block,
    [content-box],
    .editor-template-block,
    .editor-template-code {
        max-width: 100%;
    }

    /* Indice e navigazione interna */
    .editor-anchor-nav,
    .article-anchor-nav {
        display: block;
        position: relative;
        width: 100%;
        margin-block: var(--space-lg, 1.5rem);
        padding: 0;
        overflow: hidden;
        isolation: isolate;
    }

    .editor-anchor-nav::after,
    .article-anchor-nav::after {
        pointer-events: none;
        content: "";
        position: absolute;
        top: -5vw;
        right: -5vw;
        width: 25vw;
        height: 25vw;
        opacity: 0.1;
        z-index: 0;
        -webkit-mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxNiAxNic+PHBhdGggZD0nTTQuNzE1IDYuNTQyIDMuMzQzIDcuOTE0YTMgMyAwIDEgMCA0LjI0MyA0LjI0M2wxLjgyOC0xLjgyOUEzIDMgMCAwIDAgOC41ODYgNS41TDggNi4wODZhMSAxIDAgMCAwLS4xNTQuMTk5IDIgMiAwIDAgMSAuODYxIDMuMzM3TDYuODggMTEuNDVhMiAyIDAgMSAxLTIuODMtMi44M2wuNzkzLS43OTJhNCA0IDAgMCAxLS4xMjgtMS4yODd6Jy8+PHBhdGggZD0nTTYuNTg2IDQuNjcyQTMgMyAwIDAgMCA3LjQxNCA5LjVsLjc3NS0uNzc2YTIgMiAwIDAgMS0uODk2LTMuMzQ2TDkuMTIgMy41NWEyIDIgMCAxIDEgMi44MyAyLjgzbC0uNzkzLjc5MmMuMTEyLjQyLjE1NS44NTUuMTI4IDEuMjg3bDEuMzcyLTEuMzcyYTMgMyAwIDEgMC00LjI0My00LjI0M3onLz48L3N2Zz4=") center / contain no-repeat;
        mask: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxNiAxNic+PHBhdGggZD0nTTQuNzE1IDYuNTQyIDMuMzQzIDcuOTE0YTMgMyAwIDEgMCA0LjI0MyA0LjI0M2wxLjgyOC0xLjgyOUEzIDMgMCAwIDAgOC41ODYgNS41TDggNi4wODZhMSAxIDAgMCAwLS4xNTQuMTk5IDIgMiAwIDAgMSAuODYxIDMuMzM3TDYuODggMTEuNDVhMiAyIDAgMSAxLTIuODMtMi44M2wuNzkzLS43OTJhNCA0IDAgMCAxLS4xMjgtMS4yODd6Jy8+PHBhdGggZD0nTTYuNTg2IDQuNjcyQTMgMyAwIDAgMCA3LjQxNCA5LjVsLjc3NS0uNzc2YTIgMiAwIDAgMS0uODk2LTMuMzQ2TDkuMTIgMy41NWEyIDIgMCAxIDEgMi44MyAyLjgzbC0uNzkzLjc5MmMuMTEyLjQyLjE1NS44NTUuMTI4IDEuMjg3bDEuMzcyLTEuMzcyYTMgMyAwIDEgMC00LjI0My00LjI0M3onLz48L3N2Zz4=") center / contain no-repeat;
    }

    .editor-anchor-nav:not(:has(.article-anchor-nav-toggle)),
    .article-anchor-nav:not(:has(.article-anchor-nav-toggle)) {
        padding-bottom: clamp(1.15rem, 2.8vw, 1.8rem);
    }

    .editor-anchor-nav-title,
    .article-anchor-nav-title,
    .editor-anchor-nav-links,
    .article-anchor-nav-links,
    .article-anchor-nav-toggle {
        position: relative;
        z-index: 1;
    }

    .editor-anchor-nav-title,
    .article-anchor-nav-title {
        margin: 0;
        padding-top: clamp(1.15rem, 2.8vw, 1.8rem);
        padding-inline: clamp(1.15rem, 2.8vw, 1.8rem);
    }

    .editor-anchor-nav-links,
    .article-anchor-nav-links {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: clamp(0.8rem, 1.2vw + 1vw, 1.1rem);
        margin-top: 0;
        padding-top: clamp(1.15rem, 2.8vw, 1.8rem);
        padding-inline: clamp(1.15rem, 2.8vw, 1.8rem);
        overflow: hidden;
        max-height: none;
    }

    .article-anchor-nav.is-ready .editor-anchor-nav-links,
    .article-anchor-nav.is-ready .article-anchor-nav-links {
        transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .editor-anchor-nav-item,
    .article-anchor-nav-item {
        display: block;
        align-items: center;
    }

    .editor-anchor-nav-link,
    .article-anchor-nav-link {
        display: inline-flex;
        align-items: center;
        gap: 0.55rem;
    }

    .editor-anchor-nav-link::before,
    .article-anchor-nav-link::before {
        content: "";
        display: inline-block;
        width: 0.56em;
        height: 0.56em;
        flex-shrink: 0;
    }

    .article-anchor-nav-toggle {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        margin-top: clamp(1.15rem, 2.2vw, 1.9rem);
        padding: clamp(1.15rem, 2.8vw, 1.8rem);
        padding-block: 1rem;
        width: 100%;
        border: 0;
        cursor: pointer;

        &::before {
            pointer-events: none;
            content: "";
            display: block;
            height: 120px;
            position: absolute;
            right: 0;
            top: -120px;
            width: 100%;
            transition: opacity 0.22s ease;
        }
    }

    .anchor-nav-toggle-icon {
        transform-origin: center;
        transition: transform 0.22s ease;
    }

    .article-anchor-nav.is-expanded .anchor-nav-toggle-icon {
        transform: rotate(180deg);
    }

    .article-anchor-nav.is-expanded .article-anchor-nav-toggle {
        &::before {
            opacity: 0;
        }
    }

    .article-anchor-nav.is-collapsed .editor-anchor-nav-item[data-anchor-nav-extra="1"],
    .article-anchor-nav.is-collapsed .article-anchor-nav-item[data-anchor-nav-extra="1"] {
        pointer-events: none;
    }

    /* Media nativi */
    iframe,
    video,
    audio,
    embed,
    object {
        max-width: 100%;
    }

    video {
        display: block;
        width: 100%;
        height: auto;
    }

    audio {
        width: min(100%, 520px);
    }

    /* Immagini singole, affiancate e gallery */
    [data-image-block],
    .editor-image-block {
        --article-image-gap: clamp(0.9rem, 1.8vw, 1.5rem);
        overflow: clip;
        display: block;
        width: 100%;
        margin-block: var(--space-lg, 1.5rem);
    }

    [data-image-block] *,
    .editor-image-block * {
        box-sizing: border-box;
    }

    [data-image-block] .image-media,
    .editor-image-block .image-media {
        margin: 0;
        width: min(100%, var(--image-size, 100%));
    }

    [data-image-block] .image-media>a,
    .editor-image-block .image-media>a,
    [data-image-block].image-layout-gallery .gallery-image>a,
    .editor-image-block.image-layout-gallery .gallery-image>a {
        position: relative;
        display: block;
        width: 100%;
    }

    [data-image-block].image-layout-gallery .gallery-image>a,
    .editor-image-block.image-layout-gallery .gallery-image>a {
        overflow: hidden;
        isolation: isolate;
    }

    [data-image-block].image-layout-gallery .gallery-image>a::before,
    .editor-image-block.image-layout-gallery .gallery-image>a::before {
        content: "";
        position: absolute;
        inset: 0;
        backdrop-filter: blur(0);
        -webkit-backdrop-filter: blur(0);
        opacity: 0;
        transition: opacity 0.28s ease, backdrop-filter 0.28s ease, -webkit-backdrop-filter 0.28s ease, background-color 0.28s ease;
        pointer-events: none;
        z-index: 1;
    }

    [data-image-block].image-layout-gallery .gallery-image>a::after,
    .editor-image-block.image-layout-gallery .gallery-image>a::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: clamp(2.1rem, 5vw, 2.9rem);
        height: clamp(2.1rem, 5vw, 2.9rem);
        background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCA0OCA0OCc+PGcgZmlsbD0nbm9uZScgc3Ryb2tlPSd3aGl0ZScgc3Ryb2tlLXdpZHRoPSczJyBzdHJva2UtbGluZWNhcD0ncm91bmQnIHN0cm9rZS1saW5lam9pbj0ncm91bmQnPjxjaXJjbGUgY3g9JzIxJyBjeT0nMjEnIHI9JzEwJy8+PHBhdGggZD0nbTI4IDI4IDEwIDEwJy8+PHBhdGggZD0nTTIxIDE2djEwJy8+PHBhdGggZD0nTTE2IDIxaDEwJy8+PC9nPjwvc3ZnPg==") center / contain no-repeat;
        transform: translate(-50%, -42%) scale(0.86);
        opacity: 0;
        transition: opacity 0.24s ease, transform 0.24s ease;
        pointer-events: none;
        z-index: 2;
    }

    [data-image-block].image-layout-gallery .gallery-image>a:hover::before,
    [data-image-block].image-layout-gallery .gallery-image>a:focus-visible::before,
    .editor-image-block.image-layout-gallery .gallery-image>a:hover::before,
    .editor-image-block.image-layout-gallery .gallery-image>a:focus-visible::before {
        opacity: 1;
        backdrop-filter: blur(1.4px);
        -webkit-backdrop-filter: blur(1.4px);
    }

    [data-image-block].image-layout-gallery .gallery-image>a:hover::after,
    [data-image-block].image-layout-gallery .gallery-image>a:focus-visible::after,
    .editor-image-block.image-layout-gallery .gallery-image>a:hover::after,
    .editor-image-block.image-layout-gallery .gallery-image>a:focus-visible::after {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(1);
    }

    /* Play e interazione Lightbox: copertine centrali, affiancate e in gallery */
    [data-image-block] :is(.image-media, [data-image-media]) > a[data-video-provider],
    .editor-image-block :is(.image-media, [data-image-media]) > a[data-video-provider],
    [data-image-block].image-layout-gallery .gallery-image > a[data-video-provider],
    .editor-image-block.image-layout-gallery .gallery-image > a[data-video-provider] {
        position: relative;
        display: block;
        cursor: pointer;
        isolation: isolate;

        > img {
            transition: filter 0.24s ease;
        }

        /* Il video usa lo stesso effetto in ogni layout, senza la lente delle foto. */
        &::before {
            content: none;
        }

        &::after {
            content: "";
            position: absolute;
            top: 50%;
            left: 50%;
            width: clamp(2rem, 5vw, 3rem);
            height: clamp(2rem, 5vw, 3rem);
            background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='22' fill='%23000' fill-opacity='.72' stroke='white' stroke-width='2'/%3E%3Cpath d='M20 15 34 24 20 33Z' fill='white'/%3E%3C/svg%3E") center / contain no-repeat;
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
            transition: transform 0.24s ease, filter 0.24s ease;
            pointer-events: none;
            z-index: 2;
        }

        &:is(:hover, :focus-visible) {
            > img {
                filter: brightness(0.82);
            }

            &::after {
                transform: translate(-50%, -50%) scale(1.14);
                filter: drop-shadow(0 3px 8px rgb(0 0 0 / 40%));
            }
        }

        @media (prefers-reduced-motion: reduce) {
            > img,
            &::after {
                transition: none;
            }

            &:is(:hover, :focus-visible)::after {
                transform: translate(-50%, -50%) scale(1);
            }
        }
    }

    [data-image-block] img,
    .editor-image-block img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    /* Didascalie */
    [data-image-block] figcaption:where(.image-caption, .gallery-caption),
    .editor-image-block figcaption:where(.image-caption, .gallery-caption) {
        overflow-wrap: anywhere;
    }

    [data-image-block] [data-image-text],
    [data-image-block] .image-text,
    .editor-image-block [data-image-text],
    .editor-image-block .image-text {
        min-width: 0;
    }

    [data-image-block] [data-image-text]> :first-child,
    [data-image-block] .image-text> :first-child,
    .editor-image-block [data-image-text]> :first-child,
    .editor-image-block .image-text> :first-child {
        margin-top: 0;
    }

    [data-image-block] [data-image-text]> :last-child,
    [data-image-block] .image-text> :last-child,
    .editor-image-block [data-image-text]> :last-child,
    .editor-image-block .image-text> :last-child {
        margin-bottom: 0;
    }

    [data-image-block].image-layout-center .image-media,
    .editor-image-block.image-layout-center .image-media {
        margin-inline: auto;
    }

    [data-image-block].image-layout-left,
    .editor-image-block.image-layout-left,
    [data-image-block].image-layout-right,
    .editor-image-block.image-layout-right {
        display: grid;
        gap: var(--article-image-gap);
        align-items: start;
        width: 100%;
    }

    [data-image-block].image-layout-left,
    .editor-image-block.image-layout-left {
        grid-template-columns: minmax(0, min(var(--image-size, 50%), 80%)) minmax(0, 1fr);
        grid-template-areas: "media text";
    }

    [data-image-block].image-layout-left>.image-media,
    .editor-image-block.image-layout-left>.image-media {
        grid-area: media;
    }

    [data-image-block].image-layout-left>[data-image-text],
    [data-image-block].image-layout-left>.image-text,
    .editor-image-block.image-layout-left>[data-image-text],
    .editor-image-block.image-layout-left>.image-text {
        grid-area: text;
    }

    [data-image-block].image-layout-right,
    .editor-image-block.image-layout-right {
        grid-template-columns: minmax(0, 1fr) minmax(0, min(var(--image-size, 50%), 80%));
        grid-template-areas: "text media";
    }

    [data-image-block].image-layout-right>[data-image-text],
    [data-image-block].image-layout-right>.image-text,
    .editor-image-block.image-layout-right>[data-image-text],
    .editor-image-block.image-layout-right>.image-text {
        grid-area: text;
    }

    [data-image-block].image-layout-right>.image-media,
    .editor-image-block.image-layout-right>.image-media {
        grid-area: media;
    }

    [data-image-block].image-layout-left>.image-media,
    .editor-image-block.image-layout-left>.image-media,
    [data-image-block].image-layout-right>.image-media,
    .editor-image-block.image-layout-right>.image-media {
        width: 100%;
        max-width: 100%;
    }

    [data-image-block].image-layout-left>[data-image-text],
    [data-image-block].image-layout-left>.image-text,
    .editor-image-block.image-layout-left>[data-image-text],
    .editor-image-block.image-layout-left>.image-text,
    [data-image-block].image-layout-right>[data-image-text],
    [data-image-block].image-layout-right>.image-text,
    .editor-image-block.image-layout-right>[data-image-text],
    .editor-image-block.image-layout-right>.image-text {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    [data-image-block].image-layout-gallery,
    .editor-image-block.image-layout-gallery {
        --article-gallery-gap: clamp(0.7rem, 1.6vw, 1rem);
        display: flex;
        flex-direction: column;
        gap: var(--article-gallery-gap);
    }

    [data-image-block].image-layout-gallery>[data-gallery-group],
    .editor-image-block.image-layout-gallery>[data-gallery-group] {
        display: grid;
        grid-template-columns: repeat(var(--gallery-cols, 3), minmax(0, 1fr));
        gap: var(--article-gallery-gap);
    }

    [data-image-block].image-layout-gallery .gallery-item,
    .editor-image-block.image-layout-gallery .gallery-item {
        min-width: 0;
    }

    [data-image-block].image-layout-gallery .gallery-item.is-empty,
    .editor-image-block.image-layout-gallery .gallery-item.is-empty {
        display: none !important;
    }

    [data-image-block].image-layout-gallery .gallery-figure,
    .editor-image-block.image-layout-gallery .gallery-figure {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin: 0;
        height: 100%;
    }

    [data-image-block].image-layout-gallery .gallery-image,
    .editor-image-block.image-layout-gallery .gallery-image {
        overflow: hidden;
    }

    [data-image-block].image-layout-gallery .gallery-image img,
    .editor-image-block.image-layout-gallery .gallery-image img {
        width: 100%;
        height: 100%;
        aspect-ratio: 4 / 3;
        object-fit: cover;
    }

    /* Colonne editoriali */
    [data-columns-block],
    .editor-columns {
        display: flex;
        align-items: flex-start;
        gap: clamp(0.9rem, 1.8vw, 1.35rem);
        width: 100%;
        margin-block: var(--space-lg, 1.5rem);
    }

    [data-columns-block]>[data-column],
    [data-columns-block]>.editor-column,
    .editor-columns>[data-column],
    .editor-columns>.editor-column {
        min-width: 0;
        flex: 1 1 0;
    }

    [data-columns-block]>[data-column]> :first-child,
    [data-columns-block]>.editor-column> :first-child,
    .editor-columns>[data-column]> :first-child,
    .editor-columns>.editor-column> :first-child {
        margin-top: 0;
    }

    [data-columns-block]>[data-column]> :last-child,
    [data-columns-block]>.editor-column> :last-child,
    .editor-columns>[data-column]> :last-child,
    .editor-columns>.editor-column> :last-child {
        margin-bottom: 0;
    }

    [data-columns-block].columns-30-70>[data-column="left"],
    .editor-columns.columns-30-70>[data-column="left"] {
        flex: 0 1 30%;
    }

    [data-columns-block].columns-30-70>[data-column="right"],
    .editor-columns.columns-30-70>[data-column="right"] {
        flex: 0 1 70%;
    }

    [data-columns-block].columns-70-30>[data-column="left"],
    .editor-columns.columns-70-30>[data-column="left"] {
        flex: 0 1 70%;
    }

    [data-columns-block].columns-70-30>[data-column="right"],
    .editor-columns.columns-70-30>[data-column="right"] {
        flex: 0 1 30%;
    }

    [data-columns-block] [data-image-block],
    [data-columns-block] .editor-image-block,
    .editor-columns [data-image-block],
    .editor-columns .editor-image-block {
        margin-block: 0;
    }

    /* Box di contenuto e template */
    [content-box] {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
        margin-block: var(--space-lg, 1.5rem);
    }

    [content-box] [box] {
        padding: 1rem;

        > :first-child {
            margin-top: 0;
        }

        > :last-child {
            margin-bottom: 0;
        }
    }

    .editor-template-block,
    [data-template-block] {
        margin-block: var(--space-lg, 1.5rem);
        padding: 1rem;
    }

    .editor-template-code,
    [data-template-code] {
        margin-block: var(--space-lg, 1.5rem);
        padding: 1rem;
        overflow-x: auto;
        white-space: pre-wrap;
        word-break: break-word;
    }

    /* HTML embedded e video responsive */
    [data-html-block],
    .editor-html-block {
        display: block;
        margin-block: var(--space-lg, 1.5rem);
        max-width: 100%;
    }

    [data-html-block] [data-html-render],
    .editor-html-block [data-html-render],
    .editor-html-block .editor-html-render {
        display: block;
        width: 100%;
        max-width: 100%;
    }

    [data-html-block] [data-html-render] :where(img, video, audio, embed, object),
    .editor-html-block [data-html-render] :where(img, video, audio, embed, object),
    .editor-html-block .editor-html-render :where(img, video, audio, embed, object) {
        max-width: 100%;
    }

    [data-html-block] [data-html-render] iframe,
    .editor-html-block [data-html-render] iframe,
    .editor-html-block .editor-html-render iframe {
        display: block;
        width: 100%;
        max-width: 100%;
        min-height: clamp(220px, 45vw, 520px);
        border: 0;
    }

    [data-html-block] [data-html-render] .editor-html-embed-responsive,
    .editor-html-block [data-html-render] .editor-html-embed-responsive,
    .editor-html-block .editor-html-render .editor-html-embed-responsive {
        position: relative;
        width: 100%;
        max-width: 100%;
        padding-top: var(--embed-ratio, 56.25%);
        overflow: hidden;
    }

    [data-html-block] [data-html-render] .editor-html-embed-responsive>iframe,
    .editor-html-block [data-html-render] .editor-html-embed-responsive>iframe,
    .editor-html-block .editor-html-render .editor-html-embed-responsive>iframe {
        position: absolute;
        inset: 0;
        width: 100% !important;
        height: 100% !important;
        min-height: 0;
        border: 0;
    }

    /* Controlli riservati all’editor */
    [data-caption-add],
    [data-caption-remove],
    [data-image-caption-add],
    [data-image-caption-remove],
    [data-gallery-caption-add],
    [data-gallery-caption-remove],
    [data-image-caption-trigger],
    [data-gallery-caption-trigger],
    [data-gallery-image-remove],
    [data-gallery-add],
    [data-gallery-group-add],
    [data-image-link-trigger],
    [data-html-label],
    .image-caption-trigger,
    .gallery-caption-trigger,
    .image-caption-add,
    .gallery-caption-add,
    .image-caption-remove,
    .gallery-caption-remove,
    .gallery-add,
    .gallery-group-add,
    .gallery-image-remove,
    .image-link-trigger,
    .editor-block-handle {
        display: none !important;
    }

    /* Breakpoint responsive */
    @media (max-width: 1024px) {
        [data-image-block].image-layout-gallery>[data-gallery-group],
        .editor-image-block.image-layout-gallery>[data-gallery-group] {
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        }
    }

    @media (max-width: 900px) {
        [data-columns-block],
        .editor-columns {
            flex-direction: column;
        }

        [data-columns-block]>[data-column],
        [data-columns-block]>.editor-column,
        .editor-columns>[data-column],
        .editor-columns>.editor-column {
            width: 100%;
            flex: 1 1 auto !important;
        }

        [data-html-block] [data-html-render] iframe,
        .editor-html-block [data-html-render] iframe,
        .editor-html-block .editor-html-render iframe {
            min-height: clamp(190px, 52vw, 420px);
        }
    }

    @media (max-width: 760px) {
        [data-image-block].image-layout-left,
        .editor-image-block.image-layout-left,
        [data-image-block].image-layout-right,
        .editor-image-block.image-layout-right {
            grid-template-columns: 1fr;
            grid-template-areas: "media" "text";
        }

        [data-image-block].image-layout-left>.image-media,
        .editor-image-block.image-layout-left>.image-media,
        [data-image-block].image-layout-left>[data-image-text],
        [data-image-block].image-layout-left>.image-text,
        .editor-image-block.image-layout-left>[data-image-text],
        .editor-image-block.image-layout-left>.image-text,
        [data-image-block].image-layout-right>.image-media,
        .editor-image-block.image-layout-right>.image-media,
        [data-image-block].image-layout-right>[data-image-text],
        [data-image-block].image-layout-right>.image-text,
        .editor-image-block.image-layout-right>[data-image-text],
        .editor-image-block.image-layout-right>.image-text {
            grid-column: 1;
        }

        [data-image-block].image-layout-left .image-media,
        .editor-image-block.image-layout-left .image-media,
        [data-image-block].image-layout-right .image-media,
        .editor-image-block.image-layout-right .image-media {
            width: 100%;
        }
    }

    @media (max-width: 640px) {
        .editor-anchor-nav,
        .article-anchor-nav {
            padding: 1rem 0.95rem;
        }

        [data-image-block].image-layout-gallery>[data-gallery-group],
        .editor-image-block.image-layout-gallery>[data-gallery-group] {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }
    }

    @media (max-width: 520px) {
        [data-image-block].image-layout-gallery>[data-gallery-group],
        .editor-image-block.image-layout-gallery>[data-gallery-group] {
            grid-template-columns: 1fr;
        }
    }

    /* Immagini tradizionali e didascalie sovrapposte */
    .img_left {
        clear: left;
        display: block;
        float: left;
        margin: 10px 4% 10px 0;
        max-width: var(--max-width-img, 33%);

        img {
            max-width: 100%;
            height: auto;
        }
    }

    .img_center {
        clear: none;
        display: block;
        float: none;
        margin: 10px 0;
        max-width: 100%;

        img {
            max-width: 100%;
            height: auto;
        }
    }

    .img_right {
        clear: right;
        display: block;
        float: right;
        margin: 10px 0 10px 4%;
        max-width: var(--max-width-img, 33%);

        img {
            max-width: 100%;
            height: auto;
        }
    }

    .img_with_caption {
        display: block;
        max-width: 100%;
        overflow: hidden;
        position: relative;

        &.img_right,
        &.img_left {
            max-width: var(--max-width-img, 33%);
        }

        img {
            max-width: 100%;
            vertical-align: top;
        }

        .img_caption {
            bottom: 0;
            display: block;
            padding: 10px 15px;
            position: absolute;
            transition: all 0.5s ease-in-out;
            width: 100%;
        }

        &:hover .img_caption {
            bottom: -60px;
        }
    }

    .img_huge {
        width: 100%;
    }

    @media (max-width: 768px) {
        .img_left,
        .img_right,
        .img_with_caption {
            max-width: none;
            width: 100%;
            margin: 10px 0;
        }

        .img_with_caption .img_caption {
            position: relative;
            transition: none;
        }

        .img_with_caption:hover {
            padding: 10px 15px;
        }
    }
}

/* Accordion */
.infoAccordion.infoAccordion--boost {
    position: relative;
    padding-block: var(--grid-margin, 36px);

    &.no-pddng {
        padding-block: unset;
    }

    & * {
        transition: var(--transition-default);
    }

    & .infoAccordion__elm {
        display: block;
        width: min(100%, var(--max-content-width));
        padding-block: var(--elm-padding-block);

        &+.infoAccordion__elm {
            margin-top: calc(-1 * var(--border-width));
        }

        & label {
            display: block;

            & input {
                display: none;

                &:checked {
                    &~.elmTitolo {
                        & h3 i {
                            transform: rotate(45deg);
                        }
                    }

                    &~article[elm_article] {
                        pointer-events: all;
                        padding: var(--article-padding);
                        max-height: 100vh;
                        opacity: 1;
                    }
                }
            }

            & article[elm_article] {
                overflow: clip;
                pointer-events: none;
                width: 100%;
                padding-top: 0;
                max-height: 0;
                opacity: 0;
            }
        }

        & .elmTitolo {
            position: relative;
            width: 100%;

            & h3 {
                display: flex;
                flex-direction: row;
                flex-wrap: nowrap;
                align-items: center;
                justify-content: space-between;
                gap: 10px;
                width: 100%;

                &:hover {
                    cursor: pointer;
                }
            }
        }

        & .innerObject {
            margin-block-start: var(--elm-padding-block);

            &:first-child {
                margin-block-start: 0;
            }
        }
    }
}

/* Call to action */
.cta.cta {
    position: relative;
    display: block;
    margin-block: var(--cta-margin-block);
    padding: var(--cta-padding);

    &.home {
        margin-block: var(--cta-home-margin-block);

        @media (max-width: 960px) {
            margin-block: var(--cta-home-margin-block-tablet);
        }

        @media (max-width: 768px) {
            margin-block: var(--cta-home-margin-block-mobile);
        }
    }

    @media (max-width: 768px) {
        margin-block: var(--cta-margin-block-mobile);
    }

    & .cta__title {
        overflow: clip;
        position: absolute;
        bottom: 100%;
        left: 0;
        display: inline-block;
        padding: var(--cta-title-padding);
        border: none;
        transition: var(--cta-title-transition);

        &::after {
            content: '';
            position: absolute;
            top: var(--cta-corner-offset);
            right: var(--cta-corner-offset);
            width: var(--cta-corner-size);
            height: var(--cta-corner-size);
            transform: rotate(-45deg);
        }
    }

    & p {
        max-width: var(--cta-paragraph-max-width);
    }

    & a.btn.small {
        transition: all 0.25s ease-in-out;
    }

    & a.btn+a.btn {
        margin-left: var(--cta-button-gap);
    }
}

/* Box a colonne */
.BoxColonne.BoxColonne {
    margin-block: var(--focus-margin-block);
    margin-inline: var(--focus-margin-inline);
    padding: var(--focus-padding-block);

    @media (max-width: var(--bp-sm)) {
        margin-inline: 0;
    }

    & .griglia {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(var(--focus-grid-min-col-width), 1fr));
        gap: var(--focus-grid-gap);
        padding-inline: var(--focus-grid-padding-inline);

        @media (max-width: var(--bp-md)) {
            flex-wrap: wrap;
        }
    }
}

/* Aggiornamenti progetto */
.boxAggiornamentiPrg.boxAggiornamentiPrg {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-content: start;
    margin-top: 1rem;

    & .boxAggiornamentiPrg_cont {
        display: grid;
        grid-template-columns: 50px 1fr;
        align-items: center;
        padding: 0;
        min-height: 300px;

        &+* {
            margin-top: 0.55rem;
        }

        & .boxAggiornamentiPrg_cont-fascia {
            position: relative;
            display: block;
            width: 100%;
            height: 100%;

            & strong {
                position: absolute;
                top: 2rem;
                left: 0;
                margin: 0;
                padding: 0;
                display: flex;
                align-items: center;
                justify-content: flex-start;
                width: auto;
                height: 50px;
                white-space: nowrap;
                transform-origin: top left;
                transform: rotate(-90deg) translateX(-100%);
            }
        }

        & .boxAggiornamentiPrg_cont-testi {
            padding: 1.25rem;
        }

        & .titoloAggrionamento {
            display: block;
            margin-bottom: 25px;
        }
    }
}
