/* =====================================================================
   ĐẢO HÓNG HỚT — giao diện
   Đổi màu chủ đạo: sửa biến --brand bên dưới.
   ===================================================================== */
:root {
  --brand: #234E70;
  --brand-hover: #1B3D57;
  --brand-soft: #EAF1F6;
  --highlight: #E9A23B;
  --text: #202124;
  --muted: #62666A;
  --border: #DCE2E8;
  --card-border: #B8C2CC; /* viền card — đổi màu/độ đậm viền ở đây */
  --surface: #FFFFFF;
  --page: #F6F7F4;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(32, 33, 36, .06);
  --font: "Be Vietnam Pro", "Segoe UI", Roboto, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.3; }

.wrap { width: min(1140px, calc(100% - 32px)); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px;
  border: 1px solid var(--brand); border-radius: 9px;
  background: var(--brand); color: #fff;
  font: inherit; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .18s, color .18s;
}
.btn:hover { background: var(--brand-hover); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 18px; }
.btn-light { background: var(--brand-soft); color: var(--text); border-color: var(--border); }
.btn-light:hover { background: #DCE7EF; }
.btn-outline { background: #fff; color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }

.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 10px;
  background: transparent; color: inherit;
  font-size: 20px; cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--brand); color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}

.header-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 62px;
}

.menu-toggle { display: none; }
.menu-toggle:hover { background: rgba(255, 255, 255, .12); }

.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
  font-weight: 800; font-size: 20px; white-space: nowrap;
}
.brand img { border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); }

.search {
  flex: 1; max-width: 420px; margin-left: auto;
  display: flex; align-items: center;
  background: #fff; border-radius: 999px; overflow: hidden;
}
.search input {
  flex: 1; min-width: 0;
  padding: 10px 16px;
  border: 0; outline: 0;
  font: inherit; font-size: 15px; color: var(--text);
  background: transparent;
}
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search button {
  display: grid; place-items: center;
  width: 44px; height: 40px; border: 0;
  background: transparent; color: var(--brand); cursor: pointer;
}
.search svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.search:focus-within { box-shadow: 0 0 0 3px var(--highlight); }

.support { position: relative; }
.support-btn {
  padding: 9px 12px; border: 0; border-radius: 9px;
  background: rgba(255, 255, 255, .12); color: #fff;
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.support-btn:hover { background: rgba(255, 255, 255, .22); }
.support-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px; padding: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(32, 33, 36, .18);
}
.support-menu a {
  display: block; padding: 10px 12px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px;
}
.support-menu a:hover, .support-menu a.active { background: var(--brand-soft); color: var(--brand); }

/* Thanh chuyên mục */
.cat-bar { background: #fff; border-bottom: 1px solid var(--border); }
.cat-scroll {
  display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
  padding-block: 8px;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-link {
  --accent: var(--brand);
  flex: 0 0 auto;
  padding: 7px 14px; border-radius: 999px;
  color: var(--text); text-decoration: none;
  font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.cat-link:hover { background: var(--brand-soft); color: var(--accent); }
.cat-link.active { background: var(--accent); color: #fff; }

/* Drawer (điện thoại) */
.drawer {
  width: min(86vw, 340px); height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #fff; color: var(--text);
  box-shadow: 8px 0 32px rgba(0, 0, 0, .2);
}
.drawer[open] { animation: slideIn .2s ease-out; }
.drawer::backdrop { background: rgba(32, 33, 36, .45); backdrop-filter: blur(2px); }
@keyframes slideIn { from { transform: translateX(-100%); } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.drawer-head h2 { margin: 0; font-size: 20px; color: var(--brand); }
.drawer-head .icon-btn { background: var(--brand-soft); font-size: 16px; }
.drawer-nav { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.drawer-link {
  --accent: var(--brand);
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-weight: 650;
}
.drawer-link::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.drawer-link:hover { background: var(--brand-soft); }
.drawer-link.active { background: var(--accent); color: #fff; }
.drawer-link.active::before { background: #fff; }

/* ---------- Nội dung ---------- */
#app { padding-block: 24px 40px; outline: none; min-height: 60vh; }

.banner {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  background: var(--brand);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.banner-img { width: 100%; aspect-ratio: 1600 / 535; height: auto; object-fit: cover; }
.banner-actions {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  padding: 12px;
}
.banner-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 6px;
  border: 1px solid rgba(255, 255, 255, .8); border-radius: 10px;
  background: rgba(35, 78, 112, .92); color: #fff;
  font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
  backdrop-filter: blur(4px);
  transition: background .18s, color .18s, transform .18s;
}
.banner-btn img { width: 20px; height: 20px; object-fit: contain; }
.banner-btn:hover { background: var(--highlight); color: var(--text); transform: translateY(-2px); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 14px; }
.section-head h2 {
  margin: 0; font-size: 22px;
  padding-left: 12px; border-left: 4px solid var(--highlight);
}

.page-head {
  --accent: var(--brand);
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 4px 0 18px; padding-bottom: 12px;
  border-bottom: 3px solid var(--accent);
}
.page-head h1 { margin: 0; font-size: 28px; color: var(--accent); }

/* ---------- Card tin ---------- */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  --accent: var(--brand);
  background: var(--surface);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate; /* giữ ảnh không tràn ra góc bo khi phóng to */
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent); /* hover: viền đổi sang màu chuyên mục */
  box-shadow: 0 12px 28px rgba(32, 33, 36, .12);
}
.card-img { border-bottom: 2px solid var(--card-border); transition: border-color .18s; }
.card:hover .card-img { border-bottom-color: var(--accent); }
.card-hit { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card-hit[aria-disabled="true"] { cursor: default; }

.card-img { aspect-ratio: 16 / 10; overflow: hidden; background: color-mix(in srgb, var(--accent) 12%, #fff); }
.card-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transition: transform .3s; }
.card:hover .card-img img { transform: scale(1.04); }
.card-img.noimg { display: grid; place-items: center; }
.card-img.noimg::after { content: "📰"; font-size: 40px; opacity: .5; }

.card-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 14px 16px 16px; }
.card-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.card-cat { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.card-title {
  margin: 0; font-size: 17px; font-weight: 750;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card:hover .card-title { color: var(--brand); }
.card-sum {
  margin: 0; color: var(--muted); font-size: 14.5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-more { margin-top: auto; padding-top: 4px; color: var(--brand); font-weight: 700; font-size: 14px; }
.card-hit[aria-disabled="true"] .card-more { color: var(--muted); font-weight: 600; }

/* Card nổi bật (to) */
.card-big { margin-bottom: 28px; border-color: var(--accent); }
.card-big .card-img { border-bottom: 0; border-right: 2px solid var(--accent); }
.card-big .card-hit { flex-direction: row; }
/* Ảnh cao theo nội dung chữ (tối thiểu 280px) => không còn khoảng trắng thừa */
.card-big .card-img { flex: 0 0 55%; aspect-ratio: auto; min-height: 280px; }
.card-big .card-body {
  justify-content: center; gap: 14px;
  padding: 28px 32px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, #fff), #fff 60%);
}
.card-big .card-title { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; -webkit-line-clamp: 4; }
.card-big .card-sum { font-size: 16px; -webkit-line-clamp: 4; }
.card-big .card-more {
  align-self: flex-start; margin-top: 4px;
  padding: 10px 18px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 15px;
  transition: filter .18s;
}
.card-big:hover .card-more { filter: brightness(.92); }
.card-big .card-hit[aria-disabled="true"] .card-more { background: var(--border); color: var(--muted); }
.card-big .card-meta::before {
  content: "🔥 NỔI BẬT"; margin-right: 6px; padding: 3px 8px; border-radius: 6px;
  background: var(--highlight); color: var(--text); font-weight: 800; font-size: 11.5px;
}

.load-more { display: flex; margin: 26px auto 0; }
.empty {
  padding: 40px 16px; text-align: center; color: var(--muted);
  background: #fff; border: 1px dashed var(--border); border-radius: var(--radius);
}

/* ---------- Trang tĩnh (Hướng dẫn / Hỏi đáp) ---------- */
.static-page {
  max-width: 760px; margin: 0 auto;
  padding: 28px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.static-page h1 { margin-top: 0; color: var(--brand); }
.static-page h2 { font-size: 19px; margin: 22px 0 6px; }
.static-page details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.static-page summary { font-weight: 700; cursor: pointer; }
.static-page details p { margin: 10px 0 0; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: #18364F; color: #DCE7EF; padding-top: 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-footer h3 { margin: 0 0 10px; color: #fff; font-size: 15px; text-transform: uppercase; letter-spacing: .5px; }
.brand-footer { font-size: 18px; }
.site-footer .muted { color: #A9BCCB; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-links a { color: #DCE7EF; text-decoration: none; }
.footer-links a:hover { color: var(--highlight); }
.copyright { margin-top: 28px; padding: 16px 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 13px; color: #A9BCCB; }

/* ---------- Popup ---------- */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow-y: auto;
  background: rgba(32, 33, 36, .62); backdrop-filter: blur(3px);
  animation: fade .2s;
}
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal-box {
  position: relative; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  padding: 28px 22px 22px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  animation: pop .22s ease-out;
}
@keyframes pop { from { transform: translateY(12px) scale(.97); opacity: 0; } }
.modal-box h2 { margin: 0 34px 6px; text-align: center; color: var(--brand); font-size: 23px; }
#rulesModal .modal-box h2 { margin-bottom: 16px; }
.modal-x {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 16px; cursor: pointer;
}
.modal-x:hover { background: var(--brand-hover); }
.group-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.group-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #F8FAFC;
}
.group-item h3 { margin: 0 0 4px; font-size: 16px; }
.group-item p { margin: 0; font-size: 13px; color: var(--muted); }
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rules li { font-weight: 600; font-size: 15px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------- Màn hình vừa ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-big .card-hit { flex-direction: column; }
  .card-big .card-img { flex: none; aspect-ratio: 16 / 9; min-height: 0; border-right: 0; border-bottom: 2px solid var(--accent); }
  .card-big .card-body { padding: 18px; }
  .card-big .card-title { font-size: 22px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* ---------- Điện thoại ---------- */
@media (max-width: 640px) {
  .wrap { width: calc(100% - 24px); }
  .header-row { flex-wrap: wrap; gap: 8px; padding-block: 8px; min-height: 0; }
  .menu-toggle { display: grid; margin-left: -6px; }
  .brand { font-size: 18px; margin-right: auto; }
  .brand img { width: 32px; height: 32px; }
  .search { order: 5; flex-basis: 100%; max-width: none; margin: 0; }
  .search input { padding: 9px 14px; }
  .cat-bar { display: none; }

  #app { padding-top: 16px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card-title { font-size: 16.5px; }
  .card-big .card-title { font-size: 20px; }

  .banner-actions { grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; }
  .banner-btn { font-size: 14px; min-height: 40px; }

  .page-head h1 { font-size: 24px; }
  .static-page { padding: 20px 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }

  .modal-box { padding: 26px 14px 16px; }
  .modal-box h2 { font-size: 20px; }
  .group-item { padding: 11px; }
  .modal-actions .btn { flex: 1; }
}
