/*
Theme Name: DhnNews
Theme URI: https://example.com/dhnnews
Author: DhnNews
Author URI: https://example.com
Description: Theme tin tức công nghệ chuyên nghiệp — trang chủ tạp chí với khối tin nổi bật (featured hero) và thanh tin nóng, mục lục bài viết tự động, nút chia sẻ mạng xã hội, đếm lượt xem + widget "Đang hot", đăng ký newsletter, thanh đọc tiến độ, structured data JSON-LD + Open Graph/Twitter Card, dark mode và AJAX Load More.
Version: 3.18.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dhnnews
Tags: news, technology, blog, magazine, two-columns, right-sidebar, custom-colors, custom-menu, featured-images, translation-ready
*/

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Palette — light */
  --dhn-bg:          #ffffff;
  --dhn-bg-soft:     #f6f6f4;
  --dhn-bg-sunken:   #efeeec;
  --dhn-surface:     #ffffff;
  --dhn-ink:         #0c0c0d;
  --dhn-ink-soft:    #3a3a3e;
  --dhn-ink-mute:    #6c6c72;
  --dhn-line:        #e6e5e1;
  --dhn-line-strong: #d6d5d0;
  --dhn-accent:      #155bd6;   /* xanh dương */
  --dhn-accent-ink:  #ffffff;
  --dhn-accent-soft: #e9f0fd;
  --dhn-link:        #1450c4;

  /* Type */
  --dhn-font-display: "Bricolage Grotesque", "Sora", Georgia, serif;
  --dhn-font-body:    "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --dhn-font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --dhn-maxw: 1240px;
  --dhn-gap: 28px;
  --dhn-radius: 4px;
  --dhn-radius-lg: 8px;
  --dhn-shadow: 0 1px 2px rgba(12,12,13,.05), 0 8px 24px -16px rgba(12,12,13,.25);
  --dhn-shadow-hover: 0 2px 4px rgba(12,12,13,.06), 0 18px 40px -20px rgba(12,12,13,.35);

  /* Motion */
  --dhn-ease: cubic-bezier(.2,.7,.2,1);
}

[data-theme="dark"] {
  --dhn-bg:          #0c0d0f;
  --dhn-bg-soft:     #131417;
  --dhn-bg-sunken:   #0a0b0d;
  --dhn-surface:     #16181c;
  --dhn-ink:         #f4f4f2;
  --dhn-ink-soft:    #c7c8c9;
  --dhn-ink-mute:    #8b8d92;
  --dhn-line:        #26282d;
  --dhn-line-strong: #34373d;
  --dhn-accent:      #5b95ff;
  --dhn-accent-ink:  #0c0d0f;
  --dhn-accent-soft: #14223d;
  --dhn-link:        #82b1ff;
  --dhn-shadow: 0 1px 2px rgba(0,0,0,.5), 0 10px 30px -16px rgba(0,0,0,.7);
  --dhn-shadow-hover: 0 2px 4px rgba(0,0,0,.6), 0 22px 48px -20px rgba(0,0,0,.8);
}

/* ============================================================
   2. RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--dhn-bg);
  color: var(--dhn-ink);
  font-family: var(--dhn-font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .3s var(--dhn-ease), color .3s var(--dhn-ease);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--dhn-link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1,h2,h3,h4,h5 {
  font-family: var(--dhn-font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--dhn-ink);
  margin: 0 0 .5em;
}
p { margin: 0 0 1.2em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }

.dhn-container { max-width: var(--dhn-maxw); margin: 0 auto; padding: 0 24px; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 1000;
  background: var(--dhn-ink); color: var(--dhn-bg); padding: 10px 16px; border-radius: var(--dhn-radius);
}
.skip-link:focus { left: 8px; }

/* ============================================================
   3. HEADER
   ============================================================ */
.dhn-topbar {
  border-bottom: 1px solid var(--dhn-line);
  background: var(--dhn-surface);
  font-family: var(--dhn-font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--dhn-ink-mute);
}
.dhn-topbar-inner { display: flex; justify-content: space-between; align-items: center; height: 36px; }
.dhn-topbar .dhn-date { text-transform: uppercase; }

.dhn-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--dhn-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--dhn-line);
}
.dhn-header-inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.dhn-brand { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; }
.dhn-brand .dhn-logo {
  font-family: var(--dhn-font-display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -.03em;
  color: var(--dhn-ink);
  text-decoration: none;
}
.dhn-brand .dhn-logo b { color: var(--dhn-accent); }
.dhn-brand .dhn-tagline { font-size: 12px; color: var(--dhn-ink-mute); font-family: var(--dhn-font-mono); }

.dhn-nav { margin-left: auto; }
.dhn-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.dhn-nav a {
  display: block; padding: 10px 14px; color: var(--dhn-ink-soft);
  font-weight: 600; font-size: 15px; border-radius: var(--dhn-radius);
  text-decoration: none; transition: background .15s, color .15s;
}
.dhn-nav a:hover, .dhn-nav .current-menu-item > a { background: var(--dhn-bg-soft); color: var(--dhn-ink); }
.dhn-nav .current-menu-item > a { box-shadow: inset 0 -2px 0 var(--dhn-accent); }

/* Menu con (sub-menu) — dropdown xổ xuống khi rê chuột */
.dhn-nav li { position: relative; }
.dhn-nav .menu-item-has-children > a { display: inline-flex; align-items: center; }
.dhn-nav .menu-item-has-children > a::after {
  content: ""; width: 6px; height: 6px; margin-left: 7px; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px); opacity: .55;
  transition: transform .15s var(--dhn-ease);
}
.dhn-nav .menu-item-has-children:hover > a::after,
.dhn-nav .menu-item-has-children:focus-within > a::after { transform: rotate(225deg) translateY(2px); }
.dhn-nav .sub-menu {
  position: absolute; top: 100%; left: 0; z-index: 60;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 220px; margin: 0; padding: 6px;
  background: var(--dhn-surface); border: 1px solid var(--dhn-line);
  border-radius: var(--dhn-radius-lg); box-shadow: var(--dhn-shadow-hover);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .16s var(--dhn-ease), transform .16s var(--dhn-ease), visibility .16s;
}
.dhn-nav .sub-menu::before { content: ""; position: absolute; top: -9px; left: 0; right: 0; height: 9px; } /* cầu nối giữ hover */
.dhn-nav .menu-item-has-children:hover > .sub-menu,
.dhn-nav .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dhn-nav .sub-menu li { width: 100%; }
.dhn-nav .sub-menu a { display: block; width: 100%; white-space: nowrap; padding: 9px 12px; font-weight: 500; }
.dhn-nav .sub-menu a:hover { background: var(--dhn-accent-soft); color: var(--dhn-accent); }
.dhn-nav .sub-menu .current-menu-item > a { background: var(--dhn-accent-soft); color: var(--dhn-accent); box-shadow: none; }

.dhn-header-tools { display: flex; align-items: center; gap: 8px; }
.dhn-icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: transparent; border: 1px solid var(--dhn-line); border-radius: var(--dhn-radius);
  color: var(--dhn-ink-soft); cursor: pointer; transition: all .15s;
}
.dhn-icon-btn:hover { border-color: var(--dhn-line-strong); color: var(--dhn-ink); background: var(--dhn-bg-soft); }
.dhn-icon-btn svg { width: 18px; height: 18px; }

.dhn-menu-toggle { display: none; }

/* Search drawer */
.dhn-search-drawer {
  display: none; border-bottom: 1px solid var(--dhn-line); background: var(--dhn-surface);
}
.dhn-search-drawer.open { display: block; }
.dhn-search-drawer form { display: flex; gap: 10px; padding: 20px 0; }
.dhn-search-drawer input[type="search"] {
  flex: 1; border: 1px solid var(--dhn-line-strong); background: var(--dhn-bg);
  color: var(--dhn-ink); padding: 14px 16px; border-radius: var(--dhn-radius); font-size: 17px;
}
.dhn-search-drawer button {
  background: var(--dhn-accent); color: var(--dhn-accent-ink); border: 0; padding: 0 24px;
  border-radius: var(--dhn-radius); font-weight: 700; cursor: pointer;
}

/* ============================================================
   4. LAYOUT
   ============================================================ */
.dhn-main { padding: 40px 0 64px; }
.dhn-layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 48px; }
.dhn-layout.no-sidebar { grid-template-columns: minmax(0,1fr); }

/* ============================================================
   5. SECTION HEADINGS (category blocks)
   ============================================================ */
.dhn-section { margin-bottom: 56px; }
.dhn-section-head {
  display: flex; align-items: center; gap: 16px; margin-bottom: 24px;
  border-bottom: 2px solid var(--dhn-ink); padding-bottom: 10px;
}
.dhn-section-head h2 {
  margin: 0; font-size: 22px; text-transform: uppercase; letter-spacing: -.01em;
}
.dhn-section-head .dhn-kicker {
  display: inline-block; background: var(--dhn-accent); color: var(--dhn-accent-ink);
  font-family: var(--dhn-font-mono); font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 3px; letter-spacing: .06em; text-transform: uppercase;
}
.dhn-section-head .dhn-more {
  margin-left: auto; font-size: 13px; font-weight: 600; color: var(--dhn-ink-mute);
  font-family: var(--dhn-font-mono); text-decoration: none;
}
.dhn-section-head .dhn-more:hover { color: var(--dhn-accent); }

/* ============================================================
   6. POST GRID + CARD
   ============================================================ */
.dhn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--dhn-gap); }
.dhn-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.dhn-card { display: flex; flex-direction: column; min-width: 0; }
.dhn-card-media {
  position: relative; display: block; overflow: hidden; border-radius: var(--dhn-radius-lg);
  aspect-ratio: 16/10; background: var(--dhn-bg-sunken); margin-bottom: 14px;
}
.dhn-card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s var(--dhn-ease);
}
.dhn-card:hover .dhn-card-media img { transform: scale(1.045); }
.dhn-noimg {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg, var(--dhn-bg-soft) 0 12px, var(--dhn-bg-sunken) 12px 24px);
}
.dhn-noimg::after {
  content: ""; position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--dhn-accent); width: 36px; height: 36px; margin: auto; border-radius: 50%;
  opacity: .9;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 5h16v14H4z' fill='none'/%3E%3Cpath d='M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14l4-4 3 3 5-5 4 4z'/%3E%3C/svg%3E") center/22px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 19V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14l4-4 3 3 5-5 4 4z'/%3E%3C/svg%3E") center/22px no-repeat;
}
.dhn-pagelinks { font-family: var(--dhn-font-mono); font-size: 14px; margin: 24px auto 0; max-width: 720px; }
.dhn-pagelinks a, .dhn-pagelinks > span { display: inline-block; padding: 4px 10px; border: 1px solid var(--dhn-line); border-radius: var(--dhn-radius); margin-right: 4px; }
.dhn-card-cat {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  background: var(--dhn-ink); color: var(--dhn-bg);
  font-family: var(--dhn-font-mono); font-size: 11px; font-weight: 600;
  padding: 5px 9px; border-radius: 3px; letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none;
}
.dhn-card-cat:hover { background: var(--dhn-accent); color: var(--dhn-accent-ink); text-decoration: none; }
.dhn-card-title {
  font-family: var(--dhn-font-display); font-weight: 700; font-size: 19px; line-height: 1.22;
  letter-spacing: -.015em; margin: 0 0 8px;
}
.dhn-card-title a { color: var(--dhn-ink); text-decoration: none; background-image: linear-gradient(var(--dhn-accent),var(--dhn-accent)); background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .25s var(--dhn-ease); }
.dhn-card-title a:hover { background-size: 100% 2px; }
.dhn-card-excerpt { color: var(--dhn-ink-soft); font-size: 15px; line-height: 1.6; margin: 0 0 12px; }
.dhn-card-meta {
  display: flex; align-items: center; gap: 8px; margin-top: auto;
  font-size: 13px; color: var(--dhn-ink-mute); font-family: var(--dhn-font-mono);
}
.dhn-card-meta a { color: var(--dhn-ink-soft); text-decoration: none; font-weight: 600; }
.dhn-card-meta a:hover { color: var(--dhn-accent); }
.dhn-card-meta .dhn-dot { width: 3px; height: 3px; background: var(--dhn-line-strong); border-radius: 50%; }

/* Lead / featured card variant */
.dhn-card.is-lead { grid-column: span 2; grid-row: span 2; height: 100%; }
/* Ảnh lead giãn lấp đầy chiều cao 2 hàng -> không còn khoảng trống giữa bài */
.dhn-card.is-lead .dhn-card-media { aspect-ratio: auto; flex: 1 1 auto; min-height: 360px; }
.dhn-card.is-lead .dhn-card-title { font-size: 32px; }
.dhn-card.is-lead .dhn-card-excerpt { font-size: 17px; }

/* Compact list (sidebar / author) */
.dhn-list { display: flex; flex-direction: column; gap: 18px; }
.dhn-list-item { display: flex; gap: 14px; }
.dhn-list-item .dhn-thumb {
  flex: 0 0 84px; aspect-ratio: 1; border-radius: var(--dhn-radius); overflow: hidden;
  background: var(--dhn-bg-sunken); position: relative; display: block;
}
.dhn-list-item .dhn-thumb .dhn-noimg::after {
  width: 26px; height: 26px; -webkit-mask-size: 15px; mask-size: 15px;
}
.dhn-list-item .dhn-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dhn-list-item h4 { font-size: 15px; line-height: 1.3; margin: 0 0 6px; }
.dhn-list-item h4 a { color: var(--dhn-ink); text-decoration: none; }
.dhn-list-item h4 a:hover { color: var(--dhn-accent); }
.dhn-list-item .dhn-list-meta { font-size: 12px; color: var(--dhn-ink-mute); font-family: var(--dhn-font-mono); }
.dhn-list-item .dhn-rank { font-family: var(--dhn-font-display); font-size: 26px; color: var(--dhn-line-strong); font-weight: 800; line-height: 1; }

/* ============================================================
   7. LOAD MORE
   ============================================================ */
.dhn-loadmore-wrap { display: flex; justify-content: center; margin-top: 40px; }
.dhn-loadmore {
  font-family: var(--dhn-font-mono); font-weight: 600; font-size: 14px; letter-spacing: .03em;
  background: var(--dhn-surface); color: var(--dhn-ink); border: 1px solid var(--dhn-line-strong);
  padding: 14px 34px; border-radius: 100px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px; transition: all .18s var(--dhn-ease);
}
.dhn-loadmore:hover:not(:disabled) { background: var(--dhn-ink); color: var(--dhn-bg); border-color: var(--dhn-ink); }
.dhn-loadmore:disabled { opacity: .55; cursor: default; }
.dhn-loadmore .dhn-spinner {
  width: 15px; height: 15px; border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; display: none; animation: dhn-spin .7s linear infinite;
}
.dhn-loadmore.loading .dhn-spinner { display: inline-block; }
.dhn-loadmore.loading .dhn-label { opacity: .6; }
@keyframes dhn-spin { to { transform: rotate(360deg); } }

/* staggered reveal for appended items */
.dhn-card.dhn-reveal { animation: dhn-fade .5s var(--dhn-ease) both; }
@keyframes dhn-fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ============================================================
   8. SIDEBAR
   ============================================================ */
.dhn-sidebar { position: sticky; top: 96px; align-self: start; }
.dhn-widget { margin-bottom: 40px; }
.dhn-widget-title {
  font-size: 14px; text-transform: uppercase; letter-spacing: .06em; font-family: var(--dhn-font-mono);
  color: var(--dhn-ink-mute); margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--dhn-line);
}
.dhn-widget ul { list-style: none; margin: 0; padding: 0; }
.dhn-widget ul li { padding: 8px 0; border-bottom: 1px solid var(--dhn-line); }
.dhn-widget ul li a { color: var(--dhn-ink-soft); text-decoration: none; }
.dhn-widget ul li a:hover { color: var(--dhn-accent); }

/* ============================================================
   9. SINGLE POST
   ============================================================ */
/* Căn trái toàn bộ tiêu đề; max-width khớp 720px với .dhn-content để H1
   thẳng trục với đoạn thân bài đầu tiên (không lệch trái–phải) */
.dhn-article-head { max-width: none; margin: 0 0 32px; text-align: left; }
.dhn-article-head .dhn-eyebrow { margin-bottom: 16px; }
.dhn-article-head .dhn-eyebrow a {
  background: var(--dhn-accent); color: var(--dhn-accent-ink); font-family: var(--dhn-font-mono);
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 3px; text-transform: uppercase;
  letter-spacing: .05em; text-decoration: none;
}
.dhn-article-head h1 { font-size: clamp(28px, 4.5vw, 44px); margin: 0 0 14px; }
.dhn-article-head .dhn-dek { font-size: 20px; color: var(--dhn-ink-soft); line-height: 1.5; margin: 0; }
.dhn-article-byline {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px 12px; flex-wrap: wrap;
  margin-top: 18px; font-size: 14px; color: var(--dhn-ink-mute); font-family: var(--dhn-font-mono);
}
.dhn-article-byline img { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 auto; }
.dhn-article-byline a { color: var(--dhn-ink); font-weight: 600; text-decoration: none; }
.dhn-article-byline a:hover { color: var(--dhn-accent); }
/* Dấu chấm ngăn cách giữa các mục meta (trước đây không có style nên bị mất) */
.dhn-article-byline .dhn-dot { width: 3px; height: 3px; background: var(--dhn-line-strong); border-radius: 50%; flex: 0 0 auto; }

.dhn-hero-img { margin: 0 0 40px; }
.dhn-hero-img img { width: 100%; border-radius: var(--dhn-radius-lg); }
.dhn-hero-img figcaption { font-size: 13px; color: var(--dhn-ink-mute); margin-top: 10px; text-align: center; font-family: var(--dhn-font-mono); }

.dhn-content { max-width: 720px; margin: 0 auto; font-size: 19px; line-height: 1.75; }
.dhn-content > * { margin-left: auto; margin-right: auto; }
.dhn-content h2 { font-size: 28px; margin: 1.6em 0 .5em; }
.dhn-content h3 { font-size: 22px; margin: 1.4em 0 .5em; }
.dhn-content a { color: var(--dhn-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.dhn-content img { border-radius: var(--dhn-radius-lg); margin: 1.6em auto; }
.dhn-content blockquote {
  border-left: 3px solid var(--dhn-accent); margin: 1.6em 0; padding: 4px 0 4px 24px;
  font-family: var(--dhn-font-display); font-size: 24px; line-height: 1.4; color: var(--dhn-ink);
}
.dhn-content pre {
  background: var(--dhn-bg-sunken); border: 1px solid var(--dhn-line); border-radius: var(--dhn-radius);
  padding: 18px; overflow-x: auto; font-family: var(--dhn-font-mono); font-size: 14px;
}
.dhn-content code { font-family: var(--dhn-font-mono); font-size: .9em; background: var(--dhn-bg-soft); padding: 2px 6px; border-radius: 3px; }
.dhn-content pre code { background: none; padding: 0; }

.dhn-tags { max-width: 720px; margin: 40px auto 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dhn-tags a {
  font-family: var(--dhn-font-mono); font-size: 13px; color: var(--dhn-ink-soft);
  border: 1px solid var(--dhn-line-strong); padding: 6px 12px; border-radius: 100px; text-decoration: none;
}
.dhn-tags a:hover { border-color: var(--dhn-accent); color: var(--dhn-accent); }
.dhn-tags a::before { content: "#"; color: var(--dhn-ink-mute); }

/* ============================================================
   10. AUTHOR BOX + AUTHOR PAGE
   ============================================================ */
.dhn-author-box {
  max-width: 720px; margin: 48px auto 0; padding: 28px;
  background: var(--dhn-bg-soft); border: 1px solid var(--dhn-line); border-radius: var(--dhn-radius-lg);
  display: flex; gap: 22px;
}
.dhn-author-box .dhn-avatar { flex: 0 0 84px; }
.dhn-author-box .dhn-avatar img { width: 84px; height: 84px; border-radius: 50%; }
.dhn-author-box .dhn-au-label { font-family: var(--dhn-font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dhn-ink-mute); margin-bottom: 4px; }
.dhn-author-box .dhn-au-name { font-size: 22px; margin: 0 0 6px; }
.dhn-author-box .dhn-au-name a { color: var(--dhn-ink); text-decoration: none; }
.dhn-author-box .dhn-au-name a:hover { color: var(--dhn-accent); }
.dhn-author-box .dhn-au-bio { font-size: 15px; color: var(--dhn-ink-soft); margin: 0 0 12px; }
.dhn-author-box .dhn-au-social { display: flex; gap: 8px; flex-wrap: wrap; }
.dhn-author-box .dhn-au-social a {
  font-family: var(--dhn-font-mono); font-size: 12px; color: var(--dhn-ink-soft);
  border: 1px solid var(--dhn-line-strong); padding: 4px 10px; border-radius: 100px; text-decoration: none;
}
.dhn-author-box .dhn-au-social a:hover { border-color: var(--dhn-accent); color: var(--dhn-accent); }

.dhn-author-hero {
  background: var(--dhn-bg-soft); border-bottom: 1px solid var(--dhn-line);
  padding: 56px 0;
}
.dhn-author-hero-inner { display: flex; gap: 28px; align-items: center; max-width: 860px; }
.dhn-author-hero img { width: 110px; height: 110px; border-radius: 50%; flex-shrink: 0; }
.dhn-author-hero h1 { font-size: 40px; margin: 0 0 8px; }
.dhn-author-hero .dhn-au-bio { font-size: 17px; color: var(--dhn-ink-soft); max-width: 60ch; margin: 0 0 14px; }
.dhn-author-hero .dhn-au-stat { font-family: var(--dhn-font-mono); font-size: 13px; color: var(--dhn-ink-mute); }

/* ============================================================
   11. RELATED POSTS
   ============================================================ */
.dhn-related { border-top: 1px solid var(--dhn-line); margin-top: 64px; padding-top: 40px; }

/* ============================================================
   12. PAGINATION (fallback / archive non-ajax) + breadcrumb
   ============================================================ */
.dhn-breadcrumb { font-family: var(--dhn-font-mono); font-size: 13px; color: var(--dhn-ink-mute); margin-bottom: 24px; }
.dhn-breadcrumb a { color: var(--dhn-ink-soft); text-decoration: none; }
.dhn-breadcrumb a:hover { color: var(--dhn-accent); }
.dhn-breadcrumb .sep { margin: 0 8px; }

.dhn-archive-head { margin-bottom: 40px; padding-bottom: 24px; border-bottom: 2px solid var(--dhn-ink); }
.dhn-archive-head .dhn-kicker { display: inline-block; background: var(--dhn-accent); color: var(--dhn-accent-ink); font-family: var(--dhn-font-mono); font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 3px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.dhn-archive-head h1 { font-size: clamp(28px,4vw,44px); margin: 0 0 8px; }
.dhn-archive-head p { color: var(--dhn-ink-soft); margin: 0; max-width: 70ch; }

/* ============================================================
   13. FOOTER
   ============================================================ */
.dhn-footer { background: var(--dhn-bg-sunken); border-top: 1px solid var(--dhn-line); margin-top: 40px; }
.dhn-footer-top { padding-top: 56px; padding-bottom: 56px; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.dhn-footer .dhn-logo { font-family: var(--dhn-font-display); font-weight: 800; font-size: 26px; color: var(--dhn-ink); }
.dhn-footer .dhn-logo b { color: var(--dhn-accent); }
.dhn-footer p { color: var(--dhn-ink-mute); font-size: 14px; max-width: 38ch; }
.dhn-footer h4 { font-family: var(--dhn-font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dhn-ink-mute); margin: 0 0 16px; }
.dhn-footer ul { list-style: none; margin: 0; padding: 0; }
.dhn-footer ul li { margin-bottom: 10px; }
.dhn-footer ul li a { color: var(--dhn-ink-soft); text-decoration: none; font-size: 14px; }
.dhn-footer ul li a:hover { color: var(--dhn-accent); }
.dhn-footer-bottom { border-top: 1px solid var(--dhn-line); padding-top: 22px; padding-bottom: 22px; display: flex; justify-content: space-between; font-family: var(--dhn-font-mono); font-size: 12px; color: var(--dhn-ink-mute); }

/* ============================================================
   14. RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .dhn-layout { grid-template-columns: 1fr; gap: 40px; }
  .dhn-sidebar { position: static; }
  .dhn-grid { grid-template-columns: repeat(2, 1fr); }
  .dhn-card.is-lead { grid-column: span 2; grid-row: auto; }
  .dhn-card.is-lead .dhn-card-media { aspect-ratio: 16/9; flex: none; min-height: 0; }
  .dhn-card.is-lead .dhn-card-title { font-size: 26px; }
  .dhn-footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .dhn-header-inner { gap: 14px; }
  .dhn-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--dhn-surface); border-bottom: 1px solid var(--dhn-line); padding: 12px; }
  .dhn-nav.open { display: block; }
  .dhn-nav ul { flex-direction: column; gap: 2px; }
  /* Menu con trên mobile: gập/mở (accordion) trong panel */
  .dhn-nav .sub-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    display: none; box-shadow: none; border: 0; border-left: 2px solid var(--dhn-line);
    border-radius: 0; min-width: 0; margin: 2px 0 6px 14px; padding: 2px 0 2px 8px;
  }
  .dhn-nav .sub-menu::before { display: none; }
  .dhn-nav .menu-item-has-children.is-open > .sub-menu { display: flex; }
  .dhn-nav .menu-item-has-children > a { justify-content: space-between; }
  .dhn-nav .menu-item-has-children > a::after { margin-left: auto; }
  .dhn-nav .menu-item-has-children.is-open > a::after { transform: rotate(225deg) translateY(2px); }
  .dhn-menu-toggle { display: grid; }
  .dhn-grid, .dhn-grid.cols-2 { grid-template-columns: 1fr; }
  .dhn-card.is-lead { grid-column: auto; }
  .dhn-card.is-lead .dhn-card-title { font-size: 24px; }
  .dhn-content, .dhn-article-head, .dhn-author-box, .dhn-tags, .dhn-related .dhn-container { font-size: 17px; }
  .dhn-author-box { flex-direction: column; }
  .dhn-author-hero-inner { flex-direction: column; text-align: center; }
  .dhn-footer-top { grid-template-columns: 1fr; gap: 28px; }
  .dhn-footer-bottom { flex-direction: column; gap: 8px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   BÌNH LUẬN — giao diện chuyên nghiệp (dùng design token, tự hỗ trợ dark mode)
   ============================================================ */
.dhn-comments-area { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--dhn-line); }
.dhn-comments__title {
  font-family: var(--dhn-font-display); font-weight: 700; font-size: 22px;
  color: var(--dhn-ink); margin: 0 0 24px; letter-spacing: -.01em;
}

.dhn-commentlist { list-style: none; margin: 0 0 8px; padding: 0; }
.dhn-commentlist .children { list-style: none; margin: 0; padding-left: 28px; border-left: 2px solid var(--dhn-line); }
.dhn-comment { margin: 0; }

.dhn-comment__body { display: flex; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--dhn-line); }
.dhn-comment .children .dhn-comment__body { padding-left: 12px; }
.dhn-comment__avatar img { width: 48px; height: 48px; border-radius: 50%; display: block; }
.dhn-comment__main { flex: 1 1 auto; min-width: 0; }
.dhn-comment__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.dhn-comment__author { font-weight: 700; color: var(--dhn-ink); font-size: 15px; }
.dhn-comment__date { font-size: 12.5px; color: var(--dhn-ink-mute); }
.dhn-comment__date::first-letter { text-transform: uppercase; }
.dhn-comment__pending {
  font-size: 12.5px; color: var(--dhn-accent); background: var(--dhn-accent-soft);
  padding: 4px 10px; border-radius: var(--dhn-radius); display: inline-block; margin: 0 0 8px;
}
.dhn-comment__content { font-size: 15px; line-height: 1.7; color: var(--dhn-ink-soft); }
.dhn-comment__content p { margin: 0 0 10px; }
.dhn-comment__content p:last-child { margin-bottom: 0; }
.dhn-comment__actions { margin-top: 8px; font-size: 13px; display: flex; gap: 14px; }
.dhn-comment__actions a { color: var(--dhn-accent); font-weight: 600; text-decoration: none; }
.dhn-comment__actions a:hover { text-decoration: underline; }
.dhn-comment__edit a { color: var(--dhn-ink-mute); font-weight: 500; }
.dhn-comment.bypostauthor > .dhn-comment__body { background: var(--dhn-bg-soft); border-radius: var(--dhn-radius-lg); padding-inline: 14px; }

/* Form bình luận */
.comment-respond { margin-top: 36px; padding: 26px; background: var(--dhn-bg-soft); border: 1px solid var(--dhn-line); border-radius: var(--dhn-radius-lg); }
.comment-reply-title { font-family: var(--dhn-font-display); font-weight: 700; font-size: 19px; color: var(--dhn-ink); margin: 0 0 18px; }
.comment-reply-title small { margin-left: 10px; font-weight: 400; font-size: 14px; }
.comment-reply-title small a { color: var(--dhn-ink-mute); }
.dhn-commentform__notes { font-size: 13px; color: var(--dhn-ink-mute); margin: 0 0 18px; }
.dhn-commentform__field { margin: 0 0 16px; }
.dhn-commentform__field label { display: block; font-size: 13px; font-weight: 600; color: var(--dhn-ink); margin-bottom: 6px; }
.dhn-commentform__field input,
.dhn-commentform__field textarea {
  width: 100%; padding: 11px 13px; font: inherit; font-size: 14.5px;
  color: var(--dhn-ink); background: var(--dhn-surface);
  border: 1px solid var(--dhn-line-strong); border-radius: var(--dhn-radius);
  transition: border-color .15s var(--dhn-ease), box-shadow .15s var(--dhn-ease);
}
.dhn-commentform__field input:focus,
.dhn-commentform__field textarea:focus {
  outline: none; border-color: var(--dhn-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dhn-accent) 18%, transparent);
}
.dhn-commentform__field textarea { resize: vertical; min-height: 130px; }
.required { color: var(--dhn-accent); }

.dhn-commentform__submit {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 26px; font-family: var(--dhn-font-body); font-size: 15px; font-weight: 700;
  color: var(--dhn-accent-ink); background: var(--dhn-accent); border: 1px solid var(--dhn-accent);
  border-radius: var(--dhn-radius); cursor: pointer; transition: background .15s var(--dhn-ease), transform .12s var(--dhn-ease);
}
.dhn-commentform__submit:hover { background: var(--dhn-ink); border-color: var(--dhn-ink); color: var(--dhn-bg); }
.dhn-commentform__submit:active { transform: translateY(1px); }
.dhn-comments__closed { font-size: 13.5px; color: var(--dhn-ink-mute); font-style: italic; margin: 16px 0 0; }

/* Tên / Email xếp 2 cột trên màn rộng */
@media (min-width: 600px) {
  .comment-form-author, .comment-form-email { display: inline-block; width: calc(50% - 8px); vertical-align: top; }
  .comment-form-author { margin-right: 14px; }
}

/* ============================================================
   ★ TÍNH NĂNG MỚI 1.2.0
   Featured hero · Ticker · TOC · Share · Newsletter · Progress · Back-to-top
   ============================================================ */

/* --- Category badge: tô màu theo chuyên mục (ghi đè mặc định) --- */
.dhn-card-cat { background: var(--cat, var(--dhn-ink)); color: #fff; }
.dhn-card-cat:hover { filter: brightness(1.08); background: var(--cat, var(--dhn-accent)); color: #fff; }

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */
.dhn-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: transparent; pointer-events: none;
}
.dhn-progress-fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--dhn-accent), color-mix(in srgb, var(--dhn-accent) 55%, #fff));
  transition: width .12s linear;
}

/* ============================================================
   TRENDING TICKER
   ============================================================ */
.dhn-ticker {
  background: var(--dhn-ink); color: var(--dhn-bg);
  border-bottom: 1px solid var(--dhn-line);
  overflow: hidden;
}
.dhn-ticker-inner { display: flex; align-items: center; gap: 18px; height: 46px; }
.dhn-ticker-tag {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  font-family: var(--dhn-font-mono); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  background: var(--dhn-accent); color: var(--dhn-accent-ink);
  padding: 5px 11px; border-radius: 100px;
}
.dhn-ticker-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: dhn-pulse 1.4s var(--dhn-ease) infinite; }
@keyframes dhn-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.dhn-ticker-track { overflow: hidden; flex: 1 1 auto; min-width: 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 92%, transparent); }
.dhn-ticker-list { display: inline-flex; gap: 0; margin: 0; padding: 0; list-style: none; white-space: nowrap; will-change: transform; animation: dhn-ticker-scroll 38s linear infinite; }
.dhn-ticker:hover .dhn-ticker-list { animation-play-state: paused; }
.dhn-ticker-list li { display: inline-flex; align-items: center; }
.dhn-ticker-list li::before { content: "•"; color: var(--dhn-ink-mute); margin: 0 20px; }
.dhn-ticker-list li:first-child::before { display: none; }
.dhn-ticker-list a { color: var(--dhn-bg); font-size: 13.5px; font-weight: 500; text-decoration: none; opacity: .92; }
.dhn-ticker-list a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
@keyframes dhn-ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   FEATURED HERO
   ============================================================ */
.dhn-hero { padding: 36px 0 12px; }
.dhn-hero-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 34px; }
.dhn-hero-lead { display: flex; flex-direction: column; }
.dhn-hero-lead .dhn-hero-media {
  position: relative; display: block; overflow: hidden; border-radius: var(--dhn-radius-lg);
  aspect-ratio: 16/9; background: var(--dhn-bg-sunken); margin-bottom: 18px;
}
.dhn-hero-lead .dhn-hero-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--dhn-ease); }
.dhn-hero-lead:hover .dhn-hero-media img { transform: scale(1.04); }
.dhn-hero-cat {
  position: absolute; left: 14px; top: 14px; z-index: 2;
  background: var(--cat, var(--dhn-accent)); color: #fff;
  font-family: var(--dhn-font-mono); font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: 4px; letter-spacing: .04em; text-transform: uppercase;
}
.dhn-hero-title { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1; margin: 0 0 12px; }
.dhn-hero-title a { color: var(--dhn-ink); text-decoration: none; }
.dhn-hero-title a:hover { color: var(--dhn-accent); }
.dhn-hero-excerpt { font-size: 17px; color: var(--dhn-ink-soft); line-height: 1.55; margin: 0 0 14px; }

.dhn-hero-side { display: flex; flex-direction: column; gap: 20px; }
.dhn-hero-item { display: grid; grid-template-columns: 108px minmax(0,1fr); gap: 15px; align-items: start; }
.dhn-hero-item:not(:last-child) { padding-bottom: 20px; border-bottom: 1px solid var(--dhn-line); }
.dhn-hero-item-media { display: block; aspect-ratio: 4/3; border-radius: var(--dhn-radius); overflow: hidden; background: var(--dhn-bg-sunken); }
.dhn-hero-item-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--dhn-ease); }
.dhn-hero-item:hover .dhn-hero-item-media img { transform: scale(1.06); }
.dhn-hero-item-cat { font-family: var(--dhn-font-mono); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--cat, var(--dhn-accent)); text-decoration: none; }
.dhn-hero-item-cat:hover { text-decoration: underline; }
.dhn-hero-item-title { font-size: 16px; line-height: 1.28; margin: 5px 0 6px; }
.dhn-hero-item-title a { color: var(--dhn-ink); text-decoration: none; background-image: linear-gradient(var(--dhn-accent),var(--dhn-accent)); background-size: 0 1.5px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .25s var(--dhn-ease); }
.dhn-hero-item-title a:hover { background-size: 100% 1.5px; }

/* ============================================================
   TABLE OF CONTENTS
   ============================================================ */
.dhn-content h2, .dhn-content h3 { scroll-margin-top: 92px; }
.dhn-toc {
  max-width: 720px; margin: 0 auto 30px;
  border: 1px solid var(--dhn-line); border-radius: var(--dhn-radius-lg);
  background: var(--dhn-bg-soft); overflow: hidden;
}
.dhn-toc-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: 0; cursor: pointer; padding: 15px 20px;
  font-family: var(--dhn-font-display); font-weight: 700; font-size: 15px; color: var(--dhn-ink);
}
.dhn-toc-label { display: inline-flex; align-items: center; gap: 9px; }
.dhn-toc-label::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--dhn-accent); }
.dhn-toc-chevron { width: 18px; height: 18px; color: var(--dhn-ink-mute); transition: transform .25s var(--dhn-ease); }
.dhn-toc-head[aria-expanded="false"] .dhn-toc-chevron { transform: rotate(-90deg); }
.dhn-toc-list {
  list-style: none; margin: 0; padding: 4px 20px 16px; counter-reset: toc;
  max-height: 600px; overflow: hidden; transition: max-height .3s var(--dhn-ease), opacity .2s, padding .3s;
}
.dhn-toc-list[hidden] { display: block; max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; }
.dhn-toc-list li { margin: 0; }
.dhn-toc-list a {
  display: block; padding: 6px 0; font-size: 14.5px; line-height: 1.4;
  color: var(--dhn-ink-soft); text-decoration: none; border-left: 2px solid transparent; padding-left: 12px;
  transition: color .15s, border-color .15s;
}
.dhn-toc-list a:hover { color: var(--dhn-accent); }
.dhn-toc-l3 a { padding-left: 28px; font-size: 13.5px; color: var(--dhn-ink-mute); }
.dhn-toc-list a.is-active { color: var(--dhn-accent); border-left-color: var(--dhn-accent); font-weight: 600; }

/* ============================================================
   ARTICLE BODY LAYOUT (share rail + main)
   ============================================================ */
.dhn-article-body {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  max-width: 868px; margin: 0 auto;
}
.dhn-article-main { min-width: 0; }
.dhn-article-main .dhn-content,
.dhn-article-main .dhn-tags,
.dhn-article-main .dhn-author-box,
.dhn-article-main .dhn-toc,
.dhn-article-main .dhn-newsletter { margin-left: auto; margin-right: auto; }

/* ============================================================
   SOCIAL SHARE
   ============================================================ */
.dhn-share-rail { position: sticky; top: 96px; }
.dhn-share { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.dhn-share-label {
  font-family: var(--dhn-font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--dhn-ink-mute); margin-bottom: 2px; writing-mode: vertical-rl; display: none;
}
.dhn-share-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--dhn-line); background: var(--dhn-surface); color: var(--dhn-ink-soft);
  transition: transform .15s var(--dhn-ease), background .15s, color .15s, border-color .15s;
}
.dhn-share-btn svg { width: 17px; height: 17px; }
.dhn-share-btn:hover { transform: translateY(-2px); color: #fff; }
.dhn-share-facebook:hover { background: #1877f2; border-color: #1877f2; }
.dhn-share-twitter:hover  { background: #0f1419; border-color: #0f1419; }
.dhn-share-linkedin:hover { background: #0a66c2; border-color: #0a66c2; }
.dhn-share-copy:hover { background: var(--dhn-accent); border-color: var(--dhn-accent); }
.dhn-copy-toast {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px);
  background: var(--dhn-ink); color: var(--dhn-bg); font-family: var(--dhn-font-mono); font-size: 11px;
  padding: 5px 10px; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.dhn-share-copy.copied .dhn-copy-toast { opacity: 1; transform: translateX(-50%) translateY(0); }

.dhn-share-inline { display: none; max-width: 720px; margin: 36px auto 0; padding-top: 24px; border-top: 1px solid var(--dhn-line); }
.dhn-share-inline .dhn-share { flex-direction: row; align-items: center; }
.dhn-share-inline .dhn-share-label { writing-mode: horizontal-tb; display: inline-block; margin: 0 4px 0 0; }

/* ============================================================
   META BAR — chuyên mục + chia sẻ + lượt xem (dưới ảnh hero)
   ============================================================ */
.dhn-meta-bar {
  max-width: 720px; margin: 0 auto 30px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--dhn-line);
}
.dhn-meta-bar .dhn-meta-cat {
  background: var(--dhn-accent); color: var(--dhn-accent-ink); font-family: var(--dhn-font-mono);
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 3px; text-transform: uppercase;
  letter-spacing: .05em; text-decoration: none; line-height: 1; white-space: nowrap;
}
.dhn-meta-bar .dhn-meta-cat:hover { filter: brightness(.94); text-decoration: none; }
.dhn-meta-bar .dhn-meta-right { margin-left: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dhn-meta-bar .dhn-share { flex-direction: row; align-items: center; gap: 8px; }
.dhn-meta-bar .dhn-share-label { writing-mode: horizontal-tb; display: inline-block; margin: 0 2px 0 0; }
.dhn-meta-bar .dhn-share-btn { width: 34px; height: 34px; }
.dhn-meta-bar .dhn-share-btn svg { width: 15px; height: 15px; }
.dhn-meta-views {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-family: var(--dhn-font-mono); font-size: 13px; color: var(--dhn-ink-mute);
}
.dhn-meta-views svg { width: 15px; height: 15px; }

/* Breadcrumb nằm trong khối tiêu đề -> thẳng trục với H1 */
.dhn-article-head .dhn-breadcrumb { margin-bottom: 14px; }

/* ============================================================
   NEWSLETTER
   ============================================================ */
.dhn-newsletter {
  position: relative; overflow: hidden;
  border: 1px solid var(--dhn-line); border-radius: var(--dhn-radius-lg);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--dhn-accent) 12%, transparent), transparent 60%),
    var(--dhn-bg-soft);
}
.dhn-newsletter::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--dhn-accent); }
.dhn-newsletter-icon { color: var(--dhn-accent); }
.dhn-newsletter-icon svg { width: 30px; height: 30px; }
.dhn-newsletter-title { font-size: 19px; margin: 0 0 6px; }
.dhn-newsletter-desc { font-size: 14px; color: var(--dhn-ink-soft); margin: 0 0 16px; line-height: 1.55; }
.dhn-newsletter-form { display: flex; gap: 8px; }
.dhn-newsletter-form input {
  flex: 1; min-width: 0; padding: 11px 14px; font: inherit; font-size: 14.5px;
  color: var(--dhn-ink); background: var(--dhn-surface);
  border: 1px solid var(--dhn-line-strong); border-radius: var(--dhn-radius);
}
.dhn-newsletter-form input:focus { outline: none; border-color: var(--dhn-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dhn-accent) 18%, transparent); }
.dhn-newsletter-form button {
  flex-shrink: 0; padding: 11px 20px; font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer;
  color: var(--dhn-accent-ink); background: var(--dhn-accent); border: 1px solid var(--dhn-accent); border-radius: var(--dhn-radius);
  transition: background .15s, transform .12s;
}
.dhn-newsletter-form button:hover { background: var(--dhn-ink); border-color: var(--dhn-ink); color: var(--dhn-bg); }
.dhn-newsletter-form button:active { transform: translateY(1px); }
.dhn-newsletter-msg { font-size: 13px; color: var(--dhn-accent); margin: 10px 0 0; min-height: 1px; }
.dhn-newsletter-msg:empty { margin: 0; }

/* variant: article (full width, icon + body cạnh nhau) */
.dhn-newsletter--article { max-width: 720px; margin: 44px auto 0; display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: 26px 28px; align-items: start; }
.dhn-newsletter--article .dhn-newsletter-icon { padding-top: 4px; }

/* variant: sidebar (dọc, gọn) */
.dhn-newsletter--sidebar { padding: 22px 20px; }
.dhn-newsletter--sidebar .dhn-newsletter-icon { margin-bottom: 10px; }
.dhn-newsletter--sidebar .dhn-newsletter-form { flex-direction: column; }
.dhn-newsletter--sidebar .dhn-newsletter-form button { width: 100%; }

/* variant: block (mặc định) */
.dhn-newsletter--block { padding: 26px 28px; }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.dhn-totop {
  position: fixed; right: 22px; bottom: 22px; z-index: 55;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center;
  background: var(--dhn-accent); color: var(--dhn-accent-ink); border: 0;
  box-shadow: var(--dhn-shadow-hover);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s var(--dhn-ease), transform .25s var(--dhn-ease), visibility .25s;
}
.dhn-totop.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dhn-totop:hover { background: var(--dhn-ink); color: var(--dhn-bg); }
.dhn-totop svg { width: 22px; height: 22px; }

/* ============================================================
   RESPONSIVE — tính năng mới
   ============================================================ */
@media (max-width: 980px) {
  .dhn-hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .dhn-hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .dhn-hero-item { grid-template-columns: 1fr; }
  .dhn-hero-item-media { aspect-ratio: 16/10; }
  .dhn-hero-item:not(:last-child) { padding-bottom: 0; border-bottom: 0; }
}
@media (max-width: 860px) {
  /* Bỏ rail dọc, chuyển share xuống cuối bài */
  .dhn-article-body { display: block; max-width: 720px; }
  .dhn-share-rail { display: none; }
  .dhn-share-inline { display: block; }
  /* Rail đã ẩn -> bỏ phần dịch trái của header/hero để khỏi thụt vào */
  .dhn-article-head, .dhn-hero-img { margin-left: 0; margin-right: 0; }
}
@media (max-width: 680px) {
  .dhn-ticker-inner { gap: 12px; }
  .dhn-hero-side { grid-template-columns: 1fr; }
  .dhn-newsletter--article { grid-template-columns: 1fr; }
  .dhn-newsletter--article .dhn-newsletter-form { flex-direction: column; }
  .dhn-newsletter--article .dhn-newsletter-form button { width: 100%; }
  .dhn-totop { right: 14px; bottom: 14px; }
}

/* ============================================================
   ★ TÍNH NĂNG 1.3.0 — TRANG CHỦ FULL-WIDTH + LAYOUT ĐA DẠNG
   + SIDEBAR TRONG SINGLE
   ============================================================ */

/* Feed full-width: các section xếp dọc, không sidebar */
.dhn-feed { width: 100%; }
.dhn-feed .dhn-section { margin-bottom: 64px; }
.dhn-feed .dhn-section:last-child { margin-bottom: 8px; }

/* Tiêu đề chuyên mục: gạch màu nhận diện ở đầu */
.dhn-feed .dhn-section-head h2 a { color: inherit; text-decoration: none; }
.dhn-feed .dhn-section-head h2 a:hover { color: var(--cat, var(--dhn-accent)); }
.dhn-feed .dhn-section-head .dhn-kicker { background: var(--cat, var(--dhn-accent)); color: #fff; }

/* --- LAYOUT "ROW": dải card đều nhau nằm ngang (4 cột) --- */
.dhn-grid--row { grid-template-columns: repeat(4, 1fr); }

/* --- LAYOUT "MOSAIC": dùng lưới 3 cột + bài lead 2x2 (đã có .is-lead) --- */
.dhn-grid--mosaic { grid-template-columns: repeat(3, 1fr); }

/* --- LAYOUT "LIST": danh sách dọc, mỗi bài là một hàng ảnh + chữ --- */
.dhn-catlist {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 26px 40px;
}
.dhn-hrow { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: start; }
.dhn-hrow-media {
  display: block; aspect-ratio: 4/3; border-radius: var(--dhn-radius);
  overflow: hidden; background: var(--dhn-bg-sunken); position: relative;
}
.dhn-hrow-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--dhn-ease); }
.dhn-hrow:hover .dhn-hrow-media img { transform: scale(1.06); }
.dhn-hrow-media .dhn-noimg { position: absolute; inset: 0; background:
  repeating-linear-gradient(135deg, var(--dhn-bg-soft) 0 10px, var(--dhn-bg-sunken) 10px 20px); }
.dhn-hrow-title { font-size: 18px; line-height: 1.28; margin: 0 0 8px; }
.dhn-hrow-title a {
  color: var(--dhn-ink); text-decoration: none;
  background-image: linear-gradient(var(--cat, var(--dhn-accent)), var(--cat, var(--dhn-accent)));
  background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size .25s var(--dhn-ease);
}
.dhn-hrow-title a:hover { background-size: 100% 2px; }
.dhn-hrow-excerpt { font-size: 14px; color: var(--dhn-ink-soft); line-height: 1.55; margin: 0 0 10px; }

/* ============================================================
   SINGLE — bố cục bài viết + sidebar phải
   ============================================================ */
.dhn-single-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px;
  align-items: start;
}
.dhn-article-col { min-width: 0; }
/* Trong grid này, thân bài lấp đầy cột thay vì tự căn giữa 868px */
.dhn-single-grid .dhn-article-body { max-width: none; margin: 0; }

/* Nội dung đọc căn trái trong cột main -> mép trái thẳng trục với H1/breadcrumb
   (vốn đã được dịch sang phải đúng bằng bề rộng rail + gap) */
.dhn-single-grid .dhn-article-main .dhn-content,
.dhn-single-grid .dhn-article-main .dhn-toc,
.dhn-single-grid .dhn-article-main .dhn-tags,
.dhn-single-grid .dhn-article-main .dhn-author-box,
.dhn-single-grid .dhn-article-main .dhn-newsletter { margin-left: 0; margin-right: auto; }
.dhn-single-grid .dhn-article-main .dhn-content > * { margin-left: 0; margin-right: auto; }

.dhn-single-aside { position: sticky; top: 96px; align-self: start; }
.dhn-single-aside .dhn-widget { margin-bottom: 36px; }
.dhn-single-aside .dhn-widget:last-child { margin-bottom: 0; }

/* Nhãn chuyên mục nhỏ trong widget danh sách (Mới nhất) */
.dhn-list-cat {
  display: inline-block; font-family: var(--dhn-font-mono); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px;
  color: var(--cat, var(--dhn-accent)); text-decoration: none;
}
.dhn-list-cat:hover { text-decoration: underline; }
.dhn-single-aside .dhn-list-item .dhn-thumb,
.dhn-sidebar .dhn-list-item .dhn-thumb {
  flex: 0 0 76px; width: 76px; height: 76px; aspect-ratio: auto; border-radius: var(--dhn-radius);
  overflow: hidden; background: var(--dhn-bg-sunken);
}
/* Canh ảnh giữa theo chiều cao khối tiêu đề + giới hạn tiêu đề 2 dòng cho cân đối */
.dhn-single-aside .dhn-list-item,
.dhn-sidebar .dhn-list-item { align-items: center; }
.dhn-widget .dhn-list-item h4 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dhn-single-aside .dhn-list-cat,
.dhn-sidebar .dhn-list-cat { margin-bottom: 3px; }

/* ============================================================
   RESPONSIVE — layout mới
   ============================================================ */
@media (max-width: 1080px) {
  .dhn-grid--row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  /* Single: sidebar xuống dưới bài, hết sticky */
  .dhn-single-grid { grid-template-columns: 1fr; gap: 8px; }
  .dhn-single-aside { position: static; margin-top: 8px; }
  .dhn-single-aside .dhn-widget { margin-bottom: 28px; }
}
@media (max-width: 860px) {
  .dhn-grid--row { grid-template-columns: repeat(2, 1fr); }
  .dhn-catlist { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 560px) {
  .dhn-grid--row { grid-template-columns: 1fr; }
  .dhn-hrow { grid-template-columns: 116px minmax(0, 1fr); gap: 14px; }
  .dhn-hrow-title { font-size: 16px; }
  .dhn-hrow-excerpt { display: none; }
}

/* --- MOSAIC: co cột theo màn hình (sửa lỗi tràn 3 cột trên mobile) --- */
@media (max-width: 1024px) {
  .dhn-grid--mosaic { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .dhn-grid--mosaic { grid-template-columns: 1fr; }
  /* Bài lead về dạng card thường, ảnh tỉ lệ chuẩn, tiêu đề full chiều rộng */
  .dhn-sec--mosaic .dhn-card.is-lead { grid-column: auto; grid-row: auto; height: auto; }
  .dhn-sec--mosaic .dhn-card.is-lead .dhn-card-media { aspect-ratio: 16/9; flex: none; min-height: 0; }
  .dhn-sec--mosaic .dhn-card.is-lead .dhn-card-title { font-size: 22px; }
}

/* --- SECTION HEAD: gọn gàng, không vỡ trên mobile --- */
@media (max-width: 680px) {
  .dhn-section-head { flex-wrap: wrap; gap: 8px 12px; padding-bottom: 8px; margin-bottom: 18px; }
  .dhn-section-head h2 { font-size: 19px; }
  .dhn-section-head .dhn-kicker { font-size: 10px; padding: 3px 7px; }
  .dhn-section-head .dhn-more { margin-left: auto; font-size: 12px; }
}

/* Nội dung soạn tay trong trang chủ (banner/intro phía trên các khối) */
.dhn-home-intro { margin: 8px 0 40px; }
.dhn-home-intro:empty { display: none; }
.dhn-home-intro > *:first-child { margin-top: 0; }
.dhn-home-intro img { max-width: 100%; height: auto; border-radius: var(--dhn-radius-lg); }

/* Tiêu đề bài viết trên mobile: thu gọn cỡ chữ + dòng byline, giữ thẳng trục
   với ảnh hero và thân bài (bỏ padding 16px cũ vốn gây lệch trái) */
@media (max-width: 680px) {
  .dhn-article-head { margin-bottom: 24px; }
  .dhn-article-head h1 { font-size: clamp(26px, 7vw, 32px); margin-bottom: 12px; }
  .dhn-article-head .dhn-dek { font-size: 17px; }
  .dhn-article-byline { gap: 6px 10px; margin-top: 14px; font-size: 13px; }
  .dhn-article-byline img { width: 28px; height: 28px; }
  .dhn-meta-bar { gap: 12px; margin-bottom: 24px; padding-bottom: 14px; }
  .dhn-meta-bar .dhn-meta-right { width: 100%; margin-left: 0; justify-content: space-between; }
  .dhn-meta-bar .dhn-share-btn { width: 32px; height: 32px; }
}

/* ============================================================
 * Section "Mẹo, thủ thuật" (gom bài đã tick) — cuối các trang mẫu
 * ============================================================ */
.ga-grouped { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--dhn-line, #e6e5e1); }
.ga-grouped .dhn-section-head { margin-bottom: 24px; }
@media (max-width: 680px) {
  .ga-grouped { margin-top: 36px; padding-top: 28px; }
}