/**
 * Stili Frontend per Embla Carousel
 */

.ied-embla-carousel-wrapper {
    position: relative;
    width: 100%;
}

/* Embla Base */
.embla {
    overflow: hidden;
    position: relative;
}

.embla__viewport {
    overflow: hidden;
    width: 100%;
}

.embla__container {
    display: flex;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    height: auto;
    min-height: 0;
}

.embla__slide {
    position: relative;
    min-width: 100%;
    flex-shrink: 0;
}

.embla__slide__img {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: block;
}

.embla__slide__img img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Caption */
.embla__slide__caption {
    color: #fff;
    padding: 20px;
    z-index: 1;
}

/* Caption sopra l'immagine */
.embla__slide__caption--above {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 2;
    transition: all 0.3s ease;
}

.embla__slide__caption--above .embla__slide__text {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    padding-top: 0;
    margin-top: 0;
}

.embla__slide:hover .embla__slide__caption--above,
.embla__slide:focus .embla__slide__caption--above {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 100%);
}

.embla__slide:hover .embla__slide__caption--above .embla__slide__text,
.embla__slide:focus .embla__slide__caption--above .embla__slide__text {
    max-height: 500px;
    opacity: 1;
    padding-top: 10px;
    margin-top: 8px;
}

/* Overlay scuro al hover quando caption è sopra */
.embla__slide__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.embla__slide:hover .embla__slide__overlay,
.embla__slide:focus .embla__slide__overlay {
    background: rgba(0, 0, 0, 0.4);
}

/* Caption sotto l'immagine */
.embla__slide__caption--below {
    position: relative;
    background: #fff;
    color: #333;
    margin-top: 0;
}

.embla__slide__title {
    margin: 0 0 8px 0;
    font-size: 1.5em;
    font-weight: 600;
    line-height: 1.2;
}

.embla__slide__text {
    margin: 0;
    font-size: 1em;
    line-height: 1.5;
    opacity: 0.95;
}

/* Controlli */
.embla__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 15px;
}

.embla__controls--inside {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
}

.embla__controls--inside .embla__buttons {
    pointer-events: all;
}

/* Pulsanti */
.embla__buttons {
    display: flex;
    gap: 10px;
}

.embla__button {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    color: var(--wp--preset--color--base);
}

.embla__button:hover:not(:disabled) {
    color: var(--wp--preset--color--contrast-two);
}

.embla__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.embla__button__svg {
    width: 32px;
    height: 32px;
}

/* Dots */
.embla__dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.embla__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.embla__dot:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.2);
}

.embla__dot.is-selected {
    background: rgba(0, 0, 0, 0.8);
    width: 12px;
    height: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .embla__slide__caption {
        padding: 15px;
    }
    
    .embla__slide__title {
        font-size: 1.25em;
    }
    
    .embla__slide__text {
        font-size: 0.9em;
    }
    
    .embla__button {
        width: 36px;
        height: 36px;
    }
    
    .embla__button__svg {
        width: 24px;
        height: 24px;
    }
}

/* Fade Plugin Support */
.embla__slide.fade {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.embla__slide.fade.is-selected {
    opacity: 1;
}

/* Class Names Plugin Support */

.embla__slide.is-draggable {
    cursor: grab;
}

.embla__slide.is-dragging {
    cursor: grabbing;
}

/* ========================================
   Layout: Multiplo
   ======================================== */

.ied-embla-layout-multiplo .embla__container {
    display: flex;
    gap: 2.5rem;
}

.ied-embla-layout-multiplo .embla__slide {
    position: relative;
    min-width: 50%;
    flex-shrink: 0;
    padding: 0;
    box-sizing: border-box;
}

.ied-embla-layout-multiplo .embla__slide:first-child {
    padding-left: 0;
}

.ied-embla-layout-multiplo .embla__slide:last-child {
    padding-right: 0;
}

.ied-embla-layout-multiplo .embla__slide__multiplo-content {
    position: relative;
    width: 100%;
    height: 100%;
}

.ied-embla-layout-multiplo .embla__slide__multiplo-image {
    position: relative;
    width: 100%;
    height: 500px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    cursor: pointer;
}

.ied-embla-layout-multiplo .embla__slide__multiplo-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, var(--wp--preset--color--base) 0%, transparent 100%);
    z-index: 1;
}

/* Testo unico che si anima */
.ied-embla-layout-multiplo .embla__slide__multiplo-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 2;
    color: var(--wp--preset--color--base-two);
    transition: color 0.3s ease, z-index 0.3s ease;
}

.ied-embla-layout-multiplo .embla__slide__multiplo-text .embla__slide__title {
    color: var(--wp--preset--color--base-two);
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    line-height: 1.2;
    transition: color 0.3s ease, border-bottom 0.3s ease, padding-bottom 0.3s ease;
    border-bottom: 0 solid transparent;
    padding-bottom: 0;
}

.ied-embla-layout-multiplo .embla__slide__multiplo-text .embla__slide__text {
    color: var(--wp--preset--color--base-two);
    font-size: 1em;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease, max-height 0.4s ease;
    max-height: 3.2em; /* Circa 2 righe con line-height 1.6 */
}

/* Quando la slide è espansa, anima il testo */
.ied-embla-layout-multiplo .embla__slide.is-expanded .embla__slide__multiplo-text {
    z-index: 4; /* Sopra l'overlay */
    color: var(--wp--preset--color--base);
}

.ied-embla-layout-multiplo .embla__slide.is-expanded .embla__slide__multiplo-text .embla__slide__title {
    color: var(--wp--preset--color--base);
    border-bottom: 1px solid var(--wp--preset--color--base-two);
    padding-bottom: 0.5rem;
}

.ied-embla-layout-multiplo .embla__slide.is-expanded .embla__slide__multiplo-text .embla__slide__text {
    color: var(--wp--preset--color--base);
    -webkit-line-clamp: unset;
    line-clamp: unset;
    max-height: 1000px; /* Valore alto per mostrare tutto */
    display: block;
}

/* Overlay modalità espansa */
.ied-embla-layout-multiplo .embla__slide__multiplo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--wp--preset--color--contrast-two);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 3;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-sizing: border-box;
}

.ied-embla-layout-multiplo .embla__slide.is-expanded .embla__slide__multiplo-overlay {
    opacity: 0.9;
    visibility: visible;
}

.ied-embla-layout-multiplo .embla__slide__multiplo-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--wp--preset--color--base-two);
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 4;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.2s ease;
}

.ied-embla-layout-multiplo .embla__slide.is-expanded .embla__slide__multiplo-close {
    opacity: 1;
}

.ied-embla-layout-multiplo .embla__slide__multiplo-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ied-embla-layout-multiplo .embla__slide__multiplo-close svg {
    width: 20px;
    height: 20px;
}


/* Tablet: 3 slide visibili */
@media (min-width: 769px) and (max-width: 1024px) {
    .ied-embla-layout-multiplo .embla__slide {
        min-width: 33.333%;
    }
}

/* Desktop: 4 slide visibili */
@media (min-width: 1025px) {
    .ied-embla-layout-multiplo .embla__slide {
        min-width: 25%;
    }
}

/* Mobile: 2 slide visibili (già definito sopra) */
@media (max-width: 768px) {
    .ied-embla-layout-multiplo .embla__slide {
        min-width: 50%;
        padding: 0 8px;
    }
    
    .ied-embla-layout-multiplo .embla__slide__multiplo-image {
        height: 400px;
    }
    
    .ied-embla-layout-multiplo .embla__slide__multiplo-text {
        padding: 1.5rem;
    }
    
    .ied-embla-layout-multiplo .embla__slide__multiplo-text .embla__slide__title {
        font-size: 1.25em;
    }
    
    .ied-embla-layout-multiplo .embla__slide__multiplo-overlay {
        padding: 1.5rem;
    }
}

/* Controlli Layout Multiplo */
.ied-embla-layout-multiplo {
    position: relative;
}

.ied-embla-layout-multiplo .embla__controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 1rem;
    padding: 0;
}

.ied-embla-layout-multiplo .embla__numbered-buttons--multiplo {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.ied-embla-layout-multiplo .embla__numbered-button--multiplo {
    border: none;
    background: transparent;
    color: var(--wp--preset--color--base);
    font-size: var(--wp--preset--font-size--small);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    width: auto;
    height: auto;
}

.ied-embla-layout-multiplo .embla__numbered-button--multiplo:hover {
    transform: scale(1.1);
}

.ied-embla-layout-multiplo .embla__numbered-button--multiplo.is-active {
    color: var(--wp--preset--color--contrast-two);
}

.ied-embla-layout-multiplo .embla__buttons--multiplo {
    display: flex;
    gap: 0;
}

.ied-embla-layout-multiplo .embla__buttons--multiplo .embla__button {
    background: transparent;
    border: none;
    color: var(--wp--preset--color--base);
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.ied-embla-layout-multiplo .embla__buttons--multiplo .embla__button:hover:not(:disabled) {
    color: var(--wp--preset--color--contrast-two);
}

.ied-embla-layout-multiplo .embla__buttons--multiplo .embla__button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ied-embla-layout-multiplo .embla__buttons--multiplo .embla__button__svg {
    width: 32px;
    height: 32px;
}

@media (max-width: 768px) {
    .ied-embla-layout-multiplo .embla__controls {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .ied-embla-layout-multiplo .embla__numbered-buttons--multiplo {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .ied-embla-layout-multiplo .embla__numbered-button--multiplo {
        font-size: 0.9em;
    }
    
    .ied-embla-layout-multiplo .embla__buttons--multiplo .embla__button {
        width: 36px;
        height: 36px;
    }
    
    .ied-embla-layout-multiplo .embla__buttons--multiplo .embla__button__svg {
        width: 32px;
        height: 32px;
    }
}

/* ========================================
   Layout: Hero
   ======================================== */

.ied-embla-layout-hero .embla__slide__hero-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ied-embla-layout-hero .embla__slide__hero-images {
    display: grid;
    grid-template-columns: 70% 30%;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 400px;
}

.ied-embla-layout-hero .embla__slide__hero-images--single {
    grid-template-columns: 100%;
}

.ied-embla-layout-hero .embla__slide__hero-main {
    position: relative;
    overflow: hidden;
}

.ied-embla-layout-hero .embla__slide__hero-secondary {
    position: relative;
    overflow: hidden;
}

.ied-embla-layout-hero .embla__slide__hero-main .embla__slide__img,
.ied-embla-layout-hero .embla__slide__hero-secondary .embla__slide__img {
    width: 100%;
    height: 100%;
}

.ied-embla-layout-hero .embla__slide__hero-main .embla__slide__img img,
.ied-embla-layout-hero .embla__slide__hero-secondary .embla__slide__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ied-embla-layout-hero .embla__slide__caption--hero {
    background: #fff;
    color: #333;
    padding: 20px;
    margin-top: auto;
}

.ied-embla-layout-hero .embla__slide__caption--hero .embla__slide__title {
    color: #333;
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 12px;
}

.ied-embla-layout-hero .embla__slide__caption--hero .embla__slide__text {
    color: #666;
    font-size: 1em;
    line-height: 1.6;
}


/* Responsive Layout Hero */
@media (max-width: 768px) {
    .ied-embla-layout-hero .embla__slide__hero-images {
        grid-template-columns: 100%;
        min-height: 300px;
    }
    
    .ied-embla-layout-hero .embla__slide__hero-secondary {
        display: none;
    }
    
    .ied-embla-layout-hero .embla__slide__caption--hero .embla__slide__title {
        font-size: 1.4em;
    }
    
    .ied-embla-layout-hero .embla__slide__caption--hero {
        padding: 15px;
    }
}

/* ========================================
   Layout: Hero Fullscreen
   ======================================== */

.ied-embla-layout-hero-fullscreen {
    position: relative;
    width: 100%;
    background: var(--wp--preset--color--base-two);
    /* overflow: hidden; */
}

.ied-embla-layout-hero-fullscreen .embla {
    overflow: unset;
    position: relative;
}

.ied-embla-layout-hero-fullscreen .embla__viewport {
    overflow: unset;
    width: 100%;
}

.ied-embla-layout-hero-fullscreen .embla__container {
    display: flex;
}

.ied-embla-layout-hero-fullscreen .embla__slide {
    position: relative;
    /* min-width: 100%;   */
    max-width: var(--wp--style--global--wide-size);
    flex-shrink: 0;
    /* padding: 0 1.5rem; */
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
}

/* Slide attiva visibile */
.ied-embla-layout-hero-fullscreen .embla__slide.is-snapped {
    opacity: 1;
    pointer-events: auto;
}

/* Slide successiva alla attiva visibile */
.ied-embla-layout-hero-fullscreen .embla__slide.is-snapped + .embla__slide {
    opacity: 1;
    pointer-events: auto;
}
.ied-embla-layout-hero-fullscreen .embla__slide.is-snapped + .embla__slide .embla__slide__caption {
    opacity: 0;
}

.ied-embla-layout-hero-fullscreen .embla__slide__hero-fullscreen-content {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 40vh;
    background: var(--wp--preset--color--base-two);
}

.ied-embla-layout-hero-fullscreen .embla__slide__hero-fullscreen-image {
    width: 100%;
    position: relative;
    overflow: hidden;
    flex: 1;
}

.ied-embla-layout-hero-fullscreen .embla__slide__hero-fullscreen-image .embla__slide__img {
    width: 100%;
    height: 70vh;
    min-height: 70vh;
}

.ied-embla-layout-hero-fullscreen .embla__slide__hero-fullscreen-image .embla__slide__img img {
    width: 100%;
    height: 70vh;
    padding: 0 2.5rem;
    object-fit: cover;
    display: block;
}

.ied-embla-layout-hero-fullscreen .embla__slide__caption--hero-fullscreen {
    background: transparent;
    color: var(--wp--preset--color--base);
    padding: 2.5rem 0;
}

.ied-embla-layout-hero-fullscreen .embla__slide__caption--hero-fullscreen .embla__slide__title {
    color: var(--wp--preset--color--base);
    font-size: 1.5em;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

/* Progress Bar Verticale */
.ied-embla-layout-hero-fullscreen .embla__progress-bar--vertical {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-left: 1px solid var(--wp--preset--color--contrast-two);
    height: 70vh;
    background: rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.ied-embla-layout-hero-fullscreen .embla__progress-bar--vertical .embla__progress-bar__fill {
    width: 100%;
    height: 0%;
    background: var(--wp--preset--color--contrast-two);
    transition: height 0.3s ease;
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Controlli Hero Fullscreen */
.ied-embla-layout-hero-fullscreen .embla__controls--hero-fullscreen {
    position: absolute;
    top: calc(70vh + 2.5rem);
    right: 0;
    /*bottom: 20px;
    left: 20px;
    right: 20px;*/
    display: flex;
    align-items: center;
    justify-content:end;
    z-index: 10;
    gap: 20px;
}

.ied-embla-layout-hero-fullscreen .embla__numbered-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    /* flex: 1; */
}

.ied-embla-layout-hero-fullscreen .embla__numbered-button {
    /* width: 40px;
    height: 40px; */
    border:none;
    background: transparent;
    color: var(--wp--preset--color--base);
    font-size: var(--wp--preset--font-size--small);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.ied-embla-layout-hero-fullscreen .embla__numbered-button:hover {
    /* background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8); */
    transform: scale(1.1);
}

.ied-embla-layout-hero-fullscreen .embla__numbered-button.is-active {
    /* background: var(--wp--preset--color--contrast-two);
    border-color: var(--wp--preset--color--contrast-two); */
    color: var(--wp--preset--color--contrast-two);
}

.ied-embla-layout-hero-fullscreen .embla__buttons--hero-fullscreen {
    display: flex;
    gap: 0;
}

.ied-embla-layout-hero-fullscreen .embla__buttons--hero-fullscreen .embla__button {
    background: transparent;
    border: none;
    color: var(--wp--preset--color--base);
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.ied-embla-layout-hero-fullscreen .embla__buttons--hero-fullscreen .embla__button:hover:not(:disabled) {
    color: var(--wp--preset--color--contrast-two);
}

.ied-embla-layout-hero-fullscreen .embla__buttons--hero-fullscreen .embla__button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Responsive Layout Hero Fullscreen */
@media (max-width: 1024px) {
    /* Tablet e Mobile: riattiva overflow hidden */
    .ied-embla-layout-hero-fullscreen {
        overflow: hidden;
    }
    
    .ied-embla-layout-hero-fullscreen .embla {
        overflow: hidden;
    }
    
    .ied-embla-layout-hero-fullscreen .embla__viewport {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .ied-embla-layout-hero-fullscreen .embla__slide {
        padding-left: 2px;
        padding-right: 2px;
    }
    
    .ied-embla-layout-hero-fullscreen .embla__controls--hero-fullscreen {
        bottom: 15px;
        left: 15px;
        right: 15px;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .ied-embla-layout-hero-fullscreen .embla__numbered-buttons {
        /* gap: 8px;
        flex-wrap: wrap; */
        display: none;
    }
    
    .ied-embla-layout-hero-fullscreen .embla__numbered-button {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .ied-embla-layout-hero-fullscreen .embla__buttons--hero-fullscreen .embla__button {
        width: 36px;
        height: 36px;
    }
    
    .ied-embla-layout-hero-fullscreen .embla__buttons--hero-fullscreen .embla__button__svg {
        width: 32px;
        height: 32px;
    }
    
    .ied-embla-layout-hero-fullscreen .embla__slide__caption--hero-fullscreen {
        padding: 15px;
    }
    
    .ied-embla-layout-hero-fullscreen .embla__slide__caption--hero-fullscreen .embla__slide__title {
        font-size: 1.2em;
    }
}


