/* ========================================
   POST DETAIL PAGE CSS
   Mobile-first, proper typography for readability
   ======================================== */

/* Container */
.news-container {
    max-width: var(--container-max-width, 1440px);
    margin: 0 auto;
    padding: 0 !important;
    overflow-x: hidden;
    /* Ngăn scroll ngang */
}

@media (min-width: 768px) {
    .news-container {
        padding: 0 !important;
    }
}

@media (min-width: 1024px) {
    .news-container {
        padding: 0 !important;
    }
}

@media (min-width: 1440px) {
    .news-container {
        padding: 0 !important;
    }
}

/* Breadcrumb */
.news-breadcrumb {
    background: #FFFFFF;
    border-bottom: 1px solid #E7E7E7;
}

.breadcrumb {
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px 16px;
    /* Mobile: 16px vertical and horizontal */
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'SF Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 20px;
    color: #3D3D3D;
    flex-wrap: wrap;
}

.breadcrumb-link {
    color: #666666;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 400;
}

.breadcrumb-link:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.breadcrumb-link.breadcrumb-current {
    color: #3D3D3D;
    font-weight: 500;
    text-decoration: none;
    cursor: default;
}

.breadcrumb-link.breadcrumb-current:hover {
    color: #3D3D3D;
    text-decoration: none;
}

.breadcrumb-separator {
    color: #888888;
    user-select: none;
    font-weight: 400;
}

.breadcrumb-current {
    color: #3D3D3D;
    font-weight: 590;
}

/* Category Tabs Section */
.category-tabs-section {
    background: #FFFFFF;
    border-bottom: 1px solid #E7E7E7;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.category-tabs {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
    /* Mobile: 16px */
    display: flex;
    align-items: center;
    gap: 16px;
    height: 60px;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    font-family: 'SF Pro', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    color: #3D3D3D;
    background: transparent;
    border: none;
    padding: 20px 4px;
    position: relative;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.3s ease;
    font-variation-settings: 'wdth' 100;
    text-decoration: none;
    flex-shrink: 0;
}

.category-tab:hover {
    color: var(--color-primary);
}

.category-tab.active {
    color: #3D3D3D;
    border-bottom: 4px solid var(--color-primary);
}

.category-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
}

/* Main wrapper */
.main-wrapper {
    width: 100%;
}

/* Section container */
.sec--news-detail {
}

/* News detail container - Matches header/footer alignment */
.news-detail-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0;
}

/* Main content container - Two column layout on desktop */
.main-toc-contain {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Thu gọn width */
    margin: 0 auto;
    /* Căn giữa màn hình */
}

/* Author info */
.toc-author {
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: #888888;
    margin-bottom: 24px;
}

.toc-author .public-date {
    color: #888888;
    font-weight: 400;
}

/* Article content - Optimized for reading */
.article-toc {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    width: 100%;
}

/* Article content inner - No max-width constraint on mobile */
.article-toc>div {
    width: 100%;
    max-width: 800px;
    /* Reading width constraint */
}

/* Article title */
.toc--label-head {
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    font-weight: 700;
    font-size: 28px;
    line-height: 36px;
    color: #3D3D3D;
    margin-bottom: 16px;
    text-align: left;
}

/* Article subtitle */
.toc--sub-title {
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    font-weight: 510;
    font-size: 18px;
    line-height: 26px;
    color: #888888;
    margin-bottom: 32px;
    text-align: left;
}

/* Article body content - Typography optimized for reading */
.article-toc>div:nth-child(2) {
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    font-size: 16px;
    line-height: 28px;
    /* 1.75 for better readability */
    color: #3D3D3D;
    margin-bottom: 32px;
}

/* Body paragraphs */
.article-toc p {
    margin-bottom: 20px;
    text-align: justify;
}

/* Body headings */
.article-toc h2 {
    font-weight: 700;
    font-size: 24px;
    line-height: 32px;
    color: #3D3D3D;
    margin-top: 32px;
    margin-bottom: 16px;
}

.article-toc h3 {
    font-weight: 600;
    font-size: 20px;
    line-height: 28px;
    color: #3D3D3D;
    margin-top: 24px;
    margin-bottom: 12px;
}

/* Body lists */
.article-toc ul,
.article-toc ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.article-toc li {
    margin-bottom: 8px;
    line-height: 28px;
}

/* Body images */
.article-toc img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
    display: block;
}

/* Body links */
.article-toc a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.article-toc a:hover {
    border-bottom-color: var(--color-primary);
}

/* Body blockquotes */
.article-toc blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 20px;
    margin: 24px 0;
    font-style: italic;
    color: #6c757d;
}

/* Tags section */
.news-tagsearch {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #E7E7E7;
}

.news-tagsearch .category-label {
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: #3D3D3D;
    margin-bottom: 12px;
}

.news-tagsearch .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-tagsearch .tags li {
    margin: 0;
}

.news-tagsearch .tags a {
    display: inline-block;
    padding: 6px 12px;
    background: #F7F7F8;
    border-radius: 16px;
    font-size: 14px;
    line-height: 20px;
    color: #3D3D3D;
    text-decoration: none;
    transition: all 0.3s ease;
}

.news-tagsearch .tags a:hover {
    background: var(--color-primary);
    color: #FFFFFF;
}

/* Sidebar - Share and related products */
.toc-wrap.chapter-list {
    display: flex;
    flex-direction: column;
}

/* Share block */
.block-share {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.block-share .share-label {
    font-family: 'SF Pro Display', -apple-system, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #3D3D3D;
}

/* Individual share link - each has gray background */
.block-share .share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #F7F7F8;
    border-radius: 8px;
    padding: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.block-share .share-link img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
    transition: filter 0.3s ease;
}

/* Hover: primary blue background, white icon */
.block-share .share-link:hover {
    background: var(--color-primary, #4564ED);
}

.block-share .share-link:hover img {
    filter: brightness(0) invert(1);
}

/* ========================================
   RESPONSIVE BREAKPOINTS - Mobile-First
   ======================================== */

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .news-detail-container {
        padding: 0 20px;
        /* Tablet: 20px */
    }

    /* Match header alignment */
    .breadcrumb {
        padding: 16px 20px;
        /* Tablet: 20px horizontal */
    }

    .category-tabs {
        padding: 0 20px;
        /* Tablet: 20px */
    }

    .toc--label-head {
        font-size: 32px;
        line-height: 40px;
    }

    .toc--sub-title {
        font-size: 20px;
        line-height: 28px;
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .news-detail-container {
        padding: 0 24px;
        /* Desktop: 24px */
    }

    /* Match header alignment */
    .breadcrumb {
        padding: 16px 24px;
        /* Desktop: 24px horizontal */
    }

    .category-tabs {
        padding: 0 24px;
        /* Desktop: 24px */
    }

    /* Grid layout: author on top of article column, sidebar on right */
    .main-toc-contain {
        display: grid;
        grid-template-columns: 1fr 320px;
        /* Article (flexible) + Sidebar (fixed 320px) */
        grid-template-rows: auto 1fr;
        /* Author row + Content row */
        gap: 16px 40px;
        /* row-gap: 24px, column-gap: 40px */
        align-items: start;
    }

    /* Author in first row, first column */
    .toc-author {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
    }

    /* Article in second row, first column */
    .article-toc {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
    }

    /* Sidebar in first row (spanning both rows), second column */
    .toc-wrap.chapter-list {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
        /* Spans both rows */
    }

    /* Article content stays left-aligned */
    .article-toc>div {
        max-width: 800px;
        /* Optimal reading width on large screens */
    }

    .toc--label-head {
        font-size: 36px;
        line-height: 44px;
    }

    .sec--news-detail {
    }
}

/* Wide: 1440px+ */
@media (min-width: 1440px) {
    .news-detail-container {
        padding: 0 32px;
        /* Wide: 32px */
    }

    /* Match header alignment */
    .breadcrumb {
        padding: 16px 32px;
        /* Wide: 32px horizontal */
    }

    .category-tabs {
        padding: 0 32px;
        /* Wide: 32px */
    }

    /* Wider reading area on very large screens, still left-aligned */
    .article-toc>div {
        max-width: 900px;
    }
}

/* Mobile responsive for category tabs */
@media (max-width: 767px) {
    .category-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* Smooth scroll iOS */
        justify-content: flex-start;
    }
}
