/* Elementor Stacked Cards Widget Styles */

.esc-wrapper {
    padding: 40px 20px;
    background: transparent;
    overflow: visible;
}

.esc-container {
    max-width: 100%;
    margin: 0 auto;
    overflow: visible;
}

/* Header Styles */
.esc-header {
    text-align: center;
    margin-bottom: 60px;
}

.esc-header-subtitle {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.esc-header-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.esc-header-description {
    font-size: 16px;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
}

/* ─── Cards Wrapper ─────────────────────────────────────────────────────────
   Must NOT use overflow:hidden — sticky positioning breaks inside clipped
   containers. JS sets a min-height so the section is tall enough to scroll.
──────────────────────────────────────────────────────────────────────────── */
.esc-cards-wrapper {
    position: relative;
    overflow: visible;
    padding: 110px 34px 120px;
    perspective: 1800px;
}

/* ─── Individual Card ────────────────────────────────────────────────────────
   1. position:sticky + top:80px → every card pins to the same stack anchor.
   2. margin-bottom:40vh          → scroll distance before the NEXT card
      arrives and slides over this one.
   3. z-index set by JS           → arriving card goes OVER pinned cards.
──────────────────────────────────────────────────────────────────────────── */
.esc-card {
    position: sticky;
    top: 80px;
    box-sizing: border-box;
    width: 100%;
    height: clamp(540px, calc(100vh - 170px), 760px);
    background: #ffffff;
    border-radius: 32px;
    padding: 60px;
    margin-bottom: 32vh;
    box-shadow:
        0 30px 70px rgba(20, 60, 150, 0.14),
        0 12px 30px rgba(0,0,0,0.06);
    transition: transform 0.32s ease,
                filter 0.32s ease,
                box-shadow 0.32s ease;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    overflow: hidden;
    border: 1px solid rgba(230, 230, 230, 0.8);
    transform-origin: center top;
    transform-style: preserve-3d;
    will-change: transform, filter;
}

.esc-card:last-child {
    margin-bottom: 0;
}

/* Ensure last card is always fully visible without transparency */
.esc-card:last-of-type {
    filter: none !important;
    opacity: 1 !important;
    transform: scale(1) !important;
}

.esc-cards-end-spacer {
    height: 95vh;
    pointer-events: none;
}

/* ─── Stack depth classes (applied by JS) ────────────────────────────────── */

/* Card buried 1 level deep (one card on top of it) */
.esc-card.esc-stacked {
    transform: translateY(calc(var(--esc-stack-lift, 0) * -1px)) scale(var(--esc-stack-scale, 0.965));
    filter: brightness(1);
    /*box-shadow:*/
    /*    0 24px 60px rgba(20, 60, 150, 0.12),*/
    /*    0 10px 25px rgba(0,0,0,0.05);*/
}

/* Card buried 2+ levels deep */
.esc-card.esc-stacked-deep {
    transform: translateY(calc(var(--esc-stack-lift, 0) * -1px)) scale(var(--esc-stack-scale, 0.93));
    filter: brightness(1);
    /*box-shadow:*/
    /*    0 18px 45px rgba(20, 60, 150, 0.10),*/
    /*    0 8px 20px rgba(0,0,0,0.04);*/
}

/* The card currently on top: always crisp, full-size, fully interactive */
.esc-card.esc-active {
    transform: scale(1);
    filter: none;
    box-shadow:
        0 10px 9px #167ADB70;
}

/* ─── Card Content ───────────────────────────────────────────────────────── */
.esc-card-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.esc-card-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.esc-card-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.esc-card-description {
    font-size: 16px;
    line-height: 1.7;
    margin: 0 !important;
}

/* Tags */
.esc-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.esc-tag {
    background: transparent;
    border: 1.5px solid currentColor;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.25s ease, color 0.25s ease;
}

/* Button - Two-part design with connector */
.esc-card-button {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    width: fit-content;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.esc-card-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
}

/* Button text part - rounded on left */
.esc-card-button::before {
    content: attr(data-text);
    padding: 14px 32px;
    background-color: inherit;
    border-radius: 8px 0 0 8px;
    display: inline-flex;
    align-items: center;
}

/* Connector - small bridge between text and arrow */
.esc-card-button::after {
    content: '';
    width: 12px;
    height: 100%;
    background-color: inherit;
    display: inline-block;
}

.esc-card-button svg {
    width: 20px;
    height: 20px;
    padding: 14px;
    background-color: inherit;
    border-radius: 0 8px 8px 0;
    box-sizing: content-box;
}

/* ─── Card Visual ────────────────────────────────────────────────────────── */
.esc-card-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
    height: 100%;
}

.esc-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: none;
    transition: transform 0.4s ease;
}

/* Only scale image on the active top card to avoid odd hover on buried cards */
.esc-card.esc-active:hover .esc-card-image {
    transform: scale(1.04);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 968px) {
    .esc-card {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 620px;
        padding: 40px 30px;
        gap: 40px;
        margin-bottom: 30vh;
    }

    .esc-card-visual {
        order: -1;
        min-height: 200px;
    }

    .esc-header-title { font-size: 32px; }
    .esc-card-title   { font-size: 28px; }

    .esc-card-image {
        max-height: 200px;
    }
    .esc-cards-wrapper {
    padding: 110px 4px 120px;
    
}

    
}

@media (max-width: 640px) {
    .esc-card-content {
        gap:10px
    }
    .esc-wrapper {
        padding: 20px 15px;
    }
  .esc-cards-wrapper {
    padding: 110px 4px 120px;
    
}
    .esc-card {
        min-height: 580px;
        padding: 30px 20px;
        margin-bottom: 25vh;
    }

    .esc-header-title      { font-size: 28px; }
    .esc-card-title        { font-size: 24px; }
    .esc-card-description  { font-size: 14px; }

    .esc-card-visual {
        min-height: 200px;
    }
}

/* ─── Elementor editor ───────────────────────────────────────────────────── */
/* Show all cards flat so the editor is usable */
.elementor-editor-active .esc-card {
    position: relative !important;
    top: auto !important;
    margin-bottom: 30px !important;
    transform: none !important;
    filter: none !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
}

.elementor-widget-stacked_cards {
    overflow: visible !important;
}

html {
    scroll-behavior: smooth;
}


.esc-card:hover {
    transform: translateY(-6px);
}

.esc-card-visual::before {
    content: "";
    position: absolute;
    width: 330px;
    height: 330px;
    background: radial-gradient(circle, rgba(0,132,255,0.45) 0%, rgba(0,60,255,0.22) 45%, transparent 75%);
    filter: blur(40px);
    z-index: 0;
}

.esc-card-image {
    position: relative;
    z-index: 1;
}
