/* 部落格系統樣式 */

/* 全域樣式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* 導航欄樣式 */
.navbar-brand {
    font-size: 1.5rem;
}

/* 側邊欄樣式 */
.sidebar {
    position: sticky;
    top: 100px;
}

/* 文章卡片樣式 */
.card {
    transition: transform 0.2s;
    border: none;
    margin: 0 auto;
    text-align: left; /* 改為左對齊，符合 Mobile01 風格 */
    border-radius: 0; /* 移除圓角 */
    box-shadow: none; /* 移除陰影 */
    margin-bottom: 15px; /* 減少卡片間距 */
}

.card:hover {
    transform: translateY(-3px); /* 減少懸浮效果 */
    box-shadow: 0 3px 10px rgba(0,0,0,0.1); /* 輕微陰影 */
}

/* 圖片容器樣式 */
.card-img-container {
    height: 200px; /* 增加高度，從180px調整為200px */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    width: 100%;
    padding: 0;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 改為contain，確保圖片不被裁剪或擠壓 */
    margin: 0;
    display: block;
    max-height: 100%;
    max-width: 100%;
}

/* 卡片內容樣式 */
.card-body {
    padding: 10px; /* 減少內邊距 */
}

.card-title {
    font-size: 16px; /* 減小標題字體 */
    font-weight: 600; /* 加粗標題 */
    margin-bottom: 5px; /* 減少標題下方間距 */
    line-height: 1.3; /* 減少行高 */
}

.card-text {
    font-size: 14px; /* 減小內容字體 */
    margin-bottom: 5px; /* 減少段落間距 */
    color: #666; /* 淺灰色文字 */
}

/* 標籤樣式 */
.badge {
    font-size: 12px;
    padding: 4px 8px;
    font-weight: normal;
    margin-bottom: 8px;
}

/* 文章統計信息 */
.text-muted {
    font-size: 12px;
    color: #888 !important;
}

/* 最新文章網格樣式 */
.latest-posts {
    text-align: left; /* 改為左對齊 */
}

.latest-posts .row {
    margin: 0 -8px; /* 減少行間距 */
}

.latest-posts .col-md-6, .latest-posts .col-lg-4 {
    padding: 0 8px; /* 減少列間距 */
}

/* 按鈕樣式 */
.btn-outline-primary {
    border-radius: 0; /* 移除圓角 */
    font-size: 12px; /* 減小按鈕字體 */
    padding: 4px 8px; /* 減少按鈕內邊距 */
}

/* 主內容區域樣式 */
.container-fluid {
    max-width: 1500px; /* 從1300px增加到1500px，再增加200px（約10公分） */
    margin: 0 auto;
    padding-left: 30px;
    padding-right: 30px;
}

.row {
    justify-content: center; /* 確保行內容置中 */
}

/* 最新文章網格樣式 */
.latest-posts {
    text-align: center;
}

.latest-posts .row {
    display: flex;
    justify-content: center;
}

/* 輪播圖片樣式修正 */
.hero-post img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    filter: brightness(0.7);
}

.carousel-caption {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    padding: 20px;
}

/* 標籤雲樣式 */
.tag-cloud .badge {
    font-size: 0.9rem;
    padding: 8px 12px;
    text-decoration: none;
    border: 1px solid #dee2e6;
}

.tag-cloud .badge:hover {
    background-color: #007bff !important;
    color: white !important;
}

/* 搜尋框樣式 */
.search-box input {
    border-radius: 20px 0 0 20px;
}

.search-box button {
    border-radius: 0 20px 20px 0;
}

/* 分類頁面樣式 */
.category-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.hover-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.sidebar .list-group-item.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white;
}

.sidebar .list-group-item:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
}

/* 分頁樣式 */
.pagination .page-link {
    color: var(--bs-primary);
    border: 1px solid #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.pagination .page-link:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    border-color: var(--bs-primary);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .category-header {
        padding: 1rem;
        text-align: center;
    }
    
    .category-header .d-flex {
        flex-direction: column;
    }
    
    .category-header .text-end {
        text-align: center !important;
        margin-top: 1rem;
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .category-header {
        padding: 1rem;
        text-align: center;
    }
    
    .category-header .d-flex {
        flex-direction: column;
    }
    
    .category-header .text-end {
        text-align: center !important;
        margin-top: 1rem;
    }
}

/* 頁腳樣式 */
footer {
    margin-top: auto;
}

.social-links a {
    font-size: 1.5rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #007bff !important;
}

/* 載入動畫 */
.loading {
    text-align: center;
    padding: 50px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}


/* 文章詳情頁面樣式 */
.post-content {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.post-title {
    color: #2c3e50;
    font-weight: 700;
    line-height: 1.3;
}

.post-meta {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.post-body h1, .post-body h2, .post-body h3, 
.post-body h4, .post-body h5, .post-body h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.post-body p {
    margin-bottom: 1.5rem;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.post-body blockquote {
    border-left: 4px solid var(--bs-primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 0 8px 8px 0;
}

.post-body code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-body pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}

.post-body pre code {
    background: none;
    padding: 0;
}

.social-share a {
    transition: transform 0.2s ease;
}

.social-share a:hover {
    transform: translateY(-2px);
}

.post-navigation .btn {
    min-height: 80px;
    padding: 1rem;
}

.post-tags .badge {
    font-size: 0.9em;
    padding: 0.5rem 0.8rem;
    transition: all 0.2s ease;
}

.post-tags .badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.related-posts .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-posts .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 側邊欄最新文章樣式 */
.sidebar .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,.125);
}

.sidebar .card-header h6 {
    font-weight: 600;
    color: #333;
}

.sidebar .card-body {
    padding: 15px;
}

/* 調整主內容區域寬度 */
.container-fluid .row .col-lg-10 {
    max-width: 1500px; /* 從1300px增加到1500px，保持一致 */
}

#table-of-contents a {
    color: #666;
    transition: color 0.2s ease;
}

#table-of-contents a:hover {
    color: var(--bs-primary);
}

/* 返回頂部按鈕 */
#back-to-top {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    transition: all 0.3s ease;
}

#back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .post-content {
        padding: 1rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-body {
        font-size: 1rem;
    }
    
    .social-share {
        text-align: center;
    }
    
    .social-share .btn {
        margin-bottom: 0.5rem;
    }
    
    .post-navigation .btn {
        min-height: auto;
        margin-bottom: 1rem;
    }
}

/* 打印樣式 */
@media print {
    .navbar, .sidebar, .social-share, 
    .post-navigation, footer, #back-to-top {
        display: none !important;
    }
    
    .post-content {
        box-shadow: none;
        padding: 0;
    }
    
    .container {
        max-width: 100%;
    }
}.col-md-6.col-lg-4 {
    display: flex;
    justify-content: center;
}

/* 主內容區域樣式 */
.hero-section, .latest-posts {
    width: 100%;
    margin-bottom: 20px;
}

/* 確保輪播和最新文章區域寬度一致 */
.hero-section .carousel,
.latest-posts .row {
    width: 100%;
}

/* 調整卡片容器樣式，確保一致性 */
.card-img-container {
    height: 200px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    width: 100%;
    padding: 0;
}

/* 調整側邊欄樣式 */
.sidebar {
    position: sticky;
    top: 100px;
    width: 100%;
}

/* 響應式調整 */
@media (max-width: 992px) {
    .col-lg-9, .col-lg-3 {
        width: 100%;
    }
    
    .sidebar {
        margin-top: 30px;
        position: static;
    }
}