/* Internal Link Suggester Frontend Styles */

.ils-related-posts-section {
    margin: 40px 0;
    padding: 30px 0;
    border-top: 2px solid #f0f0f0;
}

.ils-related-posts-section h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    position: relative;
}

.ils-related-posts-section h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #0073aa;
    margin: 10px auto 0;
}

.ils-related-posts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ils-related-post-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ils-related-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #0073aa;
}

.ils-post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.ils-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ils-related-post-item:hover .ils-post-thumbnail img {
    transform: scale(1.05);
}

.ils-no-thumbnail {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 48px;
}

.ils-post-content {
    padding: 20px;
}

.ils-post-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
}

.ils-post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ils-post-title a:hover {
    color: #0073aa;
}

.ils-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.ils-post-date {
    font-style: italic;
}

.ils-relevance-score {
    background: #0073aa;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.ils-post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.ils-matched-keywords {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.ils-keywords-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ils-keyword-tag {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin: 2px 4px 2px 0;
    border: 1px solid #e0e0e0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ils-related-posts {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ils-related-posts-section {
        margin: 30px 0;
        padding: 20px 0;
    }
    
    .ils-related-posts-section h3 {
        font-size: 20px;
    }
    
    .ils-post-thumbnail {
        height: 150px;
    }
    
    .ils-post-content {
        padding: 15px;
    }
    
    .ils-post-title {
        font-size: 16px;
    }
    
    .ils-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .ils-related-posts-section {
        margin: 20px 0;
        padding: 15px 0;
    }
    
    .ils-related-posts-section h3 {
        font-size: 18px;
    }
    
    .ils-post-thumbnail {
        height: 120px;
    }
    
    .ils-post-content {
        padding: 12px;
    }
    
    .ils-post-title {
        font-size: 15px;
    }
}

/* Animation for loading */
.ils-related-posts.loading {
    opacity: 0.6;
    pointer-events: none;
}

.ils-related-posts.loading::after {
    content: '関連記事を読み込み中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-style: italic;
}

/* Print styles */
@media print {
    .ils-related-posts-section {
        break-inside: avoid;
        margin: 20px 0;
        padding: 15px 0;
        border-top: 1px solid #ccc;
    }
    
    .ils-related-posts {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .ils-related-post-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .ils-post-thumbnail {
        height: 120px;
    }
    
    .ils-relevance-score {
        background: #ccc !important;
        color: #000 !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ils-related-post-item {
        border: 2px solid #000;
    }
    
    .ils-related-post-item:hover {
        border-color: #0073aa;
        background: #f8f9fa;
    }
    
    .ils-post-title a {
        color: #000;
        text-decoration: underline;
    }
    
    .ils-relevance-score {
        background: #000;
        color: #fff;
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ils-related-post-item,
    .ils-related-post-item:hover,
    .ils-post-thumbnail img,
    .ils-related-post-item:hover .ils-post-thumbnail img {
        transition: none;
        transform: none;
    }
}
