.news-detail-main {
    padding: 50px 0 80px 0;
}

.detail-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.detail-sidebar {
    width: fit-content;
    position: sticky;
    top: 80px;
    height: fit-content;
}

.detail-content {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 30px;
    line-height: 1.3;
}

.post-body {
    font-size: 16px;
    line-height: 1.8;
    color: #3a3a3a;
    word-wrap: break-word;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

.post-body h1 {
    font-size: 24px;
}

.post-body h2 {
    font-size: 22px;
}

.post-body h3 {
    font-size: 20px;
}

.post-body p {
    margin-bottom: 16px;
}

.post-body ul,
.post-body ol {
    margin-left: 20px;
    margin-bottom: 16px;
    padding-left: 20px;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
}

/* Table of Contents */
.table-of-contents {
    width: fit-content;
    background: #ffffff;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.toc-header {
    width: fit-content;
    padding: 10px 40px;
    font-weight: 600;
    border-radius: 8px;
    font-size: 15px;
    color: var(--color-text-active);
    background-color: #ffeff4;
    text-transform: uppercase;
    cursor: pointer;
}

.toc-body {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 130%;
    left: 0;
    max-height: 500px;
    width: 300px;
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #ffd0e3;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.table-of-contents:hover .toc-body {
    opacity: 1;
    visibility: visible;
}

.toc-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

#table-of-contents a {
    color: #4e4e4e;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    display: block;
    border-radius: 4px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

#table-of-contents a:hover,
#table-of-contents a.active {
    color: var(--color-text-active);
}

#table-of-contetns a:last-child {
    margin-bottom: 0;
}
#table-of-contents ul li {
    list-style: none;
    text-decoration: none;
}

.article_item {
    width: 100%;
    background-color: #fff;
}

.article_item_img {
    width: 100%;
    display: block;
    overflow: hidden;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    aspect-ratio: 380 / 240;
    background-color: var(--bg-gray-white);
}

.article_item:hover .article_item_img img {
    transform: scale(1.05);
}

.article_item_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    content-visibility: auto;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.article_info {
    width: 100%;
    padding: 24px;
}

.article_meta {
    display: flex;
    justify-content: start;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    color: var(--color-text-active);
}

.article_title {
    display: block;
    width: 100%;
    text-decoration: none;
    color: var(--price-sale);
    text-transform: uppercase;
    font-weight: 500;
    font-size: 16px;
    margin: 4px 0 8px 0;
}

.article_desc {
    font-size: 13px;
    font-weight: 400;
    color: var(--price-sale);
    line-height: 1.5;
}

.article_action {
    width: 100%;
    display: flex;
    justify-content: end;
}

.btn_article {
    width: 200px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    gap: 7px;
    background-color: #fff;
    color: var(--price-sale);
    font-weight: 500;
    font-size: 15px;
    padding: 12px 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    cursor: pointer;
}

.btn_article > i {
    font-size: 20px;
    transition: all 0.3s ease;
}

.btn_article:hover {
    background-color: var(--color-text-white);
    color: var(--color-text-active);
}

.btn_article:hover i {
    transform: translateX(8px);
}

.related_post_wrapper {
    width: 100%;
    position: relative;
}

.btn-carousel-post {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--price-sale);
    font-size: 18px;
    transition:
        background-color 0.3s ease,
        color 0.3s ease;
    z-index: 10;
}

.btn-carousel-post:hover {
    color: var(--color-text-main);
}

.btn-carousel-post-prev {
    left: -40px;
}

.btn-carousel-post-next {
    right: -40px;
}

.related-posts {
    padding: 50px 0 80px 0;
    width: 100%;
    position: relative;
    background: #fffdf8;
    border: 0.5px solid #ffd0e3;
}

.section-title {
    text-transform: uppercase;
    font-size: 32px;
    font-weight: 600;
    color: var(--price-sale);
    margin-bottom: 40px;
}

.no-toc-message {
    font-size: 12px;
    color: #4d4d4d;
    text-align: center;
}

/* Responsive */
@media (max-width: 1199px) {
    .detail-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .detail-sidebar {
        flex: 1;
        position: static;
        max-width: 100%;
    }

    .detail-content {
        flex: 1;
    }
}

@media (max-width: 991px) {
    .detail-wrapper {
        flex-direction: column;
    }

    .post-title {
        font-size: 24px;
    }

    .post-body {
        font-size: 15px;
    }

    .btn-carousel-post {
        display: none;
    }

    .article_meta,
    .btn_article {
        font-size: 12px;
    }

    .article_info {
        padding: 8px;
    }

    .article_title {
        font-size: 14px;
    }
    .section-title {
        font-size: 24px;
    }

    .news-detail-main,
    .related-posts {
        padding: 30px 0;
    }
}
