/* Detail view only. Shared layout/components live in index.css. */

.detail-page .content-wrapper {
    padding-top: 15px;
}

.article-content-wrapper {
    padding: 32px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.article-header {
    margin-bottom: 24px;
}

.article-category {
    display: inline-block;
    margin-bottom: 12px;
    padding: 4px 12px;
    border-radius: 100px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.article-title {
    margin-bottom: 16px;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.35;
}

.article-meta,
.meta-author,
.meta-item {
    display: flex;
    align-items: center;
}

.article-meta {
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.meta-author,
.meta-item {
    gap: 6px;
}

.meta-author i {
    color: var(--primary);
}

.article-share {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.share-btn {
    padding: 8px 14px;
    border: 0;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
}

.share-btn.fb { background: #1877f2; }
.share-btn.zalo { background: #0068ff; }
.share-btn.copy { background: var(--text-secondary); }
.share-btn:hover { transform: translateY(-2px); }

.article-featured-image {
    margin-bottom: 8px;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.article-featured-image img {
    width: 100%;
}

.image-caption {
    color: var(--text-light);
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
}

.toc-box {
    margin: 28px 0;
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
}

.toc-title {
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 700;
}

.toc-list {
    padding-left: 20px;
    list-style: decimal;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a,
.article-body a {
    color: var(--primary);
}

.toc-list a:hover,
.article-body a:hover {
    text-decoration: underline;
}

.article-body {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
}

.article-body h2,
.article-body h3 {
    color: var(--text-primary);
    line-height: 1.4;
}

.article-body h2 {
    margin: 34px 0 14px;
    font-size: 1.45rem;
}

.article-body h3 {
    margin: 26px 0 12px;
    font-size: 1.2rem;
}

.article-body p,
.article-body ul,
.article-body ol {
    margin-bottom: 18px;
}

.article-body ul,
.article-body ol {
    padding-left: 24px;
}

.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 8px; }

.article-body img {
    display: block;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
    margin: 24px auto 8px;
    border-radius: var(--radius-md);
}

/* Nội dung từ trình soạn thảo có thể chứa kích thước cố định trên wrapper. */
.article-body figure,
.article-body picture,
.article-body p:has(> img) {
    max-width: 100% !important;
}

.article-body figure {
    width: auto !important;
    margin-right: auto;
    margin-left: auto;
}

.article-body blockquote,
.info-box {
    margin: 24px 0;
    padding: 18px 22px;
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    background: var(--primary-light);
}

.info-box {
    display: flex;
    gap: 14px;
}

.info-box i {
    margin-top: 4px;
    color: var(--primary);
}

.info-box h4 {
    margin-bottom: 6px;
    color: var(--text-primary);
}

.article-body .highlight {
    padding: 2px 4px;
    border-radius: 4px;
    background: #fff3cd;
    color: #856404;
    font-family: monospace;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.article-tags-title {
    margin-right: 8px;
    font-weight: 600;
}

.tag-pill {
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    background: var(--bg-light);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.tag-pill:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.author-box {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
}

.author-avatar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 2.5rem;
}

.author-info h4 {
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.author-info p {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.author-social {
    display: flex;
    gap: 10px;
}

.author-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: white;
}

.related-articles {
    margin-top: 28px;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.related-heading {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--primary-light);
}

.related-heading-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
}

.related-eyebrow {
    display: block;
    color: var(--text-light);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.related-title {
    margin: 1px 0 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    line-height: 1.25;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-card {
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    transition: var(--transition);
}

.related-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.related-img {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.related-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    padding: 12px;
}

.related-content h3 {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.related-content h3 a:hover { color: var(--primary); }
.related-date { display: inline-flex; gap: 5px; align-items: center; margin-top: 9px; color: var(--text-light); font-size: .75rem; }

.related-side-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.related-side-item:last-child {
    margin-bottom: 0;
}

.related-side-thumb {
    flex: 0 0 auto;
    width: 80px;
    height: 56px;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

.related-side-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-side-item h4 {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.ad-after-article {
    margin-top: 40px;
}

.ad-sidebar {
    margin: 0;
}

.category-widget-item.is-current {
    color: var(--primary);
}

@media (max-width: 768px) {
    .article-content-wrapper {
        padding: 20px;
    }

    .article-title {
        font-size: 1.5rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .article-content-wrapper {
        padding: 16px;
    }

    .author-box {
        flex-direction: column;
    }
}
.article-audio,
.attachment-list,
.download-box {
    margin: 24px 0;
}

.article-audio audio { display: block; width: 100%; margin-top: 10px; }
.download-box { text-align: center; }
.download-btn { display: inline-flex; gap: 8px; align-items: center; padding: 12px 22px; color: #fff; background: var(--primary); border-radius: var(--radius-sm); font-weight: 700; }

.attachment-list { padding: 20px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--bg-light); }
.attachment-list h3 { margin-top: 0; }
.attachment-item { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border-color); }
.attachment-item a, .attachment-item button { margin-left: 12px; color: var(--primary); background: none; border: 0; cursor: pointer; }
.myFrame { width: 100%; min-height: 800px; border: 1px solid var(--border-color); }
.related-links { display: grid; gap: 0; margin-top: 18px; border-top: 1px solid var(--border-color); }
.related-links a { display: flex; gap: 10px; align-items: flex-start; padding: 12px 4px; border-bottom: 1px solid var(--border-color); color: var(--text-secondary); font-size: .9rem; font-weight: 500; }
.related-links a i { margin-top: 5px; color: var(--primary); font-size: .7rem; transition: var(--transition); }
.related-links a:hover { color: var(--primary); padding-left: 8px; }

@media (max-width: 576px) {
    .attachment-item { flex-direction: column; }
    .related-articles { padding: 18px; }
}
