/**
 * 产品 SEO 链接 - 前端样式
 * 
 * @package Corporate_Theme
 * @since 1.0.0
 */

/* ============================================
   相关产品模块
   ============================================ */

.related-products-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.related-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.related-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.related-product-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.product-thumbnail {
    position: relative;
    padding-top: 75%; /* 4:3 比例 */
    overflow: hidden;
    background: #f5f7fa;
}

.product-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-product-card:hover .product-thumbnail img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.product-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.view-details {
    color: #1976d2;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}

.view-details .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.related-product-card:hover .view-details .dashicons {
    transform: translateX(4px);
}

/* ============================================
   相关内容模块
   ============================================ */

.related-content-section {
    background: #fff;
}

.related-content-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
}

.related-content-card {
    background: #fff;
    border-left: 4px solid #1976d2;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.related-content-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateX(4px);
}

.related-content-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.content-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
}

.content-type {
    display: inline-flex;
    align-items: center;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.content-type.solution {
    background: #e8f5e9;
    color: #4caf50;
}

.content-date {
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
}

.content-date .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.content-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.4;
}

.content-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: #1976d2;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.read-more .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.related-content-card:hover .read-more .dashicons {
    transform: translateX(4px);
}

/* ============================================
   外部资源链接
   ============================================ */

.external-resources {
    margin-top: 32px;
    padding: 24px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.external-resources-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.external-resources-title .dashicons {
    color: #1976d2;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.external-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.external-link-item {
    margin: 0;
}

.external-link-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    color: #1a1a1a;
    transition: all 0.2s ease;
}

.external-link-item a:hover {
    background: #f9fafb;
    border-color: #1976d2;
    color: #1976d2;
}

.link-icon {
    color: #1976d2;
    font-size: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.link-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.external-indicator {
    color: #999;
    font-size: 14px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.external-indicator .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.external-link-item a:hover .external-indicator {
    color: #1976d2;
}

/* ============================================
   响应式设计
   ============================================ */

@media (max-width: 1024px) {
    .related-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .related-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
    }
    
    .product-info {
        padding: 16px;
    }
    
    .product-title {
        font-size: 16px;
    }
    
    .related-content-card {
        padding: 20px;
    }
    
    .content-title {
        font-size: 16px;
    }
    
    .external-resources {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .related-products-grid {
        grid-template-columns: 1fr;
    }
    
    .content-meta {
        flex-wrap: wrap;
    }
    
    .external-link-item a {
        padding: 10px 12px;
    }
    
    .link-title {
        font-size: 13px;
    }
}

/* ============================================
   打印样式
   ============================================ */

@media print {
    .related-products-section,
    .related-content-section {
        page-break-inside: avoid;
    }
    
    .related-product-card,
    .related-content-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .related-product-card:hover,
    .related-content-card:hover {
        transform: none;
    }
}

/* ============================================
   无障碍优化
   ============================================ */

.related-product-card:focus-within,
.related-content-card:focus-within,
.external-link-item a:focus {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    .related-product-card,
    .related-content-card,
    .product-thumbnail img,
    .view-details .dashicons,
    .read-more .dashicons,
    .external-link-item a {
        transition: none;
    }
    
    .related-product-card:hover,
    .related-content-card:hover {
        transform: none;
    }
    
    .related-product-card:hover .product-thumbnail img {
        transform: none;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .related-product-card,
    .related-content-card,
    .external-link-item a {
        border: 2px solid currentColor;
    }
    
    .content-type,
    .external-resources {
        border: 1px solid currentColor;
    }
}
