/* TitanCMS — widget Elementor-style (frontend + editor) */
.widget-tabs,
.widget-accordion,
.widget-imagebox,
.widget-iconbox,
.widget-carousel,
.widget-gallery,
.widget-iconlist,
.widget-counter,
.widget-progress,
.widget-testimonial,
.widget-social,
.widget-alert,
.widget-soundcloud,
.widget-shortcode,
.widget-anchor {
    color: inherit;
}

/* Schede */
.widget-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.widget-tab-btn {
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 10px 16px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.7;
}

.widget-tab-btn.is-active {
    opacity: 1;
    border-bottom-color: #E63946;
    color: #E63946;
}

.widget-tab-panel {
    display: none;
    padding: 0.5rem 0;
}

.widget-tab-panel.is-active {
    display: block;
}

/* Accordion */
.widget-accordion-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.widget-accordion-item summary {
    padding: 14px 16px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.widget-accordion-item summary::-webkit-details-marker {
    display: none;
}

.widget-accordion-item > div {
    padding: 0 16px 16px;
    opacity: 0.85;
}

/* Riquadro immagine / icona */
.widget-imagebox {
    text-align: center;
}

.widget-imagebox img {
    width: 100%;
    max-width: 320px;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.widget-imagebox h3,
.widget-iconbox h3 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.widget-iconbox {
    text-align: center;
}

.widget-iconbox-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    border-radius: 50%;
    background: rgba(230, 57, 70, 0.15);
    color: #E63946;
    font-size: 1.5rem;
}

/* Carosello */
.widget-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.widget-carousel-track {
    display: flex;
    transition: transform 0.4s ease;
}

.widget-carousel-track figure {
    flex: 0 0 100%;
    margin: 0;
}

.widget-carousel-track img {
    width: 100%;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.widget-carousel-prev,
.widget-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2;
}

.widget-carousel-prev { left: 12px; }
.widget-carousel-next { right: 12px; }

/* Galleria */
.widget-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.widget-gallery-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

/* Lista icone */
.widget-iconlist ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.widget-iconlist li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.widget-iconlist-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(230, 57, 70, 0.2);
    color: #E63946;
    font-size: 12px;
    font-weight: 700;
}

/* Contatore */
.widget-counter {
    text-align: center;
    padding: 1.5rem;
}

.widget-counter-number {
    display: block;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 1;
    color: #E63946;
}

.widget-counter-label {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Progress bar */
.widget-progress-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.widget-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.widget-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #E63946, #ff6b6b);
    transition: width 0.6s ease;
}

/* Testimonianza */
.widget-testimonial {
    text-align: center;
    padding: 1.5rem;
}

.widget-testimonial-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
}

.widget-testimonial blockquote {
    font-size: 1.1rem;
    font-style: italic;
    margin: 0 0 1rem;
    border: 0;
    padding: 0;
}

.widget-testimonial cite {
    display: block;
    font-weight: 700;
    font-style: normal;
}

.widget-testimonial-role {
    display: block;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 4px;
}

/* Social */
.widget-social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.widget-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    transition: background 0.2s, color 0.2s;
}

.widget-social a:hover {
    background: #E63946;
    color: #fff;
}

/* Avviso */
.widget-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.widget-alert-info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

.widget-alert-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
}

.widget-alert-warning {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.3);
}

.widget-alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.widget-alert p {
    margin: 0;
}

/* SoundCloud */
.widget-soundcloud iframe {
    width: 100%;
    height: 166px;
    border: 0;
    border-radius: 8px;
}

/* Shortcode */
.widget-shortcode {
    padding: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.widget-shortcode code {
    font-family: ui-monospace, monospace;
    font-size: 0.9rem;
    color: #E63946;
}

/* Ancora menu */
.widget-anchor {
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    visibility: hidden;
}

@media (max-width: 640px) {
    .widget-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hero background — tema nativo e widget */
main,
[data-live-root],
.widgets-page,
.widgets-page--linear {
    width: 100% !important;
    max-width: 100% !important;
    padding-top: 0 !important;
}

/* Hero a tutta larghezza: esce dalla griglia 3 colonne di layout-fullwidth */
.layout-fullwidth .widgets .widget.widget-hero,
.layout-fullwidth .widgets .widget-hero.live-hero-block,
.layout-fullwidth .widgets-page--linear .widget.widget-hero {
    display: block !important;
    grid-template-columns: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    background: transparent !important;
    border: 0 !important;
}

.layout-fullwidth .widgets .widget.widget-hero > *,
.layout-fullwidth .widgets .widget-hero.live-hero-block > *,
.layout-fullwidth .widgets-page--linear .widget.widget-hero > * {
    grid-column: auto !important;
    width: 100% !important;
    max-width: none !important;
}

section.hero.live-hero-block,
section.hero,
section.widget-hero.live-hero-block {
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    left: 0 !important;
    right: 0 !important;
    min-height: 100vh !important;
    min-height: 100svh !important;
    display: block !important;
    padding: 0 !important;
}

section.hero > .hero-bg,
section.hero.live-hero-block > .hero-bg,
section.widget-hero > .hero-bg,
.widget-hero.live-hero-block > .hero-bg {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 0 !important;
    overflow: hidden !important;
    pointer-events: none;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    transform: none !important;
}

section.hero > .hero-overlay,
section.hero > .hero-gradient-circle,
section.hero.live-hero-block > .hero-overlay,
section.hero.live-hero-block > .hero-gradient-circle {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    pointer-events: none;
}

section.hero .hero-bg img,
section.hero.live-hero-block .hero-bg img,
section.widget-hero .hero-bg img,
.widget-hero.live-hero-block .hero-bg img {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
    pointer-events: none;
}

section.hero .hero-bg.has-bg-image img,
section.hero.live-hero-block .hero-bg.has-bg-image img,
section.widget-hero .hero-bg.has-bg-image img,
.widget-hero.live-hero-block .hero-bg.has-bg-image img {
    opacity: 0 !important;
}

section.hero .hero-bg:not(.has-bg-image) img,
section.hero.live-hero-block .hero-bg:not(.has-bg-image) img {
    opacity: 1 !important;
}

section.hero .hero-bg.has-bg-image,
section.hero.live-hero-block .hero-bg.has-bg-image,
.widget-hero.live-hero-block .hero-bg.has-bg-image,
section.hero.hero--has-bg,
section.hero.live-hero-block.hero--has-bg {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

section.hero.hero--has-bg,
section.hero.live-hero-block.hero--has-bg {
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
}

section.hero .hero-content,
section.hero.live-hero-block .hero-content,
.widget-hero.live-hero-block .hero-content {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    max-width: 800px !important;
    min-height: 100svh !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: clamp(5.5rem, 11vh, 8rem) clamp(1.2rem, 4vw, 3rem) 3rem !important;
}

.widget-hero.live-hero-block .widget-button,
section.hero .hero-content .widget-button,
.hero-content .widget-button,
.hero-buttons .hero-btn {
    width: auto !important;
    max-width: none !important;
    align-self: flex-start !important;
}

/* Hero widget con immagine di sfondo */
.widget-hero.live-hero-block,
section.widget-hero.live-hero-block {
    position: relative !important;
    overflow: hidden !important;
    min-height: 100svh !important;
    display: block !important;
    align-items: stretch !important;
    padding: 0 !important;
}

.widget-hero.live-hero-block .hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.widget-hero.live-hero-block .hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.widget-hero.live-hero-block .hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    transition: background 0.35s ease;
}

.widget-hero.live-hero-block:hover .hero-overlay {
    background: rgba(var(--hero-overlay-rgb, 0, 0, 0), var(--hero-overlay-hover, 0.7)) !important;
}

.widget-hero.live-hero-block .hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
}

.widget-hero.live-hero-block h2 {
    margin: 0 0 1rem;
}

.widget-hero.live-hero-block p {
    margin: 0 0 1.5rem;
}
