/* Custom Story Section Styles - Pinned Stage Implementation */

/* 1. Main Section Padding */
.history-area {
    position: relative;
    background-color: transparent;
}

/* 2. Stage Container */
.pinned-story-stage {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 0;
    /* ✅ adds equal breathing space top & bottom */
}


/* 3. Text Stage & Items */
.story-text-stage {
    position: relative;
    width: 100%;
    min-height: 400px;
}

.story-text-item {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
    opacity: 0;
    visibility: hidden;
    transition: none;
    pointer-events: none;
    z-index: 1;
}

.story-text-item.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
    pointer-events: auto;
}

.story-text-item .title {
    font-size: 3rem;
    margin-bottom: 20px;
}

.story-text-item .description {
    font-size: 18px;
    /* Increased font size */
    font-weight: 400;
    line-height: 1.8;
    /* Increased line height */
    color: rgba(255, 255, 255, 0.85);
    /* Slightly brighter */
}

.year-label {
    font-size: 5rem;
    font-weight: 800;
    color: var(--color-primary);
    opacity: 1;
    line-height: 1;
    margin-bottom: 15px;
    display: block;
}

/* Our Story image stage – add breathing space */
.our-story-section .story-image-stage {
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 18px;
    /* optional, looks premium */
}

/* Ensure the container centers stacked images */
.our-story-section .story-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    /* IMPORTANT: prevent old square container rules from overriding */
    aspect-ratio: auto;
    max-width: none;
}

/* Resize the actual story images: height -25%, width +20% */
.our-story-section .story-img {
    position: absolute;
    inset: 0;
    margin: auto;
    height: 300px;
    /* 400px * 0.75 */
    width: 120%;
    /* +20% */
    max-width: none;
    object-fit: cover;
    /* change to contain if you don’t want cropping */
    border-radius: 18px;
}

/* Responsive fallback: prevent overflow on small screens */
@media (max-width: 768px) {
    .our-story-section .story-img {
        width: 100%;
        height: 260px;
    }
}

.our-story-section .section-head {
    margin-top: 10px;
    margin-bottom: 40px;
}

.our-story-section .row.align-items-center {
    padding-top: 20px;
    padding-bottom: 20px;
}

/* 4. Image Stage & Items */
.story-image-stage {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Keep these global rules (unchanged), but they won’t override .our-story-section now */
.story-image-container {
    position: relative;
    width: 80%;
    /* Increased width */
    max-width: 600px;
    /* Cap max width */
    aspect-ratio: 1 / 1;
    height: auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.story-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.1);
    z-index: 1;
}

.story-img.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 2;
}

/* 5. Mobile Fallback */
@media (max-width: 991px) {
    .pinned-story-stage {
        padding: 50px 0;
        min-height: auto;
    }

    .story-text-stage {
        height: auto !important;
        min-height: auto;
    }

    .story-text-item {
        position: relative;
        opacity: 1;
        visibility: visible;
        transform: none;
        top: auto;
        left: auto;
        margin-bottom: 50px;
        pointer-events: auto;
    }

    .story-image-stage {
        display: none;
    }
}