/**
 * 首页 gettplhtml("article") / gettplhtml("video") 整块样式
 * 不依赖整站 style.css，避免 reset 与 Tailwind 首页冲突。
 */

.recommended-articles-section,
.recommended-videos-section {
    --hrs-primary: #0066cc;
    --hrs-radius: 14px;
    --hrs-card-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    --hrs-card-shadow-hover: 0 14px 28px rgba(15, 23, 42, 0.12);

    padding: 3rem 0 4.25rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 55%);
}

/* Tailwind/common/head 里 .container 无 max-width，在此补回内页排版 */
.recommended-articles-section .container,
.recommended-videos-section .container {
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.recommended-articles-section .section-header,
.recommended-videos-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.recommended-articles-section .section-header h2 {
    font-size: clamp(1.25rem, 2.8vw, 1.65rem);
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.65rem;
    line-height: 1.35;
}

/* 视频区块标题略小、更粗 */
.recommended-videos-section .section-header h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.65rem;
    line-height: 1.35;
}

.recommended-articles-section .section-subtitle,
.recommended-videos-section .section-subtitle {
    font-size: 0.98rem;
    color: #64748b;
    line-height: 1.65;
    max-width: 840px;
    margin: 0 auto;
}

.recommended-articles-section .articles-grid,
.recommended-videos-section .videos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.75rem 2rem;
    margin-top: 0.25rem;
}

@media (max-width: 1024px) {
    .recommended-articles-section .articles-grid,
    .recommended-videos-section .videos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .recommended-articles-section .articles-grid,
    .recommended-videos-section .videos-grid {
        grid-template-columns: 1fr;
        gap: 1.35rem;
    }

    .recommended-videos-section .section-header h2 {
        font-size: 1.1rem;
    }
}

.recommended-articles-section .article-card,
.recommended-videos-section .video-card {
    background: #ffffff;
    border-radius: var(--hrs-radius);
    overflow: hidden;
    box-shadow: var(--hrs-card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.recommended-articles-section .article-card:hover,
.recommended-videos-section .video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--hrs-card-shadow-hover);
}

.recommended-articles-section .article-card > a,
.recommended-videos-section .video-card > a {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* 封面 16:9 */
.recommended-articles-section .article-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e2e8f0;
}

.recommended-articles-section .article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.38s ease;
}

.recommended-articles-section .article-card:hover .article-thumbnail img {
    transform: scale(1.04);
}

.recommended-articles-section .article-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.25rem 1.35rem 1.5rem;
}

/* 首页视频模板：thumbnail 包住 play + img（与站内 video-poster 里绝对定位的 .video-thumbnail 区分开） */
.recommended-videos-section .video-card .video-thumbnail {
    position: relative !important;
    top: auto;
    left: auto;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

.recommended-videos-section .video-thumbnail img {
    position: relative !important;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.38s ease;
}

.recommended-videos-section .video-card:hover .video-thumbnail img {
    transform: scale(1.04);
}

.recommended-videos-section .video-thumbnail .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.96);
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
    opacity: 0.95;
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.recommended-videos-section .video-card:hover .video-thumbnail .play-icon {
    background: rgba(0, 0, 0, 0.55);
    transform: translate(-50%, -50%) scale(1.05);
}

.recommended-videos-section .video-info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.25rem 1.35rem 1.5rem;
}

.recommended-articles-section .article-info h3,
.recommended-videos-section .video-info h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.08rem;
    font-weight: 650;
    line-height: 1.4;
    letter-spacing: 0.01em;
    min-height: calc(1.4em * 2);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.recommended-articles-section .article-info p,
.recommended-videos-section .video-info > p,
.recommended-videos-section .video-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.92rem;
    line-height: 1.65;
    min-height: calc(1.65em * 3);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.recommended-articles-section .article-card:hover .article-info h3,
.recommended-videos-section .video-card:hover .video-info h3 {
    color: var(--hrs-primary);
}
