/* ============================================
   PAGE: News Detail — news/news
   ============================================ */

/* --- Article Meta --- */
.news-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}
.news-detail__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.news-detail__meta-item svg {
    flex-shrink: 0;
    color: #999;
}
.news-detail__meta-item a {
    color: var(--shop-color-main);
}
.news-detail__meta-item a:hover {
    color: var(--shop-color-accent);
}

/* --- Featured Image --- */
.news-detail__featured-image {
    margin-bottom: 24px;
    border-radius: 8px;
    overflow: hidden;
}
.news-detail__featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Excerpt / Description Short --- */
.news-detail__excerpt {
    font-size: 16px;
    line-height: 1.7;
    color: var(--body-color);
    font-weight: 500;
    padding: 16px 20px;
    border-left: 4px solid var(--shop-color-accent);
    background: #f8f9fa;
    border-radius: 0 6px 6px 0;
    margin-bottom: 24px;
}

/* --- Table of Contents (inline, mobile) --- */
.news-detail__toc {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 28px;
}
.news-detail__toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.news-detail__toc-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--shop-color-main);
}
.news-detail__toc-toggle {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    transition: transform 0.3s;
}
.news-detail__toc-toggle.is-collapsed {
    transform: rotate(-90deg);
}
.news-detail__toc-body {
    margin-top: 12px;
}
.news-detail__toc-body.is-hidden {
    display: none;
}
.news-detail__toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}
.news-detail__toc-item {
    counter-increment: toc-counter;
    margin-bottom: 6px;
}
.news-detail__toc-item::before {
    content: counters(toc-counter, ".") ". ";
    color: var(--shop-color-accent);
    font-weight: 600;
    font-size: 13px;
}
.news-detail__toc-item a {
    font-size: 14px;
    color: #444;
    text-decoration: none;
    transition: color 0.2s;
}
.news-detail__toc-item a:hover {
    color: var(--shop-color-main);
}
.news-detail__toc-item--h3 {
    padding-left: 20px;
}

/* --- Article Body --- */
.news-detail__body {
    margin-bottom: 28px;
}

/* --- Tags --- */
.news-detail__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid #e9ecef;
    margin-bottom: 16px;
}
.news-detail__tags-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #444;
}
.news-detail__tags-label svg {
    color: #999;
}
.news-detail__tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 13px;
    color: #555;
    background: #f0f0f0;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
}
.news-detail__tag:hover {
    background: var(--shop-color-main);
    color: #fff;
}

/* --- Social Share --- */
.news-detail__share {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid #e9ecef;
    margin-bottom: 32px;
}
.news-detail__share-label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}
.news-detail__share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: #fff;
    transition: opacity 0.2s;
}
.news-detail__share-btn:hover {
    opacity: 0.85;
}
.news-detail__share-btn--fb {
    background: #1877f2;
}
.news-detail__share-btn--tw {
    background: #1da1f2;
}
.news-detail__share-btn--copy {
    background: #6c757d;
}

/* --- Comments Section --- */
.news-detail-comments {
    padding-top: 32px;
    border-top: 2px solid #e9ecef;
    margin-bottom: 40px;
}
.news-detail-comments__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--shop-color-main);
    margin-bottom: 20px;
}
.news-detail-comments__empty {
    padding: 16px;
    background: #fff3cd;
    border-radius: 6px;
    color: #856404;
    font-size: 14px;
}
.news-detail-comments__form-wrap {
    margin-top: 28px;
    padding: 24px;
    background: #f8f9fa;
    border-radius: 8px;
}
.news-detail-comments__form-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--body-color);
    margin-bottom: 16px;
}
.news-detail-comments__field {
    margin-bottom: 14px;
}
.news-detail-comments__input,
.news-detail-comments__textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 14px;
    transition: border-color 0.3s;
}
.news-detail-comments__input:focus,
.news-detail-comments__textarea:focus {
    border-color: var(--shop-color-main);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}
.news-detail-comments__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    background: var(--btn-bg);
    color: var(--btn-color);
    border: 1px solid var(--btn-bg);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}
.news-detail-comments__submit:hover {
    background: var(--btn-color);
    color: var(--btn-bg);
    border-color: var(--btn-bg);
}

/* --- Sidebar TOC (sticky, desktop) --- */
.news-detail-sidebar--sticky {
    position: sticky;
    top: 100px;
}
.news-detail-sidebar__toc {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}
.news-detail-sidebar__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--shop-color-main);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--shop-color-accent);
}
.news-detail-sidebar__toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.news-detail-sidebar__toc-item {
    margin-bottom: 8px;
}
.news-detail-sidebar__toc-item a {
    font-size: 13px;
    color: #555;
    text-decoration: none;
    display: block;
    padding: 4px 0;
    border-left: 2px solid transparent;
    padding-left: 10px;
    transition: all 0.2s;
}
.news-detail-sidebar__toc-item a:hover,
.news-detail-sidebar__toc-item.is-active a {
    color: var(--shop-color-main);
    border-left-color: var(--shop-color-accent);
}
.news-detail-sidebar__toc-item--h3 a {
    padding-left: 24px;
    font-size: 12px;
}

/* --- Related News --- */
.news-detail-related {
    padding: 48px 0;
    background: #f8f9fa;
}
.news-detail-related .section__heading {
    margin-bottom: 28px;
}
.news-detail-related__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* nws__card (class chung, override cho context related) */
.news-detail-related .nws__card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s;
}
.news-detail-related .nws__card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.news-detail-related .nws__thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/10;
}
.news-detail-related .nws__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.news-detail-related .nws__card:hover .nws__thumb img {
    transform: scale(1.05);
}
.news-detail-related .nws__content {
    padding: 16px;
}
.news-detail-related .nws__cat {
    display: inline-block;
    font-size: 12px;
    color: var(--shop-color-accent);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 6px;
    text-decoration: none;
}
.news-detail-related .nws__cat:hover {
    color: var(--shop-color-main);
}
.news-detail-related .nws__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}
.news-detail-related .nws__title a {
    color: var(--body-color);
    text-decoration: none;
}
.news-detail-related .nws__title a:hover {
    color: var(--shop-color-main);
}
.news-detail-related .nws__desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-detail-related .nws__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #999;
}
.news-detail-related .nws__author::before {
    content: "·";
    margin-right: 12px;
}

/* --- Responsive --- */
@media (min-width: 768px) {
    .news-detail-related__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .news-detail__toc {
        display: block;
    }
}

@media (min-width: 1024px) {
    .news-detail-related__grid {
        grid-template-columns: repeat(3, 1fr);
    }
    /* Ẩn TOC inline khi có sidebar TOC */
    .news-detail-page:not(.has-sidebar) .news-detail__toc {
        display: none;
    }
}
