/* ==========================================================
   Khối soạn trong trình khối (Gutenberg): dùng trên web và trong trình soạn thảo.
   Bố cục trang: .entry (page.php, templates/trang-tu-dung.php).
   ========================================================== */

/* ---------- Khung nội dung trang: cột 860px, "rộng" 1200px, "toàn khổ" hết màn hình ---------- */
.entry { font-size: 1.08rem; }
.entry > * { width: min(860px, calc(100% - 40px)); margin: 0 auto 1.25rem; }
.entry > .alignwide { width: min(1200px, calc(100% - 40px)); max-width: none; }
.entry > .alignfull { width: 100%; max-width: none; margin-top: 3.5rem; margin-bottom: 3.5rem; }
.entry > .ttn-khoi { margin-top: 0; margin-bottom: 0; }
.entry > :first-child { margin-top: 0; }
.entry > :last-child { margin-bottom: 0; }
.entry > .alignleft { float: left; width: auto; max-width: 50%; margin: .3em 24px 16px max(20px, calc(50% - 430px)); }
.entry > .alignright { float: right; width: auto; max-width: 50%; margin: .3em max(20px, calc(50% - 430px)) 16px 24px; }
.entry::after { content: ""; display: table; clear: both; }
/* Bỏ giới hạn 60 ký tự của đoạn văn; trong khối "bố cục giới hạn" (constrained) WordPress vẫn tự giới hạn khổ */
.entry > p, :where([class*="wp-block-"]) > p { max-width: none; }

/* Tiêu đề trong bài: chữ thường, gọn. Kiểu "Tiêu đề lớn TTN" và tiêu đề trong nhóm, ảnh bìa: chữ Oswald in hoa */
.entry > h2:not(.is-style-ttn-display) { font-family: var(--font); text-transform: none; font-weight: 700; font-size: 1.5rem; line-height: 1.3; margin-top: 2.4rem; }
.entry > h3 { margin-top: 1.8rem; }
.entry > h2.is-style-ttn-display { margin-top: 3rem; }
.is-style-ttn-display { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .005em; line-height: 1.14; }
h2.is-style-ttn-display { font-size: clamp(2rem, 3.6vw, 3rem); }
h3.is-style-ttn-display { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.wp-block-cover :is(h1, h2, h3, h4), .has-text-color :is(h1, h2, h3, h4) { color: inherit; }

/* Danh sách, liên kết */
.entry > ul, .entry > ol, .wp-block-list { padding-left: 1.3em; }
.wp-block-list li { margin-bottom: .5em; }
.entry > p a, .entry > ul a, .entry > ol a, .wp-block-list a, [class*="wp-block-"] > p a, .wp-block-table a, .wp-block-details a { color: var(--red); font-weight: 600; }
.has-text-color > p a { color: inherit; text-decoration: underline; }

/* ---------- Nút ---------- */
.wp-block-buttons { gap: 12px; }
.wp-block-button .wp-block-button__link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px;
  border-radius: 999px; border: 2px solid transparent; background-color: var(--red); color: #fff;
  font-family: var(--display); font-weight: 500; font-size: 1.02rem; letter-spacing: .04em; line-height: 1.2;
  text-transform: uppercase; text-decoration: none; transition: background-color .18s, color .18s, border-color .18s;
}
.wp-block-button .wp-block-button__link:hover { background-color: var(--red-deep); color: #fff; }
.wp-block-button.is-style-outline .wp-block-button__link { background-color: transparent; border-color: currentColor; color: var(--navy); }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background-color: var(--navy); border-color: var(--navy); color: #fff; }
.has-text-color .wp-block-button.is-style-outline .wp-block-button__link, .wp-block-cover .wp-block-button.is-style-outline .wp-block-button__link { color: #fff; }
.has-text-color .wp-block-button.is-style-outline .wp-block-button__link:hover, .wp-block-cover .wp-block-button.is-style-outline .wp-block-button__link:hover { background-color: #fff; border-color: #fff; color: var(--navy); }

/* ---------- Nhóm, thẻ, dải ---------- */
.is-style-ttn-card { height: 100%; padding: 32px 28px; border-radius: var(--r-lg); background: var(--paper); }
.is-style-ttn-card > :last-child { margin-bottom: 0; }
.wp-block-group.has-background:not(.is-style-ttn-card) { padding: 32px 28px; }
.wp-block-group.alignfull.has-background, .ttn-band { padding: 88px 20px; }
.wp-block-group.has-background > :last-child { margin-bottom: 0; }
.ttn-band p { color: rgba(255, 255, 255, .82); }
.wp-block-cover { border-radius: var(--r-lg); }
.wp-block-cover.alignfull { border-radius: 0; }

/* ---------- Ảnh, bảng, trích dẫn, đường kẻ, hỏi – đáp ---------- */
.wp-block-image img, .wp-block-media-text__media img { border-radius: var(--r); }
.wp-block-image.alignfull img { border-radius: 0; }
.wp-block-table table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.wp-block-table th, .wp-block-table td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.wp-block-table th, .wp-block-table thead { background: var(--paper); }
.wp-block-quote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--red); color: var(--navy); }
.wp-block-quote cite { display: block; margin-top: 8px; font-size: .92rem; font-style: normal; color: var(--slate); }
.wp-block-pullquote { border-top: 3px solid var(--red); border-bottom: 3px solid var(--red); color: var(--navy); }
.wp-block-separator { border: 0; border-top: 1px solid var(--line-strong); }
.wp-block-separator.is-style-wide { width: 100%; }
.wp-block-details { border-bottom: 1px solid var(--line-strong); padding: 6px 0; }
.wp-block-details summary { padding: 14px 0; cursor: pointer; font-weight: 700; font-size: 1.08rem; color: var(--navy); }
.wp-block-details > :not(summary) { margin: 0 0 14px; }
.ttn-faq { border-top: 1px solid var(--line-strong); }
.wp-block-embed iframe { width: 100%; border-radius: var(--r); }

/* ---------- Khối có sẵn TTN trong trang ---------- */
.ttn-khoi .section-flush { background: none; }
.ttn-khoi .khoi-pad, .khoi-pad { padding-block: 56px; }

/* ---------- Trang thường (page.php) ---------- */
.page-body:has(> .entry > .alignfull:first-child) { padding-top: 0; }
.page-body:has(> .entry > .alignfull:last-child) { padding-bottom: 0; }

/* ---------- Trang tự dựng ---------- */
.page-blocks { padding: calc(var(--hdr-top) + var(--header-h) + 56px) 0 96px; }
.page-blocks-title { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 1.5rem; }
.page-blocks:has(> .entry > .wp-block-cover.alignfull:first-child),
.page-blocks:has(> .entry > .sr-only:first-child + .wp-block-cover.alignfull) { padding-top: 0; }
.page-blocks .entry > .wp-block-cover.alignfull:first-child,
.page-blocks .entry > .sr-only:first-child + .wp-block-cover.alignfull { margin-top: 0; min-height: 520px; padding-top: calc(var(--hdr-top) + var(--header-h) + 48px); }
.page-blocks:has(> .entry > .alignfull:last-child) { padding-bottom: 0; }
.page-blocks .entry > .alignfull:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
  .entry > .alignleft, .entry > .alignright { float: none; max-width: none; width: calc(100% - 40px); margin: 0 auto 1.25rem; }
  .wp-block-group.alignfull.has-background, .ttn-band { padding: 64px 20px; }
  .page-blocks { padding-top: calc(var(--hdr-top) + var(--header-h) + 36px); }
}
