/* ===== 最新文章區塊 ===== */

#latest-posts {
    padding: var(--space-xxl) 0;
    background: var(--bg-white); /* 改為白色背景 */
}

/* 兩欄佈局容器 */
.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* 左欄：最新消息 */
.news-column {
    background: var(--bg-white);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.news-column-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--space-lg);
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

/* 右欄：課程資訊 */
.courses-column {
    background: var(--bg-white);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.courses-column-header {
    background: linear-gradient(135deg, var(--primary-light) 0%, #ff6b9d 100%);
    color: white;
    padding: var(--space-lg);
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
}

/* 條列式文章列表 - 重新設計 */
.posts-list {
    max-width: none; /* 移除最大寬度限制 */
    margin: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    border: none;
}

.post-list-item {
    display: flex;
    align-items: center;
    padding: var(--space-xl) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.post-list-item:last-child {
    border-bottom: none;
}

.post-list-item:hover {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.02) 0%, rgba(255, 107, 107, 0.05) 100%);
    transform: translateX(5px);
    box-shadow: inset 3px 0 0 var(--primary-color);
}

.post-list-date {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 600;
    margin-right: var(--space-xl);
    background: var(--bg-light);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-small);
    border: 1px solid var(--border-light);
}

.post-list-content {
    flex: 1;
    min-width: 0;
    margin-right: var(--space-lg);
}

.post-list-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
    line-height: 1.3;
    transition: color 0.3s ease;
    letter-spacing: -0.02em;
}

.post-list-item:hover .post-list-title {
    color: var(--primary-color);
}

.post-list-excerpt {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.8;
}

.post-list-category {
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--primary-bg-light) 100%);
    color: var(--primary-dark);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-medium);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255, 107, 107, 0.2);
    transition: all 0.3s ease;
}

.post-list-item:hover .post-list-category {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-soft);
}

/* 課程資訊樣式 */
.courses-list {
    padding: 0;
}

.course-item {
    display: flex;
    align-items: center;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

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

.course-item:hover {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.02) 0%, rgba(255, 107, 107, 0.05) 100%);
    transform: translateX(5px);
    box-shadow: inset 3px 0 0 var(--primary-light);
}

.course-status {
    flex-shrink: 0;
    width: 60px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-small);
    margin-right: var(--space-lg);
}

.course-status.current {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
}

.course-status.upcoming {
    background: linear-gradient(135deg, #FF9800 0%, #FFB74D 100%);
    color: white;
}

.course-content {
    flex: 1;
    min-width: 0;
}

.course-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs) 0;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.course-item:hover .course-title {
    color: var(--primary-color);
}

.course-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

.course-date {
    flex-shrink: 0;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: var(--space-md);
    background: var(--bg-light);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-small);
    border: 1px solid var(--border-light);
}

/* 響應式調整 */
@media (max-width: 1024px) {
    .two-column-layout {
        grid-template-columns: 1fr;
        gap: var(--space-md); /* 減少間距 */
        padding: 0 var(--space-sm); /* 減少左右邊距 */
    }
}

@media (max-width: 768px) {
    .two-column-layout {
        padding: 0 var(--space-xs); /* 進一步減少邊距 */
        gap: var(--space-sm); /* 減少欄位間距 */
    }
    
    .news-column, .courses-column {
        border-radius: var(--radius-medium);
    }
    
    .news-column-header, .courses-column-header {
        padding: var(--space-sm); /* 減少標題內邊距 */
        font-size: 1.1rem; /* 稍微減小字體 */
    }
    
    .posts-list {
        margin: 0;
        border-radius: 0;
    }
    
    .post-list-item {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-md); /* 減少內邊距 */
        gap: var(--space-xs); /* 減少元素間距 */
    }
    
    .post-list-item:hover {
        transform: translateX(0);
        box-shadow: inset 0 3px 0 var(--primary-color);
    }
    
    .post-list-date {
        width: auto;
        margin-right: 0;
        margin-bottom: 0;
        font-size: 0.9rem;
        align-self: flex-start;
    }
    
    .post-list-content {
        width: 100%;
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .post-list-title {
        font-size: 1rem; /* 稍微減小標題字體 */
        margin-bottom: var(--space-xs);
        line-height: 1.3; /* 調整行高 */
    }
    
    .post-list-excerpt {
        font-size: 0.9rem; /* 稍微減小摘要字體 */
        line-height: 1.4; /* 調整行高 */
    }
    
    .post-list-category {
        align-self: flex-start;
        margin-left: 0;
    }
    
    /* 課程資訊響應式 */
    .course-item {
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-sm); /* 減少內邊距 */
        gap: var(--space-xs); /* 減少元素間距 */
    }
    
    .course-item:hover {
        transform: translateX(0);
        box-shadow: inset 0 3px 0 var(--primary-light);
    }
    
    .course-status {
        width: auto;
        margin-right: 0;
        margin-bottom: 0;
        align-self: flex-start;
    }
    
    .course-content {
        width: 100%;
    }
    
    .course-title {
        font-size: 1rem; /* 調整課程標題字體 */
        line-height: 1.3;
    }
    
    .course-info {
        font-size: 0.85rem; /* 調整課程資訊字體 */
        line-height: 1.4;
    }
    
    .course-date {
        margin-left: 0;
        align-self: flex-start;
        font-size: 0.8rem; /* 調整日期字體 */
    }
}

/* 舊的網格樣式保留作為備用 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}
