/* ============================================================
   blog.css — 博客列表 & 單篇文章頁面專屬樣式
   依賴：main.css
   ============================================================ */

/* ============================================================
   Blog List Layout
   ============================================================ */
.blog-section {
    padding: 80px 20px;
    background: var(--light-color, #f8f9fa);
}

.blog-layout {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 50px;
    align-items: start;
}

.blog-main { min-width: 0; }

/* ── 搜尋表單 ─────────────────────────────────────────────── */
.blog-search {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.blog-search .search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 30px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #fff;
}

.blog-search .search-input:focus {
    outline: none;
    border-color: var(--primary-color, #1a5f7a);
    box-shadow: 0 0 0 3px rgba(26,95,122,0.1);
}

.blog-search .search-btn {
    padding: 14px 28px;
    background: var(--gradient-1, linear-gradient(135deg, #1a5f7a, #2d8bb8));
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.3s;
    font-family: inherit;
}
.blog-search .search-btn:hover { opacity: 0.88; }

/* ── 篩選 Badges ──────────────────────────────────────────── */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.filter-label { font-weight: 600; color: var(--dark-color, #1e293b); margin-right: 4px; }

.filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--gradient-1, linear-gradient(135deg, #1a5f7a, #2d8bb8));
    color: #fff;
    border-radius: 20px;
    font-size: 0.88rem;
}

.filter-remove {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    line-height: 1;
}
.filter-remove:hover { opacity: 0.7; }

.clear-filters {
    margin-left: auto;
    color: var(--primary-color, #1a5f7a);
    text-decoration: none;
    font-size: 0.9rem;
}
.clear-filters:hover { text-decoration: underline; }

.results-count {
    color: #64748b;
    margin-bottom: 25px;
    font-size: 0.95rem;
}
.results-count strong { color: var(--primary-color, #1a5f7a); }

/* ── 空狀態 ───────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.06);
}
.empty-state .empty-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 20px;
    display: block;
}
.empty-state h3 { color: var(--dark-color, #1e293b); margin-bottom: 12px; }
.empty-state p { color: #94a3b8; margin-bottom: 24px; }

.btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: var(--gradient-1, linear-gradient(135deg, #1a5f7a, #2d8bb8));
    color: #fff;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s;
}
.btn-primary:hover { transform: translateY(-2px); }

/* ============================================================
   Blog Cards（列表卡片）
   ============================================================ */
.blog-grid { display: flex; flex-direction: column; gap: 30px; }

.blog-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    display: grid;
    grid-template-columns: 320px 1fr;
}
.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}

.blog-card .card-image-link {
    display: block;
    overflow: hidden;
}
.blog-card .card-image {
    width: 100%;
    height: 100%;
    min-height: 220px;
    overflow: hidden;
    position: relative;
}
.blog-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.blog-card:hover .card-image img { transform: scale(1.08); }

.blog-card .card-body {
    padding: 28px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-card .card-category {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 14px;
    background: var(--gradient-2, linear-gradient(135deg, #ff6b35, #f7931e));
    color: #fff;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 12px;
}

.blog-card .card-title {
    font-size: 1.4rem;
    line-height: 1.4;
    margin: 0 0 14px;
}
.blog-card .card-title a {
    color: var(--dark-color, #1e293b);
    text-decoration: none;
    transition: color 0.3s;
}
.blog-card .card-title a:hover { color: var(--primary-color, #1a5f7a); }

.blog-card .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: #999;
    font-size: 0.83rem;
    margin-bottom: 14px;
}
.blog-card .card-meta i { color: var(--secondary-color, #2d8bb8); margin-right: 4px; }

.blog-card .card-excerpt {
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    color: var(--primary-color, #1a5f7a);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s;
    font-size: 0.95rem;
}
.read-more:hover { gap: 14px; }

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 50px;
}

.page-btn,
.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    background: #fff;
    color: var(--dark-color, #1e293b);
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: all 0.3s;
}
.page-btn:hover {
    background: var(--primary-color, #1a5f7a);
    color: #fff;
}
.page-btn.active {
    background: var(--gradient-1, linear-gradient(135deg, #1a5f7a, #2d8bb8));
    color: #fff;
}
.page-ellipsis {
    background: none;
    box-shadow: none;
    color: #94a3b8;
}

/* ============================================================
   Sidebar
   ============================================================ */
.blog-sidebar { display: flex; flex-direction: column; gap: 25px; }

.sidebar-widget {
    background: #fff;
    border-radius: 18px;
    padding: 28px 26px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.widget-title,
.sidebar-widget h3 {
    font-size: 1.15rem;
    color: var(--dark-color, #1e293b);
    margin: 0 0 18px;
    padding-bottom: 14px;
    position: relative;
}
.widget-title::after,
.sidebar-widget h3::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 40px; height: 3px;
    background: var(--gradient-2, linear-gradient(135deg, #ff6b35, #f7931e));
    border-radius: 2px;
}

/* Sidebar search */
.sidebar-search { display: flex; gap: 8px; }
.sidebar-search .search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    font-size: 0.92rem;
    background: #f8fafc;
}
.sidebar-search .search-input:focus {
    outline: none;
    border-color: var(--primary-color, #1a5f7a);
    background: #fff;
}
.sidebar-search .search-btn {
    width: 42px; height: 42px;
    border: none;
    background: var(--gradient-1, linear-gradient(135deg, #1a5f7a, #2d8bb8));
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}

/* Categories */
.category-list { list-style: none; padding: 0; margin: 0; }
.category-list li {
    border-bottom: 1px solid #f1f5f9;
}
.category-list li:last-child { border-bottom: none; }
.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    color: #475569;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.95rem;
}
.category-list a:hover,
.category-list a.active { color: var(--primary-color, #1a5f7a); }
.cat-count {
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}
.category-list a.active .cat-count {
    background: var(--primary-color, #1a5f7a);
    color: #fff;
}

/* Recent posts */
.recent-posts-list { list-style: none; padding: 0; margin: 0; }
.recent-post-item {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.recent-post-item:last-child { border-bottom: none; }
.recent-post-item:first-child { padding-top: 0; }

.recent-post-thumb {
    width: 70px; height: 70px;
    border-radius: 10px;
    overflow: hidden;
    display: block;
}
.recent-post-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.recent-post-info { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.recent-post-title {
    color: var(--dark-color, #1e293b);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}
.recent-post-title:hover,
.recent-post-title.current { color: var(--primary-color, #1a5f7a); }

.recent-post-date {
    color: #94a3b8;
    font-size: 0.78rem;
}
.recent-post-date i { margin-right: 4px; }

/* Tags */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-link {
    display: inline-block;
    padding: 5px 14px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
}
.tag-link:hover,
.tag-link.active {
    background: var(--gradient-1, linear-gradient(135deg, #1a5f7a, #2d8bb8));
    color: #fff;
}

/* ============================================================
   Blog Single Page
   ============================================================ */
.blog-single-section {
    padding: 60px 20px 80px;
    background: var(--light-color, #f8f9fa);
}

.blog-single-layout {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 50px;
    align-items: start;
}

.blog-article {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}

/* Article Hero */
.article-hero {
    position: relative;
    height: 380px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-color: #1a5f7a;
}
.article-hero img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.article-hero-overlay,
.article-hero .hero-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(26,95,122,0.7) 0%, rgba(0,0,0,0.55) 100%);
}
.article-hero-content {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    padding: 40px;
    color: #fff;
    z-index: 2;
}
.article-hero-content .card-category {
    display: inline-block;
    padding: 4px 16px;
    background: var(--gradient-2, linear-gradient(135deg, #ff6b35, #f7931e));
    color: #fff;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 14px;
}
.article-hero-content h1 {
    font-size: 2.2rem;
    line-height: 1.3;
    margin: 0 0 16px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    color: #fff;
}
.article-hero-content .card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.92rem;
    color: rgba(255,255,255,0.92);
}
.article-hero-content .card-meta i { margin-right: 6px; }

/* Article Body */
.article-body {
    padding: 50px;
    color: #444;
    line-height: 1.95;
    font-size: 1.05rem;
}
.article-body h2 {
    font-size: 1.6rem;
    color: var(--primary-color, #1a5f7a);
    margin: 40px 0 20px;
    padding-left: 16px;
    border-left: 4px solid var(--gradient-2-start, #ff6b35);
}
.article-body h3 {
    font-size: 1.3rem;
    color: var(--dark-color, #1e293b);
    margin: 30px 0 15px;
}
.article-body p { margin-bottom: 18px; }
.article-body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}
.article-body ul, .article-body ol { padding-left: 26px; margin-bottom: 18px; }
.article-body li { margin-bottom: 8px; }
.article-body blockquote {
    border-left: 4px solid var(--primary-color, #1a5f7a);
    background: #f8fafc;
    padding: 18px 24px;
    margin: 20px 0;
    color: #64748b;
    font-style: italic;
    border-radius: 0 12px 12px 0;
}
.article-body a { color: var(--primary-color, #1a5f7a); }

/* Tags */
.article-tags {
    padding: 0 50px 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.tags-label,
.article-tags .tags-label { font-weight: 600; color: var(--dark-color, #1e293b); }
.article-tags .tag-link {
    background: #f1f5f9;
    color: #475569;
    padding: 5px 14px;
    border-radius: 16px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s;
}
.article-tags .tag-link:hover {
    background: var(--primary-color, #1a5f7a);
    color: #fff;
}

/* Share */
.article-share {
    padding: 24px 50px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.share-label { font-weight: 600; color: var(--dark-color, #1e293b); margin-right: 4px; }

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 22px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform 0.3s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.share-btn:hover { transform: translateY(-2px); color: #fff; }
.share-btn.share-fb  { background: #1877f2; }
.share-btn.share-wa  { background: #25d366; }
.share-btn.share-copy { background: var(--primary-color, #1a5f7a); }

/* ============================================================
   Related Posts
   ============================================================ */
.related-posts {
    margin-top: 50px;
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.06);
}
.related-posts-title,
.related-posts h3 {
    font-size: 1.5rem;
    color: var(--dark-color, #1e293b);
    margin: 0 0 28px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f1f5f9;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.related-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}
.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

.related-card-image-link { display: block; overflow: hidden; }
.related-card-image { height: 160px; overflow: hidden; }
.related-card-image img,
.related-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.related-card:hover .related-card-image img { transform: scale(1.08); }

.related-card-body,
.related-card .related-info { padding: 18px; }
.related-card-title,
.related-card .related-info h4 {
    font-size: 1rem;
    line-height: 1.45;
    margin: 0 0 10px;
}
.related-card-title a {
    color: var(--dark-color, #1e293b);
    text-decoration: none;
}
.related-card-title a:hover { color: var(--primary-color, #1a5f7a); }
.related-card-excerpt {
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-card-date,
.related-card .related-info span {
    color: #94a3b8;
    font-size: 0.82rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .blog-layout,
    .blog-single-layout { grid-template-columns: 1fr; }
    .blog-sidebar { order: 2; }
}

@media (max-width: 768px) {
    .blog-section { padding: 50px 16px; }
    .blog-card { grid-template-columns: 1fr; }
    .blog-card .card-image { height: 220px; min-height: 220px; }
    .blog-card .card-body { padding: 22px; }
    .blog-card .card-title { font-size: 1.2rem; }
    .article-hero { height: 280px; }
    .article-hero-content { padding: 24px; }
    .article-hero-content h1 { font-size: 1.5rem; }
    .article-body { padding: 28px; font-size: 0.98rem; }
    .article-tags { padding: 0 28px 24px; }
    .article-share { padding: 20px 28px; }
    .related-posts { padding: 28px; }
}