/* Block Hero - Maexport */
.maexport-hero {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    min-height: clamp(28rem, 85vh, 40.625rem);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--wp--preset--color--blu, #054290);
    margin-block-start: 0;
}

.maexport-hero.alignfull,
.maexport-hero.alignwide {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Background di sezione - immagine singola via inline style, carosello e video via layer absolute */
.maexport-hero {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.maexport-hero__splide {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    padding: 0 !important;
    overflow: hidden;
}

.maexport-hero__splide,
.maexport-hero__splide .splide__track,
.maexport-hero__splide .splide__list {
    width: 100%;
    height: 100% !important;
    min-height: clamp(28rem, 85vh, 40.625rem);
}

.maexport-hero__splide .splide__track {
    overflow: hidden;
}

.maexport-hero__splide .splide__list {
    display: flex;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    backface-visibility: hidden;
    height: 100% !important;
}

.maexport-hero__splide .splide__slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100% !important;
    min-height: clamp(28rem, 85vh, 40.625rem);
    margin: 0 !important;
    padding: 0 !important;
    border: 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.maexport-hero__bg-video {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Rimuove stile default splide pagination/arrows se presenti */
.maexport-hero__splide .splide__pagination,
.maexport-hero__splide .splide__arrows {
    display: none !important;
}

/* Overlay scuro per leggibilità */
.maexport-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(29, 29, 29, 0.15) 0%, rgba(29, 29, 29, 0.45) 100%);
    z-index: 1;
}

/* Contenuto centrale - sempre sovrapposto al media */
.maexport-hero__inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: min(100% - 2rem, 75rem);
    margin-inline: auto;
    padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(6rem, 14vw, 12rem);
    pointer-events: auto;
    gap: 0;
}

.maexport-hero__breadcrumb-wrap {
    position: absolute;
    top: 3.75rem; /* 60px desktop da header */
    left: 50%;
    transform: translateX(-50%);
    width: min(100% - 2rem, 75rem);
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    z-index: 3;
    pointer-events: auto;
}
.maexport-hero__breadcrumb {
    font-size: 0.875rem; /* 14px smallest */
    font-weight: 800;
    color: #f9f9f9;
    text-align: center;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
}
.maexport-hero__breadcrumb a {
    color: #fabd6f !important;
    font-weight: 800;
    text-decoration: none;
    text-underline-offset: 0.2em;
}
.maexport-hero__breadcrumb a:hover,
.maexport-hero__breadcrumb a:focus {
    text-decoration: underline;
    color: #fabd6f !important;
}
/* Fix: link giallo anche dentro wrapper giallo (blog intro archiviato) - sovrascrive .has-giallo-background-color a {color:#b96038} di input.css */
.has-giallo-background-color .maexport-hero__breadcrumb a,
.has-background[style*="fabd6f"] .maexport-hero__breadcrumb a,
.has-background[style*="FABD6F"] .maexport-hero__breadcrumb a,
.maexport-blog-intro .maexport-hero__breadcrumb a,
.wp-block-shortcode .maexport-hero__breadcrumb a {
    color: #fabd6f !important;
}
.has-giallo-background-color .maexport-hero__breadcrumb a:hover,
.has-background[style*="fabd6f"] .maexport-hero__breadcrumb a:hover {
    color: #fabd6f !important;
}
.maexport-hero__breadcrumb .breadcrumb_last,
.maexport-hero__breadcrumb [aria-current="page"] {
    color: #f9f9f9;
    font-weight: 800;
    opacity: 1;
}

.maexport-hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4.375rem; /* 70px */
    max-width: 56.25rem; /* 900px */
    width: 100%;
    text-align: center;
}

.maexport-hero__title,
.maexport-hero__subtitle,
.maexport-hero__title *,
.maexport-hero__subtitle * {
    color: #f9f9f9 !important;
    white-space: normal !important;
    text-align: center;
    text-shadow: 0 0 24px rgba(0, 0, 0, 0.5) !important;
}

/* Badge evidenziato o titolo principale con sfondo giallo */
.maexport-hero__title {
    font-size: clamp(1.75rem, 4vw, 3.25rem);
    line-height: 1.15;
    font-weight: 800;
    text-wrap: balance;
}

.maexport-hero__title *:first-child {
    margin-top: 0;
}

.maexport-hero__title *:last-child {
    margin-bottom: 0;
}

/* Se evidenziato = true → unico box giallo attorno al titolo primario (Figma: ma-export-parent) */
.maexport-hero--evidenziato .maexport-hero__title {
    background-color: var(--wp--preset--color--giallo, #fabd6f);
    color: #1d1d1d !important;
    padding: 0.18em 0.5em;
    display: inline-block;
    text-shadow: none !important;
    line-height: 1 !important;
    white-space: normal !important;
}
.maexport-hero--evidenziato .maexport-hero__title * {
    color: #1d1d1d !important;
    background: transparent !important;
    text-shadow: none !important;
    white-space: normal !important;
}
.maexport-hero--evidenziato .maexport-hero__subtitle,
.maexport-hero--evidenziato .maexport-hero__subtitle * {
    color: #f9f9f9 !important;
    text-shadow: 0 0 24px rgba(0, 0, 0, 0.5) !important;
    background: none !important;
}
.maexport-hero--evidenziato .maexport-hero__subtitle,
.maexport-hero--evidenziato .maexport-hero__subtitle * {
    margin-bottom: 2rem;
}

/* Span giallo nei testi bianchi non evidenziati - specificità aumentata per override */
.maexport-hero .maexport-hero__title span,
.maexport-hero .maexport-hero__subtitle span,
.maexport-hero__content span {
    color: var(--wp--preset--color--giallo, #fabd6f) !important;
    background: transparent !important;
}
.maexport-hero--evidenziato .maexport-hero__title span,
.maexport-hero--evidenziato .maexport-hero__title * span {
    color: #1d1d1d !important;
    background: transparent !important;
}
.maexport-hero--evidenziato .maexport-hero__subtitle span {
    color: var(--wp--preset--color--giallo, #fabd6f) !important;
    background: transparent !important;
}

/* Se titolo contiene mark o span giallo manuale */
.maexport-hero__title mark,
.maexport-hero__title .has-giallo-background-color {
    background: var(--wp--preset--color--giallo, #fabd6f);
    color: var(--wp--preset--color--nero, #1d1d1d);
    padding: 0.15em 0.4em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    text-shadow: none;
}

.maexport-hero__subtitle {
    font-size: clamp(1rem, 2.2vw, 1.35rem);
    line-height: 1.5;
    font-weight: 400;
    max-width: 56.25rem;
    text-wrap: balance;
    opacity: 1;
}

.maexport-hero__subtitle p {
    margin: 0;
}

.maexport-hero__subtitle strong {
    font-weight: 700;
}

/* Variante piccola: su sfondo chiaro testo scuro, su scuro resta bianco (se non evidenziato resta bianco come richiesto) */
.maexport-hero--piccola .maexport-hero__title,
.maexport-hero--piccola .maexport-hero__subtitle,
.maexport-hero--piccola .maexport-hero__title *,
.maexport-hero--piccola .maexport-hero__subtitle * {
    color: var(--wp--preset--color--nero, #1d1d1d) !important;
    text-shadow: none !important;
}

.maexport-hero--piccola.maexport-hero--dark .maexport-hero__title,
.maexport-hero--piccola.maexport-hero--dark .maexport-hero__subtitle,
.maexport-hero--piccola.maexport-hero--dark .maexport-hero__title *,
.maexport-hero--piccola.maexport-hero--dark .maexport-hero__subtitle * {
    color: #f9f9f9 !important;
    text-shadow: 0 0 24px rgba(0, 0, 0, 0.5) !important;
}

.maexport-hero--piccola {
    overflow: visible;
    flex-direction: column;
    padding-bottom: 0;
}
.maexport-hero--piccola .maexport-hero__inner {
    padding-bottom: 2rem;
    flex-shrink: 0;
}

/* Immagine piccola - di seguito al contenuto, chevron davanti (z3) e immagine dietro (z1), allunga il contenitore */
.maexport-hero__bottom-figure {
    display: none;
    pointer-events: none;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) translateY(45%);
    z-index: 1;
    width: clamp(10rem, 28vw, 18rem);
}
.maexport-hero--piccola .maexport-hero__bottom-figure {
    display: block;
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    z-index: 1;
    width: clamp(12rem, 32vw, 20rem);
    margin: 1.5rem auto 0;
    padding-bottom: 0;
}
.maexport-hero--piccola .maexport-hero__chevron {
    z-index: 3;
}

.maexport-hero__bottom-figure:has(img) {
    display: block;
}

.maexport-hero__bottom-image,
.maexport-hero__bottom-figure img {
    width: 100%;
    height: auto;
    max-height: clamp(14rem, 38vh, 26rem);
    object-fit: contain;
    object-position: center bottom;
    display: block;
    filter: drop-shadow(0 0.75rem 1.25rem rgba(0, 0, 0, 0.2));
}

/* Chevron giallo sovrapposto - stessa inclinazione del divisore sezioni (viewBox 167.21) */
.maexport-hero__chevron {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 80px;
    width: 100%;
    height: clamp(2.5rem, 8vw, 9.75rem);
    z-index: 3;
    line-height: 0;
    pointer-events: none;
}

.maexport-hero__chevron svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Tablet 782px–960px (48.875em–60rem): evita sovrapposizione h1 su breadcrumb */
@media (min-width: 48em) and (max-width: 60rem) {
    .maexport-hero {
        min-height: 38rem;
    }
    .maexport-hero__inner {
        padding-top: 6rem;
        padding-bottom: clamp(5rem, 12vw, 8rem);
    }
    .maexport-hero__breadcrumb-wrap {
        top: 2.5rem;
    }
    .maexport-hero__title {
        font-size: clamp(2rem, 4vw, 2.6rem);
        line-height: 1.1;
    }
}

/* Mobile ottimizzazioni */
@media (max-width: 48em) {
    .maexport-hero {
        min-height: clamp(26rem, 92vh, 34.375rem);
    }

    .maexport-hero__inner {
        padding-top: clamp(4rem, 12vw, 5rem);
        padding-bottom: clamp(5rem, 18vw, 8rem);
    }

    .maexport-hero__breadcrumb-wrap {
        top: 1.875rem; /* 30px mobile da header */
    }

    .maexport-hero__title {
        font-size: clamp(1.65rem, 7vw, 2.4rem);
    }

    .maexport-hero__title h1 {
        line-height: 1;
    }

    .maexport-hero__content {
        gap: 2.375rem;
    }
}

/* Editor preview: assicura altezza visibile */
.editor-styles-wrapper .maexport-hero {
    min-height: 32rem;
}
/* OVERRIDE FINALE - span giallo su testi bianchi (fix cache/precedenza) */
.maexport-hero .maexport-hero__title span,
.maexport-hero .maexport-hero__subtitle span {
    color: var(--wp--preset--color--giallo, #fabd6f) !important;
}
.maexport-hero--evidenziato .maexport-hero__title span {
    color: #1d1d1d !important;
}
.maexport-hero--evidenziato .maexport-hero__subtitle span {
    color: var(--wp--preset--color--giallo, #fabd6f) !important;
}

/* FIX ORDINE - span giallo deve vincere su regola * bianca con !important (piccola dark ha specificità 0,3,0) */
.maexport-hero.maexport-hero--piccola.maexport-hero--dark .maexport-hero__title span,
.maexport-hero.maexport-hero--piccola.maexport-hero--dark .maexport-hero__subtitle span,
html body .maexport-hero .maexport-hero__title span,
html body .maexport-hero .maexport-hero__subtitle span {
    color: var(--wp--preset--color--giallo, #fabd6f) !important;
}
html body .maexport-hero--evidenziato .maexport-hero__title span {
    color: #1d1d1d !important;
}
