/* 使用者文章列表專用樣式 */

/* 確保 Bootstrap grid 系統正常工作 */
.articles-list .row {
    margin-left: -15px;
    margin-right: -15px;
}

.articles-list .row > [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
}

/* 文章卡片樣式 */
.article-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 圖片樣式 */
.article-image-link {
    display: block;
    position: relative;
    overflow: hidden;
    height: 200px;
}

.article-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-image-link:hover .article-image {
    transform: scale(1.05);
}

/* 文章內容樣式 */
.article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-title {
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-title a {
    font-family: 'Noto Serif TC', serif;
    color: #333;
    text-decoration: none;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-title a:hover {
    color: #8336D6;
    text-decoration: none;
}

.article-excerpt {
    color: #666;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* 文章元資訊樣式 */
.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #999;
    border-top: 1px solid #f0f0f0;
    padding-top: 12px;
    margin-top: auto;
}

.article-meta span {
    display: flex;
    align-items: center;
}

.article-meta i {
    margin-right: 6px;
    font-size: 12px;
}

.publish-date {
    color: #666;
}

.views-count {
    color: #999;
}

/* 響應式設計 */
@media (max-width: 991.98px) {
    .article-image-link {
        height: 180px;
    }
}

@media (max-width: 767.98px) {
    .articles-list .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    .articles-list .row > [class*="col-"] {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* 修正手機版內層 row 的 flexbox 問題 */
    .article-card .row {
        margin: 0 !important;
        flex-direction: column !important;
    }
    
    .article-card .row > [class*="col-"] {
        padding: 0 !important;
        max-width: 100% !important;
        flex: none !important;
    }
    
    .article-image-link {
        height: 200px;
        width: 100%;
        display: block;
    }
    
    .article-content {
        width: 100%;
        display: block !important;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    /* 手機版分頁樣式修正 */
    .pagination-center {
        padding: 0 10px;
        margin-top: 30px;
        padding-bottom: 30px;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }
    
    .pagination .page-item {
        margin: 1px;
    }
    
    .pagination .page-link {
        padding: 6px 8px;
        font-size: 14px;
        min-width: 32px;
        text-align: center;
    }
    
    /* 隱藏中間的頁數，只顯示前後幾頁 */
    .pagination .page-item:nth-child(n+6):nth-last-child(n+6) {
        display: none;
    }
    
    /* 但保留當前頁及其相鄰頁 */
    .pagination .page-item.active,
    .pagination .page-item.active + .page-item,
    .pagination .page-item.active + .page-item + .page-item,
    .pagination .page-item:has(+ .page-item.active),
    .pagination .page-item:has(+ .page-item + .page-item.active) {
        display: flex !important;
    }
}

/* 空狀態樣式 */
.no-content-container {
    text-align: center;
    padding: 60px 0;
    color: #999;
}

.no-content-container i {
    opacity: 0.5;
}
