/* ═══════════════════════════════════════
   Decorant Hero Slider – Frontend CSS
   Version: 1.0.0
   ═══════════════════════════════════════ */

.dec-hero {
    position: relative !important;
    width: 100% !important;
    height: 100vh;
    min-height: 580px;
    max-height: 1000px;
    overflow: hidden !important;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Salient-overrides */
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    display: block !important;
}

/* Salient/WPBakery-override: säkerställ att alla element positioneras rätt */
.dec-hero,
.dec-hero *,
.dec-hero *::before,
.dec-hero *::after {
    box-sizing: border-box !important;
}

/* ── Bakgrundsbilder ── */

.dec-hero-bg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1;
    overflow: hidden !important;
}

.dec-hero-slide {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0;
    transform: scale(1.08);
    transition:
        opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1),
        transform 6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
    background: #1a1a1a;
    overflow: hidden !important;
}

.dec-hero-slide.active {
    opacity: 1;
    transform: scale(1);
}

.dec-hero-slide img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    -o-object-fit: cover !important;
    object-position: center center;
    display: block !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ── Overlay ── */

.dec-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(160deg,
            rgba(10, 10, 10, 0.82) 0%,
            rgba(20, 20, 18, 0.65) 45%,
            rgba(30, 28, 24, 0.55) 100%
        );
}

.dec-hero-overlay::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 220px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
}

/* ── Textinnehåll ── */

.dec-hero-content {
    position: relative;
    z-index: 5;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 8%;
    max-width: 680px;
}

.dec-hero-tag {
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #d4a017;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(16px);
    animation: decFadeUp 0.8s 0.3s forwards;
}

.dec-hero h1 {
    font-size: clamp(2rem, 5.5vw, 3.6rem);
    font-weight: 500;
    color: #f0efe8;
    line-height: 1.1;
    margin: 0 0 20px;
    padding: 0;
    letter-spacing: -0.01em;
    text-transform: none;
    opacity: 0;
    transform: translateY(20px);
    animation: decFadeUp 0.8s 0.5s forwards;
}

/* Salient-override */
.dec-hero h1,
.dec-hero .dec-hero-tag,
.dec-hero .dec-hero-desc {
    text-shadow: none;
    border: none;
    background: none;
}

.dec-hero-desc {
    font-size: clamp(14px, 1.8vw, 17px);
    color: rgba(240, 239, 232, 0.55);
    max-width: 460px;
    margin-bottom: 36px;
    line-height: 1.75;
    font-weight: 300;
    opacity: 0;
    transform: translateY(20px);
    animation: decFadeUp 0.8s 0.7s forwards;
}

.dec-hero-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(16px);
    animation: decFadeUp 0.8s 0.9s forwards;
}

/* ── Knappar ── */

.dec-btn-primary {
    display: inline-block;
    padding: 15px 38px;
    background: #d4a017;
    color: #111 !important;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 4px;
    text-decoration: none !important;
    transition: all 0.35s;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}

.dec-btn-primary:hover {
    background: #b88a14;
    color: #111 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 160, 23, 0.25);
    text-decoration: none !important;
}

.dec-btn-secondary {
    display: inline-block;
    padding: 15px 38px;
    border: 1px solid rgba(240, 239, 232, 0.2);
    color: rgba(240, 239, 232, 0.7) !important;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 4px;
    text-decoration: none !important;
    transition: all 0.35s;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
}

.dec-btn-secondary:hover {
    border-color: #d4a017;
    color: #d4a017 !important;
    text-decoration: none !important;
}

/* ── Indikatorer ── */

.dec-hero-indicators {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dec-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid rgba(240, 239, 232, 0.3);
    background: transparent;
    cursor: pointer;
    transition: all 0.4s;
    padding: 0;
    outline: none;
}

.dec-indicator.active {
    background: #d4a017;
    border-color: #d4a017;
    transform: scale(1.15);
}

.dec-indicator:hover:not(.active) {
    border-color: rgba(240, 239, 232, 0.6);
}

.dec-indicator:focus-visible {
    box-shadow: 0 0 0 2px #d4a017;
}

/* ── Scroll-indikator ── */

.dec-hero-scroll {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: decFadeUp 0.8s 1.2s forwards;
}

.dec-hero-scroll span {
    font-size: 9px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(240, 239, 232, 0.25);
}

.dec-scroll-line {
    width: 1px;
    height: 36px;
    position: relative;
    overflow: hidden;
}

.dec-scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, #d4a017);
    animation: decScrollLine 2s ease-in-out infinite;
}

/* ── Progressbar ── */

.dec-hero-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 6;
    background: rgba(255, 255, 255, 0.05);
}

.dec-hero-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #d4a017, #e8be4a);
    transition: width 0.1s linear;
}

.dec-hero-progress-bar.running {
    width: 100%;
}

.dec-hero-progress-bar.reset {
    transition: none;
    width: 0%;
}

/* ── Bildräknare ── */

.dec-hero-counter {
    position: absolute;
    bottom: 36px;
    right: 36px;
    z-index: 6;
    font-size: 13px;
    color: rgba(240, 239, 232, 0.2);
    letter-spacing: 2px;
    font-weight: 300;
}

.dec-hero-counter .current {
    color: rgba(240, 239, 232, 0.5);
    font-weight: 500;
}

/* ── Animationer ── */

@keyframes decFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes decScrollLine {
    0%  { top: -100%; }
    50% { top: 100%;  }
    100%{ top: 100%;  }
}

/* ═══ RESPONSIVT ═══ */

@media (max-width: 968px) {
    .dec-hero {
        min-height: 520px;
    }

    .dec-hero-content {
        padding: 0 6%;
    }

    .dec-hero-indicators {
        right: 20px;
        gap: 8px;
    }

    .dec-indicator {
        width: 8px;
        height: 8px;
    }
}

@media (max-width: 768px) {
    .dec-hero {
        height: 100vh !important;
        height: 100svh !important;
        min-height: 480px !important;
        max-height: none !important;
    }

    /* Tvinga bild-containern att täcka HELA slidern */
    .dec-hero .dec-hero-bg,
    .dec-hero .dec-hero-slide {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    .dec-hero .dec-hero-slide img {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: cover !important;
        /* Fallback fokuspunkt — JS skriver över per bild */
        object-position: center 60% !important;
    }

    .dec-hero-content {
        padding: 0 24px;
        padding-top: 80px;
        justify-content: center;
        position: relative !important;
        z-index: 5 !important;
    }

    /* Overlay måste också täcka allt på mobil */
    .dec-hero .dec-hero-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    .dec-hero-tag {
        font-size: 10px;
        letter-spacing: 3px;
        margin-bottom: 14px;
    }

    .dec-hero-desc {
        margin-bottom: 28px;
    }

    .dec-hero-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .dec-btn-primary,
    .dec-btn-secondary {
        text-align: center;
        padding: 14px 28px;
        font-size: 12px;
    }

    .dec-hero-indicators {
        flex-direction: row;
        right: auto;
        left: 24px;
        top: auto;
        bottom: 36px;
        transform: none;
    }

    .dec-hero-scroll {
        display: none;
    }

    .dec-hero-counter {
        bottom: 38px;
        right: 24px;
        font-size: 12px;
    }

    .dec-hero-overlay {
        background:
            linear-gradient(180deg,
                rgba(10, 10, 10, 0.75) 0%,
                rgba(20, 20, 18, 0.5) 40%,
                rgba(10, 10, 8, 0.7) 100%
            );
    }
}

@media (max-width: 400px) {
    .dec-hero h1 {
        font-size: 1.75rem;
    }

    .dec-hero-tag {
        font-size: 9px;
    }
}

/* ═══ REDUCED MOTION ═══ */

@media (prefers-reduced-motion: reduce) {
    .dec-hero-slide {
        transition: opacity 0.6s ease;
        transform: none !important;
    }

    .dec-hero-slide.active {
        transform: none !important;
    }

    .dec-scroll-line::after {
        animation: none;
    }

    .dec-hero-tag,
    .dec-hero h1,
    .dec-hero-desc,
    .dec-hero-buttons,
    .dec-hero-scroll {
        opacity: 1;
        transform: none;
        animation: none;
    }
}
