/* ==========================================
   PV INCONS - STYLESHEET TIN TỨC - MAIN (style_news.css)
   ========================================== */

/* 1. Biến CSS của bài viết chỉ áp dụng trong <main>.
      Không khai báo ở :root để không ghi đè biến chung (--text-main, --border-color...) của style.css,
      tránh làm lệch giao diện header/footer so với các trang khác. */
main {
    /* Brand Colors */
    --brand-blue: #1e68a8;
    --brand-darkblue: #0d3d6b;
    --brand-orange: #e87e23;
    --brand-gold: #8c6239;

    /* Theme & System Colors */
    --primary-color: var(--brand-blue);
    --primary-dark: #071728;
    --primary-blue: #1e68a8;
    --accent-orange: #e87e23;
    --accent-gold: #8c6239;
    --accent-bg: #f4efe6;

    /* Tone màu chuẩn */
    --bg-body: white;
    --bg-card: white;
    --text-main: #202020;
    --text-muted: #64748b;
    --border-color: #e5e0d8;

    /* Spacing */
    --slide-y: 22px;
    --slide-x: 100px;
}

main {
    font-family: Inter, sans-serif;
    line-height: 1.7;
    color: var(--text-main);
    background-color: var(--bg-body);
}

/* 2. Toàn bộ CSS bên dưới được giới hạn scope riêng cho thẻ <main> */
main {

    /* Container Bài Viết: Phẳng, không viền, không bóng */
    .article-container {
        font-family: Inter, sans-serif;
        line-height: 1.7;
        color: var(--text-main);
        background-color: var(--bg-body);
        max-width: 760px;
        margin: 20px auto;
        background-color: var(--bg-card);
        box-shadow: none;
        border: none;
    }

    /* Breadcrumb Điều Hướng */
    .breadcrumb {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.875rem;
        color: var(--text-muted);
        margin-bottom: 20px;
        flex-wrap: wrap;
    }

    .breadcrumb a {
        color: var(--primary-color);
        text-decoration: none;
        transition: color 0.2s;
    }

    .breadcrumb a:hover {
        text-decoration: underline;
    }

    /* Article Meta & Author */
    .article-meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 24px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--border-color);
        flex-wrap: wrap;
    }

    .author-info {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .author-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background-color: whitesmoke;
        object-fit: contain;
        /* Giữ nguyên tỉ lệ và không bị xén mép logo */
        padding: 6px;
        /* Tạo khoảng thở giúp logo nằm gọn trong đường tròn */
        border: 1px solid #e2e8f0;
        /* Viền mỏng định hình khối tròn nét hơn */
    }

    .article-date-time {
        color: var(--text-muted);
        font-size: 0.875rem;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    /* ===== TIÊU ĐỀ BÀI VIẾT ===== */
    h1.article-title {
        font-family: Inter, sans-serif;
        font-size: 2.25rem;
        font-weight: 700;
        color: #000000;
        line-height: 1.7;
        margin: 0 0 16px 0;
        letter-spacing: -0.01em;
    }

    /* ===== MÔ TẢ NỘI DUNG / SAPO ===== */
    .article-subtitle {
        font-family: Inter, sans-serif;
        font-size: 1.1rem;
        color: #222222;
        font-weight: 400;
        line-height: 1.7;
        margin-bottom: 28px;
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border-color);
    }

    /* ===== THÂN BÀI VIẾT ===== */
    .article-content {
        font-family: Inter, sans-serif;
        font-size: 1.1rem;
        color: #202020;
        line-height: 1.7;
    }

    .article-content p {
        margin-bottom: 1.25rem;
    }

    /* ===== ĐỀ MỤC BÀI VIẾT H2, H3 ===== */
    .article-content h2,
    h2 {
        font-family: Inter, sans-serif;
        font-size: 1.3rem;
        color: #202020;
        margin-top: 32px;
        margin-bottom: 14px;
        font-weight: 700 !important;
        line-height: 1.7;
    }

    .article-content h3,
    h3 {
        font-family: Inter, sans-serif;
        font-size: 1.125rem;
        color: #202020;
        margin-top: 24px;
        margin-bottom: 10px;
        font-weight: 700 !important;
        line-height: 1.7;
    }

    /* Callout Box */
    .callout-box {
        background-color: #f3eee3;
        border-left: 4px solid var(--primary-color);
        padding: 18px 22px;
        margin: 24px 0;
    }

    .callout-box p {
        margin: 0;
        color: #202020;
        font-size: 1rem;
    }

    /* Trích dẫn Blockquote */
    blockquote {
        margin: 24px 0;
        padding: 16px 20px;
        border-left: 3px solid var(--brand-orange);
        background-color: #f5efe4;
        font-style: italic;
        color: #333333;
    }

    /* Responsive Table Container */
    .table-wrapper {
        width: 100%;
        overflow-x: auto;
        margin: 24px 0;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 1rem;
        white-space: nowrap;
        background-color: #fff;
    }

    .data-table th {
        background-color: #ede7dc;
        color: #202020;
        font-weight: 700;
        text-align: left;
        padding: 12px 16px;
        border: 1px solid var(--border-color);
        font-family: Inter, sans-serif;
    }

    .data-table td {
        padding: 12px 16px;
        border: 1px solid var(--border-color);
    }

    .data-table tr:nth-child(even) {
        background-color: #f9f6f0;
    }

    /* Formats */
    code {
        font-family: "Fira Code", Consolas, Monaco, monospace;
        background-color: #eee8dd;
        color: var(--brand-orange);
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 1rem;
    }

    .step-list {
        list-style: none;
        counter-reset: step-counter;
        padding-left: 0;
    }

    .step-list li {
        position: relative;
        padding-left: 40px;
        margin-bottom: 16px;
    }

    .step-list li::before {
        counter-increment: step-counter;
        content: counter(step-counter);
        position: absolute;
        left: 0;
        top: 2px;
        width: 26px;
        height: 26px;
        background-color: var(--primary-color);
        color: white;
        font-weight: bold;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
        font-family: Inter, sans-serif;
    }

    /* Images & Figures */
    figure {
        margin: 24px 0;
        text-align: center;
    }

    figure img {
        max-width: 100%;
        height: auto;
        border-radius: 4px;
    }

    figcaption {
        margin-top: 8px;
        font-size: 0.875rem;
        color: var(--text-muted);
        font-style: italic;
    }

    /* Article Tags */
    .article-tags {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        margin-top: 36px;
        padding-top: 20px;
        border-top: 1px solid var(--border-color);
    }

    .tag-item {
        background-color: #eee7dc;
        color: #333333;
        padding: 4px 12px;
        border-radius: 16px;
        font-size: 0.85rem;
        text-decoration: none;
        transition: all 0.2s;
    }

    .tag-item:hover {
        background-color: var(--primary-color);
        color: #ffffff;
    }

    /* ===== TỐI ƯU GIAO DIỆN DI ĐỘNG (MOBILE RESPONSIVE) ===== */
    @media (max-width: 640px) {

        .article-container {
            padding: 0 16px;
            margin: 12px auto;
        }

        h1.article-title {
            font-size: 1.5rem;
            line-height: 1.7;
            margin-bottom: 12px;
        }

        .article-subtitle {
            font-size: 1.05rem;
            line-height: 1.7;
            margin-bottom: 20px;
            padding-bottom: 16px;
        }

        .article-content {
            font-size: 1.05rem;
            line-height: 1.7;
        }

        .article-content h2,
        h2 {
            font-size: 1.1rem;
            margin-top: 24px;
            margin-bottom: 10px;
        }

        .article-meta {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;
        }
    }
}