/* Sviluppo & Innovazione v1.2 - effetti tecnologici opzionali. */
:root {
    --si-fx-duration: .72s;
    --si-fx-distance: 24px;
    --si-fx-glow-alpha: .16;
}

body.si-fx-speed-slow { --si-fx-duration: 1s; }
body.si-fx-speed-fast { --si-fx-duration: .46s; }
body.si-fx-intensity-low { --si-fx-distance: 14px; --si-fx-glow-alpha: .09; }
body.si-fx-intensity-high { --si-fx-distance: 38px; --si-fx-glow-alpha: .25; }

/* JS progressive enhancement: content remains visible when JS is unavailable. */
body.si-fx-active.si-fx-js .si-fx-section {
    opacity: 0;
    will-change: opacity, transform, filter;
    transition:
        opacity var(--si-fx-duration) cubic-bezier(.22,.8,.25,1),
        transform var(--si-fx-duration) cubic-bezier(.22,.8,.25,1),
        filter var(--si-fx-duration) ease;
}

body.si-fx-active.si-fx-js .si-fx-section[data-si-fx="fade-up"] { transform: translate3d(0,var(--si-fx-distance),0); }
body.si-fx-active.si-fx-js .si-fx-section[data-si-fx="fade-left"] { transform: translate3d(calc(var(--si-fx-distance) * -1),0,0); }
body.si-fx-active.si-fx-js .si-fx-section[data-si-fx="fade-right"] { transform: translate3d(var(--si-fx-distance),0,0); }
body.si-fx-active.si-fx-js .si-fx-section[data-si-fx="zoom"] { transform: scale(.975); }
body.si-fx-active.si-fx-js .si-fx-section[data-si-fx="glow-in"] {
    transform: translate3d(0,12px,0) scale(.99);
    filter: drop-shadow(0 0 0 rgba(23,45,97,0));
}

body.si-fx-active.si-fx-js .si-fx-section.si-fx-visible {
    opacity: 1;
    transform: none;
    filter: none;
}

body.si-fx-active.si-fx-js .si-fx-section[data-si-fx="glow-in"].si-fx-visible {
    animation: siGlowArrival calc(var(--si-fx-duration) * 1.25) ease both;
}

@keyframes siGlowArrival {
    0% { box-shadow: inset 0 0 0 rgba(23,45,97,0); }
    45% { box-shadow: inset 0 0 42px rgba(23,45,97,var(--si-fx-glow-alpha)); }
    100% { box-shadow: inset 0 0 0 rgba(23,45,97,0); }
}

/* Digital accent: subtle grid/light treatment, never changes the theme layout. */
body.si-fx-ambient .si-section-soft,
body.si-fx-ambient .si-home-intro {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

body.si-fx-ambient .si-section-soft::before,
body.si-fx-ambient .si-home-intro::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .38;
    background-image:
        linear-gradient(rgba(23,45,97,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23,45,97,.025) 1px, transparent 1px),
        radial-gradient(circle at 88% 18%, rgba(23,45,97,.09), transparent 24%);
    background-size: 32px 32px, 32px 32px, auto;
}

body.si-fx-intensity-low.si-fx-ambient .si-section-soft::before,
body.si-fx-intensity-low.si-fx-ambient .si-home-intro::before { opacity: .22; }
body.si-fx-intensity-high.si-fx-ambient .si-section-soft::before,
body.si-fx-intensity-high.si-fx-ambient .si-home-intro::before { opacity: .55; }

/* Tech accent on institutional cards and intro card. */
body.si-fx-active .si-home-intro-card,
body.si-fx-active .si-feature,
body.si-fx-active .si-card {
    position: relative;
}

body.si-fx-active .si-home-intro-card::before,
body.si-fx-active .si-feature::before,
body.si-fx-active .si-card::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 0;
    width: 46px;
    height: 2px;
    background: var(--pri-color, #172d61);
    opacity: .66;
    pointer-events: none;
}

body.si-fx-cards .si-feature,
body.si-fx-cards .si-card,
body.si-fx-cards .si-home-intro-card {
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

body.si-fx-cards .si-feature:hover,
body.si-fx-cards .si-card:hover {
    transform: translateY(-5px);
    border-color: rgba(23,45,97,.24);
    box-shadow: 0 15px 38px rgba(11,27,61,.11);
}

body.si-fx-cards .si-button {
    position: relative;
    overflow: hidden;
}

body.si-fx-cards .si-button::after {
    content: "";
    position: absolute;
    top: -80%;
    left: -60%;
    width: 42%;
    height: 260%;
    transform: rotate(24deg);
    background: rgba(255,255,255,.16);
    transition: left .45s ease;
    pointer-events: none;
}

body.si-fx-cards .si-button:hover::after { left: 125%; }

/* Existing native Newsup hero: visual only, structure and news logic untouched. */
body.si-fx-hero-enabled .mg-fea-area {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

body.si-fx-hero-enabled.si-fx-ambient .mg-fea-area::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: .34;
    background:
        linear-gradient(120deg, transparent 0 42%, rgba(255,255,255,.055) 49%, transparent 56%),
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 240% 100%, 36px 36px, 36px 36px;
    animation: siHeroSweep 11s linear infinite;
}

body.si-fx-hero-enabled .mg-fea-area > .overlay { position: relative; z-index: 2; }
body.si-fx-hero-enabled.si-fx-js .mg-fea-area.si-fx-hero {
    opacity: 0;
    transform: translateY(12px) scale(.995);
    transition: opacity .75s ease, transform .75s cubic-bezier(.22,.8,.25,1);
}
body.si-fx-hero-enabled.si-fx-js .mg-fea-area.si-fx-hero.si-fx-visible {
    opacity: 1;
    transform: none;
}

@keyframes siHeroSweep {
    0% { background-position: 150% 0, 0 0, 0 0; }
    100% { background-position: -150% 0, 0 0, 0 0; }
}

/* Navigation micro-interaction, no layout changes. */
body.si-fx-active .navbar-wp .navbar-nav > li > a {
    transition: transform .2s ease, opacity .2s ease;
}
body.si-fx-active .navbar-wp .navbar-nav > li > a:hover { transform: translateY(-1px); }

/* Accessibility: always suppress movement when requested by the user/device. */
@media (prefers-reduced-motion: reduce) {
    body.si-fx-active.si-fx-js .si-fx-section,
    body.si-fx-hero-enabled.si-fx-js .mg-fea-area.si-fx-hero {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
        animation: none !important;
    }
    body.si-fx-hero-enabled.si-fx-ambient .mg-fea-area::before,
    body.si-fx-active.si-fx-js .si-fx-section[data-si-fx="glow-in"].si-fx-visible,
    body.si-fx-cards .si-button::after {
        animation: none !important;
        transition: none !important;
    }
    body.si-fx-cards .si-feature:hover,
    body.si-fx-cards .si-card:hover,
    body.si-fx-active .navbar-wp .navbar-nav > li > a:hover { transform: none !important; }
}
