/* ==========================================================================
   MMTECH – CSS bổ sung cho WordPress (nạp sau design.css)
   Những phần không có trong bản thiết kế Figma: menu con, nội dung bài viết
   do người soạn nhập, phân trang của WordPress, tương thích Elementor.
   ========================================================================== */

[hidden] { display: none !important; }

.mmtech-skip:focus { position: fixed; z-index: 1000; top: 8px; left: 8px; width: auto; height: auto; clip: auto; margin: 0; padding: 10px 14px; border-radius: 8px; background: #17213a; color: #fff; font-size: 14px; }

/* ---------- Header ---------- */
.mm-brand > img { width: 82px; height: 42px; object-fit: contain; object-position: left center; }
.nav-links a { white-space: nowrap; }
.nav-links .mobile-contact { display: none; } /* chỉ hiện trong menu điện thoại */
.nav-links a.is-current { color: #1266df; }
@media (min-width: 981px) and (max-width: 1180px) {
	.nav-links { gap: 18px; margin-left: 24px; }
	.mm-brand .brand-partner { display: none; }
}
.menu-button .menu-icon-close { display: none; }
.menu-button.is-open .menu-icon-open { display: none; }
.menu-button.is-open .menu-icon-close { display: inline; }

/* Menu con */
.nav-item { position: relative; }
.nav-item > a { padding-block: 10px; }
.nav-sub { position: absolute; top: 100%; left: -18px; z-index: 60; min-width: 250px; display: none; flex-direction: column; gap: 2px; padding: 10px; border: 1px solid #e5e9f0; border-radius: 12px; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.12); }
.nav-sub a { padding: 10px 12px; border-radius: 8px; }
.nav-sub a:hover { background: #eef5ff; }
.nav-sub a svg { display: none; }
@media (min-width: 981px) {
	.nav-item:hover > .nav-sub, .nav-item:focus-within > .nav-sub { display: flex; }
}
@media (max-width: 980px) {
	.nav-links { max-height: calc(100vh - 120px); overflow-y: auto; }
	.nav-item > a { padding-block: 0; }
	.nav-item > a svg { transform: none; }
	.nav-sub { position: static; display: flex; min-width: 0; margin-top: 10px; padding: 0 0 0 14px; border: 0; border-left: 2px solid #e5e9f0; border-radius: 0; box-shadow: none; }
	.nav-sub a { padding: 8px 10px; }
}

/* ---------- Footer ---------- */
/* Bản thiết kế có 2 quy tắc đè nhau làm cột đầu to hơn: thống nhất mọi cột. */
.site-footer .footer-grid .footer-column > a { margin: 5px 0; color: #b4c0d1; font-size: 14px; line-height: 1.5; }
.site-footer .footer-grid .footer-column > a:hover { color: #fff; }

/* Ô Thông tin pháp lý: gọn chiều cao, tên công ty 1 dòng, điện thoại + email chung hàng khi đủ chỗ */
.site-footer .legal-card { gap: 8px; padding: 16px 18px; }
.site-footer .legal-card > strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-footer .legal-card p { gap: 8px; }
.site-footer .legal-contacts { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 2px; margin-top: 2px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.1); }
.site-footer .legal-card .legal-contacts a { margin: 0; gap: 7px; font-size: 13px; line-height: 1.45; white-space: nowrap; }
@media (max-width: 1100px) and (min-width: 769px) {
	.site-footer .legal-card { padding-inline: 14px; }
	.site-footer .legal-card > strong { font-size: 12px; }
}

/* ---------- Khối trang chủ ---------- */
[data-mm-tabs] [data-panel] > .plans-grid { margin-top: 22px; }
.mmtech-empty { margin-top: 24px; padding: 18px 22px; border: 1px dashed rgba(127,150,190,.6); border-radius: 12px; text-align: center; font-size: 14px; opacity: .85; }

/* ---------- Ảnh bài viết ---------- */
.article-art > img.mmtech-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Ảnh đại diện của site thường có chữ trên ảnh: khung gần vuông thì hiện trọn ảnh, không cắt. */
.featured-post .article-art:has(> img.mmtech-thumb) { background: #eef3fa; }
.featured-post .article-art > img.mmtech-thumb { object-fit: contain; }
.post-card > a { display: block; }
.post-card h3 a:hover { color: #1266df; }

/* ---------- Nội dung bài viết / trang (người soạn nhập) ---------- */
:is(.post-body, .page-body) > :is(h3, h4) { margin: 30px 0 11px; color: #17213a; font-size: 21px; line-height: 1.4; font-weight: 600; letter-spacing: -.3px; }
:is(.post-body, .page-body) > h4 { font-size: 18px; }
:is(.post-body, .page-body) > :is(ul, ol) { margin: 15px 0; padding-left: 1.4em; color: #4f5d73; font-size: 15px; line-height: 1.85; }
:is(.post-body, .page-body) > ul { list-style: disc; }
:is(.post-body, .page-body) > ol { list-style: decimal; }
:is(.post-body, .page-body) li + li { margin-top: 4px; }
:is(.post-body, .page-body) li > :is(ul, ol) { margin-top: 4px; padding-left: 1.3em; list-style: circle; }
:is(.post-body, .page-body) :is(p, li, td) a { color: #1266df; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:is(.post-body, .page-body) strong { color: #26334b; font-weight: 600; }
:is(.post-body, .page-body) img { max-width: 100%; height: auto; border-radius: 12px; }
:is(.post-body, .page-body) :is(figure, .wp-block-image, .wp-caption) { margin: 26px 0; }
:is(.post-body, .page-body) :is(figcaption, .wp-caption-text) { margin-top: 8px; color: #7c899d; font-size: 13px; text-align: center; }
:is(.post-body, .page-body) .aligncenter { margin-inline: auto; }
:is(.post-body, .page-body) .alignleft { float: left; margin: 6px 22px 14px 0; }
:is(.post-body, .page-body) .alignright { float: right; margin: 6px 0 14px 22px; }
:is(.post-body, .page-body) :is(table) { width: 100%; margin: 24px 0; border-collapse: collapse; font-size: 14px; }
:is(.post-body, .page-body) :is(th, td) { padding: 11px 13px; border: 1px solid #dce3ed; text-align: left; vertical-align: top; color: #4f5d73; }
:is(.post-body, .page-body) th { background: #f2f6fb; color: #17213a; font-weight: 600; }
:is(.post-body, .page-body) .wp-block-table { overflow-x: auto; }
/* Ảnh có chú thích kiểu cũ ([caption] đặt cứng width: 1200px) – co theo khung bài */
:is(.post-body, .page-body) .wp-caption { max-width: 100%; }
:is(.post-body, .page-body) .wp-caption img { max-width: 100%; height: auto; }

/* Bảng so sánh dài trong bài viết (được main.js dựng nhóm thu gọn): phân làn cột, hàng tiêu đề, hàng nhóm */
:is(.post-body, .page-body) .mm-table-scroll { max-width: 100%; overflow-x: auto; margin: 24px 0; }
:is(.post-body, .page-body) .mm-table-scroll > table { margin: 0; }
:is(.post-body, .page-body) .mm-compare-tools { margin-top: 24px; }
:is(.post-body, .page-body) .mm-compare-tools + .mm-table-scroll { margin-top: 10px; }
table.mm-post-compare tr.mm-post-head > * { color: #fff; background: #0f6cbd; font-weight: 600; border-color: rgba(255,255,255,.25); }
table.mm-post-compare tr:not(.mm-group):not(.mm-post-head) > :nth-child(even) { background-color: rgba(18,102,223,.035); }
table.mm-post-compare tr:not(.mm-group):not(.mm-post-head) > :first-child { color: #26334b; font-weight: 500; }
table.mm-post-compare tr:not(.mm-group):not(.mm-post-head):hover > * { background-color: rgba(18,102,223,.07); }
table.mm-post-compare tr.mm-group > td, table.mm-post-compare tr.mm-group > th { padding: 0; color: #1266df; background: #eef5ff; font-size: 13px; font-weight: 700; }
table.mm-post-compare .mm-group-toggle { padding: 12px 13px; }
:is(.post-body, .page-body) :is(iframe, video) { max-width: 100%; border-radius: 12px; }
:is(.post-body, .page-body) .wp-block-button__link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 9px; background: #1266df; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
:is(.post-body, .page-body) hr { margin: 32px 0; border: 0; border-top: 1px solid #e2e7ee; }
:is(.post-body, .page-body)::after { content: ''; display: table; clear: both; }
.page-body blockquote { margin: 30px 0; padding: 26px 28px; border-left: 3px solid #1266df; border-radius: 0 13px 13px 0; background: #eef5ff; color: #2d4566; }
/* Mục lục tự động của plugin Table of Contents Plus */
:is(.post-body, .page-body) #toc_container { margin: 30px 0; padding: 23px; border: 0; border-radius: 14px; background: #f2f6fb; }
:is(.post-body, .page-body) #toc_container .toc_title { color: #1c2a42; font-size: 16px; font-weight: 600; text-align: left; }
:is(.post-body, .page-body) #toc_container ul { list-style: none; padding: 0; margin-top: 10px; }
:is(.post-body, .page-body) #toc_container a { color: #52627a; font-size: 14px; text-decoration: none; }
/* Mục lục do theme dựng (inc/toc.php): danh sách lồng, khoảng cách, cuộn tới tiêu đề không bị header che */
:is(.post-body, .page-body) #toc_container li { margin: 0; padding: 3px 0; line-height: 1.5; }
:is(.post-body, .page-body) #toc_container li::marker { content: none; }
:is(.post-body, .page-body) #toc_container ul ul { margin-top: 2px; padding-left: 16px; }
:is(.post-body, .page-body) #toc_container a:hover { color: #1266df; text-decoration: underline; }
:is(.post-body, .page-body) :is(h1, h2, h3, h4, h5) > span[id] { scroll-margin-top: 110px; }
html { scroll-behavior: smooth; }

/* ---------- Phân trang WordPress ---------- */
.pagination .page-numbers { min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border: 1px solid #d7dfea; border-radius: 8px; color: #5c6a80; background: #fff; font-size: 13px; font-weight: 600; }
.pagination .page-numbers.current { border-color: #1266df; color: #fff; background: #1266df; }
.pagination .page-numbers.dots { border: 0; background: none; }
.pagination .page-numbers:hover:not(.current, .dots) { border-color: #1266df; color: #1266df; }

/* ---------- Trang dựng bằng Elementor (giữ tạm) ---------- */
/* CSS nền của thiết kế xóa kiểu mặc định của danh sách/tiêu đề; trả lại cho nội dung Elementor. */
.elementor .elementor-widget-text-editor :is(ul, ol) { padding-left: 1.4em; margin: .6em 0; }
.elementor .elementor-widget-text-editor ul { list-style: disc; }
.elementor .elementor-widget-text-editor ol { list-style: decimal; }
.elementor .elementor-widget-text-editor p { margin-bottom: .9em; }
.elementor img { display: inline-block; }
/* Khung nội dung Elementor = khung 1180px của thiết kế (trước đây theme Neve làm việc này). */
/* .app-shell tăng độ ưu tiên vì CSS kit của Elementor (rộng 1600px) được nạp sau. */
.app-shell .elementor-section.elementor-section-boxed > .elementor-container,
.app-shell .e-con.e-con-boxed > .e-con-inner { max-width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
@media (max-width: 760px) {
	.app-shell .elementor-section.elementor-section-boxed > .elementor-container,
	.app-shell .e-con.e-con-boxed > .e-con-inner { max-width: calc(100% - 28px); }
}
