/*------------------- PRAGATI: Stacking Achievements (JS-driven) -------------------*/

.pa-stacked-achievements {
    background-color: var(--theme-color);
    padding: 100px 0 60px;
    position: relative;
    z-index: 1;
}

.pa-stacked-achievements .sec-title,
.pa-stacked-achievements .sub-title {
    color: var(--white-color);
}

.pa-stacked-achievements .sub-title {
    color: var(--theme-color2);
}

.pa-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 40px;
    position: relative;
}

.pa-stack-card-wrapper {
    height: 100vh;
    position: relative;
}

.pa-stack-card {
    position: relative;
    top: 0;
    height: 60vh;
    min-height: 450px;
    background: var(--white-color);
    border-radius: 24px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.07),
        0 12px 28px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: stretch;
    overflow: hidden;
    transform-origin: center top;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: box-shadow 0.5s ease;
    will-change: transform;
    z-index: 1;
}

/* Z-index stacking — later cards go on top */
.pa-card-1 { z-index: 10; }
.pa-card-2 { z-index: 20; }
.pa-card-3 { z-index: 30; }
.pa-card-4 { z-index: 40; }

/* Dark overlay that fades in when stacked behind */
.pa-stack-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    border-radius: 24px;
    pointer-events: none;
    z-index: 100;
    transition: background 0.5s ease;
}

.pa-stack-card.is-stacked::after {
    background: rgba(0, 0, 0, var(--stack-dim, 0));
}

/* Alternate layout for even cards */
.pa-stack-card-wrapper:nth-child(even) .pa-stack-card {
    flex-direction: row-reverse;
}

/* ========== Card Content ========== */

.pa-card-content {
    flex: 1;
    padding: 80px 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background: var(--white-color);
}

.pa-card-content i.watermark {
    position: absolute;
    top: -20px;
    left: -20px;
    font-size: 250px;
    color: rgba(152, 13, 26, 0.03);
    z-index: 0;
    pointer-events: none;
}

.pa-card-content > * {
    position: relative;
    z-index: 1;
}

.pa-card-year {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--white-color);
    background: var(--theme-color);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 700;
    margin-bottom: 25px;
    align-self: flex-start;
}

.pa-card-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--title-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.pa-card-desc {
    font-size: 16px;
    color: #000;
    line-height: 1.7;
    margin-bottom: 30px;
}

/* ========== Card Image ========== */

.pa-card-image {
    flex: 1;
    position: relative;
    overflow: visible;
}

.pa-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 10s ease;
}

.pa-stack-card:hover .pa-card-image img {
    transform: scale(1.1);
}

/* ========== Golden Overlap Badge ========== */

.pa-golden-overlap-badge {
    position: absolute;
    top: 30px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #FFD700 0%, #B09845 50%, #FFD700 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.9),
        0 0 0 6px rgba(255, 215, 0, 0.2),
        0 8px 20px rgba(176, 152, 69, 0.3);
    z-index: 15;
    animation: pa-badge-pulse 4s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.pa-stack-card-wrapper:nth-child(odd) .pa-golden-overlap-badge {
    left: -50px;
}

.pa-stack-card-wrapper:nth-child(even) .pa-golden-overlap-badge {
    right: -50px;
}

.pa-badge-content {
    text-align: center;
    color: #1a0f08;
}

.pa-badge-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

.pa-badge-number {
    display: block;
    font-size: 22px;
    font-weight: 900;
    line-height: 0.8;
    margin-bottom: 1px;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.9);
}

.pa-badge-unit {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

@keyframes pa-badge-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 0.9),
            0 0 0 6px rgba(255, 215, 0, 0.2),
            0 8px 20px rgba(176, 152, 69, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 0.9),
            0 0 0 8px rgba(255, 215, 0, 0.3),
            0 10px 25px rgba(176, 152, 69, 0.4);
    }
}

@media (max-width: 991px) {
    @keyframes pa-badge-pulse {
        0%, 100% {
            transform: translateX(-50%) scale(1);
            box-shadow:
                0 0 0 3px rgba(255, 255, 255, 0.9),
                0 0 0 6px rgba(255, 215, 0, 0.2),
                0 8px 20px rgba(176, 152, 69, 0.3);
        }
        50% {
            transform: translateX(-50%) scale(1.05);
            box-shadow:
                0 0 0 3px rgba(255, 255, 255, 0.9),
                0 0 0 8px rgba(255, 215, 0, 0.3),
                0 10px 25px rgba(176, 152, 69, 0.4);
        }
    }
}

.pa-stack-card:hover .pa-golden-overlap-badge {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

@media (max-width: 991px) {
    .pa-stack-card:hover .pa-golden-overlap-badge {
        transform: translateX(-50%) scale(1.1);
        transition: transform 0.3s ease;
    }
}

/* ========== Tablet & Mobile ========== */
@media (max-width: 991px) {
    .pa-stacked-achievements {
        padding: 80px 0 60px;
    }

    .pa-stack-card-wrapper {
        height: 75vh;
    }

    .pa-cards-container {
        gap: 0;
        padding-bottom: 0;
    }

    .pa-stack-card {
        height: auto;
        min-height: auto;
        flex-direction: column-reverse !important;
        border-radius: 18px;
    }

    .pa-stack-card::after {
        border-radius: 18px;
    }

    .pa-card-content {
        padding: 50px 30px;
    }

    .pa-card-title {
        font-size: 28px;
    }

    .pa-card-image {
        height: 350px;
        flex: none;
    }

    .pa-stack-card-wrapper:nth-child(odd) .pa-card-image img,
    .pa-stack-card-wrapper:nth-child(even) .pa-card-image img {
        border-radius: 18px 18px 0 0;
    }

    .pa-golden-overlap-badge {
        width: 80px;
        height: 80px;
        top: auto;
        bottom: -40px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .pa-stack-card-wrapper:nth-child(odd) .pa-golden-overlap-badge,
    .pa-stack-card-wrapper:nth-child(even) .pa-golden-overlap-badge {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .pa-badge-number { font-size: 16px; }
    .pa-badge-label { font-size: 8px; }
    .pa-badge-unit { font-size: 8px; }
}
