/* Google Fonts Import */
@import url("https://fonts.googleapis.com/css2?family=Lato:wght@700;900&family=Roboto:wght@400;500;700&display=swap");

/* * You can either copy these variables into your main CSS file 
    * or keep them here if this is the only component using them.
*/
:root {
    --bg-color: #faf7e2;
    --card-text-bg: #ffffff;
    --primary-text-color: #333333;
    --secondary-text-color: #555555;
    --heading-font: "Lato", sans-serif;
    --body-font: "Roboto", sans-serif;
    --button-blue: #007bff;
    --button-blue-hover: #0056b3;
}

/* * Apply this class to the section or a parent container 
    * to scope the styles and prevent conflicts.
*/
.media-section-styles {
    font-family: var(--body-font);
    background-color: var(--bg-color);
    color: var(--primary-text-color);
    padding: 4rem 0;
    overflow-x: hidden;
}

.media-section-styles * {
    box-sizing: border-box;
}

.media-section-styles .section-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.media-section-styles .section-heading {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-text-color);
    text-align: center;
    margin-bottom: 1rem;
}

.media-section-styles .stories-carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.media-section-styles .story-main-card {
    display: grid;
    grid-template-columns: 60% 40%;
    width: 80%;
    max-width: 1050px;
    background-color: var(--card-text-bg);
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: opacity 0.5s ease-in-out;
    position: relative;
    z-index: 20;
    align-items: center;
}

/* .media-section-styles .story-image-container {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    justify-self: center;
}

.media-section-styles .story-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
} */

main .story-image-container {
    width: 100%;
    height: auto;
    position: relative;
    aspect-ratio: 16 / 9;
    justify-self: center;
    /* Needed to position the ::after pseudo-element */
}

main .story-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Good practice to remove bottom space under image */
}


.media-section-styles .story-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* The gradient goes from white -> transparent -> white */
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 1) 0%,
            /* Solid white at the very top */
            rgba(255, 255, 255, 0) 25%,
            /* Fades to transparent by 25% down */
            rgba(255, 255, 255, 0) 75%,
            /* Stays transparent until 75% down */
            rgba(255, 255, 255, 1) 100%
            /* Fades back to solid white at the bottom */
        );

    /* This ensures you can still interact with the image if needed */
    pointer-events: none;
}

.media-section-styles .story-text-content {
    padding: 2.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.media-section-styles .story-text-content::before {
    content: none;
}

.media-section-styles .story-title {
    font-family: var(--heading-font);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-text-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.media-section-styles .story-text-content p {
    font-size: 1rem;
    line-height: 1.6;
    text-align: justify;
    margin-bottom: 0rem;
    color: var(--secondary-text-color);
    flex-grow: 1;
}

.media-section-styles .story-text-content p::before {
    content: "\201C";
    font-family: serif;
    font-size: 6rem;
    color: rgba(0, 0, 0, 0.08);
    float: left;
    line-height: 0.8;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
}

.media-section-styles .story-author {
    margin-top: 1.5rem;
}

.media-section-styles .story-author .name {
    font-weight: 700;
    font-size: 1rem;
    font-style: italic;
    color: var(--secondary-text-color);
}

.media-section-styles .story-text-content .read-more {
    background-color: var(--button-blue);
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease-in-out;
    margin-top: 1rem;
    align-self: flex-start;
}

.media-section-styles .story-text-content .read-more:hover {
    background-color: var(--button-blue-hover);
}

.media-section-styles .story-preview {
    position: absolute;
    width: 60%;
    max-width: 750px;
    height: auto;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.4s ease, opacity 0.4s ease;
    z-index: 10;
    filter: brightness(0.6) blur(2px);
}

.media-section-styles .story-preview.prev {
    left: 50%;
    transform: translateX(-135%) scale(0.75);
}

.media-section-styles .story-preview.next {
    left: 50%;
    transform: translateX(35%) scale(0.75);
}

.media-section-styles .story-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

.media-section-styles .carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    /* width: 40px; */
    height: 75px;
    font-size: 1.5rem;
    color: var(--primary-text-color);
    cursor: pointer;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    transition: background-color 0.2s ease;
}

.media-section-styles .carousel-arrow:hover {
    background-color: #52494977;
}

.media-section-styles .carousel-arrow.prev-story-btn {
    left: 5%;
}

.media-section-styles .carousel-arrow.next-story-btn {
    right: 5%;
}

.media-section-styles .story-dots {
    text-align: center;
    margin-top: 1rem;
}

.media-section-styles .story-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ccc;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.media-section-styles .story-dot.active {
    background-color: var(--primary-text-color);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .media-section-styles .section-heading {
        font-size: 2rem;
    }

    .media-section-styles .story-main-card {
        grid-template-columns: 1fr;
        width: 65%;
    }

    .media-section-styles .story-text-content {
        padding: 1.5rem;
    }

    .media-section-styles .story-preview.prev {
        transform: translateX(-120%) scale(0.8);
    }

    .media-section-styles .story-preview.next {
        transform: translateX(20%) scale(0.8);
    }

    .media-section-styles .carousel-arrow {
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.4);
        color: white;
    }

    .media-section-styles .carousel-arrow.prev-story-btn {
        left: 8%;
    }

    .media-section-styles .carousel-arrow.next-story-btn {
        right: 8%;
    }
}

@media (max-width: 768px) {
    .media-section-styles {
        padding: 2rem 0;
    }

    .media-section-styles .story-main-card {
        width: 80%;
    }

    .media-section-styles .story-preview {
        width: 95%;
    }

    .media-section-styles .story-preview.prev {
        transform: translateX(-105%) scale(0.7);
    }

    .media-section-styles .story-preview.next {
        transform: translateX(5%) scale(0.7);
    }

    .media-section-styles .carousel-arrow.prev-story-btn {
        left: 1%;
    }

    .media-section-styles .carousel-arrow.next-story-btn {
        right: 1%;
    }
}