.related-posts {
    margin: 5rem 0 3rem;
    padding: 3rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;  /* 단색 배경으로 변경 */
}

.related-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
    color: #333;
    position: relative;
    padding-bottom: 1rem;
}

.related-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #007bff;  /* 단색으로 변경 */
    border-radius: 3px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0;
    margin: 0 auto;
    list-style: none;
    max-width: 1400px;
}

.related-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);  /* 그림자 더 섬세하게 조정 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.04);  /* 테두리 더 연하게 */
}

.related-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);  /* 호버 시 그림자 조정 */
}

.related-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;  /* 더 얇게 조정 */
    background: #007bff;  /* 단색으로 변경 */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-item:hover::before {
    opacity: 1;
}

.related-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.related-image-wrapper {
    position: relative;
    padding-top: 66.67%; /* 3:2 비율 */
    background: #f8f9fa;
    overflow: hidden;
}

.related-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-item:hover .related-image {
    transform: scale(1.05);
}

.related-content {
    padding: 1.5rem;
    background: #fff;
    position: relative;
}

.related-post-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 3em;
}

/* 반응형 디자인 개선 */
@media (max-width: 1200px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        padding: 0 1rem;
    }
}

@media (max-width: 992px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .related-posts {
        margin: 3rem 0 2rem;
        padding: 2rem 0;
    }

    .related-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);  /* 1fr에서 repeat(2, 1fr)로 변경 */
        gap: 1rem;  /* 간격을 좀 더 좁게 조정 */
        padding: 0 0.5rem;  /* 좌우 패딩 추가 */
        max-width: 100%;  /* max-width 500px 제거 */
    }

    .related-post-title {
        font-size: 0.9rem;  /* 글자 크기를 약간 줄임 */
        -webkit-line-clamp: 2;  /* 2줄로 제한 */
        min-height: 2.7em;  /* 높이 조정 */
    }

    .related-content {
        padding: 1rem;  /* 패딩 살짝 줄임 */
    }
}

/* 로딩 및 페이드인 애니메이션 */
.related-item {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 각 아이템별 지연 애니메이션 */
.related-item:nth-child(1) { animation-delay: 0.1s; }
.related-item:nth-child(2) { animation-delay: 0.2s; }
.related-item:nth-child(3) { animation-delay: 0.3s; }
.related-item:nth-child(4) { animation-delay: 0.4s; }
.related-item:nth-child(5) { animation-delay: 0.5s; }
.related-item:nth-child(6) { animation-delay: 0.6s; }

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    .related-item {
        animation: none;
        opacity: 1;
    }
    
    .related-item:hover {
        transform: none;
    }
    
    .related-image {
        transition: none;
    }
}