/* topic_detail.css — 專題詳細頁 */

/* ===== Hero 區域 ===== */
.td-hero {
    position: relative;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.td-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.td-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(18px) brightness(.4);
    transform: scale(1.05);
}

.td-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 32px;
    align-items: flex-start;
    max-width: var(--container);
    margin: 0 auto;
    padding: 40px var(--page-pad);
}

/* 幻燈 */
.td-slides {
    flex-shrink: 0;
    width: 320px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16/9;
}

.td-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .5s;
}

.td-slide.is-active {
    opacity: 1;
}

.td-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 手動切換控件（多於 1 張才輸出） */
.td-slide-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .4); color: #fff; font-size: 14px;
    opacity: 0; transition: opacity .2s, background .2s;
}
.td-slides:hover .td-slide-nav, .td-slide-nav:focus-visible { opacity: 1; }
.td-slide-nav:hover { background: rgba(0, 0, 0, .65); }
.td-slide-prev { left: 8px; }
.td-slide-next { right: 8px; }
.td-slide-dots { position: absolute; bottom: 8px; left: 0; right: 0; z-index: 2; display: flex; justify-content: center; gap: 6px; }
.td-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: background .2s, width .2s; }
.td-dot.is-active { background: #fff; width: 18px; border-radius: 3px; }

/* 資訊 */
.td-info {
    flex: 1;
    min-width: 0;
}

.td-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.td-sub {
    font-size: 14px;
    color: rgba(255,255,255,.7);
    margin-bottom: 12px;
}

.td-desc {
    font-size: 14px;
    color: rgba(255,255,255,.65);
    line-height: 1.8;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.td-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(255,255,255,.6);
}

/* ===== 主內容 ===== */
.td-main {
    padding: var(--section-gap) 0 60px;
}

.td-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--page-pad);
}

/* ===== RWD ===== */
@media (max-width: 900px) {
    .td-hero-inner {
        flex-direction: column;
        align-items: center;
        padding: 28px 16px;
        gap: 20px;
    }

    .td-slides {
        width: 100%;
        max-width: 480px;
    }

    .td-info {
        width: 100%;
        text-align: center;
    }

    .td-meta {
        justify-content: center;
    }

}

@media (max-width: 600px) {
    .td-title {
        font-size: 20px;
    }


    .td-main {
        padding-bottom: 80px;
    }
}

/* ===== 面包屑（覆蓋在 Hero 底圖上，提高對比度） ===== */
.td-crumb { margin: 0 0 12px; max-width: none; padding: 0; }
.td-crumb a, .td-crumb .bc-sep { color: rgba(255, 255, 255, .6); }
.td-crumb a:hover { color: #fff; }
.td-crumb .bc-current { color: #fff; }

/* ===== 專題正文（topic_content 富文本） ===== */
.td-section-hd {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-1);
}
.td-section-hd .mac-icon { color: var(--accent-deep); }
.td-richtext { margin-top: var(--section-gap); }
.td-richtext-body {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-2);
}
.td-richtext-body img { max-width: 100%; height: auto; margin: 12px 0; }
.td-richtext-body h3 { font-size: 17px; color: var(--text-1); margin: 24px 0 10px; }
.td-richtext-body h4 { font-size: 15px; color: var(--text-1); margin: 18px 0 8px; }
.td-richtext-body p { margin: 0 0 12px; }
.td-richtext-body strong { color: var(--text-1); }
.td-richtext-body ul, .td-richtext-body ol { margin: 0 0 12px; padding-left: 22px; list-style: disc; }
.td-richtext-body li { margin-bottom: 6px; }
.td-richtext-body a { color: var(--accent-deep); text-decoration: underline; }
.td-richtext-body table { max-width: 100%; display: block; overflow-x: auto; }
