html,
body {
    margin: 0;
    padding: 0;
    max-width: 100%;
    max-height: 100%;
    background: #f9ef69;

}

/* Bgs */

.events-bg {
    position: absolute;
    left: 0px;
    width: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.e-bg2 {
    top: 784px;
}

.e-bg3 {
    top: 1415px;
}

.e-bg4 {
    top: 2137px;
}

.e-bg5 {
    top: 2756px;
}

.e-bg6 {
    top: 3420px;
    height: 800px;
}



/* Events */

.events {
    width: 100%;
    position: relative;
    background-color: #f9ef69;
    min-height: 100vh;
    overflow: visible;
    text-align: left;
    font-size: 24px;
    color: #28261b;
    font-family: Pacifico;
     padding-bottom: 400px;
   
}

.events-heading {
    position: relative;
    top: 254px;
    font-size: 48px;
    text-align: center;
}

.all-events {
    position: relative;
    top: 396px;
    left: 137px;
    width: 1166px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 260px;
    text-align: center;
    font-size: 40px;
    font-family: Domine;
}

.event-l,
.event-r {
    /* Ensures content remains side-by-side (row direction) for all screen sizes */
    align-self: stretch;
    display: flex;
    flex-direction: row; 
    align-items: center;
    justify-content: flex-start;
    gap: 80px;
}


.abt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.e-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.event-title {
    position: relative;
    letter-spacing: -0.01em;
    line-height: 52px;
}

.event-date {
    position: relative;
    font-size: 20px;
    line-height: 24px;
    font-family: Sen;
    color: #000;
}

.e-desc {
    font-size: 16px;
    font-family: Outfit;
    color: #28261b;
    transition: all 0.3s ease;
}


.full-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}


.full-text.expanded {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
}


.short-text {
    display: none;
}


@media (max-width: 768px) {
    .short-text {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        width: 160px;
    }


    .short-text,
    .full-text {
        display: none;
    }

    .short-text.expanded {
        display: block;
    }

    .full-text.expanded {
        display: none;
    }
}


/* Icon Toggle Button Styling */
.toggle-btn {
    border: none;
    background: none;
    font-size: 24px; 
    cursor: pointer;
    color: #333;
    padding: 10px 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn i {
    transition: transform 0.3s ease; 
}

.toggle-btn i.expanded-icon {
    transform: rotate(180deg); 
}


.vector-icon {
    width: 400px;
    position: relative;
    max-height: 100%;
    object-fit: cover;
}




/* -----Event animation: RESTORED ALTERNATING SLIDE-IN ----- */

/* Initial hidden state */
.event-l,
.event-r {
    opacity: 0;
    transition: all 0.8s ease-out;
}

/* Event L (Image on Left) slides in from the LEFT */
.event-l {
    transform: translateX(-200px);
}

/* Event R (Image on Right) slides in from the RIGHT */
.event-r {
    transform: translateX(200px);
}

/* Active state when in view */
.event-l.show,
.event-r.show {
    opacity: 1;
    transform: translateX(0);
}


/* ---- Mobile: Layout & Animation Fixes ---- */

@media (max-width: 768px) {
    
    body {
        max-width: 100%;
    }

    .e-heading {
        font-size: 14px;
    }

    .events-heading {
        top: 128px;
        font-size: 32px;
        text-align: center;
        line-height: 40px;
    }

    .event-title {
        line-height: 24px;
    }

    .event-date {
        position: relative;
        font-size: 10px;
        line-height: 14px;
        font-family: Sen;
        color: #464545;
    }

    .e-desc {
        font-size: 11px;
        line-height: 14px;
    }
    
    .vector-icon {
        width: 180px;
        position: relative;
        max-height: 100%;
        object-fit: cover;
    }

    .abt {
        gap: 0px;
    }

    .all-events {
        top: 240px;
        left: 24px;
        width: 320px;
        gap: 100px;
        text-align: center;
    }


    .event-l,
    .event-r {
        /* Restoring row layout for mobile as requested */
        flex-direction: row; 
        gap: 4px;
        width: 310px;
        justify-content: center;
        /* Re-applying correct animation initial states */
        opacity: 0;
    }
    
    /* Animation initial state for mobile - preserving alternate direction */
    .event-l {
        transform: translateX(-180px);
    }
    .event-r {
        transform: translateX(180px); 
    }
    .event-l.show,
    .event-r.show {
        opacity: 1;
        transform: translateX(0);
    }


    


    .e-bg2 {
        top: 433px;
    }

    .e-bg3 {
        top: 710px;
    }

    .e-bg4 {
        top: 1000px;
    }

    .e-bg5 {
        top: 1266px;
        height: 400px;
    }

    .e-bg6 {
        top: 1530px;
        height: 340px;
    }

}

.e-bg7 {
    top: 3500px; 
    
}

.e-bg8 {
    top: 4000px; 
}

@media (max-width: 768px) {

    .e-bg7,
    .e-bg8 {
        display: none; 
    }

}