/*
Theme Name: Đặng Ka-Đil
Theme URI: https://example.com
Author: Đặng Ka-Đil
Description: Theme riêng cho website Đặng Ka-Đil, bố cục lấy cảm hứng từ trang kênh YouTube. Gồm trang chủ dạng trang kênh, Blog có mục lục tự tạo, Thư viện mở khóa bằng email, đăng ký workshop và dải "Kênh đã đồng hành" tự cập nhật từ YouTube.
Version: 1.3.0
Requires at least: 6.3
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: dangkadil
*/

/* ---------- Màu và nền tảng ---------- */
:root {
  --navy: #18324A;
  --navy-2: #213F5B;
  --clay: #C87545;
  --clay-deep: #A65A30;
  --clay-text: #96512A;
  --clay-light: #E9B48F;
  --clay-glow: #F0D9C9;
  --ivory: #F5F1E8;
  --ivory-2: #ECE5D6;
  --ivory-3: #E3DCCB;
  --paper: #FFFDF8;
  --line: #DDD5C4;
  --line-2: #CFC6B3;
  --ink: #343A40;
  --ink-2: #4A5056;
  --on-navy-2: #D9D3C6;
  --radius: 14px;
  --wrap: 1280px;
  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); }
a:hover { color: var(--clay-text); }
h1, h2, h3, h4 { color: var(--navy); font-weight: 800; line-height: 1.3; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }
.sr-only, .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dk-skip { position: absolute; left: 12px; top: -60px; background: var(--navy); color: var(--ivory); padding: 10px 16px; border-radius: 8px; z-index: 100; }
.dk-skip:focus { top: 12px; }

.dk-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.dk-main { padding-top: 16px; padding-bottom: 56px; }
.dk-label { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--clay-text); }
.dk-muted { font-size: 13px; color: var(--ink-2); }

/* ---------- Nút ---------- */
.dk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 999px; border: 2px solid transparent; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: filter .15s; }
.dk-btn:hover { filter: brightness(1.08); }
.dk-btn--primary { background: var(--clay-deep); color: #fff; }
.dk-btn--primary:hover { color: #fff; }
.dk-btn--navy { background: var(--navy); color: var(--ivory); }
.dk-btn--navy:hover { color: var(--ivory); }
.dk-btn--light { background: var(--ivory); color: var(--navy); }
.dk-btn--light:hover { color: var(--navy); }
.dk-btn--outline { background: transparent; border-color: var(--navy); color: var(--navy); }
.dk-btn--ghost { background: var(--ivory-3); color: var(--navy); min-height: 40px; padding: 0 16px; font-size: 13px; }
.dk-btn--block { width: 100%; }
.dk-btn svg { flex: none; }

/* ---------- Đầu trang ---------- */
.dk-header { border-bottom: 1px solid var(--ivory-3); background: var(--ivory); }
.dk-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px 24px; max-width: 1440px; margin: 0 auto; }
.dk-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.dk-brand__mark { width: 40px; height: 40px; border-radius: 10px; background: var(--navy); color: var(--ivory); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; overflow: hidden; flex: none; }
.dk-brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.dk-brand__name { font-weight: 800; font-size: 18px; color: var(--navy); }
.dk-search { flex: 1 1 280px; max-width: 560px; display: flex; margin: 0 auto; }
.dk-search input { flex: 1; min-width: 0; height: 44px; padding: 0 18px; border: 1px solid var(--line-2); border-right: 0; border-radius: 22px 0 0 22px; background: var(--paper); font-size: 14px; }
.dk-search button { width: 64px; height: 44px; border: 1px solid var(--line-2); border-radius: 0 22px 22px 0; background: var(--ivory-2); color: var(--navy); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dk-header__actions { display: flex; align-items: center; gap: 8px; }
.dk-header__link { font-weight: 700; font-size: 14px; text-decoration: none; padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; }
.dk-header .dk-btn { font-size: 14px; }
@media (max-width: 720px) {
  .dk-search { order: 3; flex-basis: 100%; max-width: none; }
  .dk-header__actions .dk-btn { padding: 0 16px; }
}

/* ---------- Ảnh bìa và thông tin kênh ---------- */
.dk-cover { position: relative; border-radius: 16px; overflow: hidden; background: var(--navy); min-height: 220px; padding: 40px 48px; display: flex; align-items: center; background-size: cover; background-position: center; }
.dk-cover::before, .dk-cover::after { content: ""; position: absolute; border-radius: 50%; border: 2px solid var(--clay); pointer-events: none; }
.dk-cover::before { right: -80px; top: -120px; width: 420px; height: 420px; opacity: .55; }
.dk-cover::after { right: 20px; top: -20px; width: 220px; height: 220px; opacity: .35; }
.dk-cover.has-image::before, .dk-cover.has-image::after { display: none; }
.dk-cover__inner { position: relative; display: flex; flex-direction: column; gap: 12px; }
.dk-cover__kicker { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--clay-light); }
.dk-cover__title { max-width: 780px; font-size: clamp(24px, 3.2vw, 40px); line-height: 1.25; font-weight: 800; color: var(--ivory); }
.dk-cover__title em { font-style: normal; color: var(--clay); }
.dk-cover--compact { min-height: 110px; padding: 24px 40px; }
.dk-cover--compact .dk-cover__title { font-size: clamp(17px, 2vw, 22px); line-height: 1.35; }
.dk-cover--compact::after { display: none; }
@media (max-width: 600px) { .dk-cover { padding: 28px 24px; min-height: 180px; } .dk-cover--compact { padding: 20px 22px; min-height: 90px; } }

.dk-channel { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; padding: 28px 0 20px; }
.dk-avatar { width: 160px; height: 160px; border-radius: 50%; background: var(--ivory-3); box-shadow: 0 0 0 4px var(--ivory), 0 0 0 6px var(--clay); flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 40px; color: var(--navy); }
.dk-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dk-channel__info { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dk-channel__name { font-size: 34px; }
.dk-channel__meta { font-size: 14px; font-weight: 500; }
.dk-channel__desc { font-size: 15px; line-height: 1.6; max-width: 680px; }
.dk-channel__links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; font-weight: 600; }
.dk-channel__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.dk-channel--compact { gap: 18px; padding: 20px 0 12px; }
.dk-channel--compact .dk-avatar { width: 80px; height: 80px; font-size: 22px; box-shadow: 0 0 0 3px var(--ivory), 0 0 0 5px var(--clay); }
.dk-channel--compact .dk-channel__name { font-size: 26px; }
.dk-channel--compact .dk-channel__info { flex-basis: 300px; gap: 4px; }
@media (max-width: 600px) { .dk-avatar { width: 112px; height: 112px; font-size: 30px; } .dk-channel__name { font-size: 28px; } }

/* ---------- Thanh tab ---------- */
.dk-tabs { border-bottom: 1px solid var(--line); margin-bottom: 32px; }
/* Tab vượt quá chiều ngang thì tự xuống dòng, không bị cắt và không phải kéo ngang. */
.dk-tabs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 4px; }
.dk-tabs a { display: block; padding: 14px 18px; font-size: 15px; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.dk-tabs a:hover { color: var(--navy); }
.dk-tabs .current-menu-item > a, .dk-tabs .current_page_item > a, .dk-tabs .current-menu-ancestor > a, .dk-tabs .current_page_parent > a, .dk-tabs .is-current > a { color: var(--navy); font-weight: 700; border-bottom-color: var(--clay); }
/* Điện thoại: các tab chia đều chiều ngang để hiện đủ, chữ tự thu nhỏ theo màn hình. */
@media (max-width: 640px) {
  .dk-tabs ul { gap: 0; }
  .dk-tabs li { flex: 1 1 auto; }
  .dk-tabs a { padding: 12px 4px; font-size: clamp(12px, 3.4vw, 15px); text-align: center; letter-spacing: -.01em; }
}
@media (max-width: 350px) {
  .dk-tabs a { padding: 12px 2px; font-size: 11px; }
}

/* ---------- Khung mục ---------- */
.dk-section { padding: 40px 0; border-bottom: 1px solid var(--line); }
.dk-section:last-child { border-bottom: 0; }
.dk-section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 20px; }
.dk-section__title { font-size: 22px; display: flex; align-items: center; gap: 10px; }
.dk-section__sub { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.dk-section__more { font-size: 14px; font-weight: 700; }
.dk-live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 4px var(--clay-glow); flex: none; }

/* ---------- Video nổi bật ---------- */
.dk-featured-video { display: flex; flex-wrap: wrap; gap: 32px; align-items: center; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.dk-featured-video__media { flex: 1 1 440px; max-width: 580px; }
.dk-featured-video__text { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.dk-featured-video__text h2 { font-size: 26px; }
.dk-featured-video__text p { font-size: 15px; line-height: 1.7; }

/* Video nhúng nhẹ: chỉ tải YouTube khi bấm */
.dk-yt { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--navy); }
.dk-yt img { width: 100%; height: 100%; object-fit: cover; }
.dk-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dk-yt__play { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--clay); color: var(--ivory); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.dk-yt__play:hover { filter: brightness(1.08); }
.dk-yt--empty { display: flex; align-items: center; justify-content: center; color: var(--ivory); font-size: 13px; font-weight: 600; text-align: center; padding: 16px; }

/* ---------- Dải kênh chạy vòng ---------- */
.dk-marquee { position: relative; overflow: hidden; padding: 6px 0; -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent); }
.dk-marquee__track { display: flex; gap: 28px; width: max-content; animation: dk-marquee var(--dk-speed, 40s) linear infinite; }
.dk-marquee:hover .dk-marquee__track, .dk-marquee:focus-within .dk-marquee__track { animation-play-state: paused; }
@keyframes dk-marquee { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 14px)); } }
@media (prefers-reduced-motion: reduce) { .dk-marquee__track { animation: none; } .dk-marquee { overflow-x: auto; } }
.dk-chan { width: 140px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; text-decoration: none; }
.dk-chan__img { width: 104px; height: 104px; border-radius: 50%; overflow: hidden; background: var(--ivory-3); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 28px; color: var(--navy); }
.dk-chan__img img { width: 100%; height: 100%; object-fit: cover; }
.dk-chan__name { font-size: 14px; font-weight: 700; color: var(--navy); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dk-chan__subs { font-size: 12px; color: var(--ink-2); margin-top: -6px; }
.dk-marquee__note { margin-top: 16px; font-size: 12px; color: var(--ink-2); text-align: center; }

/* ---------- Đang mở đăng ký ---------- */
.dk-events { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 20px; }
.dk-event { display: flex; flex-wrap: wrap; gap: 18px; background: var(--paper); border: 1px solid var(--ivory-3); border-radius: var(--radius); padding: 18px; }
.dk-event__date { width: 96px; flex: none; border-radius: 10px; background: var(--navy); color: var(--ivory); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 14px 0; gap: 2px; text-align: center; }
.dk-event__dow { font-size: 12px; font-weight: 600; color: var(--clay-light); }
.dk-event__day { font-size: 38px; font-weight: 800; line-height: 1; }
.dk-event__month { font-size: 12px; font-weight: 600; }
.dk-event__body { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.dk-event__title { font-size: 17px; line-height: 1.35; }
.dk-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--ivory-2); color: var(--navy); padding: 3px 8px; border-radius: 4px; }
.dk-tag--navy { background: var(--navy); color: var(--ivory); }
.dk-tag--light { background: var(--ivory); color: var(--navy); }
.dk-coaching { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; background: var(--navy); border-radius: var(--radius); padding: 22px; }
.dk-coaching::after { content: ""; position: absolute; right: -50px; top: -60px; width: 170px; height: 170px; border-radius: 50%; border: 2px solid var(--clay); opacity: .5; }
.dk-coaching > * { position: relative; z-index: 1; }
.dk-coaching h3 { font-size: 19px; color: var(--ivory); line-height: 1.35; }
.dk-coaching p { font-size: 13px; color: var(--on-navy-2); }

/* ---------- Thẻ bài viết ---------- */
.dk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 32px 20px; }
.dk-grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 36px 24px; }
.dk-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; }
.dk-card:hover .dk-card__title { color: var(--clay-text); }
.dk-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--navy); display: flex; flex-direction: column; justify-content: flex-end; padding: 18px; }
.dk-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dk-thumb__text { position: relative; font-size: 22px; font-weight: 800; line-height: 1.15; color: var(--ivory); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dk-thumb--t1 { background: var(--ivory-3); } .dk-thumb--t1 .dk-thumb__text { color: var(--navy); }
.dk-thumb--t2 { background: var(--navy); }
.dk-thumb--t3 { background: var(--clay); } .dk-thumb--t3 .dk-thumb__text { color: var(--navy); }
.dk-thumb--t4 { background: var(--ink); }
.dk-card__cat { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--clay-text); margin-top: 4px; }
.dk-card__title { font-size: 17px; font-weight: 800; line-height: 1.4; color: var(--navy); }
.dk-card__excerpt { font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dk-card--small .dk-card__title { font-size: 15px; }

.dk-lead-post { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; text-decoration: none; color: inherit; padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.dk-lead-post .dk-thumb { flex: 1 1 460px; max-width: 620px; padding: 28px; }
.dk-lead-post .dk-thumb__text { font-size: clamp(26px, 3.2vw, 40px); }
.dk-lead-post__body { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.dk-lead-post__title { font-size: 26px; line-height: 1.3; }
.dk-lead-post__excerpt { font-size: 15px; line-height: 1.7; }

/* ---------- Bộ lọc dạng chip ---------- */
.dk-chips { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 28px; scrollbar-width: none; }
.dk-chips::-webkit-scrollbar { display: none; }
.dk-chip { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 10px; border: 0; background: var(--ivory-3); color: var(--navy); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.dk-chip:hover { color: var(--navy); filter: brightness(.97); }
.dk-chip.is-active, .dk-chip[aria-pressed="true"] { background: var(--navy); color: var(--ivory); font-weight: 700; }

/* ---------- Khung đăng ký email ---------- */
.dk-newsletter { position: relative; overflow: hidden; margin-top: 16px; border-radius: 16px; background: var(--navy); padding: 40px; display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; justify-content: space-between; }
.dk-newsletter::after { content: ""; position: absolute; right: -70px; bottom: -110px; width: 260px; height: 260px; border-radius: 50%; border: 2px solid var(--clay); opacity: .45; pointer-events: none; }
.dk-newsletter__text { position: relative; flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.dk-newsletter__text h2 { font-size: 26px; color: var(--ivory); }
.dk-newsletter__text h2 em { font-style: normal; color: var(--clay-light); }
.dk-newsletter__text p { font-size: 15px; color: var(--on-navy-2); }
.dk-newsletter form { position: relative; flex: 1 1 380px; max-width: 520px; display: flex; flex-wrap: wrap; gap: 10px; }
.dk-newsletter input[type=email] { flex: 1 1 220px; min-width: 0; height: 48px; padding: 0 18px; border: 0; border-radius: 24px; background: var(--ivory); font-size: 15px; }
.dk-newsletter .dk-consent { flex-basis: 100%; color: var(--on-navy-2); }
.dk-newsletter .dk-consent a { color: var(--clay-light); }
.dk-newsletter .dk-form__msg { flex-basis: 100%; color: var(--ivory); }
@media (max-width: 600px) { .dk-newsletter { padding: 28px 22px; } }

/* ---------- Form chung ---------- */
.dk-form { display: flex; flex-direction: column; gap: 14px; }
.dk-field { display: flex; flex-direction: column; gap: 6px; }
.dk-field label { font-size: 13px; font-weight: 700; color: var(--navy); }
.dk-field input, .dk-field select, .dk-field textarea { min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--ivory); font-size: 15px; width: 100%; }
.dk-field textarea { resize: vertical; }
.dk-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; cursor: pointer; }
.dk-consent input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--navy); }
.dk-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.dk-form__msg { font-size: 14px; font-weight: 600; min-height: 1em; }
.dk-form__msg.is-error { color: #A8321F; }
.dk-newsletter .dk-form__msg.is-error { color: var(--clay-light); }

/* ---------- Thư viện ---------- */
.dk-lib-notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; background: var(--ivory-2); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 24px; }
.dk-lib-notice__text { display: flex; gap: 14px; align-items: center; flex: 1 1 360px; min-width: 0; font-size: 14px; line-height: 1.55; }
.dk-lib-notice__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: var(--ivory); display: flex; align-items: center; justify-content: center; flex: none; }
.dk-lib-notice.is-unlocked { background: var(--navy); color: var(--ivory); }
.dk-lib-notice.is-unlocked strong { color: var(--ivory); }
.dk-lib-notice.is-unlocked .dk-lib-notice__icon { background: var(--clay); }
.dk-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 32px 20px; }
.dk-lib-item { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.dk-lib-item[hidden] { display: none; }
.dk-lib-cover { position: relative; width: 100%; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--navy); padding: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.dk-lib-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dk-lib-cover > span { position: relative; }
.dk-lib-cover__title { font-size: 22px; font-weight: 800; line-height: 1.2; color: var(--ivory); }
.dk-lib-cover__brand { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--clay-light); }
.dk-lib-cover--t1 { background: var(--ivory-3); } .dk-lib-cover--t1 .dk-lib-cover__title { color: var(--navy); } .dk-lib-cover--t1 .dk-lib-cover__brand { color: var(--clay-text); }
.dk-lib-cover--t3 { background: var(--clay); } .dk-lib-cover--t3 .dk-lib-cover__title, .dk-lib-cover--t3 .dk-lib-cover__brand { color: var(--navy); }
.dk-lib-cover--t4 { background: var(--ink); }
.dk-lib-item h3 { font-size: 15px; line-height: 1.4; font-weight: 700; }
.dk-lib-item .dk-muted { margin-top: -4px; }
.dk-lib-item .dk-btn { font-size: 14px; padding: 0 18px; }
.dk-locked-only, .dk-unlocked-only { display: none !important; }
body:not(.dk-is-unlocked) .dk-locked-only { display: inline-flex !important; }
body.dk-is-unlocked .dk-unlocked-only { display: inline-flex !important; }
body:not(.dk-is-unlocked) .dk-lib-notice.dk-locked-only, body.dk-is-unlocked .dk-lib-notice.dk-unlocked-only { display: flex !important; }

/* ---------- Hộp thoại ---------- */
.dk-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(24, 50, 74, .72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dk-modal[hidden] { display: none; }
.dk-modal__box { position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--ivory); border-radius: 18px; padding: 32px 28px 26px; display: flex; flex-direction: column; gap: 14px; }
.dk-modal__close { position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dk-modal__close:hover { background: var(--ivory-3); }
.dk-modal__icon { width: 56px; height: 56px; border-radius: 14px; background: var(--navy); color: var(--clay); display: flex; align-items: center; justify-content: center; }
.dk-modal__box h2 { font-size: 22px; }
.dk-modal__box p { font-size: 14px; line-height: 1.6; }
.dk-modal .dk-field input { background: var(--paper); }
body.dk-modal-open { overflow: hidden; }

/* ---------- Bài viết ---------- */
.dk-article-layout { max-width: 1200px; margin: 0 auto; padding: 28px 24px 56px; display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.dk-article { flex: 999 1 640px; min-width: 0; max-width: 760px; display: flex; flex-direction: column; gap: 20px; }
.dk-article__aside { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 24px; padding-top: 56px; }
.dk-crumbs { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.dk-crumbs a { text-decoration: none; }
.dk-crumbs a:last-child { color: var(--clay-text); }
.dk-article__title { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.25; }
.dk-byline { display: flex; align-items: center; gap: 12px; }
.dk-byline__avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: var(--ivory); font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.dk-byline__avatar img { width: 100%; height: 100%; object-fit: cover; }
.dk-byline strong { display: block; font-size: 15px; color: var(--navy); }
.dk-article__cover { border-radius: var(--radius); overflow: hidden; }
.dk-article__cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.dk-prose { font-size: 17px; line-height: 1.8; display: flex; flex-direction: column; gap: 18px; }
.dk-prose > * { margin: 0; }
.dk-prose h2 { font-size: 24px; line-height: 1.35; margin-top: 14px; scroll-margin-top: 16px; }
.dk-prose h3 { font-size: 20px; margin-top: 8px; scroll-margin-top: 16px; }
.dk-prose ul, .dk-prose ol { padding-left: 24px; }
.dk-prose li + li { margin-top: 6px; }
.dk-prose blockquote { margin: 0; padding: 18px 22px; background: var(--ivory-2); border-radius: 12px; font-weight: 600; color: var(--navy); }
.dk-prose figure { margin: 8px 0; }
.dk-prose figcaption, .dk-prose .wp-element-caption { margin-top: 8px; font-size: 13px; color: var(--ink-2); text-align: center; }
.dk-prose img { border-radius: 12px; }
.dk-prose .wp-block-embed__wrapper { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--ink); }
.dk-prose .wp-block-embed__wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.dk-prose a { font-weight: 600; }

.dk-toc { background: var(--paper); border: 1px solid var(--ivory-3); border-radius: var(--radius); padding: 20px 24px; }
.dk-toc__title { margin: 0 0 12px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--navy); }
.dk-toc ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; }
.dk-toc a { text-decoration: none; font-weight: 600; }

/* Khối chèn trong bài (mẫu khối) */
.dk-prose .dk-note { background: var(--ivory-2); border-radius: 12px; padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.dk-prose .dk-note > * { margin: 0; }
.dk-note__label { font-size: 13px !important; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--clay-text); }
.dk-note p:not(.dk-note__label) { font-size: 16px; font-weight: 600; line-height: 1.7; color: var(--navy); }
.dk-prose .dk-cta { border-radius: 16px; padding: 24px 26px; display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.dk-prose .dk-cta > * { margin: 0; }
.dk-cta .wp-block-group, .dk-cta__text { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dk-cta__text > * { margin: 0; }
.dk-cta__kicker { font-size: 12px !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dk-cta__title { font-size: 19px !important; font-weight: 800; line-height: 1.4; }
.dk-cta .wp-block-buttons { margin: 0; }
.dk-cta .wp-block-button__link { display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px; font-weight: 800; font-size: 14px; text-decoration: none; }
.dk-cta--library { background: var(--navy); }
.dk-cta--library .dk-cta__kicker { color: var(--clay-light); }
.dk-cta--library .dk-cta__title { color: var(--ivory); }
.dk-cta--library .wp-block-button__link { background: var(--ivory); color: var(--navy); }
.dk-cta--course { background: var(--paper); border: 1px solid var(--ivory-3); }
.dk-cta--course .dk-cta__kicker { color: var(--clay-text); }
.dk-cta--course .dk-cta__title { color: var(--navy); }
.dk-cta--course .wp-block-button__link { background: var(--clay-deep); color: #fff; }
.dk-cta--coaching { background: var(--ivory-2); }
.dk-cta--coaching .dk-cta__kicker { color: var(--clay-text); }
.dk-cta--coaching .dk-cta__title { color: var(--navy); }
.dk-cta--coaching .wp-block-button__link { background: var(--navy); color: var(--ivory); }

.dk-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dk-share__label { font-size: 14px; font-weight: 700; color: var(--navy); margin-right: 6px; }
.dk-author { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; background: var(--paper); border: 1px solid var(--ivory-3); border-radius: 16px; padding: 22px; }
.dk-author .dk-avatar { width: 72px; height: 72px; font-size: 20px; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--clay); }
.dk-author__body { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.dk-author__body strong { font-size: 18px; color: var(--navy); }
.dk-author__body p { font-size: 14px; }
.dk-side-box { background: var(--navy); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.dk-side-box h2 { font-size: 17px; color: var(--ivory); line-height: 1.4; }
.dk-side-box input[type=email] { height: 44px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--ivory); font-size: 14px; width: 100%; }
.dk-side-box .dk-consent { color: var(--on-navy-2); font-size: 12px; }
.dk-side-box .dk-consent a { color: var(--clay-light); }
.dk-side-box .dk-form__msg { color: var(--ivory); }
.dk-related h2 { font-size: 20px; margin-bottom: 18px; }

/* ---------- Trang thường và trang Giới thiệu ---------- */
.dk-page-title { font-size: clamp(28px, 3vw, 36px); margin-bottom: 20px; }
.dk-page-content { font-size: 16px; line-height: 1.75; }
.dk-page-content > * + * { margin-top: 18px; }
.dk-page-content > .alignfull, .dk-page-content > .dk-about-method { margin-top: 0; }

.dk-about-hero { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: center; padding-bottom: 56px; }
.dk-about-hero > .wp-block-column { flex: 1 1 340px !important; min-width: 0; }
.dk-about-hero h1 { font-size: clamp(32px, 4vw, 52px); line-height: 1.15; }
.dk-about-hero h1 em, .dk-about-method h2 em { font-style: normal; color: var(--clay); }
.dk-about-hero .wp-block-image img { border-radius: 20px; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.dk-about-lead { font-size: 18px; line-height: 1.7; }
.dk-stats { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; padding-bottom: 64px; }
.dk-stats > .wp-block-group, .dk-stat { background: var(--paper); border: 1px solid var(--ivory-3); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 6px; margin: 0 !important; }
.dk-stat__num { font-size: 40px !important; font-weight: 800; line-height: 1 !important; color: var(--navy); margin: 0 !important; }
.dk-stat p:not(.dk-stat__num) { font-size: 14px; font-weight: 600; margin: 0; }
.dk-stat--navy { background: var(--navy) !important; border-color: var(--navy) !important; }
.dk-stat--navy .dk-stat__num { color: var(--clay); }
.dk-stat--navy p { color: var(--ivory); }
.dk-about-story { display: flex; flex-wrap: wrap; gap: 40px 56px; align-items: flex-start; padding-bottom: 72px; }
.dk-about-story > .wp-block-column { flex: 1 1 340px !important; min-width: 0; }
.dk-about-story img { border-radius: 20px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.dk-about-story h2 { font-size: 32px; }
.dk-about-story p { font-size: 17px; line-height: 1.8; }
.dk-about-method { position: relative; overflow: hidden; background: var(--navy); border-radius: 24px; padding: clamp(28px, 4vw, 56px); margin-bottom: 72px !important; }
.dk-about-method::after { content: ""; position: absolute; right: -120px; top: -160px; width: 440px; height: 440px; border-radius: 50%; border: 2px solid var(--clay); opacity: .4; pointer-events: none; }
.dk-about-method > * { position: relative; z-index: 1; }
.dk-about-method .dk-label { color: var(--clay-light); }
.dk-about-method h2 { color: var(--ivory); font-size: clamp(26px, 3vw, 36px); margin: 12px 0 36px; }
.dk-steps { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 20px; }
.dk-step { background: var(--navy-2); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 12px; margin: 0 !important; }
.dk-step > * { margin: 0 !important; }
.dk-step__num { font-size: 36px !important; font-weight: 800; line-height: 1 !important; color: var(--clay); }
.dk-step h3 { font-size: 19px; color: var(--ivory); }
.dk-step p:not(.dk-step__num) { font-size: 14px; line-height: 1.7; color: var(--on-navy-2); }
.dk-timeline { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 28px 20px; }
.dk-milestone { display: flex; flex-direction: column; gap: 10px; margin: 0 !important; position: relative; padding-top: 26px; }
.dk-milestone::before { content: ""; position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--clay); }
.dk-milestone::after { content: ""; position: absolute; left: 24px; right: 0; top: 6px; height: 2px; background: var(--line); }
.dk-milestone > * { margin: 0 !important; }
.dk-milestone__year { font-size: 26px !important; font-weight: 800; color: var(--navy); }
.dk-milestone p:not(.dk-milestone__year) { font-size: 14px; line-height: 1.6; }
.dk-press { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 16px; }
.dk-press img { height: 48px; width: auto; object-fit: contain; filter: grayscale(1); opacity: .8; }
.dk-block-section { padding-bottom: 64px; }
.dk-block-section > h2 { font-size: 30px; margin-bottom: 24px; }

.dk-contact { display: flex; flex-wrap: wrap; gap: 32px 48px; background: var(--paper); border: 1px solid var(--ivory-3); border-radius: 24px; padding: clamp(24px, 4vw, 48px); }
.dk-contact__info { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.dk-contact__info h2 { font-size: 30px; }
.dk-contact__list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.dk-contact__list li { display: flex; gap: 12px; align-items: center; }
.dk-contact__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--ivory-2); color: var(--navy); display: flex; align-items: center; justify-content: center; flex: none; }
.dk-contact .dk-form { flex: 1 1 380px; min-width: 0; }

/* ---------- Tìm kiếm, phân trang, chân trang ---------- */
.dk-pagination { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dk-pagination .page-numbers { min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 10px; background: var(--ivory-3); color: var(--navy); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.dk-pagination .current { background: var(--navy); color: var(--ivory); }
.dk-empty { padding: 40px; text-align: center; background: var(--paper); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.dk-footer { border-top: 1px solid var(--line); padding: 20px 24px; }
.dk-footer__inner { max-width: var(--wrap); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.dk-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px; }

/* Căn chỉnh của trình soạn thảo */
.alignwide { max-width: 1100px; }
.aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.has-text-align-center { text-align: center; }

/* ---------- Nút và ảnh trong trình soạn thảo khối ---------- */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 24px; border-radius: 999px; border: 2px solid var(--navy); background: var(--navy); color: var(--ivory); font-weight: 700; font-size: 15px; text-decoration: none; }
.wp-block-button__link:hover { color: var(--ivory); filter: brightness(1.08); }
.is-style-dk-primary .wp-block-button__link { background: var(--clay-deep); border-color: var(--clay-deep); color: #fff; }
.is-style-dk-outline .wp-block-button__link { background: transparent; color: var(--navy); }
.is-style-dk-outline .wp-block-button__link:hover { color: var(--navy); }
.dk-page-content .dk-about-hero .wp-block-buttons { margin-top: 6px; }
.wp-block-image img:not([src]), .wp-block-image img[src=""] { display: none; }
.dk-photo:has(img:not([src])) { display: none; }
.dk-about-hero .wp-block-column > * + *, .dk-about-story .wp-block-column > * + * { margin-top: 16px; }
.wp-block-columns { display: flex; flex-wrap: wrap; gap: 32px; }
.wp-block-column { flex: 1 1 300px; min-width: 0; }
.dk-form__msg:empty { display: none; }

/* Theme cổ điển: WordPress bọc nội dung khối Nhóm trong một lớp phụ; bỏ lớp đó để bố cục lưới hoạt động. */
[class*="dk-"] > .wp-block-group__inner-container { display: contents; }
.wp-block-column:has(> .dk-photo:only-child img:not([src])) { display: none; }
.wp-block-column:empty { display: none; }

/* ---------- Thông báo nhỏ (toast) ---------- */
.dk-toast { position: fixed; left: 50%; bottom: 24px; z-index: 1100; transform: translate(-50%, 20px); opacity: 0; max-width: min(520px, calc(100% - 32px)); padding: 14px 20px; border-radius: 12px; background: var(--navy); color: var(--ivory); font-size: 14px; font-weight: 600; line-height: 1.5; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); transition: opacity .25s, transform .25s; }
.dk-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .dk-toast { transition: none; } }
.is-flash { animation: dk-flash 0.8s ease-in-out 3; }
@keyframes dk-flash { 50% { box-shadow: 0 0 0 6px var(--clay-glow); } }

/* ---------- Sắp xếp Blog ---------- */
.dk-sort { display: inline-flex; gap: 4px; background: var(--ivory-2); border-radius: 10px; padding: 4px; }
.dk-sort__opt { min-height: 36px; padding: 0 14px; border-radius: 8px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.dk-sort__opt:hover { color: var(--navy); }
.dk-sort__opt.is-active { background: var(--paper); color: var(--navy); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
