/* ===== PND: compact legal links + mobile off-canvas drawer ===== */
/* cache-bust 2026-11-27-d: grid spacer packs legal+social+copyright at the bottom; legal stays one line */

/* --- Mobile off-canvas: ~72% width, full-height white, dimmed page + X stay visible on the right --- */
html body .jeg_mobile_wrapper,
html body #jeg_off_canvas .jeg_mobile_wrapper,
html body.jeg_show_menu #jeg_off_canvas .jeg_mobile_wrapper {
  width: 72vw !important;
  max-width: 75vw !important;
  min-width: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  top: 0 !important;
  left: 0 !important;
  box-sizing: border-box !important;
  background: #fff !important;
  background-color: #fff !important;
  overflow-x: hidden;
  overflow-y: auto;
}
html body .jeg_mobile_wrapper .nav_wrap,
html body #jeg_off_canvas .nav_wrap {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  box-sizing: border-box !important;
  min-height: 100% !important;
  height: 100% !important;
  background: #fff !important;
  background-color: #fff !important;
}
html body .jeg_mobile_wrapper .nav_wrap:before,
html body #jeg_off_canvas .nav_wrap:before {
  background: #fff !important;
  background-color: #fff !important;
  min-height: 100% !important;
  top: 0 !important;
  bottom: 0 !important;
}
html body #jeg_off_canvas .item_main,
html body .jeg_mobile_wrapper .item_main {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
html body #jeg_off_canvas .item_main > .jeg_aside_item:last-child,
html body .jeg_mobile_wrapper .item_main > .jeg_aside_item:last-child {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding-bottom: 0 !important;
}

/* Do not cover or hide the close (X) on the dimmed right strip */
html body #jeg_off_canvas > a.jeg_menu_close,
html body.jeg_show_menu a.jeg_menu_close {
  z-index: 10000 !important;
}

/*
 * Menu is a grid, not a wrapping flex row:
 *   5 channel rows, then a 1fr spacer, then one legal row.
 * Leftover white sits BETWEEN the channels and the legal+social+copyright group.
 */
html body #jeg_off_canvas .jeg_mobile_menu,
html body .jeg_mobile_wrapper .jeg_mobile_menu {
  display: grid !important;
  grid-template-columns: repeat(5, max-content);
  grid-template-rows: auto auto auto auto auto 1fr auto;
  justify-content: start;
  align-content: stretch;
  align-items: start;
  column-gap: 0;
  row-gap: 0;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  margin: 0 !important;
}
html body #jeg_off_canvas .jeg_mobile_menu > li:nth-child(-n+5) {
  grid-column: 1 / -1 !important;
  flex: none !important;
  width: 100% !important;
  float: none !important;
  margin-bottom: 0 !important;
}

/* Legal items: about / contact / advertise / privacy / disclaimer — one row, no wrap */
html body #jeg_off_canvas .jeg_mobile_menu > li:nth-child(n+6),
html body #jeg_off_canvas .jeg_mobile_menu > li.menu-item-471,
html body #jeg_off_canvas .jeg_mobile_menu > li.menu-item-472,
html body #jeg_off_canvas .jeg_mobile_menu > li.menu-item-473,
html body #jeg_off_canvas .jeg_mobile_menu > li.menu-item-474,
html body #jeg_off_canvas .jeg_mobile_menu > li.menu-item-475 {
  grid-row: 7 !important;
  flex: none !important;
  width: auto !important;
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  white-space: nowrap !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}
html body #jeg_off_canvas .jeg_mobile_menu > li:nth-child(n+6)::before,
html body #jeg_off_canvas .jeg_mobile_menu > li:nth-child(n+6)::after,
html body #jeg_off_canvas .jeg_mobile_menu > li:nth-child(n+6) > a::before,
html body #jeg_off_canvas .jeg_mobile_menu > li:nth-child(n+6) > a::after {
  content: none !important;
  display: none !important;
  border: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body #jeg_off_canvas .jeg_mobile_menu > li:nth-child(n+6) > a {
  font-size: 11px !important;
  line-height: 1.5 !important;
  color: #777777 !important;
  font-weight: 400 !important;
  padding: 2px 0 !important;
  background: none !important;
  border: 0 !important;
  white-space: nowrap !important;
}
/* Separators before items 2-5 only; all five stay on one row so no line-start ｜ */
html body #jeg_off_canvas .jeg_mobile_menu > li:nth-child(n+7)::before,
html body #jeg_off_canvas .jeg_mobile_menu > li.menu-item-472::before,
html body #jeg_off_canvas .jeg_mobile_menu > li.menu-item-473::before,
html body #jeg_off_canvas .jeg_mobile_menu > li.menu-item-474::before,
html body #jeg_off_canvas .jeg_mobile_menu > li.menu-item-475::before {
  content: "\FF5C" !important;
  display: inline !important;
  color: #777777 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  margin: 0 0.18em !important;
  line-height: 1.5 !important;
  font-family: Arial, "PingFang HK", "Noto Sans TC", "Microsoft JhengHei", sans-serif !important;
  width: auto !important;
  border: 0 !important;
  padding: 0 !important;
}

/* Tight pack: legal links sit just above social + copyright at the bottom */
html body #jeg_off_canvas .item_bottom,
html body .jeg_mobile_wrapper .item_bottom {
  position: static !important;
  bottom: auto !important;
  flex: 0 0 auto !important;
  margin-top: 6px !important;
  padding-top: 0 !important;
  padding-bottom: 16px !important;
}
html body #jeg_off_canvas .item_bottom .socials_widget,
html body .jeg_mobile_wrapper .item_bottom .socials_widget {
  margin-top: 0 !important;
  margin-bottom: 6px !important;
  padding-top: 0 !important;
}
html body #jeg_off_canvas .item_bottom .jeg_aside_copyright,
html body .jeg_mobile_wrapper .item_bottom .jeg_aside_copyright {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* --- Site footer legal links (desktop + mobile) --- */
.jeg_footer .jeg_menu_footer {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end;
  align-items: center;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0;
}
.jeg_footer .jeg_menu_footer > li {
  display: inline-flex !important;
  align-items: center;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
}
.jeg_footer .jeg_menu_footer > li::before,
.jeg_footer .jeg_menu_footer > li::after,
.jeg_footer .jeg_menu_footer > li > a::before,
.jeg_footer .jeg_menu_footer > li > a::after {
  content: none !important;
  display: none !important;
}
.jeg_footer .jeg_menu_footer > li > a {
  font-size: 12px !important;
  line-height: 1.5 !important;
  color: #777777 !important;
  font-weight: 400 !important;
  padding: 2px 0 !important;
  background: none !important;
}
.jeg_footer .jeg_menu_footer > li:not(:first-child)::before {
  content: "\FF5C" !important;
  display: inline !important;
  color: #777777 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  margin: 0 0.45em !important;
  font-family: Arial, "PingFang HK", "Noto Sans TC", "Microsoft JhengHei", sans-serif !important;
  width: auto !important;
}
@media (max-width: 767px) {
  .jeg_footer .jeg_menu_footer {
    justify-content: flex-start;
  }
}

/* PND homepage tweaks 2026-11-28-a — append; do not delete 2026-11-27-d legal/drawer rules */

/* 最新文章：腳本未跑時先只顯示候選池最新 6 篇，避免閃出 8–10 篇。
   Scoped to headed 「最新文章」 module only. */
[class*="jnews_module_163_2_"].pnd-latest-random .jeg_post:nth-child(n + 7) {
  display: none;
}

/* 手機分類列：只針對白色 sticky 分類列 .jeg_navbar_mobile_menu，
   不要改漢堡抽屜 .jeg_mobile_menu，也不要改桌面主選單 .jeg_main_menu。
   Additional CSS 有 14px / padding 8px !important，這裡用更高優先度收窄，
   令五個名稱（含四字「旅遊攻略」）在 ~320/360/390 單行顯示、唔好先靠橫向捲動。 */
@media (max-width: 767px) {
  html body .jeg_navbar_mobile .jeg_navbar_mobile_menu,
  html body .jeg_navbar_mobile .jeg_navbar_mobile_menu .container,
  html body .jeg_navbar_mobile .jeg_navbar_mobile_menu ul,
  html body .jeg_navbar_mobile .jeg_mobile_menu_style_1,
  .jeg_header .pnd-catbar,
  .jeg_navbar .pnd-catbar,
  .jeg_header_sticky .pnd-catbar {
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
  }
  html body .jeg_navbar_mobile .jeg_navbar_mobile_menu li,
  html body .jeg_navbar_mobile .jeg_mobile_menu_style_1 > li,
  .jeg_header .pnd-catbar li,
  .jeg_navbar .pnd-catbar li,
  .jeg_header_sticky .pnd-catbar li {
    white-space: nowrap !important;
    float: none !important;
    display: inline-block !important;
    flex: 0 0 auto !important;
  }
  html body .jeg_navbar_mobile .jeg_navbar_mobile_menu a,
  html body .jeg_navbar_mobile .jeg_mobile_menu_style_1 > li > a,
  .jeg_header .pnd-catbar a,
  .jeg_navbar .pnd-catbar a,
  .jeg_header_sticky .pnd-catbar a {
    white-space: nowrap !important;
    font-size: 12px !important;
    letter-spacing: 0 !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}

@media (max-width: 360px) {
  html body .jeg_navbar_mobile .jeg_navbar_mobile_menu a,
  html body .jeg_navbar_mobile .jeg_mobile_menu_style_1 > li > a,
  .jeg_header .pnd-catbar a,
  .jeg_navbar .pnd-catbar a,
  .jeg_header_sticky .pnd-catbar a {
    font-size: 11px !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
}

/* PND 2026-11-28-k: after JS runs, show only .pnd-show in 最新文章 (6 latest-first).
   Scoped to headed module. Reveal with revert, not display:block !important. */
[class*="jnews_module_163_2_"].pnd-latest-random.pnd-latest-randomized .jeg_post {
  display: none !important;
}
[class*="jnews_module_163_2_"].pnd-latest-random.pnd-latest-randomized .jeg_post.pnd-show {
  display: revert !important;
}