/*
 * Chuẩn hoá thân bài viết (Tin tức, Góc HCM) + vùng soạn thảo TinyMCE.
 * Bài cũ được soạn bằng nhiều nguồn (template HTML/AI, dán Word...) với style inline riêng:
 * file này ghi đè các phần làm lệch bố cục — lề, font, cỡ chữ, bóng chữ, ảnh — để mọi bài đồng nhất.
 * Dùng chung cho trang public và editor admin (content_css), sửa 1 chỗ áp dụng cả 2.
 * Bài "thiết kế riêng" (nội dung bọc trong .lqd-custom) được giữ nguyên style — không áp các quy tắc dưới.
 */
.post-content {
  --pc-text: #334155;
  --pc-heading: #002147;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--pc-text);
  overflow-wrap: break-word;
}

/* 1. Một font chữ, không bóng chữ / giãn chữ tự đặt */
.post-content:not(:has(.lqd-custom)) * {
  font-family: inherit !important;
  text-shadow: none !important;
  letter-spacing: normal !important;
}

/* 2. Khung bọc tự đặt (max-width 850–1000px, padding 0 20px) → thẳng lề với tiêu đề bài */
.post-content:not(:has(.lqd-custom)) [style*="max-width"]:not(img) {
  max-width: 100% !important;
}
.post-content:not(:has(.lqd-custom)) > div[style*="max-width"],
.post-content:not(:has(.lqd-custom)) > div[style*="max-width"] > div[style*="max-width"] {
  margin: 0 0 1.25rem !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
/* Banner trang trí cao quá mức (padding 80–100px) → gọn lại */
.post-content:not(:has(.lqd-custom)) [style*="padding:100px"], .post-content:not(:has(.lqd-custom)) [style*="padding: 100px"],
.post-content:not(:has(.lqd-custom)) [style*="padding:80px"], .post-content:not(:has(.lqd-custom)) [style*="padding: 80px"] {
  padding: 2rem 1rem !important;
}

/* 3. Cỡ chữ thân bài: gom 15–20px / 11–14pt về một cỡ (= prose-lg); chữ nhỏ (chú thích) về một cỡ */
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:15px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 15px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:16px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 16px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:17px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 17px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:18px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 18px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:19px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 19px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:20px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 20px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:11pt"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 11pt"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:12pt"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 12pt"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:13pt"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 13pt"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:14pt"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 14pt"] {
  font-size: 1.125rem !important;
  line-height: 1.8 !important;
}
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:11px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 11px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:12px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 12px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:13px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 13px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:14px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 14px"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:9pt"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 9pt"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size:10pt"],
.post-content:not(:has(.lqd-custom)) :is(p, li, span, div, td, strong, em, b)[style*="font-size: 10pt"] {
  font-size: 0.875rem !important;
  line-height: 1.6 !important;
}

/* 4. Tiêu đề trong bài: một thang cỡ (h1 trong bài hiển thị như h2 vì trang đã có tiêu đề) */
.post-content:not(:has(.lqd-custom)) :is(h1, h2) {
  font-size: 1.5rem !important;
  line-height: 1.35 !important;
  margin: 1.75rem 0 0.75rem !important;
}
.post-content:not(:has(.lqd-custom)) h3 {
  font-size: 1.25rem !important;
  line-height: 1.4 !important;
  margin: 1.5rem 0 0.5rem !important;
}
.post-content:not(:has(.lqd-custom)) :is(h4, h5, h6) {
  font-size: 1.125rem !important;
  margin: 1.25rem 0 0.5rem !important;
}
/* Màu tiêu đề theo web — trừ tiêu đề nằm trong khối có nền riêng (chữ trắng trên nền tối) */
.post-content:not(:has(.lqd-custom)) :is(h1, h2, h3, h4):not([style*="background"] *) {
  color: var(--pc-heading) !important;
}

/* 5. Ảnh: không tràn khung, giữ tỉ lệ, bo góc thống nhất */
.post-content:not(:has(.lqd-custom)) img {
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;
  border-radius: 0.75rem !important;
}

/* 6. Đoạn rỗng chỉ để tạo khoảng trắng */
.post-content:not(:has(.lqd-custom)) p:empty {
  display: none;
}

/* 7. Điện thoại: căn trái thay vì căn đều (tránh khoảng trắng lớn giữa các chữ) */
@media (max-width: 767px) {
  .post-content:not(:has(.lqd-custom)),
  .post-content:not(:has(.lqd-custom)) [style*="justify"] {
    text-align: left !important;
  }
}
