/* ═══════════════════════════════════════════════════════════════
   Vimiss CMS — Block Chi Tiết Bài Viết (article-detail)
   Theo phong cách giao diện web cũ (CodeIgniter)
   ═══════════════════════════════════════════════════════════════ */

/* ── Wrapper ── */
.vm-article-wrapper {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

/* ── Tiêu đề H1 ── */
.vm-article-title {
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 700;
    color: #225074;
    line-height: 1.4;
    margin: 0 0 16px 0;
    padding: 0;
}

/* ── Mô tả ngắn ── */
.vm-article-description {
    font-size: 15px;
    font-style: italic;
    font-weight: 500;
    color: #222;
    border-left: 4px solid #3075AA;
    padding: 10px 16px;
    margin: 0 0 24px 0;
    background: #f4f8fc;
    border-radius: 0 6px 6px 0;
    line-height: 1.7;
}

.vm-article-description p {
    margin: 0;
}

/* ── Nội dung đầy đủ ── */
.vm-article-content {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.85;
    color: #333;
    margin-bottom: 32px;
}

/* Headings */
.vm-article-content h1,
.vm-article-content h2,
.vm-article-content h3,
.vm-article-content h4,
.vm-article-content h5,
.vm-article-content h6 {
    clear: both !important;
}

.vm-article-content h2 {
    font-size: 20px;
    font-weight: 500;
    color: #225074;
    margin: 28px 0 12px 0;
    padding: 0;
    line-height: 1.3;
}

.vm-article-content h3 {
    font-size: 17px;
    font-weight: 500;
    color: #225074;
    margin: 22px 0 10px 0;
    padding: 0;
    line-height: 1.35;
}

.vm-article-content h4 {
    font-size: 16px;
    font-weight: 700;
    color: #334;
    margin: 18px 0 8px 0;
}

/* Paragraphs */
.vm-article-content p {
    margin: 0 0 14px 0;
}

/* Ảnh & Figure */
.vm-article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.vm-article-content figure {
    margin: 20px 0;
    text-align: center;
}

.vm-article-content figure.image,
.vm-article-content figure.image-style-align-center {
    text-align: center;
}

.vm-article-content figure.image-style-align-left {
    float: left;
    margin: 0 20px 12px 0;
    text-align: left;
}

.vm-article-content figure.image-style-align-right {
    float: right;
    margin: 0 0 12px 20px;
    text-align: right;
}

.vm-article-content figcaption {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
    font-style: italic;
}

/* Blockquote */
.vm-article-content blockquote {
    border-left: 4px solid #3075AA;
    padding: 12px 18px;
    color: #555;
    background: #f0f5fb;
    margin: 20px 0;
    border-radius: 0 6px 6px 0;
    font-style: italic;
}

.vm-article-content blockquote p {
    margin: 0;
}

/* Lists */
.vm-article-content ul,
.vm-article-content ol {
    padding-left: 28px;
    margin: 12px 0 14px;
}

.vm-article-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

/* Links */
.vm-article-content a {
    color: #225074;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.vm-article-content a:hover {
    color: #3075AA;
}

/* Table */
.vm-article-content table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
    table-layout: auto;
    word-break: normal;
    overflow-wrap: anywhere;
    float: none !important;
    clear: both !important;
}

/* Bọc bảng trong wrapper có thể scroll ngang trên mobile */
.vm-article-content figure.table,
.vm-article-content .wp-block-table {
    display: block !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0 !important;
    box-sizing: border-box !important;
}

.vm-article-content th,
.vm-article-content td {
    border: 1px solid #dde4eb;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    min-width: 80px;
    word-break: break-word;
}

/* Cột đầu tiên (thường là label) — không bị ép quá hẹp */
.vm-article-content td:first-child,
.vm-article-content th:first-child {
    white-space: nowrap;
    min-width: 120px;
}

.vm-article-content th {
    background: #225074;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.vm-article-content tr:nth-child(even) td {
    background: #f4f8fc;
}


/* Clear floats */
.vm-article-content::after {
    content: "";
    display: table;
    clear: both;
}

/* ── Bài viết liên quan ── */
.vm-article-related {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 2px solid #E5E5E5;
    clear: both;
}

.vm-related-heading {
    font-size: 16px;
    font-weight: 700;
    color: #225074;
    margin-bottom: 14px;
    padding-left: 10px;
    border-left: 4px solid #3075AA;
}

.vm-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vm-related-list li {
    padding: 9px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.vm-related-list li::before {
    content: "›";
    color: #3075AA;
    font-size: 18px;
    line-height: 1.2;
    flex-shrink: 0;
}

.vm-related-list a {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
    transition: color 0.15s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vm-related-list a:hover {
    color: #225074;
    text-decoration: underline;
}

/* ── Placeholder (editor preview) ── */
.vm-article-preview-placeholder {
    padding: 24px;
    border: 2px dashed #C8DFEF;
    border-radius: 12px;
    text-align: center;
    color: #888;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .vm-article-title {
        font-size: 19px;
    }

    .vm-article-description {
        font-size: 14px;
        padding: 8px 12px;
    }

    .vm-article-content {
        font-size: 14.5px;
        line-height: 1.8;
    }

    .vm-article-content h2 {
        font-size: 18px;
    }

    .vm-article-content h3 {
        font-size: 16px;
    }

    .vm-article-content figure.image-style-align-left,
    .vm-article-content figure.image-style-align-right {
        float: none;
        margin: 16px 0;
        text-align: center;
    }

    .vm-article-content table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .vm-article-content td:first-child,
    .vm-article-content th:first-child {
        white-space: normal;
        min-width: 70px;
    }
}
