/**
 * @file
 * Styles for Next DC Student Stories Block.
 */

.nextdc-student-stories-block {
    width: 100%;
}

.nextdc-student-stories-block__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;

    @media (max-width: 991.98px) {
        grid-template-columns: 1fr;
    }
}

.nextdc-student-stories-block__card {
    position: relative;
    display: flex;
    overflow: hidden;

    @media (max-width: 991.98px) {
        flex-direction: column !important;
    }
}

.nextdc-student-stories-block__card.flex-row-reverse {
    flex-direction: row-reverse;

    @media (max-width: 991.98px) {
        flex-direction: column !important;
    }
}

.nextdc-student-stories-block__card.flex-row {
    flex-direction: row;

    @media (max-width: 991.98px) {
        flex-direction: column !important;
    }
}

/* Background Colors */
.nextdc-student-stories-block__card.bg-color-mint-wave {
    background-color: #3BB7B3;
}

.nextdc-student-stories-block__card.bg-color-amber-sun {
    background-color: #E8AD1A;
}

.nextdc-student-stories-block__card.bg-color-firebrick {
    background-color: #BA3430;
}

.nextdc-student-stories-block__card.bg-color-space-cadet {
    background-color: #201850;
}

.nextdc-student-stories-block__card-image {
    width: 50%;
    overflow: hidden;
    position: relative;
    flex: 0 0 50%;

    @media (max-width: 991.98px) {
        width: 100%;
        flex: 0 0 100%;
    }
}

.nextdc-student-stories-block__card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.5s ease;
    display: block;
    position: relative;
    z-index: 0;
    aspect-ratio: 1 / 1;
}

/* Hover zoom effect */
.nextdc-student-stories-block__card:hover .nextdc-student-stories-block__card-image img {
    transform: scale(1.1);
}

.nextdc-student-stories-block__card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
    background-color: inherit;
    width: 50%;
    flex: 0 0 50%;
    justify-content: center;

    @media (max-width: 991.98px) {
        width: 100%;
        flex: 0 0 100%;
        justify-content: flex-start;
    }

    @media (max-width: 767.98px) {
        padding: 2rem 1.5rem;
    }
}

.nextdc-student-stories-block__card-testimonial {
    font-family: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 120%;
    letter-spacing: 3.2%;
}

/* Row 1 (odd rows) - dark purple text */
.nextdc-student-stories-block__card.row-odd .nextdc-student-stories-block__card-testimonial {
    color: #201850;
}

/* Row 2 (even rows) - white text */
.nextdc-student-stories-block__card.row-even .nextdc-student-stories-block__card-testimonial {
    color: #ffffff;
}

.nextdc-student-stories-block__card-testimonial p {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    font-weight: inherit;
}

.nextdc-student-stories-block__card-testimonial p:last-child {
    margin-bottom: 0;
}

.nextdc-student-stories-block__link {
    font-family: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 130%;
    letter-spacing: 0.032em;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    transition: opacity 0.3s ease;
}

/* Row 1 (odd rows) - dark purple text and arrow */
.nextdc-student-stories-block__card.row-odd .nextdc-student-stories-block__link {
    color: #201850;
}

.nextdc-student-stories-block__card.row-odd .nextdc-student-stories-block__link::after {
    background-color: #201850;
    background-image: none;
    mask-image: url('/themes/custom/nextdc/images/arrow-right.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url('/themes/custom/nextdc/images/arrow-right.svg');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

/* Row 2 (even rows) - white text and arrow */
.nextdc-student-stories-block__card.row-even .nextdc-student-stories-block__link {
    color: #ffffff;
}

.nextdc-student-stories-block__card.row-even .nextdc-student-stories-block__link::after {
    background-image: url('/themes/custom/nextdc/images/arrow-right.svg');
}

.nextdc-student-stories-block__link:hover {
    opacity: 0.8;
}

.nextdc-student-stories-block__link::after {
    content: '';
    display: inline-block;
    width: 22px;
    height: 20px;
    background-image: url('/themes/custom/nextdc/images/arrow-right.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.nextdc-student-stories-block__link:hover::after {
    transform: translateX(4px);
}

/* Responsive adjustments */
@media (max-width: 991.98px) {

    .nextdc-student-stories-block__grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .nextdc-student-stories-block__card {
        flex-direction: column !important;
        min-height: auto;
    }

    .nextdc-student-stories-block__card-image {
        width: 100%;
        flex: 0 0 auto;
        min-height: 300px;
        max-height: 414px;
        @media (max-width: 575.98px) {
            height: 414px;
        }
    }

    .nextdc-student-stories-block__card-image img {
        aspect-ratio: 4 / 3;
        min-height: 300px;
        max-height: 414px;

        @media (max-width: 575.98px) {
            aspect-ratio: 1 / 1 !important;
        }

        .nextdc-student-stories-block__card-content {
            width: 100%;
            flex: 0 0 auto;
            padding: 2rem 1.5rem;
        }

        .nextdc-student-stories-block__card-testimonial {
            font-size: 18px;
        }
    }

    @media (max-width: 767.98px) {
        .nextdc-student-stories-block__card-image {
            min-height: 250px;
            max-height: 414px;
        }

        .nextdc-student-stories-block__card-image img {
            min-height: 250px;
            max-height: 414px;
        }

        .nextdc-student-stories-block__card-content {
            padding: 1.5rem 1rem;
        }

        .nextdc-student-stories-block__card-testimonial {
            font-size: 16px;
        }
    }
}