.CompletedStories {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 15px;
    margin-top: 20px;
    box-sizing: border-box;
}

.CompletedStories__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.CompletedStories__header h1 {
    font-size: 20px;
    font-weight: 500;
    color: #333;
    text-transform: uppercase;
    margin: 0;
}

.CompletedStories__header__link {
    color: #999;
    font-size: 13px;
    text-decoration: none;
}

.CompletedStories__header__link:hover {
    color: #d32f2f;
}

.CompletedStories__container {
    display: flex;
    gap: 40px;
    /* height: 410px; Removed fixed height */
}

/* Main Story - Left */
.CompletedStories__main {
    width: 213px;
    flex-shrink: 0;
    background: #fcfcfc;
    padding: 15px;
    text-align: center;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.CompletedStories__main__cover {
    display: block;
    width: 68%;
    margin-bottom: 15px;
}

.CompletedStories__main__cover img {
    width: 100%;
    height: auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    aspect-ratio: 2/3;
}

.CompletedStories__main__info {
    width: 100%;
}

.CompletedStories__main__title {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    text-decoration: none;
    line-height: 1.4;
}

.CompletedStories__main__title:hover {
    color: #d32f2f;
}

.CompletedStories__main__author {
    color: #d32f2f;
    margin-bottom: 5px;
    font-size: 14px;
}

.CompletedStories__main__chapters {
    color: #f57c00;
    /* Brown/Orange */
    margin-bottom: 10px;
    font-weight: normal;
    font-size: 14px;
}

.CompletedStories__main__desc {
    color: #666;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* List Stories - Right */
.CompletedStories__list {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 32px;
    row-gap: 10px;
}

.CompletedStories__item {
    display: flex;
    gap: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    height: 100px;
    /* Fixed height for consistency */
}

.CompletedStories__item:nth-last-child(1),
.CompletedStories__item:nth-last-child(2),
.CompletedStories__item:nth-last-child(3) {
    border-bottom: none;
}

.CompletedStories__item__cover {
    position: relative;
    width: 75px;
    flex-shrink: 0;
}

.CompletedStories__item__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.CompletedStories__item__badge {
    position: absolute;
    bottom: 0;
    left: 0;
    background: #d32f2f;
    color: white;
    font-size: 11px;
    padding: 1px 4px;
    font-weight: bold;
}

.CompletedStories__item__info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 2px;
    padding-bottom: 2px;
}

.CompletedStories__item__title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.CompletedStories__item__title:hover {
    color: #d32f2f;
}

.CompletedStories__item__desc {
    color: #888;
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 5px 0;
}

.CompletedStories__item__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.CompletedStories__item__author {
    display: flex;
    align-items: center;
    color: #999;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.CompletedStories__item__author i {
    margin-right: 4px;
    font-size: 12px;
}

.CompletedStories__item__category {
    border: 1px solid #ddd;
    padding: 1px 6px;
    border-radius: 2px;
    color: #999;
    font-size: 11px;
    white-space: nowrap;
}

/* Tablet & Mobile (Stacked Layout) */
@media (max-width: 1024px) {
    .CompletedStories__container {
        flex-direction: column;
        gap: 20px;
    }

    .CompletedStories__main {
        width: 100%;
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
        gap: 20px;
        box-sizing: border-box;
        padding: 20px;
    }

    .CompletedStories__main__cover {
        width: 140px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .CompletedStories__main__info {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .CompletedStories__main__desc {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .CompletedStories__list {
        grid-template-columns: repeat(2, 1fr);
    }

    .CompletedStories__item {
        height: auto;
    }

    /* Reset borders for 2-column layout */
    .CompletedStories__item {
        border-bottom: 1px solid #f0f0f0;
    }

    /* Remove border for the last row (last 2 items) in 2-column layout */
    .CompletedStories__item:nth-last-child(1),
    .CompletedStories__item:nth-last-child(2) {
        border-bottom: none;
    }

    /* Ensure the 3rd last item HAS a border (resetting desktop rule) */
    .CompletedStories__item:nth-last-child(3) {
        border-bottom: 1px solid #f0f0f0;
    }

    /* Tablet: Hide the last item (show 8 items in list = 1 main + 8 list = 9 total) */
    .CompletedStories__item:last-child {
        display: none !important;
    }
}

/* Mobile (Small Screens) */
@media (max-width: 640px) {
    .CompletedStories__main__cover {
        width: 100px;
    }

    .CompletedStories__main {
        padding: 15px;
        gap: 15px;
    }

    .CompletedStories__list {
        grid-template-columns: 1fr;
    }

    /* Reset borders for 1-column layout */
    .CompletedStories__item:nth-last-child(2) {
        border-bottom: 1px solid #f0f0f0;
    }

    .CompletedStories__item:last-child {
        border-bottom: none;
    }
}