/* ══ Thân bài — dùng cho cả trang khách và trình soạn Gutenberg (add_editor_style) ══
   Chỉ đặt kiểu chữ trong .tn-noi-dung / .editor-styles-wrapper: không đụng lớp của plugin, không reset toàn cục. */
.tn-noi-dung, .editor-styles-wrapper { font-size: 17px; line-height: 1.75; color: var(--tn-chu, #1f2937); overflow-wrap: anywhere; }
.tn-noi-dung > * { margin-block: 0 1.15em; }
/* Khối đầu (thường là H2 nhắc lại tiêu đề) không đẩy thêm khoảng trắng dưới ảnh/meta. */
.tn-noi-dung > :first-child, .tn-noi-dung > #ez-toc-container + * { margin-top: 0; }
.tn-noi-dung h2, .editor-styles-wrapper h2 { font-size: 1.5em; line-height: 1.3; margin: 1.9em 0 .55em; font-weight: 800; letter-spacing: -.02em; }
.tn-noi-dung h3, .editor-styles-wrapper h3 { font-size: 1.22em; line-height: 1.38; margin: 1.6em 0 .45em; font-weight: 700; letter-spacing: -.01em; }
.tn-noi-dung h4, .editor-styles-wrapper h4 { font-size: 1.06em; line-height: 1.4; margin: 1.4em 0 .4em; font-weight: 700; }
/* Tiêu đề ngay sau ảnh/bảng/nhúng không dính sát. */
.tn-noi-dung :is(figure, .wp-block-table, .wp-block-embed, table, iframe) + :is(h2, h3, h4) { margin-top: 1.6em; }
.tn-noi-dung a, .editor-styles-wrapper a { color: var(--tn-thuong-hieu, #2563eb); text-decoration: underline; text-underline-offset: 2px; }
.tn-noi-dung a:hover { color: var(--tn-thuong-hieu-dam, #1d4ed8); }
.tn-noi-dung ul, .tn-noi-dung ol { padding-left: 1.4em; }
.tn-noi-dung li::marker { color: var(--tn-thuong-hieu, #2563eb); }
.tn-noi-dung li + li { margin-top: .3em; }
.tn-noi-dung img { max-width: 100%; height: auto; border-radius: 8px; }
/* Ảnh không căn trái/phải: ở giữa cột, không giãn quá cỡ gốc (ảnh nhập cũ thường 300–600px). */
.tn-noi-dung .wp-block-image:not(.alignleft):not(.alignright) img, .tn-noi-dung p > img:only-child { display: block; margin-inline: auto; }
.tn-noi-dung figure { margin-block: 1.5em; }
.tn-noi-dung figure { margin-inline: 0; }
.tn-noi-dung figcaption, .tn-noi-dung .wp-element-caption { font-size: 14px; color: var(--tn-chu-nhat, #55637a); text-align: center; margin-top: .5em; }
.tn-noi-dung blockquote { margin-inline: 0; padding: .6em 1.1em; border-left: 4px solid var(--tn-thuong-hieu, #2563eb); background: var(--tn-thuong-hieu-nhat, #eff6ff); border-radius: 0 8px 8px 0; }
.tn-noi-dung pre, .tn-noi-dung code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }
.tn-noi-dung pre { padding: 1em; overflow-x: auto; background: #0f172a; color: #e2e8f0; border-radius: 8px; }
.tn-noi-dung :not(pre) > code { background: var(--tn-mat-lom, #f1f5f9); padding: .1em .35em; border-radius: 4px; }
/* Bảng: cuộn ngang trong khối của nó, không làm trang tràn ngang trên điện thoại. */
.tn-noi-dung .wp-block-table, .tn-noi-dung .tn-cuon-bang { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tn-noi-dung table { border-collapse: collapse; width: 100%; font-size: 15px; }
.tn-noi-dung th, .tn-noi-dung td { border: 1px solid var(--tn-vien, #e2e8f0); padding: .55em .75em; text-align: left; vertical-align: top; }
.tn-noi-dung thead th, .tn-noi-dung tr:first-child th { background: var(--tn-mat-lom, #f1f5f9); font-weight: 700; }
/* Nhúng video: tỉ lệ đúng, không tràn. */
.tn-noi-dung .wp-block-embed__wrapper iframe, .tn-noi-dung iframe { max-width: 100%; }
.tn-noi-dung .wp-has-aspect-ratio .wp-block-embed__wrapper iframe { width: 100%; height: 100%; }
.tn-noi-dung .alignwide { width: min(1120px, 100vw - 32px); margin-inline: calc(50% - min(560px, 50vw - 16px)); max-width: none; }
.tn-noi-dung .alignfull { width: 100vw; margin-inline: calc(50% - 50vw); max-width: none; }
.tn-noi-dung .aligncenter { margin-inline: auto; text-align: center; }
.tn-noi-dung .alignleft { float: left; margin: .3em 1.2em 1em 0; max-width: 50%; }
.tn-noi-dung .alignright { float: right; margin: .3em 0 1em 1.2em; max-width: 50%; }
.tn-noi-dung::after { content: ""; display: table; clear: both; }
.tn-noi-dung .wp-block-button__link { border-radius: 8px; text-decoration: none; }
.tn-noi-dung hr { border: 0; border-top: 1px solid var(--tn-vien, #e2e8f0); margin: 2em 0; }
@media (max-width: 599px) { .tn-noi-dung { font-size: 16px; } .tn-noi-dung .alignleft, .tn-noi-dung .alignright { float: none; margin: 0 0 1em; max-width: 100%; } }
