/**
 * Related Articles Section
 * Displays latest articles from the same category
 */

.related-articles-section {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 40px 0;
    margin-top: 40px;
}

.related-articles-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 30px 0;
    padding: 0 20px;
}

.related-articles-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Individual Article Item */
.related-article-item {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.related-article-item:last-child {
    border-bottom: none;
}

.related-article-item:hover {
    background-color: #f8f9fa;
}

.related-article-link {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    text-decoration: none;
    color: inherit;
}

/* Article Image */
.related-article-image {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: #e9ecef;
}

.related-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.related-article-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.no-image-placeholder {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.8);
}

/* Article Meta (Date) */
.related-article-meta {
    margin: 6px 0 8px 0;
}

.related-article-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.related-article-date i {
    font-size: 11px;
}

/* Article Content */
.related-article-content {
    flex: 1;
    min-width: 0;
}

.related-article-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-article-link:hover .related-article-title {
    color: #667eea;
}

.related-article-summary {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .related-articles-section {
        padding: 30px 0;
        margin-top: 30px;
    }

    .related-articles-title {
        font-size: 20px;
        margin-bottom: 20px;
        padding: 0 16px;
    }

    .related-article-link {
        padding: 14px 16px;
        gap: 12px;
    }

    .related-article-image {
        width: 100px;
        height: 75px;
    }

    .related-article-title {
        font-size: 18px;
    }

    .related-article-summary {
        font-size: 14px;
    }

    .related-article-date {
        font-size: 11px;
    }

    .related-article-date i {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .related-articles-section {
        padding: 20px 0;
        margin-top: 20px;
    }

    .related-articles-title {
        font-size: 18px;
        margin-bottom: 16px;
        padding: 0 12px;
    }

    .related-article-link {
        padding: 12px;
        gap: 10px;
    }

    .related-article-image {
        width: 85px;
        height: 64px;
    }

    .related-article-title {
        font-size: 16px;
        margin-bottom: 0;
    }

    .related-article-meta {
        margin: 4px 0 6px 0;
    }

    .related-article-date {
        font-size: 11px;
    }

    .related-article-summary {
        display: none;
    }

    .no-image-placeholder {
        font-size: 24px;
    }
}

/* Lazy Loading Styles */
.related-articles-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #666;
    background: #fff;
}

.related-articles-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

.related-articles-loading p {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Sentinel element for intersection observer */
.related-articles-sentinel {
    height: 20px;
    margin: 20px 0;
}

/* Responsive Lazy Loading */
@media (max-width: 768px) {
    .related-articles-loading {
        padding: 30px 16px;
    }

    .related-articles-loading .loading-spinner {
        width: 35px;
        height: 35px;
        border-width: 3px;
    }

    .related-articles-loading p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .related-articles-loading {
        padding: 24px 12px;
    }

    .related-articles-loading .loading-spinner {
        width: 30px;
        height: 30px;
    }

    .related-articles-loading p {
        font-size: 12px;
    }

    .related-articles-sentinel {
        height: 10px;
        margin: 10px 0;
    }
}

