/* ==========================================================================
   Ky nang phong chong thien tai - Xa Thuong Duc
   He thong giao dien cho nguoi dan: chu to, tuong phan cao, vung bam rong,
   uu tien dien thoai. Ho tro che do sang/toi.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Mau thuong hieu */
  --brand: #0a5cb8;
  --brand-strong: #084a95;
  --brand-soft: #e8f1fc;
  --danger: #d92d20;
  --danger-soft: #fdeceb;

  /* Be mat + chu */
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #111827;
  --text-soft: #4b5563;
  --muted: #6b7280;
  --border: #e3e8ef;
  --border-strong: #cfd6e0;

  /* Mau chuyen de mac dinh (tung the ghi de bang style="--cat: R G B") */
  --cat: 10 92 184;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow: 0 4px 12px rgba(16, 24, 40, 0.07), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12), 0 4px 8px rgba(16, 24, 40, 0.05);

  --header-h: 60px;
  --maxw: 1080px;
  --maxw-wide: 1220px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* 17px: nguoi cao tuoi doc tren dien thoai */
  font-size: 17px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.muted { color: var(--muted); }

.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;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  transition: top 0.15s;
}
.skip-link:focus { top: 8px; }

/* ---------------------------------------------------------------- Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  max-width: var(--maxw-wide);
  margin: 0 auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  min-height: 44px;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  overflow: hidden;
  background: var(--brand);
  color: #fff;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 1rem; letter-spacing: -0.015em; }
.brand-text small { color: var(--muted); font-size: 0.775rem; }

.main-nav {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}

.nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav-link:hover { text-decoration: none; color: var(--text); }
.nav-link.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.nav-link .icon { width: 1.15em; height: 1.15em; }

@media (min-width: 720px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 16px;
  }
  .main-nav { flex: none; }
  .nav-link { padding: 0 16px; font-size: 0.95rem; }
  .brand-text strong { font-size: 1.075rem; }
}

/* ------------------------------------------------------------------ Main */

.main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 16px 40px;
}
.main-wide { max-width: var(--maxw-wide); }

.page-home .main { padding-top: 0; }

/* ------------------------------------------------------------ Breadcrumb */

.breadcrumb { margin: 6px 0 14px; }
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li:not(:last-child)::after {
  content: "›";
  margin: 0 8px;
  color: var(--border-strong);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb li[aria-current] {
  color: var(--text-soft);
  font-weight: 600;
  /* Tieu de dai khong lam vo hang tren dien thoai */
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------- Page head */

.page-head { margin-bottom: 20px; }
.page-head h1 {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
}
.page-lead {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: 1rem;
  max-width: 62ch;
}

.page-head-cat {
  display: flex;
  align-items: center;
  gap: 14px;
}
.page-head-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 15px;
  background: rgb(var(--cat));
  color: #fff;
  box-shadow: 0 8px 20px -6px rgb(var(--cat) / 0.7);
}
.page-head-icon .icon { width: 30px; height: 30px; }
.page-head-cat .page-lead { margin-top: 2px; font-size: 0.95rem; }

.page-head-detail { margin-bottom: 16px; }
.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  padding: 5px 12px 5px 8px;
  border-radius: 999px;
  background: rgb(var(--cat) / 0.1);
  color: rgb(var(--cat));
  font-size: 0.82rem;
  font-weight: 700;
}
.page-kicker-icon { display: flex; }
.page-kicker-icon .icon { width: 17px; height: 17px; }
.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------ Hero */

.hero {
  position: relative;
  overflow: hidden;
  margin: 0 -16px 24px;
  padding: 28px 16px 32px;
  background: linear-gradient(120deg, #4f46e5 0%, #0ea5e9 55%, #22c55e 100%);
  color: #fff;
}
.hero::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -90px;
  left: 18%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.hero-inner { position: relative; max-width: var(--maxw); margin: 0 auto; }
.hero-eyebrow {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.hero h1 {
  font-size: clamp(1.75rem, 6.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.hero-lead {
  margin: 12px 0 20px;
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.02rem;
}

@media (min-width: 720px) {
  .hero { margin: 0 0 28px; padding: 44px 32px 48px; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
}

/* ---------------------------------------------------------------- Search */

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 6px 6px 0;
  box-shadow: var(--shadow-lg);
  max-width: 520px;
}
.search-icon {
  position: absolute;
  left: 16px;
  display: flex;
  color: var(--muted);
  pointer-events: none;
}
.search-icon svg { width: 20px; height: 20px; }
.search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 6px 0 46px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid rgba(255, 255, 255, 0.7); outline-offset: 2px; }
.search input::-webkit-search-cancel-button { display: none; }

.search-btn {
  flex: none;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.search-btn:hover { background: #1e293b; }

.search-clear {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.search-clear:hover { background: var(--border); }

.search-results {
  margin-top: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 520px;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--surface-2); text-decoration: none; }
.search-result-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  background: rgb(var(--cat));
  color: #fff;
}
.search-result-icon .icon { width: 21px; height: 21px; }
.search-result-text { min-width: 0; }
.search-result-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result-cat { display: block; font-size: 0.8rem; color: var(--muted); }
.search-empty { padding: 20px 16px; text-align: center; color: var(--muted); font-size: 0.95rem; }

/* ----------------------------------------------------------- Topic chips */

.section { margin-bottom: 32px; }
.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.topic-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 560px) { .topic-chips { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 880px) { .topic-chips { grid-template-columns: repeat(6, 1fr); } }

.topic-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 8px;
  min-height: 104px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.topic-chip:hover {
  text-decoration: none;
  transform: translateY(-4px);
  border-color: rgb(var(--cat) / 0.5);
  box-shadow: 0 16px 30px -12px rgb(var(--cat) / 0.45);
}
.topic-chip-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: rgb(var(--cat));
  color: #fff;
  box-shadow: 0 8px 18px -6px rgb(var(--cat) / 0.7);
}
.topic-chip-icon .icon { width: 28px; height: 28px; }
.topic-chip-text { font-size: 0.85rem; font-weight: 600; line-height: 1.3; }

/* ----------------------------------------------------------- Entry cards */

.entry-cards {
  display: grid;
  gap: 12px;
}
@media (min-width: 720px) { .entry-cards { grid-template-columns: 1fr 1fr; } }

.entry-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.entry-card:hover {
  text-decoration: none;
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}
.entry-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 15px;
  background: var(--brand-soft);
  color: var(--brand);
}
.entry-icon svg { width: 28px; height: 28px; }
.entry-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.entry-body strong { font-size: 1.05rem; }
.entry-meta { font-size: 0.82rem; font-weight: 600; color: var(--brand); }
.entry-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
.entry-arrow { margin-left: auto; color: var(--muted); font-size: 1.3rem; flex: none; }

/* ------------------------------------------------------------- Emergency */

.emergency {
  padding: 20px;
  background: linear-gradient(120deg, #fff7ed, #fdeceb);
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
}
.emergency h2 { font-size: 1.1rem; color: #c2410c; }
.emergency > p { margin: 6px 0 14px; font-size: 0.92rem; color: var(--text-soft); }

.emergency-list, .hotline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (min-width: 560px) {
  .emergency-list, .hotline-list { grid-template-columns: repeat(4, 1fr); }
}
.emergency-list a, .hotline-list a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 62px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-align: center;
}
.emergency-list a:hover, .hotline-list a:hover {
  text-decoration: none;
  border-color: var(--danger);
}
.emergency-list strong, .hotline-list strong {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--danger);
  letter-spacing: 0.02em;
}
.emergency-list span, .hotline-list span { font-size: 0.75rem; color: var(--muted); line-height: 1.25; }

/* ------------------------------------------------------------ Card grids */

.grid { display: grid; gap: 12px; }

.grid-cats { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 620px) { .grid-cats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid-cats { grid-template-columns: repeat(4, 1fr); } }

.grid-items { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 620px) { .grid-items { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid-items { grid-template-columns: repeat(4, 1fr); } }

.grid-videos { grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid-videos { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid-videos { grid-template-columns: repeat(3, 1fr); } }

/* Card chuyen de */
.cat-card, .item-card, .video-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.cat-card:hover, .item-card:hover, .video-card:hover {
  text-decoration: none;
  transform: translateY(-5px);
  border-color: rgb(var(--cat) / 0.55);
  box-shadow: 0 18px 34px -16px rgb(var(--cat) / 0.5);
}

.cat-card-media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: rgb(var(--cat) / 0.08);
  overflow: hidden;
}
.cat-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cat-card-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgb(var(--cat));
  color: #fff;
  box-shadow: var(--shadow);
}
.cat-card-badge .icon { width: 21px; height: 21px; }

.cat-card-body { padding: 12px; display: flex; flex-direction: column; gap: 3px; }
.cat-card-title { font-size: 0.95rem; font-weight: 700; line-height: 1.35; }
.cat-card-count { font-size: 0.8rem; color: var(--muted); }

/* Card bai viet */
.item-card-media {
  display: block;
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  overflow: hidden;
}
.item-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}
.item-card-body { padding: 11px 12px 13px; }
.item-card-title { font-size: 0.9rem; font-weight: 600; line-height: 1.4; }

/* Card video */
.video-card { flex-direction: row; align-items: stretch; }
.video-card-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 104px;
  flex: none;
  background: linear-gradient(150deg, rgb(var(--cat) / 0.18), rgb(var(--cat) / 0.06));
  color: rgb(var(--cat));
}
.video-card-thumb > .icon { width: 34px; height: 34px; opacity: 0.5; }
.video-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  padding: 13px 14px;
  min-width: 0;
}
.video-card-title { font-size: 0.95rem; font-weight: 600; line-height: 1.4; }
.video-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.8rem; }

.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  box-shadow: var(--shadow);
}
.play-badge svg { width: 24px; height: 24px; margin-left: 2px; }
.cat-card-video .cat-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 26, 0.32);
}
.cat-card-video .play-badge, .cat-card-video .cat-card-badge { z-index: 1; }

/* ----------------------------------------------------------------- Badge */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
}
.badge .icon { width: 14px; height: 14px; }
.badge-sign { background: #e7f6ec; color: #157347; }

/* ----------------------------------------------------------- Format tabs */

.format-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.format-tab {
  min-height: 44px;
  padding: 0 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.format-tab:hover { border-color: var(--brand); color: var(--text); }
.format-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------------- Viewer */

.viewer {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.viewer-zoom {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #0e131b;
  cursor: zoom-in;
  line-height: 0;
}
.viewer-zoom img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
}
.viewer-zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(12, 17, 25, 0.78);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  backdrop-filter: blur(6px);
}
.viewer-zoom-hint svg { width: 15px; height: 15px; }

.viewer-video { border: 0; background: #000; }
.viewer-video video {
  width: 100%;
  max-height: 78vh;
  display: block;
  background: #000;
}

/* -------------------------------------------------------------- Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 11, 16, 0.96);
  /* Cho phep pinch-zoom that su tren dien thoai */
  overflow: auto;
  touch-action: pinch-zoom;
  overscroll-behavior: contain;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease-out;
  transform-origin: center center;
  cursor: zoom-in;
}
.lightbox.is-zoomed { align-items: flex-start; justify-content: flex-start; }
.lightbox.is-zoomed img { max-width: none; max-height: none; width: 240%; cursor: zoom-out; }

.lightbox-close {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  z-index: 91;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }
body.lightbox-open { overflow: hidden; }

/* --------------------------------------------------------------- Actions */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.1s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

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

.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn-sub { font-weight: 500; opacity: 0.8; font-size: 0.85rem; }

.data-warning {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0 0;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}
.data-warning .icon { width: 19px; height: 19px; color: var(--muted); margin-top: 2px; }

/* ----------------------------------------------------------------- Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 95;
  padding: 12px 22px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ------------------------------------------------------------- Prev/next */

.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.prev-next-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  min-height: 62px;
  justify-content: center;
}
.prev-next-link:hover { text-decoration: none; border-color: var(--brand); }
.prev-next-next { text-align: right; align-items: flex-end; }
.prev-next-dir { font-size: 0.75rem; font-weight: 700; color: var(--brand); }
.prev-next-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------------------------------------------------------------- Footer */

.site-footer {
  margin-top: 20px;
  padding: 28px 16px calc(28px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer-hotlines h2 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-soft);
}
.footer-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* Trang chu da co khoi khan cap lon o than trang -> khong lap lai o chan trang */
.page-home .footer-hotlines { display: none; }
.page-home .footer-note { margin-top: 0; }

/* ------------------------------------------------------------------ Print */

@media print {
  .site-header, .site-footer, .actions, .prev-next, .format-tabs, .breadcrumb, .viewer-zoom-hint { display: none; }
  body { background: #fff; font-size: 12pt; }
  .viewer { border: 0; box-shadow: none; }
  .viewer-zoom { background: #fff; }
  .viewer-zoom img { max-height: none; }
}
