/*
 * menu-drawer.css — the hamburger drawer as the ONE menu of app pages, every width
 * (linked from menu.php's app-context branch; Jun 2026-09-28: design A of three
 * mock-ups, then "Desktop版也改用這menu bar 在右方").
 *
 * The left rail hides and the drawer shows the five frequent pages as an icon row plus
 * the whole nav_manifest.php (drawer_nav.php renders that block with `hidden`, which the
 * rules below lift). Language and notifications follow. Without this stylesheet a page
 * keeps the previous chrome — the rail plus the hamburger's plain quick-link list.
 *
 * Every selector is scoped to #MainMenu (the drawer) or #leftMainMenu (the rail), so this
 * file cannot restyle anything else on the page.
 *
 * The drawer's mechanics stay menu.css's (a fixed overlay whose 320px right border is the
 * panel, .container placed over it, jQuery toggling .open); this file only restyles and
 * reorders. menu.css is a compiled artefact on B3/C (menu.less edits never recompile
 * there), so its selectors are overridden here with higher specificity.
 *
 * Plain CSS on purpose, with no sibling .less: FileResolver compiles a .less on request,
 * and www-data cannot write into assets/stylesheets/ on B3/C, so a new .less there is
 * served as a 404 (FIX-1843b). No nesting either (iOS Safari before 16.5).
 */

/* ── One menu ──────────────────────────────────────────────────────────────── */
#leftMainMenu {
  display: none;
}

/* dimmer page, rail-coloured panel (the panel is #MainMenu's right border) */
#MainMenu {
  background-color: rgba(0, 0, 0, 0.45);
  border-color: #272b3c;
}

#MainMenu .container {
  overscroll-behavior: contain;
}

/* close ✕ sits in the 56px title bar */
#MainMenu.open #btnCloseMenu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0;
  font-size: 22px;
}

#MainMenu #listLinks {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0 0 8px;
}

/* "MENU" title bar */
#MainMenu #listLinks > li:first-child {
  order: -2;
}

#MainMenu #listLinks > li:first-child label {
  height: 56px;
  margin: 0;
  padding: 0 20px;
  line-height: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}

/* the plain quick-link list gives way to the icon row */
#MainMenu #listLinks > li > a.vw-quick {
  display: none;
}

#MainMenu #listLinks > .vw-mnav {
  display: block;
  order: -1;
}

/* ── Frequent pages: an icon row ──────────────────────────────────────────── */
#MainMenu .vw-mnav-quick {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 10px 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#MainMenu #listLinks .vw-mnav-qlink {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 2px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

#MainMenu #listLinks .vw-mnav-qlink > i {
  font-size: 20px;
  line-height: 22px;
}

#MainMenu #listLinks .vw-mnav-qlink.is-current {
  background: rgba(73, 147, 232, 0.24);
}

/* ── The whole menu, one collapsible section per rail entry ───────────────── */
#MainMenu .vw-mnav-list {
  margin: 0;
  padding: 8px 0;
  list-style: none;
}

#MainMenu .vw-mnav-sec.is-admin {
  display: none;
}

#MainMenu .vw-mnav-sec.is-admin.is-admin-on {
  display: block;
}

#MainMenu #listLinks .vw-mnav-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0 16px 0 20px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

/* the section icon (manifest markup, some with inline padding) */
#MainMenu #listLinks .vw-mnav-row > :first-child {
  flex-shrink: 0;
  width: 20px;
  padding: 0 !important;
  color: rgba(255, 255, 255, 0.84);
  font-size: 16px;
  text-align: center;
}

#MainMenu .vw-mnav-chev {
  margin-left: auto;
  font-size: 18px;
  transition: transform 0.2s;
}

#MainMenu .vw-mnav-sec.is-open .vw-mnav-chev {
  transform: rotate(180deg);
}

#MainMenu .vw-mnav-sub {
  display: none;
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  background: rgba(0, 0, 0, 0.14);
}

#MainMenu .vw-mnav-sec.is-open > .vw-mnav-sub {
  display: block;
}

#MainMenu #listLinks .vw-mnav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px 0 54px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  text-decoration: none;
}

#MainMenu #listLinks .vw-mnav-link.is-current {
  background: rgba(73, 147, 232, 0.24);
  color: #ffffff;
  font-weight: 700;
}

#MainMenu #listLinks .vw-mnav a:hover {
  color: #ffffff;
}

/* a pointer gets a hover tint; touch screens skip it (no sticky hover) */
@media (hover: hover) {
  #MainMenu #listLinks .vw-mnav-row:hover,
  #MainMenu #listLinks .vw-mnav-link:not(.is-current):hover,
  #MainMenu #listLinks .vw-mnav-qlink:not(.is-current):hover {
    background: rgba(255, 255, 255, 0.07);
  }
}

#MainMenu .vw-mnav-new {
  padding: 2px 7px;
  border-radius: 9px;
  background: #008000;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

/* ── Language, then notifications ─────────────────────────────────────────── */
#MainMenu .localeSelectContainer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 !important;
  padding: 8px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* globe, from the font-awesome that menu.css already imports */
#MainMenu .localeSelectContainer::before {
  content: "\f0ac";
  width: 20px;
  color: rgba(255, 255, 255, 0.84);
  font-family: FontAwesome;
  font-size: 16px;
  text-align: center;
}

#MainMenu .localeSelectContainer .localeSelect {
  flex-grow: 1;
  width: auto;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background-color: #272b3c;
  color: #ffffff;
  font-size: 14px;
  text-align-last: left;
}

#MainMenu #listNotifications {
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* the "Notifications" heading row (menu.css pads every .notification like an item) */
#MainMenu #listNotifications > .notification:first-child {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 15px;
}

#MainMenu #listNotifications > .notification:first-child label {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin: 0;
  padding: 0 20px;
  color: rgba(255, 255, 255, 0.92);
}

#MainMenu #listNotifications > .notification:first-child .badge {
  margin-left: auto;
}
