
/* =========================================
   SOGECO - HERO SLIDER
   Design indipendente dal vecchio tema
   ========================================= */

.sg-hero {
    --sg-accent: #d6b477;
    --sg-dark: #17232d;

    position: relative;
    width: 100%;
    height: clamp(520px, 48vw, 570px);
    min-height: 520px;
    overflow: hidden;
    isolation: isolate;
    background: var(--sg-dark);
    color: #fff;
    font-family: "Manrope", Arial, sans-serif;
}

.sg-hero *,
.sg-hero *::before,
.sg-hero *::after {
    box-sizing: border-box;
}

.sg-hero-slides,
.sg-hero-slide,
.sg-hero-image,
.sg-hero-overlay {
    position: absolute;
    inset: 0;
}

.sg-hero-slide {
    z-index: 0;
    visibility: hidden;
    opacity: 0;
    transition: opacity 900ms ease, visibility 900ms;
}

.sg-hero-slide.is-active {
    z-index: 1;
    visibility: visible;
    opacity: 1;
}

.sg-hero-image {
    overflow: hidden;
}

.sg-hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    transform: scale(1.04);
    transition: transform 7s ease;
}

.sg-hero-slide.is-active .sg-hero-image img {
    transform: scale(1);
}

/* Velo scuro per garantire la leggibilità del testo */
.sg-hero-overlay {
    background:
        linear-gradient(
            90deg,
            rgba(12, 23, 32, 0.82) 0%,
            rgba(12, 23, 32, 0.64) 38%,
            rgba(12, 23, 32, 0.18) 75%,
            rgba(12, 23, 32, 0.10) 100%
        ),
        linear-gradient(
            0deg,
            rgba(12, 23, 32, 0.42) 0%,
            transparent 35%
        );
}

.sg-hero-content-wrap {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 40px 70px;
    pointer-events: none;
}

.sg-hero-content {
    width: 100%;
    max-width: 690px;
    pointer-events: auto;
}

/* Piccola etichetta sopra il titolo */
.sg-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--sg-accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 3px;
    line-height: 1.6;
}

.sg-hero-eyebrow::before {
    content: "";
    display: inline-block;
    width: 34px;
    height: 2px;
    flex: 0 0 34px;
    background: var(--sg-accent);
}

.sg-hero-title {
    max-width: 720px;
    margin: 0 0 24px;
    color: #fff;
    font-size: clamp(38px, 5vw, 68px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -2px;
    text-wrap: balance;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.12);
}

.sg-hero-description {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(15px, 1.4vw, 18px);
    font-weight: 400;
    line-height: 1.8;
}

/* Call to action */
.sg-hero-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    min-height: 54px;
    margin-top: 25px;
    padding: 0 24px;
    background: var(--sg-accent);
    color: #17232d;
    border: 1px solid var(--sg-accent);
    border-radius: 2px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    transition:
        background 200ms ease,
        color 200ms ease,
        border-color 200ms ease;
}

.sg-hero-cta span {
    font-size: 21px;
    line-height: 1;
    transition: transform 200ms ease;
}

.sg-hero-cta:hover,
.sg-hero-cta:focus-visible {
    color: #fff;
    background: transparent;
    border-color: #fff;
    text-decoration: none;
}

.sg-hero-cta:hover span {
    transform: translateX(4px);
}

/* Navigazione inferiore */
.sg-hero-bottom {
    position: absolute;
    z-index: 5;
    right: 40px;
    bottom: 77px;
    left: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    pointer-events: none;
}

.sg-hero-counter,
.sg-hero-navigation {
    display: flex;
    align-items: center;
    pointer-events: auto;
}

.sg-hero-counter {
    gap: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.sg-hero-current {
    color: #fff;
    font-size: 16px;
}

.sg-hero-counter-line {
    display: block;
    width: 46px;
    height: 1px;
    background: rgba(255, 255, 255, 0.55);
}

.sg-hero-navigation {
    gap: 10px;
}

.sg-hero-prev,
.sg-hero-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 50%;
    background: rgba(20, 30, 38, 0.18);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 21px;
    cursor: pointer;
    transition: background 200ms ease, border-color 200ms ease;
}

.sg-hero-prev:hover,
.sg-hero-next:hover,
.sg-hero-prev:focus-visible,
.sg-hero-next:focus-visible {
    background: var(--sg-accent);
    border-color: var(--sg-accent);
    color: var(--sg-dark);
}

.sg-hero-dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-hero-dot {
    display: block;
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 200ms ease, background 200ms ease;
}

.sg-hero-dot.is-active {
    width: 24px;
    border-radius: 5px;
    background: var(--sg-accent);
}

/* Indicatore del tempo della slide */
.sg-hero-progress {
    position: absolute;
    right: 0;
    bottom: -30px;
    left: 0;
    height: 2px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
}

.sg-hero-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--sg-accent);
}

.sg-hero-progress.is-running span {
    animation: sgHeroProgress 6s linear forwards;
}

@keyframes sgHeroProgress {
    from { width: 0; }
    to { width: 100%; }
}

/* Tablet */
@media (max-width: 900px) {
    .sg-hero {
        height: 610px;
        min-height: 500px;
    }

    .sg-hero-content-wrap {
        padding-right: 28px;
        padding-left: 28px;
    }

    .sg-hero-title {
        max-width: 600px;
        font-size: clamp(40px, 6vw, 58px);
        letter-spacing: -1.5px;
    }

    .sg-hero-bottom {
        right: 28px;
        left: 28px;
    }

    .sg-hero-overlay {
        background:
            linear-gradient(
                90deg,
                rgba(12, 23, 32, 0.78),
                rgba(12, 23, 32, 0.35)
            ),
            linear-gradient(
                0deg,
                rgba(12, 23, 32, 0.45),
                transparent 45%
            );
    }
}

/* Smartphone */
@media (max-width: 600px) {
    .sg-hero {
        height: min(680px, 82svh);
        min-height: 540px;
        max-height: 720px;
    }

    .sg-hero-image img {
        object-position: 58% center;
    }

    .sg-hero-overlay {
        background:
            linear-gradient(
                0deg,
                rgba(12, 23, 32, 0.88) 0%,
                rgba(12, 23, 32, 0.66) 48%,
                rgba(12, 23, 32, 0.28) 100%
            );
    }

    .sg-hero-content-wrap {
        align-items: center;
        padding: 36px 22px 100px;
    }

    .sg-hero-content {
        max-width: 100%;
    }

    .sg-hero-eyebrow {
        gap: 9px;
        margin-bottom: 20px;
        font-size: 9px;
        letter-spacing: 2px;
    }

    .sg-hero-eyebrow::before {
        width: 24px;
        flex-basis: 24px;
    }

    .sg-hero-title {
        margin-bottom: 18px;
        font-size: clamp(34px, 9vw, 48px);
        line-height: 1.1;
        letter-spacing: -1.2px;
    }

    .sg-hero-description {
        font-size: 15px;
        line-height: 1.7;
    }

    .sg-hero-cta {
        min-height: 50px;
        margin-top: 25px;
        padding: 0 18px;
        gap: 20px;
    }

    .sg-hero-bottom {
        right: 20px;
        bottom: 24px;
        left: 20px;
        gap: 10px;
    }

    .sg-hero-counter {
        gap: 8px;
        font-size: 10px;
    }

    .sg-hero-counter-line {
        width: 22px;
    }

    .sg-hero-current {
        font-size: 14px;
    }

    .sg-hero-navigation {
        gap: 7px;
    }

    .sg-hero-prev,
    .sg-hero-next {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .sg-hero-dots {
        gap: 5px;
    }

    .sg-hero-dot {
        width: 6px;
        height: 6px;
    }

    .sg-hero-dot.is-active {
        width: 17px;
    }

    .sg-hero-progress {
        bottom: -24px;
    }
}

/* Rispetto delle preferenze di accessibilità */
@media (prefers-reduced-motion: reduce) {
    .sg-hero-slide,
    .sg-hero-image img,
    .sg-hero-cta,
    .sg-hero-dot {
        transition: none !important;
    }

    .sg-hero-progress.is-running span {
        animation: none !important;
        width: 100%;
    }
}
