/* ==========================================================================
   Trang chủ — "Báo chí đưa tin": nhãn bên trái thành NÚT, bấm → bảng liệt kê đủ các bài.
   Nút: huy hiệu số bài trên biểu tượng + dòng "Xem tất cả ›"; rê chuột → nền xanh nhạt, biểu tượng nhích lên.
   Bảng: <dialog> giữa màn hình (máy tính, 2 cột) / tấm trượt từ dưới lên (điện thoại, 1 cột).
   Tiêu đề bài hiện ĐỦ, không cắt "…"; chữ nội dung ≥16px cho người lớn tuổi.
   JS: assets/js/homepage-press-list-dialog.js
   ========================================================================== */

/* ---- Nút nhãn (thay <p> cũ, giữ nguyên bố cục) ---- */
html body .strip--press .strip-press__open {
  align-self: stretch;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s;
}
html body .strip--press .strip-press__open:hover { background: #eef2ff; }
html body .strip--press .strip-press__open:focus-visible {
  outline: 3px solid #1e40af;
  outline-offset: -3px;
}
html body .strip--press .strip-press__label-icon {
  position: relative;
  transition: transform .2s, box-shadow .2s;
}
html body .strip--press .strip-press__open:hover .strip-press__label-icon {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(30, 64, 175, .3);
}
/* Huy hiệu số bài: vàng trên nền navy (đúng quy tắc màu vàng chỉ dùng trên navy) */
html body .strip--press .strip-press__count {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #0a1330;
  color: #facc15;
  font-size: 12px;
  font-weight: 800;
  line-height: 18px;
  letter-spacing: 0;
  text-align: center;
}
html body .strip--press .strip-press__text { display: flex; flex-direction: column; gap: 3px; }
html body .strip--press .strip-press__more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #1e40af;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
html body .strip--press .strip-press__more svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s;
}
html body .strip--press .strip-press__open:hover .strip-press__more { text-decoration: underline; text-underline-offset: 3px; }
html body .strip--press .strip-press__open:hover .strip-press__more svg { transform: translateX(3px); }

/* Bảng đang mở → dải đứng yên, trang không cuộn phía sau */
html body .strip--press.is-paused .strip-track { animation-play-state: paused; }
html.press-dialog-open { overflow: hidden; }

/* ---- Bảng danh sách ---- */
html body .press-dialog {
  width: min(980px, calc(100vw - 32px));
  max-width: none;
  max-height: min(86vh, 860px);
  margin: auto; /* site reset đặt margin: 0 cho mọi thẻ → phải trả lại auto để <dialog> nằm giữa */
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: #0a1330;
  box-shadow: 0 30px 80px rgba(10, 19, 48, .35);
  overflow: hidden;
}
html body .press-dialog[open] {
  display: flex;
  flex-direction: column;
  animation: pressDialogIn .26s cubic-bezier(.2, .8, .2, 1) both;
}
html body .press-dialog::backdrop {
  background: rgba(10, 19, 48, .55);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
  animation: pressBackdropIn .26s ease both;
}
html body .press-dialog.is-closing { animation: pressDialogOut .18s ease both; }
html body .press-dialog.is-closing::backdrop { animation: pressBackdropOut .18s ease both; }

html body .press-dialog__head {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 18px 24px;
  border-bottom: 1px solid #e5eaf5;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fe 100%);
}
html body .press-dialog__head-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #1e40af;
  color: #fff;
}
html body .press-dialog__head-icon svg,
html body .press-dialog__close svg,
html body .press-item__icon svg,
html body .press-item__go {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html body .press-dialog__head-icon svg { width: 24px; height: 24px; }
html body .press-dialog__heading { flex: 1; min-width: 0; }
html body .press-dialog__title {
  margin: 0;
  color: #0a1330;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}
html body .press-dialog__sub {
  margin: 4px 0 0;
  color: #475569;
  font-size: 16px;
  line-height: 1.4;
}
html body .press-dialog__sub b { color: #1e40af; }
html body .press-dialog__close {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #dbe3f3;
  border-radius: 50%;
  background: #fff;
  color: #0a1330;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, transform .2s;
}
html body .press-dialog__close svg { width: 22px; height: 22px; stroke-width: 2.2; }
html body .press-dialog__close:hover { border-color: #1e40af; background: #eef2ff; transform: rotate(90deg); }
html body .press-dialog__close:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }

html body .press-dialog__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 20px 24px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}
html body .press-dialog__item { margin: 0; animation: pressItemIn .3s ease both; animation-delay: calc(var(--i, 0) * 25ms + 60ms); }

html body .press-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  height: 100%;
  padding: 14px 14px 14px 12px;
  border: 1px solid #dbe3f3;
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s, background-color .2s;
}
html body .press-item:hover,
html body .press-item:focus-visible {
  border-color: #1e40af;
  background: #f8faff;
  box-shadow: 0 8px 22px rgba(30, 64, 175, .14);
  transform: translateY(-2px);
  outline: none;
}
html body .press-item:focus-visible { box-shadow: 0 0 0 3px rgba(30, 64, 175, .35); }
html body .press-item__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eef2ff;
  color: #1e40af;
}
html body .press-item__icon svg { width: 21px; height: 21px; }
html body .press-item__body { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
html body .press-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
html body .press-item__outlet { color: #1e3a8a; font-size: 16px; font-weight: 800; line-height: 1.3; }
html body .press-item__type {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-family: var(--ff-display);
  font-size: 13px;
  font-weight: 700;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: 0;
}
html body .press-item__title { color: #1e293b; font-size: 16px; line-height: 1.45; }
html body .press-item:hover .press-item__title,
html body .press-item:focus-visible .press-item__title { color: #0a1330; }
html body .press-item__go {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 10px;
  color: #94a3b8;
  transition: color .2s, transform .2s;
}
html body .press-item:hover .press-item__go,
html body .press-item:focus-visible .press-item__go { color: #1e40af; transform: translate(2px, -2px); }

@keyframes pressDialogIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pressDialogOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes pressBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pressBackdropOut { to { opacity: 0; } }
@keyframes pressItemIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Máy tính bảng dọc → 1 cột */
@media (max-width: 760px) {
  html body .press-dialog__list { grid-template-columns: 1fr; }
}

/* Điện thoại: tấm trượt từ dưới lên, sát 2 mép */
@media (max-width: 600px) {
  /* chữ nhãn đã ẩn (vẫn đọc được) bởi rule ≤600px trong homepage-strip-highlights.css → chỉ còn biểu tượng + số bài */
  html body .strip--press .strip-press__open { padding-right: 14px; }
  html body .press-dialog {
    width: 100vw;
    max-height: 88vh;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }
  html body .press-dialog[open] { animation-name: pressSheetIn; }
  html body .press-dialog.is-closing { animation-name: pressSheetOut; }
  html body .press-dialog__head { padding: 16px 12px 14px 16px; gap: 12px; }
  html body .press-dialog__head-icon { width: 40px; height: 40px; }
  html body .press-dialog__title { font-size: 20px; }
  html body .press-dialog__sub { font-size: 15px; }
  html body .press-dialog__close { width: 44px; height: 44px; }
  html body .press-dialog__list { gap: 10px; padding: 14px 12px calc(18px + env(safe-area-inset-bottom)); }
}
@keyframes pressSheetIn { from { transform: translateY(100%); } to { transform: none; } }
@keyframes pressSheetOut { to { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  html body .press-dialog[open],
  html body .press-dialog::backdrop,
  html body .press-dialog__item { animation: none; }
  html body .press-item,
  html body .press-dialog__close,
  html body .strip--press .strip-press__label-icon { transition: none; }
}

/* ==========================================================================
   Bộ lọc (2026-11-05, dữ liệu từ assets/data/bao-chi.json): thanh công cụ do JS dựng ngay trên danh sách.
   Hàng 1: ô tìm kiếm + ô chọn "Tên báo" + ô chọn "Sắp xếp" (dùng <select> gốc → điện thoại mở bảng chọn to).
   Hàng 2: nút kênh (Tất cả / Báo điện tử / Truyền hình / Phát thanh / Mạng xã hội, kèm số bài).
   Hàng 3: "N / tổng bài" + thẻ bộ lọc đang bật (bấm × để bỏ) + "Xóa lọc".
   Nút / ô cao 44px, chữ 16px cho người lớn tuổi.
   ========================================================================== */
html body .press-dialog__tools {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px 12px;
  border-bottom: 1px solid #e5eaf5;
  background: #fff;
}
html body .press-tools__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
html body .press-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Ô tìm kiếm */
html body .press-search { position: relative; flex: 1 1 260px; min-width: 0; }
html body .press-search__icon {
  position: absolute; top: 50%; left: 14px; width: 20px; height: 20px; transform: translateY(-50%);
  fill: none; stroke: #64748b; stroke-width: 2; stroke-linecap: round; pointer-events: none;
}
html body .press-search__input,
html body .press-select__input {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: #0a1330;
  font-family: inherit;
  font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}
html body .press-search__input { padding: 0 14px 0 44px; }
html body .press-search__input::placeholder { color: #64748b; }
html body .press-search__input:focus,
html body .press-select__input:focus { border-color: #1e40af; box-shadow: 0 0 0 3px rgba(30, 64, 175, .18); outline: none; }

/* Ô chọn có nhãn nhỏ phía trên */
html body .press-select { display: flex; flex: 0 1 220px; flex-direction: column; gap: 4px; min-width: 0; }
html body .press-select__label { color: #475569; font-size: 14px; font-weight: 700; line-height: 1.2; }
html body .press-select__input {
  padding: 0 40px 0 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e40af' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 18px;
  cursor: pointer;
}

/* Nút kênh */
html body .press-filter { display: flex; flex-wrap: wrap; gap: 8px; }
html body .press-filter__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #dbe3f3;
  border-radius: 999px;
  background: #fff;
  color: #1e3a8a;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
html body .press-filter__count {
  min-width: 26px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e40af;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}
html body .press-filter__btn:hover { border-color: #1e40af; background: #f8faff; }
html body .press-filter__btn[aria-pressed="true"] { border-color: #1e40af; background: #1e40af; color: #fff; }
html body .press-filter__btn[aria-pressed="true"] .press-filter__count { background: rgba(255, 255, 255, .2); color: #fff; }
html body .press-filter__btn:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }

/* Đang lọc gì */
html body .press-active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-height: 32px; }
html body .press-active__count { color: #475569; font-size: 15px; font-weight: 700; }
html body .press-active__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 8px 0 12px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e3a8a;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
html body .press-active__tag svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
html body .press-active__tag:hover { border-color: #1e40af; }
html body .press-active__clear {
  min-height: 32px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: #1e40af;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
html body .press-active__tag:focus-visible,
html body .press-active__clear:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }

/* Tiêu đề nhóm (ngày hoặc chữ cái): trải hết 2 cột */
html body .press-dialog__day { grid-column: 1 / -1; margin: 6px 0 -2px; list-style: none; }
html body .press-dialog__day:first-child { margin-top: 0; }
html body .press-dialog__day-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #0a1330;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}
html body .press-dialog__day-title::after { content: ""; flex: 1; height: 1px; background: #e5eaf5; }

/* Không có bài khớp */
html body .press-dialog__empty { grid-column: 1 / -1; padding: 32px 16px; text-align: center; list-style: none; }
html body .press-dialog__empty-title { margin: 0 0 6px; color: #0a1330; font-size: 18px; font-weight: 800; }
html body .press-dialog__empty-text { margin: 0 0 14px; color: #475569; font-size: 16px; }
html body .press-active__clear--big {
  min-height: 44px; padding: 0 20px; border: 1.5px solid #1e40af; border-radius: 999px; text-decoration: none;
}

/* Nhãn kênh trên thẻ bài (thay Bài báo / Video / Phát thanh) */
html body .press-item__type--bao-dien-tu { background: #f1f5f9; color: #334155; }
html body .press-item__type--truyen-hinh { background: #fef2f2; color: #b91c1c; }
html body .press-item__type--phat-thanh { background: #f0fdf4; color: #15803d; }
html body .press-item__type--mang-xa-hoi { background: #eef2ff; color: #1e40af; }

/* Ngày giờ đăng + nhãn "Mới" */
html body .press-item__date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: #475569;
  font-size: 15px;
  line-height: 1.4;
}
html body .press-item__date svg {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
html body .press-item__new {
  padding: 2px 9px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: .02em;
}

/* Điện thoại: cả bảng cuộn chung (thanh lọc cuộn đi để nhường chỗ đọc), đầu bảng có nút X luôn dính trên cùng */
@media (max-width: 600px) {
  html body .press-dialog[open] { display: block; overflow-y: auto; overscroll-behavior: contain; }
  html body .press-dialog__head { position: sticky; top: 0; z-index: 2; }
  html body .press-dialog__list { overflow: visible; }
  html body .press-dialog__tools { gap: 10px; padding: 12px; }
  html body .press-search { flex-basis: 100%; }
  html body .press-select { flex: 1 1 0; }
  html body .press-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  html body .press-filter::-webkit-scrollbar { display: none; }
  html body .press-filter__btn { flex: none; padding: 0 14px; font-size: 15px; }
}
