/**
 * CSS supplementare per blocchi Spectra renderizzati con Bootstrap Italia.
 * Caricato solo se la pagina contiene blocchi uagb/.
 */

/* Accordion FAQ */
.accordion .accordion-button:not(.collapsed) {
    color: var(--bs-primary, #0066cc);
    background-color: rgba(0, 102, 204, 0.05);
}

/* Callout CTA legacy */
.callout.callout-highlight {
    margin-bottom: 1.5rem;
}

/* Spectra CTA → BI: titolo + descrizione | bottone */
.fp-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 32px;
    margin-bottom: 1rem;
}
.fp-cta__body {
    flex: 1 1 auto;
    min-width: 0;
}
.fp-cta__title {
    margin: 0 0 0.5rem;
    font-weight: 700;
    line-height: 1.25;
}
.fp-cta__desc {
    margin: 0;
    line-height: 1.5;
}
.fp-cta__desc p:last-child {
    margin-bottom: 0;
}
.fp-cta__action {
    flex: 0 0 auto;
}
.fp-cta__button {
    white-space: nowrap;
    font-weight: 600;
    padding: 0.625rem 1.5rem;
}
@media (max-width: 640px) {
    .fp-cta {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px 16px;
    }
}

/* Social share */
.share-this .btn-icon {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

/* Gallery grid */
.it-grid-list-wrapper .it-grid-item-wrapper {
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 0;
}

.it-grid-list-wrapper .it-grid-item-wrapper img {
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.it-grid-list-wrapper .it-grid-item-wrapper:hover img {
    transform: scale(1.03);
}

/* Icon list */
.it-list-wrapper .it-rounded-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Timeline */
.it-timeline-wrapper .row {
    margin-bottom: 1rem;
}

.it-timeline-wrapper .pin-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-primary, #0066cc);
    border-radius: 50%;
}

.it-timeline-wrapper .pin-icon .icon {
    fill: #fff;
    width: 16px;
    height: 16px;
}

/* ==========================================
   Dots custom per carousel (uno per slide)
   ========================================== */

/* Nasconde la pagination default di Splide sui carousel gallery/post
   che usano i dots custom .egb-dots-per-slide. Serve !important per
   battere la regola .it-carousel-landscape-abstract-three-cols .splide__pagination
   in flex-posts.css. */
.egb-gallery-carousel > .splide__pagination,
.egb-post-carousel > .splide__pagination,
.egb-gallery-carousel .splide__pagination,
.egb-post-carousel .splide__pagination {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.egb-dots-per-slide {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    list-style: none;
    padding: 1rem 0.5rem;
    margin: 0;
}

.egb-dots-per-slide li {
    margin: 0;
    padding: 0;
    list-style: none;
    list-style-type: none;
}

.egb-dots-per-slide li::marker {
    content: '';
    display: none;
}

.egb-dots-per-slide .egb-dot {
    display: block;
    width: 10px;
    height: 10px;
    padding: 0;
    background: #d9dadb;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.egb-dots-per-slide .egb-dot:hover {
    opacity: 0.9;
    transform: scale(1.2);
}

.egb-dots-per-slide .egb-dot.is-active {
    background: var(--bs-primary, #0066cc);
    opacity: 1;
    transform: scale(1.3);
}

/* ==========================================
   Gallery Carousel - Zoom
   ========================================== */

.egb-gallery-carousel .egb-gallery-zoom {
    display: block;
    text-decoration: none;
    position: relative;
}

.egb-gallery-carousel .egb-gallery-zoom-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.egb-gallery-carousel .egb-gallery-zoom:hover .egb-gallery-zoom-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.egb-gallery-carousel .egb-gallery-zoom:hover img {
    transform: scale(1.05);
}

/* ==========================================
   Lightbox Modal
   ========================================== */

.egb-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.egb-lightbox.active {
    display: flex;
}

.egb-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    cursor: pointer;
}

.egb-lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    z-index: 1;
    pointer-events: none;
}

.egb-lightbox-container > * {
    pointer-events: auto;
}

.egb-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.egb-lightbox-close:hover,
.egb-lightbox-close:focus {
    background: var(--bs-primary, #0066cc);
    border-color: #fff;
    transform: scale(1.05);
    outline: none;
}

.egb-lightbox-close svg { display: block; }

.egb-lightbox-prev,
.egb-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: #fff;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.egb-lightbox-prev { left: 24px; }
.egb-lightbox-next { right: 24px; }

.egb-lightbox-prev:hover,
.egb-lightbox-next:hover,
.egb-lightbox-prev:focus,
.egb-lightbox-next:focus {
    background: var(--bs-primary, #0066cc);
    border-color: #fff;
    transform: translateY(-50%) scale(1.05);
    outline: none;
}

.egb-lightbox-prev svg,
.egb-lightbox-next svg { display: block; }

.egb-lightbox-content {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.egb-lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 180px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.egb-lightbox-caption {
    color: #fff;
    font-size: 1rem;
    text-align: center;
    max-width: 80%;
    line-height: 1.5;
}

.egb-lightbox-caption:empty {
    display: none;
}

.egb-lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .egb-lightbox-container { padding: 50px 20px; }
    .egb-lightbox-prev { left: 10px; }
    .egb-lightbox-next { right: 10px; }
    .egb-lightbox-prev,
    .egb-lightbox-next { width: 48px; height: 48px; }
    .egb-lightbox-prev svg,
    .egb-lightbox-next svg { width: 28px; height: 28px; }
    .egb-lightbox-close { width: 40px; height: 40px; }
    .egb-lightbox-close svg { width: 22px; height: 22px; }
}

/* Figure caption */
.figure-caption {
    font-size: 0.8125rem;
    color: #5c6f82;
    margin-top: 0.5rem;
}

/* ==========================================
   Post Carousel - card design BI
   ========================================== */

.egb-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e8edf2;
    border-left: 4px solid var(--bs-primary, #0066cc);
    border-radius: 0 6px 6px 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(23, 50, 77, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.egb-post-card:hover {
    box-shadow: 0 6px 18px rgba(23, 50, 77, 0.12);
    transform: translateY(-2px);
}

.egb-post-card__img-wrap {
    display: block;
    height: 180px;
    background: #f0f2f5;
    overflow: hidden;
    flex-shrink: 0;
}

.egb-post-card__img-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.egb-post-card__body {
    padding: 1rem 1.25rem 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.egb-post-card__date {
    display: block;
    font-size: 0.75rem;
    color: #5c6f82;
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}

.egb-post-card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.egb-post-card__title a,
.egb-post-card .egb-post-card__title a {
    color: #17324d;
    text-decoration: none !important;
    background: transparent;
}

.egb-post-card__title a:hover {
    color: var(--bs-primary, #0066cc);
    text-decoration: none !important;
}

.egb-post-card__cta,
.egb-post-card a.egb-post-card__cta {
    text-decoration: none !important;
}

.egb-post-card__cta:hover {
    text-decoration: underline !important;
}

.egb-post-card__excerpt {
    font-size: 0.8125rem;
    color: #5c6f82;
    line-height: 1.55;
    margin: 0 0 0.75rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.egb-post-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-primary, #0066cc);
    text-decoration: none;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #e8edf2;
    align-self: stretch;
}


/* Variante orizzontale: immagine a sinistra, testo a destra (columns=1) */
@media (min-width: 768px) {
    .egb-post-card--horizontal {
        flex-direction: row;
    }
    .egb-post-card--horizontal .egb-post-card__img-wrap {
        width: 40%;
        height: auto;
        min-height: 220px;
        flex-shrink: 0;
    }
    .egb-post-card--horizontal .egb-post-card__body {
        flex: 1;
        padding: 1.25rem 1.5rem;
    }
    .egb-post-card--horizontal .egb-post-card__title {
        font-size: 1.125rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    .egb-post-card--horizontal .egb-post-card__excerpt {
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }
}

/* Forza equal-height dentro splide + no-overflow */
.egb-post-carousel .splide__slide,
.egb-post-carousel .it-single-slide-wrapper,
.egb-post-carousel .card-wrapper {
    height: 100%;
    display: flex;
}

.egb-post-carousel .card-wrapper {
    flex: 1;
    min-width: 0;
}

.egb-post-carousel .egb-post-card { flex: 1; }

/* Arrow Splide nativi: lasciamoli visibili solo se nessun dots custom attivo */
.egb-post-carousel .splide__arrows { display: none; }
