/* ─── RESET & BASE ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rose:     #F2A5B0;
  --rose-d:   #D9637A;
  --rose-bg:  #FEF0F2;
  --sage:     #7BAD7E;
  --sage-d:   #4E8A52;
  --sage-bg:  #EBF5EC;
  --peach:    #FFAD84;
  --peach-d:  #C05A1A;
  --peach-bg: #FFF4ED;
  --purple:   #A78BCA;
  --purple-bg:#F3EEFB;
  --cream:    #FDF8F4;
  --warm:     #FAF0E8;
  --brown:    #3D2314;
  --text:     #2D2020;
  --muted:    #7A6A66;
  --border:   #EDE0D8;
  --light:    #F6F0EC;
  --white:    #FFFFFF;
  --shadow-s: 0 2px 8px rgba(61,35,20,.07);
  --shadow-m: 0 4px 20px rgba(61,35,20,.10);
  --r:        16px;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background: var(--cream); color: var(--text);
  font-size: 16px; line-height: 1.65;
  padding-bottom: 72px;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) { body { padding-bottom: 0; } }

/* ─── HEADER ─────────────────────────────────────────────── */
.top-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(253,248,244,.96);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.top-header-inner {
  max-width: 1180px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; height: 66px; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.logo-icon {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #F7C5CE, var(--rose-d));
  display: grid; place-items: center; font-size: 20px; flex-shrink: 0;
}
.logo-name { font-family: 'Nunito', sans-serif; font-size: 16px; font-weight: 800; color: var(--brown); line-height: 1.15; }
.logo-sub  { font-size: 11px; color: var(--muted); }

.desktop-nav { display: none; align-items: center; gap: 2px; }
@media (min-width: 900px) { .desktop-nav { display: flex; } }

/* Top-level links & nav-item wrapper */
.desktop-nav > a,
.desktop-nav .nav-item > a {
  padding: 7px 14px; border-radius: 22px;
  font-size: 14px; font-weight: 500; color: var(--text);
  text-decoration: none; transition: all .18s; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}
.desktop-nav > a:hover,
.desktop-nav .nav-item:hover > a { background: var(--rose-bg); color: var(--rose-d); }
.desktop-nav > a.active,
.desktop-nav .nav-item > a.active { background: var(--rose-d); color: var(--white); font-weight: 600; }

/* Chevron icon */
.nav-chevron {
  font-size: 10px; opacity: .55;
  transition: transform .2s; display: inline-block;
}
.desktop-nav .nav-item:hover .nav-chevron { transform: rotate(180deg); opacity: 1; }

/* Dropdown wrapper */
.nav-item { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 210px; background: var(--white);
  border-radius: 18px; border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(61,35,20,.13);
  padding: 8px 0;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s, transform .18s, visibility .18s;
  z-index: 300;
}
/* Tail arrow */
.dropdown::before {
  content: ''; position: absolute; top: -6px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: var(--white); border: 1px solid var(--border);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  border-radius: 2px 0 0 0;
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; font-size: 13.5px; font-weight: 500;
  color: var(--text); text-decoration: none;
  transition: background .15s, color .15s;
  border-radius: 0; white-space: nowrap;
}
.dropdown a:hover { background: var(--rose-bg); color: var(--rose-d); }
.dropdown a .dd-emoji { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border); margin: 6px 12px; }
.dropdown a.dd-all {
  font-weight: 700; color: var(--rose-d); font-size: 13px;
  border-top: 1px solid var(--border); margin-top: 4px; padding-top: 12px;
}

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-icon {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: var(--light); cursor: pointer;
  display: grid; place-items: center; font-size: 17px; transition: background .18s;
}
.btn-icon:hover { background: var(--rose-bg); }
.btn-follow {
  display: none; padding: 8px 18px; border-radius: 22px; border: none;
  background: var(--rose-d); color: var(--white);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 13.5px; font-weight: 600; cursor: pointer; transition: opacity .18s;
}
.btn-follow:hover { opacity: .85; }
@media (min-width: 600px) { .btn-follow { display: block; } }
.btn-ham {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: var(--light); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 5px; padding: 10px;
}
.btn-ham span { display: block; height: 2px; width: 18px; background: var(--brown); border-radius: 2px; }
@media (min-width: 900px) { .btn-ham { display: none; } }

/* ─── DRAWER ACCORDION ───────────────────────────────────── */
.drawer-group { margin-bottom: 4px; }
.drawer-group-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; border-radius: 14px; border: none; background: transparent;
  font-family: 'Be Vietnam Pro', sans-serif; font-size: 15px; font-weight: 500;
  color: var(--text); cursor: pointer; transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.drawer-group-btn:hover,
.drawer-group-btn[aria-expanded="true"] { background: var(--rose-bg); color: var(--rose-d); }
.drawer-chevron { font-size: 12px; transition: transform .22s; opacity: .6; }
.drawer-group-btn[aria-expanded="true"] .drawer-chevron { transform: rotate(180deg); opacity: 1; }
.drawer-sub {
  max-height: 0; overflow: hidden; transition: max-height .28s ease;
  padding-left: 14px;
}
.drawer-sub.open { max-height: 400px; }
.drawer-sub a {
  display: block; padding: 9px 14px; border-radius: 10px;
  font-size: 14px; color: var(--muted); text-decoration: none;
  transition: background .15s, color .15s;
}
.drawer-sub a:hover { background: var(--rose-bg); color: var(--rose-d); }

/* ─── BOTTOM NAV (mobile) ─────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: stretch;
  height: 64px; padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 768px) { .bottom-nav { display: none; } }
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; text-decoration: none;
  color: var(--muted); font-size: 10px; font-weight: 500;
  transition: color .15s; padding: 6px 2px;
  -webkit-tap-highlight-color: transparent;
}
.bnav-item.active { color: var(--rose-d); }
.bnav-icon { font-size: 22px; line-height: 1; }
.bnav-item.active .bnav-icon { background: var(--rose-bg); border-radius: 12px; padding: 2px 10px; }

/* ─── DRAWER ──────────────────────────────────────────────── */
.drawer-overlay { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.4); }
.drawer-overlay.open { display: block; }
.drawer {
  position: fixed; top: 0; left: -280px; bottom: 0; width: 275px; z-index: 301;
  background: var(--white); padding: 24px; transition: left .25s ease; overflow-y: auto;
}
.drawer.open { left: 0; }
.drawer-close {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--light); cursor: pointer; font-size: 18px;
  display: grid; place-items: center; margin-bottom: 24px;
}
.drawer nav a {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px;
  font-size: 15px; font-weight: 500; color: var(--text);
  text-decoration: none; transition: background .15s; margin-bottom: 4px;
}
.drawer nav a:hover, .drawer nav a.active { background: var(--rose-bg); color: var(--rose-d); }
.drawer nav a .nav-emoji { font-size: 20px; width: 28px; text-align: center; }

/* ─── PAGE WRAP ────────────────────────────────────────────── */
.page-wrap {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
}

/* ─── BREADCRUMB ──────────────────────────────────────────── */
/* Dùng được cho cả <nav class="breadcrumb"> và <ol class="breadcrumb"> */
nav.breadcrumb,
.cat-breadcrumb {
  max-width: 1180px; margin: 0 auto; padding: 12px 20px 0;
  font-size: 13px; color: var(--muted);
}

/* ol có thể là .breadcrumb trực tiếp hoặc con của .breadcrumb / .cat-breadcrumb */
ol.breadcrumb,
.breadcrumb ol,
.cat-breadcrumb ol {
  list-style: none;
  display: flex; align-items: center; gap: 0;
  flex-wrap: nowrap; overflow: hidden;
  white-space: nowrap;
}

ol.breadcrumb li,
.breadcrumb ol li,
.cat-breadcrumb ol li {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0; /* Home & category cố định */
}

/* Item cuối (tên bài/danh mục hiện tại) — được phép truncate */
ol.breadcrumb li:last-child,
.breadcrumb ol li:last-child,
.cat-breadcrumb ol li:last-child {
  flex-shrink: 1; min-width: 0;
}
ol.breadcrumb li:last-child > *,
.breadcrumb ol li:last-child > *,
.cat-breadcrumb ol li:last-child > * {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 380px; display: block;
}

/* Separators */
ol.breadcrumb li + li::before,
.breadcrumb ol li + li::before,
.cat-breadcrumb ol li + li::before {
  content: "›"; color: var(--border);
  margin-right: 4px; flex-shrink: 0;
}

.breadcrumb a, .cat-breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover, .cat-breadcrumb a:hover { color: var(--rose-d); }
.breadcrumb [aria-current], .cat-breadcrumb [aria-current] { color: var(--rose-d); font-weight: 500; }

/* ─── SEARCH MODAL ───────────────────────────────────────── */
.search-modal {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 80px;
  visibility: hidden; pointer-events: none;
}
.search-modal.open { visibility: visible; pointer-events: auto; }

.search-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(45,32,32,.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .22s;
}
.search-modal.open .search-modal-backdrop { opacity: 1; }

.search-modal-box {
  position: relative; z-index: 1;
  width: min(640px, calc(100vw - 32px));
  background: var(--white); border-radius: 20px;
  box-shadow: 0 20px 60px rgba(61,35,20,.18);
  padding: 24px 24px 20px;
  transform: translateY(-16px) scale(.97);
  opacity: 0; transition: transform .22s, opacity .22s;
}
.search-modal.open .search-modal-box {
  transform: translateY(0) scale(1); opacity: 1;
}

.search-modal-form {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--border); border-radius: 14px;
  padding: 4px 6px 4px 16px;
  transition: border-color .18s;
}
.search-modal-form:focus-within { border-color: var(--rose-d); }
.search-modal-icon { font-size: 18px; flex-shrink: 0; }
.search-modal-form input[type="search"] {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 16px; color: var(--text); padding: 10px 0;
}
.search-modal-form input[type="search"]::placeholder { color: var(--muted); }
.search-modal-submit {
  padding: 9px 20px; border-radius: 10px; border: none;
  background: var(--rose-d); color: var(--white);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px; font-weight: 600; cursor: pointer;
  flex-shrink: 0; transition: opacity .18s;
}
.search-modal-submit:hover { opacity: .85; }

.search-modal-tips {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; font-size: 13px; flex-wrap: wrap;
}
.search-modal-tips span { color: var(--muted); }
.search-modal-tips a {
  padding: 4px 12px; border-radius: 20px;
  background: var(--rose-bg); color: var(--rose-d);
  text-decoration: none; font-size: 13px; font-weight: 500;
  transition: background .15s;
}
.search-modal-tips a:hover { background: var(--rose); color: var(--white); }

.search-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--light); color: var(--muted);
  font-size: 14px; cursor: pointer; line-height: 1;
  display: grid; place-items: center; transition: background .15s;
}
.search-modal-close:hover { background: var(--border); }

/* ─── FOOTER ──────────────────────────────────────────────── */
footer { background: var(--brown); padding: 52px 20px 32px; }
@media (min-width: 768px) { footer { padding: 60px 24px 36px; } }
.footer-inner { max-width: 1180px; margin: 0 auto; }
.footer-top { display: grid; gap: 36px; grid-template-columns: 1fr; margin-bottom: 40px; }
@media (min-width: 600px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .footer-top { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-brand p { font-size: 14px; line-height: 1.8; color: rgba(253,248,244,.6); margin-top: 14px; }
.socials { display: flex; gap: 10px; margin-top: 18px; }
.social-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.1); display: grid; place-items: center;
  font-size: 17px; cursor: pointer; transition: background .18s;
  text-decoration: none; border: 1px solid rgba(255,255,255,.15);
}
.social-btn:hover { background: var(--rose-d); }
.footer-col h4 { font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 800; color: #FDF8F4; margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col ul li a { text-decoration: none; color: rgba(253,248,244,.6); font-size: 14px; transition: color .15s; }
.footer-col ul li a:hover { color: var(--rose); }
.footer-brand .logo-name { color: #FDF8F4; }
.footer-brand .logo-sub  { color: rgba(253,248,244,.55); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 22px;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
  text-align: center; font-size: 13px; color: rgba(253,248,244,.38);
}
@media (min-width: 600px) { .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; gap: 0; } }

/* ─── COMMON COMPONENTS ───────────────────────────────────── */
/* Highlight box */
.highlight-box {
  background: var(--sage-bg); border: 1px solid #B8DDB9;
  border-radius: 14px; padding: 16px 20px; margin: 24px 0;
}
.highlight-box p:last-child { margin-bottom: 0; }
.highlight-box .hb-title { font-weight: 700; color: var(--sage-d); margin-bottom: 8px; font-size: 14px; }

/* Warning box */
.warn-box {
  background: #FFF8E7; border: 1px solid #F5D79E;
  border-radius: 14px; padding: 16px 20px; margin: 24px 0;
}
.warn-box p:last-child { margin-bottom: 0; }
.warn-box .hb-title { font-weight: 700; color: #B45309; margin-bottom: 8px; font-size: 14px; }

/* Pros/cons */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
@media (max-width: 500px) { .pros-cons { grid-template-columns: 1fr; } }
.pros-card, .cons-card { border-radius: 14px; padding: 16px; }
.pros-card { background: var(--sage-bg); border: 1px solid #B8DDB9; }
.cons-card { background: var(--rose-bg); border: 1px solid #F7C5CE; }
.pros-card h4 { color: var(--sage-d); font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.cons-card h4 { color: var(--rose-d); font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.pros-card ul, .cons-card ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* Screen reader only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.hidden { display: none !important; }
