/**
 * 鴻邦法律事務所 (AILawKing)
 * 文章詳情頁專用樣式表 - 高質感、專業、閱讀友善
 */

:root {
    --article-accent: #b8a07e;
    --article-accent-dark: #8c7659;
    --article-bg-warm: #fdfbf8;
    --article-bg-accent-light: rgba(184, 160, 126, 0.08);
    --article-text-main: #27272a; /* Zinc-800, 高對比且柔和的深炭灰 */
    --article-text-muted: #71717a; /* Zinc-500, 次要資訊 */
    --article-border-whisper: rgba(184, 160, 126, 0.15);
    --article-shadow-whisper: 0 10px 30px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.01);
}

/* ====================================================================
   1. 基礎排版與版面配置 (Layout & Typography)
   ==================================================================== */
.article-detail-page {
    background-color: var(--article-bg-warm);
    transition: background-color 0.3s ease;
}

/* 限制閱讀主體寬度以符合黃金閱讀線寬，防止視線移動疲勞 */
.article-content-body {
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

.article-content-body p {
    margin-bottom: 1.8rem;
    line-height: 1.95;
    color: var(--article-text-main);
    font-size: 1.125rem;
    letter-spacing: 0.03em;
}

/* 麵包屑導航自訂箭頭 */
.breadcrumb-item + .breadcrumb-item::before {
    content: "\F285" !important;
    font-family: bootstrap-icons !important;
    font-size: 10px;
    color: #a1a1aa;
    padding-right: 8px;
}

/* 標題設計 */
.article-content-body h2 {
    font-size: 1.625rem;
    font-weight: 700;
    color: #09090b;
    border-start: 4px solid var(--article-accent) !important;
    padding-left: 1rem;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.article-content-body h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #18181b;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
}

.article-content-body h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #27272a;
    margin-top: 1.8rem;
    margin-bottom: 1rem;
}

/* 無序與有序列表排版 */
.article-content-body ul, 
.article-content-body ol {
    margin-bottom: 1.8rem;
    padding-left: 1.5rem;
}

.article-content-body li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--article-text-main);
    margin-bottom: 0.6rem;
}

/* 強調標記 */
.article-content-body strong {
    color: #09090b;
    font-weight: 700;
    box-shadow: inset 0 -6px 0 rgba(184, 160, 126, 0.18);
}

/* ====================================================================
   2. 精緻資訊卡片 (Information Cards)
   ==================================================================== */
/* AI 摘要卡片 */
.ai-summary-card {
    background: linear-gradient(135deg, #ffffff 0%, #faf8f5 100%) !important;
    border-left: 5px solid var(--article-accent) !important;
    border-radius: 1.25rem !important;
    box-shadow: var(--article-shadow-whisper) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-right: 1px solid var(--article-border-whisper) !important;
    border-bottom: 1px solid var(--article-border-whisper) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ai-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(184, 160, 126, 0.08) !important;
}

/* 痛點/結論提示框 */
.bg-light-warm {
    background-color: #fdfaf4 !important;
    border-left: 4px solid var(--article-accent) !important;
    border-radius: 0.75rem;
    padding: 1.5rem !important;
    box-shadow: inset 0 0 10px rgba(184, 160, 126, 0.02);
}

/* Alert 警示框 */
.alert-info, .bg-light-accent {
    background-color: #f6f8fa !important;
    border-left: 4px solid var(--article-accent) !important;
    border-radius: 0.75rem;
    padding: 1.5rem !important;
    color: var(--article-text-main) !important;
}

.alert-danger {
    background-color: #fffafb !important;
    border-left: 4px solid #ef4444 !important;
    border-radius: 0.75rem;
    padding: 1.5rem !important;
    color: var(--article-text-main) !important;
}

/* 普通內容卡片 (3欄式/2欄式) */
.article-content-body .card {
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid var(--article-border-whisper);
    box-shadow: var(--article-shadow-whisper);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.article-content-body .card:hover {
    transform: translateY(-5px);
    border-color: var(--article-accent);
    box-shadow: 0 15px 35px rgba(184, 160, 126, 0.12);
}

/* ====================================================================
   3. 高質感表格設計 (Premium Tables)
   ==================================================================== */
.custom-table, .custom-table-v2 {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 1.5rem 0;
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--article-border-whisper);
}

.custom-table th, .custom-table-v2 th {
    background-color: #18181b !important;
    color: #f4f4f5 !important;
    font-weight: 600;
    padding: 1rem 1.2rem;
    border: none;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

.custom-table td, .custom-table-v2 td {
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid var(--article-border-whisper);
    border-top: none;
    color: var(--article-text-main);
    font-size: 0.95rem;
    background-color: #ffffff;
}

.custom-table tr:last-child td, .custom-table-v2 tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr, .custom-table-v2 tbody tr {
    transition: background-color 0.2s ease;
}

.custom-table tbody tr:hover td, .custom-table-v2 tbody tr:hover td {
    background-color: #fdfcf9 !important;
}

/* ====================================================================
   4. SOP 時間軸設計 (Timeline SOP)
   ==================================================================== */
.timeline-v2 {
    position: relative;
    padding-left: 1rem;
}

/* 垂直軸線 */
.timeline-v2::before {
    content: '';
    position: absolute;
    left: 2.25rem;
    top: 1.5rem;
    bottom: 1.5rem;
    width: 2px;
    background: linear-gradient(to bottom, var(--article-accent-dark) 0%, rgba(184, 160, 126, 0.1) 100%);
    z-index: 1;
}

.timeline-step {
    padding-left: 5rem !important;
    background: #ffffff;
    border: 1px solid var(--article-border-whisper) !important;
    border-radius: 1rem !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 2;
}

.timeline-step:hover {
    transform: translateY(-4px);
    border-color: var(--article-accent) !important;
    box-shadow: 0 15px 35px rgba(184, 160, 126, 0.08) !important;
}

.step-number {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--article-accent);
    opacity: 0.15;
    z-index: 0;
    font-family: 'Outfit', sans-serif;
    transition: opacity 0.3s ease;
}

.timeline-step:hover .step-number {
    opacity: 0.4;
}

.timeline-step h4 {
    position: relative;
    z-index: 2;
}

.timeline-step p {
    font-size: 0.95rem !important;
    line-height: 1.7 !important;
    margin-bottom: 0 !important;
    position: relative;
    z-index: 2;
}

/* ====================================================================
   5. 常見問題與情境手風琴 (Accordion FAQ)
   ==================================================================== */
.accordion-item {
    background-color: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--article-border-whisper) !important;
    margin-bottom: 0.5rem;
}

.accordion-button {
    background-color: transparent !important;
    color: var(--article-text-main) !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    padding: 1.25rem 0.5rem !important;
    box-shadow: none !important;
    transition: color 0.3s ease;
}

.accordion-button:not(.collapsed) {
    color: var(--article-accent) !important;
}

.accordion-button::after {
    filter: grayscale(1) opacity(0.5);
    transition: transform 0.3s ease;
}

.accordion-button:not(.collapsed)::after {
    filter: none;
}

.accordion-body {
    padding: 0.5rem 0.5rem 1.5rem 0.5rem !important;
    color: var(--article-text-muted) !important;
    font-size: 1rem;
    line-height: 1.8;
}

/* ====================================================================
   6. 社群分享與按鈕 (Sharing & Buttons)
   ==================================================================== */
.share-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    border: 1px solid #e4e4e7 !important;
    color: var(--article-text-muted) !important;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background-color: #ffffff;
}

.share-btn:hover {
    background-color: var(--article-accent) !important;
    border-color: var(--article-accent) !important;
    color: #ffffff !important;
    transform: translateY(-3px) rotate(8deg);
    box-shadow: 0 10px 20px rgba(184, 160, 126, 0.2);
}

.share-btn-small {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    border: 1px solid #e4e4e7 !important;
    color: var(--article-text-muted) !important;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    background-color: #ffffff;
}

.share-btn-small:hover {
    background-color: var(--article-accent) !important;
    border-color: var(--article-accent) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* 延伸閱讀卡片 */
.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    border-color: var(--article-accent) !important;
    transform: translateY(-2px);
}

.group:hover .group-hover-accent {
    color: var(--article-accent) !important;
}

/* ====================================================================
   7. 高級黑金 CTA 區塊 (Premium CTA Box)
   ==================================================================== */
.cta-box {
    background: #09090b !important; /* 深黑色 */
    border-radius: 1.5rem !important;
    border: 1px solid rgba(184, 160, 126, 0.15) !important;
    position: relative;
    overflow: hidden;
}

.cta-bg-glow {
    position: absolute;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(184, 160, 126, 0.12) 0%, transparent 70%);
    top: -150px;
    right: -150px;
    pointer-events: none;
}

.cta-box h3 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.btn-accent {
    background-color: var(--article-accent) !important;
    color: #ffffff !important;
    border: none !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    box-shadow: 0 4px 14px rgba(184, 160, 126, 0.3);
}

.btn-accent:hover {
    background-color: var(--article-accent-dark) !important;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 20px rgba(184, 160, 126, 0.4);
}

/* ====================================================================
   8. 響應式優化 (Responsive Adjustments)
   ==================================================================== */
@media (max-width: 768px) {
    .article-content-body {
        padding: 0 0.5rem;
    }
    
    .timeline-v2::before {
        left: 1.5rem;
    }
    
    .timeline-step {
        padding-left: 1.5rem !important;
        padding-top: 3.5rem !important;
    }
    
    .step-number {
        top: 1.5rem;
        transform: none;
        left: 1.5rem;
        font-size: 1.75rem;
        opacity: 0.3;
    }

    .custom-table, .custom-table-v2 {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
