/* ============================================================
   HanhPhap.com — App CSS
   Mobile-first, editorial design
   ============================================================ */

/* CSS Variables */
:root {
  --brand:        #1d4ed8;
  --brand-dark:   #1e3a8a;
  --brand-light:  #dbeafe;
  --accent:       #f28c28;
  --accent-dark:  #c46a17;

  --text:         #0f172a;
  --text-soft:    #475569;
  --text-muted:   #94a3b8;

  --bg:           #ffffff;
  --bg-alt:       #f8fafc;
  --bg-card:      #ffffff;
  --border:       #e2e8f0;
  --border-soft:  #f1f5f9;

  --success:      #16a34a;
  --error:        #dc2626;
  --warning:      #d97706;

  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;

  --shadow-sm:    0 1px 2px rgba(15, 23, 42, .04);
  --shadow:       0 4px 12px rgba(15, 23, 42, .06);
  --shadow-lg:    0 16px 40px rgba(15, 23, 42, .10);

  --font-body:    'Be Vietnam Pro', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Be Vietnam Pro', system-ui, sans-serif;

  --topbar-h:     56px;
  --bottom-nav-h: 60px;
  --container:    1200px;
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-top: var(--topbar-h);
  padding-bottom: var(--bottom-nav-h);
}

@media (min-width: 768px) {
  body { padding-bottom: 0; }
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin: 0 0 .6em;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.3rem); }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; margin: 0 0 1em; }
li + li { margin-top: .3em; }

button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Display utilities */
.d-none-mobile { display: none; }
@media (min-width: 768px) { .d-none-mobile { display: initial; } }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s, background .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-alt); border-color: var(--text-muted); color: var(--text); }

.btn-block { display: flex; width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: var(--radius-lg); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  border: none;
  cursor: pointer;
  transition: background .15s;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--brand); }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.topbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 12px;
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 40px; height: 40px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  transition: background .15s;
}
.hamburger:hover { background: var(--bg-alt); }
.hamburger span {
  display: block;
  width: 100%; height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .15s;
}
.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 1024px) {
  .hamburger { display: none; }
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.brand:hover { color: var(--text); }
.brand-logo {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.brand-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.02em;
  color: var(--brand);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-slogan {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 768px) {
  .brand-name { font-size: 18px; }
  .brand-slogan { font-size: 12px; }
}

/* Topbar nav (desktop) */
.topbar-nav {
  flex: 2;
}
.topbar-nav ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  gap: 4px;
}
.topbar-nav a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.topbar-nav a:hover {
  background: var(--brand-light);
  color: var(--brand);
}

/* Topbar actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ============================================================
   Drawer (mobile menu)
   ============================================================ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 199;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0; left: 0;
  width: 85%;
  max-width: 360px;
  height: 100%;
  background: #fff;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform .25s;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.drawer.is-open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
}

.drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.drawer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.drawer-list li {
  margin: 0;
}
.drawer-list a {
  display: block;
  padding: 12px 20px;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-soft);
  transition: background .15s, color .15s;
}
.drawer-list a:hover {
  background: var(--brand-light);
  color: var(--brand);
}

.drawer-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}
.drawer-section-title {
  margin: 0 20px 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.drawer-cta {
  padding: 20px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ============================================================
   Bottom nav (mobile)
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 10px rgba(15, 23, 42, .04);
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: color .15s;
}
.bn-item:hover, .bn-item:active {
  color: var(--brand);
}
.bn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bn-label {
  font-size: 10.5px;
  line-height: 1.1;
}

@media (min-width: 768px) {
  .bottom-nav { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--brand-light) 0%, #fff 100%);
  padding: 32px 0 24px;
}
@media (min-width: 768px) {
  .hero { padding: 56px 0 40px; }
}

.hero-grid {
  display: grid;
  gap: 24px;
}
@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.1fr 1fr;
    gap: 40px;
    align-items: center;
  }
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--brand);
  margin-bottom: 8px;
}
.hero-slogan {
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--text);
  font-weight: 600;
  margin-bottom: 12px;
}
.hero-desc {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 20px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.hero-tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-tags li {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}

.hero-feature {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.hero-feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.hero-feature-link {
  display: block;
  color: var(--text);
  text-decoration: none;
}
.hero-feature-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  background-color: var(--brand-light);
}
.hero-feature-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
}
.hero-feature-tag {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--accent);
  color: #fff;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.hero-feature-body { padding: 16px 20px 20px; }
.hero-feature-body h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}
.hero-feature-body p {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 8px;
}
.hero-feature-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   Sections
   ============================================================ */
.section { padding: 32px 0; }
.section-alt { background: var(--bg-alt); }
@media (min-width: 768px) { .section { padding: 48px 0; } }

.section-head {
  margin-bottom: 24px;
  text-align: center;
}
.section-title {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-bottom: 6px;
}
.section-sub {
  color: var(--text-soft);
  font-size: 14px;
  margin: 0;
}

/* Category grid */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: all .15s;
}
.cat-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--brand);
}
.cat-icon { font-size: 28px; margin-bottom: 8px; }
.cat-name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.cat-count {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   Post grid + cards
   ============================================================ */
.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 600px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-grid--small {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 768px) { .post-grid--small { grid-template-columns: repeat(4, 1fr); } }

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--brand-light);
}
.post-card-link {
  display: block;
  color: var(--text);
  text-decoration: none;
}
.post-card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
  background-color: var(--brand-light);
  overflow: hidden;
}
.post-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
}
.post-card-cat {
  position: absolute;
  bottom: 10px; left: 10px;
  background: rgba(29, 78, 216, .9);
  color: #fff;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}
.post-card-body { padding: 14px 16px 16px; }
.post-card-title {
  font-size: 16px;
  line-height: 1.4;
  margin: 0 0 8px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-excerpt {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.post-card-meta time::before { content: '📅 '; opacity: .6; }
.post-card-read::before { content: '⏱ '; opacity: .6; }

.post-card--small .post-card-body { padding: 12px; }
.post-card--small .post-card-title { font-size: 14px; }
.post-card--small .post-card-excerpt { display: none; }

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
  padding: 14px 0;
  font-size: 13px;
}
.breadcrumb-list {
  list-style: none;
  padding: 0; margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}
.breadcrumb-item { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb-item a { color: var(--text-soft); }
.breadcrumb-item a:hover { color: var(--brand); }
.breadcrumb-item.is-current span { color: var(--text); font-weight: 500; }
.breadcrumb-sep { color: var(--text-muted); }

/* ============================================================
   Page head + content layout
   ============================================================ */
.page-head {
  margin-bottom: 20px;
}
.page-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 8px;
}
.page-desc {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 8px;
}
.page-meta {
  color: var(--text-muted);
  font-size: 13px;
}

.content-layout {
  display: grid;
  gap: 32px;
  margin-bottom: 32px;
}
@media (min-width: 1024px) {
  .content-layout {
    grid-template-columns: 1fr 320px;
    gap: 40px;
  }
}
.content-main { min-width: 0; }

/* ============================================================
   Post article (single)
   ============================================================ */
.post-article {
  background: #fff;
}
.post-header {
  margin-bottom: 20px;
}
.post-cat-link {
  display: inline-block;
  padding: 4px 12px;
  background: var(--brand-light);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.post-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.25;
  margin-bottom: 12px;
}
.post-lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 16px;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.post-meta-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-weight: 500;
}

.post-featured {
  margin: 24px 0;
}
.post-featured img {
  width: 100%;
  border-radius: var(--radius-lg);
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Post body: editorial typography */
.post-body {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text);
}
.post-body > .lead {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-soft);
  margin-bottom: 1.5em;
  padding-bottom: 1.5em;
  border-bottom: 1px solid var(--border);
}
.post-body h2 {
  font-size: 1.5em;
  margin-top: 2em;
  margin-bottom: .7em;
  padding-top: .3em;
  color: var(--text);
}
.post-body h3 {
  font-size: 1.2em;
  margin-top: 1.6em;
  margin-bottom: .6em;
  color: var(--text);
}
.post-body p { margin-bottom: 1.1em; }
.post-body ul, .post-body ol { margin-bottom: 1.2em; padding-left: 1.5em; }
.post-body li { margin-bottom: .4em; }
.post-body strong { color: var(--text); font-weight: 700; }
.post-body a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.post-body a:hover { background: var(--brand-light); }
.post-body blockquote {
  border-left: 4px solid var(--brand);
  margin: 1.2em 0;
  padding: 4px 0 4px 20px;
  color: var(--text-soft);
  font-style: italic;
  background: var(--bg-alt);
}
.post-body em {
  color: var(--text-muted);
  font-style: italic;
}
.post-body img {
  border-radius: var(--radius);
  margin: 1em 0;
}

.post-tags {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.post-tags-label { color: var(--text-muted); font-size: 13px; margin-right: 4px; }
.post-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--bg-alt);
  color: var(--text-soft);
  font-size: 12px;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.post-tag:hover { background: var(--brand-light); color: var(--brand); }

.post-inline-cta {
  margin: 32px 0;
  padding: 24px;
  background: linear-gradient(135deg, var(--brand-light), #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.post-inline-cta h3 { font-size: 1.1rem; margin-bottom: 6px; color: var(--brand); }
.post-inline-cta p { color: var(--text-soft); margin-bottom: 14px; font-size: 14px; }

.post-related {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.post-related .section-title {
  text-align: left;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: start;
}
@media (min-width: 1024px) {
  .sidebar { position: sticky; top: calc(var(--topbar-h) + 16px); }
}

.sidebar-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.sidebar-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-soft);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand);
}
.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  color: var(--text);
  font-size: 14px;
  border-bottom: 1px solid var(--border-soft);
}
.sidebar-list a:hover { color: var(--brand); }
.sidebar-list li:last-child a { border-bottom: 0; }
.sidebar-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 1px 8px;
  border-radius: 999px;
}
.sidebar-posts {
  list-style: none;
  padding: 0; margin: 0;
}
.sidebar-posts li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  margin: 0;
}
.sidebar-posts li:last-child { border-bottom: 0; }
.sidebar-rank {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-light);
  color: var(--brand);
  font-weight: 700;
  font-size: 12px;
  border-radius: 50%;
}
.sidebar-posts a {
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.4;
}
.sidebar-posts a:hover { color: var(--brand); }

.sidebar-cta {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border: none;
}
.sidebar-cta .sidebar-cta-title {
  color: #fff;
  font-size: 17px;
  margin-bottom: 8px;
}
.sidebar-cta-text {
  color: rgba(255,255,255,.85);
  font-size: 13px;
  margin-bottom: 12px;
}
.sidebar-hotline {
  margin-top: 10px;
  text-align: center;
  color: rgba(255,255,255,.85);
  font-size: 13px;
}
.sidebar-hotline a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
}

/* ============================================================
   CTA form
   ============================================================ */
.cta-section {
  padding: 32px 0 48px;
}
@media (min-width: 768px) { .cta-section { padding: 48px 0 64px; } }

.cta-card {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}
@media (min-width: 768px) { .cta-card { padding: 36px 40px; } }

.cta-head {
  text-align: center;
  margin-bottom: 24px;
}
.cta-head h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  margin-bottom: 8px;
  color: var(--brand);
}
.cta-head p { color: var(--text-soft); font-size: 14px; margin: 0; }

.cta-row {
  display: grid;
  gap: 12px;
}
@media (min-width: 600px) { .cta-row { grid-template-columns: 1fr 1fr; gap: 16px; } }

.cta-field {
  margin-bottom: 14px;
}
.cta-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.cta-field .req { color: var(--error); }
.cta-field input,
.cta-field textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.cta-field input:focus,
.cta-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
.cta-field textarea { resize: vertical; min-height: 90px; }

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.cta-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.cta-or {
  color: var(--text-muted);
  font-size: 12px;
}

.cta-status {
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  min-height: 1.2em;
}
.cta-status.is-success { color: var(--success); }
.cta-status.is-error { color: var(--error); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: #0f172a;
  color: rgba(255,255,255,.78);
  padding: 40px 0 80px;
  margin-top: 40px;
}
@media (min-width: 768px) { .site-footer { padding: 56px 0 32px; } }

.footer-grid {
  display: grid;
  gap: 28px;
  margin-bottom: 28px;
}
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-col h4 {
  color: #fff;
  font-size: 14px;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.footer-col .brand-name { color: #fff; }
.footer-tagline {
  color: rgba(255,255,255,.9);
  font-size: 14px;
  margin: 10px 0 8px;
  font-weight: 500;
}
.footer-desc {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  line-height: 1.6;
}
.footer-list {
  list-style: none;
  padding: 0; margin: 0;
}
.footer-list li {
  margin-bottom: 8px;
  font-size: 13.5px;
}
.footer-list a {
  color: rgba(255,255,255,.78);
}
.footer-list a:hover { color: #fff; }
.footer-label {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 2px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  font-size: 12px;
  color: rgba(255,255,255,.55);
  text-align: center;
}
.footer-bottom p { margin: 0 0 6px; }
.footer-disclaimer { font-style: italic; }

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 32px 0;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all .15s;
}
.page-link:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.page-link.is-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.page-gap {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  color: var(--text-muted);
}

/* ============================================================
   Search form
   ============================================================ */
.search-form {
  display: flex;
  gap: 8px;
  max-width: 600px;
  margin-top: 12px;
}
.search-form input {
  flex: 1;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.search-form input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
.search-meta {
  color: var(--text-soft);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ============================================================
   Empty state & error
   ============================================================ */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  background: var(--bg-alt);
  border-radius: var(--radius);
  color: var(--text-soft);
}

.error-page {
  text-align: center;
  padding: 80px 20px;
}
.error-code {
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 800;
  color: var(--brand-light);
  line-height: 1;
  letter-spacing: -.04em;
}
.error-page h1 { font-size: 1.6rem; margin: 12px 0; }
.error-page p { color: var(--text-soft); margin-bottom: 24px; }
.error-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   Page article (legal, about)
   ============================================================ */
.page-article {
  max-width: 800px;
  margin: 0 auto 40px;
  padding: 20px 0;
  font-size: 16px;
  line-height: 1.75;
}
.page-article h1 {
  margin-bottom: 16px;
}
.page-article h2 {
  margin-top: 1.8em;
  margin-bottom: .6em;
  font-size: 1.3em;
}
.page-article .lead {
  font-size: 17px;
  color: var(--text-soft);
  font-weight: 500;
  margin-bottom: 1.5em;
}
.page-article ul, .page-article ol { margin-bottom: 1em; }
.page-article a { text-decoration: underline; text-underline-offset: 3px; }

/* Contact grid */
.contact-grid {
  display: grid;
  gap: 32px;
  margin-bottom: 40px;
}
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1.2fr; align-items: start; } }
.contact-list {
  list-style: none;
  padding: 0;
}
.contact-list li {
  margin-bottom: 16px;
  font-size: 15px;
}
.contact-list strong {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  margin-bottom: 2px;
}

/* ============================================================
   Print
   ============================================================ */
@media print {
  .topbar, .bottom-nav, .drawer, .drawer-backdrop, .cta-section, .post-inline-cta, .sidebar { display: none !important; }
  body { padding: 0; }
  .container { max-width: 100%; }
}

/* ============================================================
   Tag cloud (frontend - Phase 2)
   ============================================================ */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 6px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  line-height: 1.7;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 4px 12px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.15s;
}

.tag-cloud-item:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: translateY(-1px);
}

.tag-cloud-count {
  font-size: 0.7em;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 2px;
}

.tag-cloud-item:hover .tag-cloud-count {
  color: rgba(255,255,255,0.8);
}

/* Sidebar tags */
.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.sidebar-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--bg-alt);
  color: var(--text-soft);
  font-size: 12px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.15s;
}

.sidebar-tag:hover {
  background: var(--brand);
  color: #fff;
}

.sidebar-tag-all {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--brand);
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  text-decoration: none;
}

.sidebar-tag-all:hover {
  text-decoration: underline;
}

/* ============================================================
   FRONTEND FIX 3 — Topbar hotline + Bottom-nav iOS
   ============================================================ */

/* 1. Hotline button trên topbar gọn lại + chỉ hiện ≥1100px */
.topbar-actions .btn-accent {
  padding: 8px 12px;
  font-size: 13px;
}

/* Tablet (768-1099): chỉ hiện icon, ẩn text */
@media (max-width: 1099px) {
  .topbar-actions .btn-accent {
    display: none;
  }
}

/* Brand không expand quá → tránh chèn hotline button */
.brand {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 65%;
}

.brand-text {
  min-width: 0;
}

.brand-name {
  display: block;
  max-width: 100%;
}

@media (max-width: 600px) {
  .brand-slogan { display: none !important; }
  .brand-name { font-size: 15px; }
}

/* Topbar inner gap nhỏ hơn để brand có chỗ */
.topbar-inner {
  gap: 8px;
}

/* 2. Bottom-nav: height fix gồm safe-area, không co */
.bottom-nav {
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  /* Trên iOS khi scroll, bottom-nav giữ height này, không co */
}

.bn-item {
  height: var(--bottom-nav-h);
}

/* Body padding bottom theo full bottom-nav height */
@media (max-width: 767px) {
  body {
    padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  }
}


/* ============================================================
   Footer social
   ============================================================ */
.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 50%;
  transition: background 0.15s, transform 0.15s;
}

.footer-social-link:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}

/* ============================================================
   FIX 4 — Hamburger right + Search overlay + Footer ecosystem
   ============================================================ */

/* 1. Hamburger sang phải, drawer trượt từ phải */
/* Hamburger hiển thị từ mobile đến tablet ≤1023px */
.hamburger {
  display: flex !important;
  order: 99; /* luôn cuối */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  gap: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger:hover {
  background: var(--bg-alt);
}

@media (min-width: 1024px) {
  .hamburger {
    display: none !important;
  }
}

/* Topbar inner: brand trái, actions phải */
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  order: 1;
  flex: 0 1 auto;
}

.topbar-nav {
  order: 2;
  flex: 1 1 auto;
  justify-content: center;
}

.topbar-actions {
  order: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Drawer trượt từ PHẢI */
.drawer {
  position: fixed;
  top: 0;
  right: 0;          /* phải */
  left: auto;
  width: min(360px, 85vw);
  height: 100vh;
  background: #fff;
  z-index: 200;
  transform: translateX(100%);   /* ẩn bên phải */
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  box-shadow: -8px 0 30px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.drawer-nav {
  flex: 1;
  padding: 12px 0;
}

.drawer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.drawer-list li a {
  display: block;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s;
}

.drawer-list li a:hover,
.drawer-list li a:active {
  background: var(--bg-alt);
  color: var(--brand);
}

.drawer-section {
  margin-top: 16px;
}

.drawer-section-title {
  padding: 8px 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0;
}

.drawer-cta {
  padding: 16px 20px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

/* 2. SEARCH OVERLAY — fullscreen với backdrop blur */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: 12vh;
}

.search-overlay.is-open {
  display: flex;
}

.search-overlay-inner {
  width: min(680px, 92vw);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  overflow: hidden;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
}

.search-overlay-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.search-overlay-form svg.search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
}

.search-overlay-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  padding: 4px 0;
  min-width: 0;
}

.search-overlay-input::placeholder {
  color: var(--text-muted);
}

.search-overlay-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

@media (max-width: 600px) {
  .search-overlay-close { display: none; }
}

.search-overlay-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.12s;
}

.search-result-item:hover,
.search-result-item.is-active {
  background: var(--bg-alt);
}

.search-result-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--bg-alt) center/cover no-repeat;
  flex-shrink: 0;
  border: 1px solid var(--border-soft);
}

.search-result-body {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.search-result-meta strong {
  font-weight: 500;
  color: var(--brand);
}

.search-empty,
.search-loading {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.search-loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.search-footer-hint {
  padding: 8px 16px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.search-footer-hint kbd {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 10px;
  font-weight: 600;
}

/* 3. FOOTER ECOSYSTEM credit */
.footer-ecosystem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 14px 12px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  text-align: center;
}

.footer-ecosystem-label {
  color: rgba(255,255,255,0.7);
  font-size: 12.5px;
}

.footer-ecosystem-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  transition: background 0.15s, transform 0.15s;
}

.footer-ecosystem-link:hover {
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  transform: translateY(-1px);
}

.footer-eco-logo {
  font-size: 14px;
}

.footer-eco-name {
  font-size: 13px;
  letter-spacing: 0.01em;
}

.footer-ecosystem-vdd {
  color: rgba(255,255,255,0.7);
  font-size: 12.5px;
}

.footer-ecosystem-vdd strong {
  color: #fff;
  font-weight: 600;
}

@media (max-width: 480px) {
  .footer-ecosystem {
    flex-direction: column;
    gap: 8px;
  }
  .footer-ecosystem-vdd {
    margin-top: 4px;
  }
}

.footer-copyright {
  text-align: center;
  font-size: 12.5px;
  color: rgba(255,255,255,0.6);
  margin: 8px 0 4px;
}

.footer-disclaimer {
  text-align: center;
  font-size: 11.5px;
  color: rgba(255,255,255,0.5);
  margin: 8px 0 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}


/* --- Drawer menu auto polish --- */
.drawer-list .drawer-item { padding: 0; }
.drawer-list .drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  tr
  font-size: 15px;
  line-height: 1.3;
}
.drawer-list .drawer-link:hover,
.drawer-list .drawer-link:active {
  background: rgba(0,0,0,0.04);
}
.drawer-icon {
  flex: 0 0 24px;
  font-size: 18px;
  text-align: center;
  line-height: 1;
}
.drawer-label {
  flex: 1 1 auto;
  font-weight: 500;
}
.drawer-count {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: rgba(0,0,0,0.5);
  background: rgba(0,0,0,0.06);
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}
