/* ==========================================================
   Crafto Stack Section Widget – Frontend Styles
   ========================================================== */

/* ---- Outer wrapper (sticky scroll container) ---- */
.csw-stack-box {
    position: relative;
    width: 100%;
}

.csw-stack-contain {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ---- Individual stack slide ---- */
.csw-stack-item {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity  0.6s ease;
    transform: translateY(100%);
    opacity: 0;
}

.csw-stack-item.csw-active {
    transform: translateY(0);
    opacity: 1;
}

/* Image panel on the right */
.csw-stack-item.csw-img-right {
    flex-direction: row-reverse;
}

/* ---- Panels (50 / 50 split) ---- */
.csw-panel {
    position: relative;
    width: 50%;
    height: 100%;
}

/* ---- Image Panel ---- */
.csw-image-panel {
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    overflow: hidden;
}

/* Hidden SEO img tag */
.csw-bg-img-seo {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

/* ---- Number Badge ---- */
.csw-number-badge {
    position: absolute;
    top: 60px;
    right: -130px;
    font-size: 10.625rem;
    font-weight: 600;
    line-height: 1;
    color: rgba(29, 29, 29, 0.3);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* ---- Vertical Side Label ---- */
.csw-side-label {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 30px 10px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    display: inline-block;
    background-color: rgba(29, 29, 29, 0.85);
    white-space: nowrap;
}

/* No-image placeholder */
.csw-no-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: #e8e8e8;
    color: #999;
    font-size: 14px;
}

/* ---- Content Panel ---- */
.csw-content-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 12%;
    background-color: #ffffff;
    overflow-y: auto;
}

/* ---- Top Heading ---- */
.csw-top-heading {
    margin: 0 0 15px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #e97522;
}

.csw-top-heading.has-gradient {
    background-image: linear-gradient(90deg, #e97522 0%, #1ea3b1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ---- Main Heading ---- */
.csw-main-heading {
    margin: 0 0 25px;
    font-size: 4.375rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -2px;
    color: #1d1d1d;
}

/* ---- Description ---- */
.csw-description {
    margin: 0 0 35px;
    width: 90%;
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

/* ---- Button ---- */
.csw-btn-wrapper {
    display: inline-block;
}

.csw-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background-color: #1d1d1d;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 0;
    transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.csw-btn:hover {
    background-color: #333333;
    color: #ffffff;
    transform: translateY(-3px);
}

.csw-btn-icon {
    display: inline-flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.csw-btn:hover .csw-btn-icon {
    transform: translateX(4px);
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 1024px) {
    .csw-main-heading {
        font-size: 3rem;
        letter-spacing: -1px;
    }

    .csw-number-badge {
        font-size: 7rem;
        right: -80px;
    }
}

@media (max-width: 768px) {
    /* On mobile, stack vertically instead of side-by-side */
    .csw-stack-item,
    .csw-stack-item.csw-img-right {
        flex-direction: column;
    }

    .csw-panel {
        width: 100%;
    }

    .csw-image-panel {
        height: 40vh;
        min-height: 220px;
    }

    .csw-content-panel {
        height: 60vh;
        padding: 40px 6%;
        overflow-y: auto;
    }

    .csw-main-heading {
        font-size: 2.25rem;
        letter-spacing: -0.5px;
        margin-bottom: 16px;
    }

    .csw-description {
        width: 100%;
        margin-bottom: 24px;
    }

    .csw-number-badge {
        font-size: 5rem;
        top: 20px;
        right: -40px;
    }

    .csw-side-label {
        writing-mode: horizontal-tb;
        transform: none;
        bottom: auto;
        top: 0;
        right: 0;
        padding: 8px 12px;
    }
}
