/* ============================================================
   account-sidebar-collapse.css: the shared sidebar folds to icons on desktop
   (owner 2026-11-29: "in the desktop as well, we must have the option to
   collapse the sidebar ... where only the icons were visible").

   ⭐ ONE PLACE. The sidebar itself prints this sheet (mnAccountRenderSidebar(),
   includes/account-shell.php), so every page that draws it gets the button and
   the strip: the pages beside it (account-rail.css), the account pages
   (committee-control-center.css), the homes and the exam screens.
   ⭐ The strip is the study room's own (study.css, "the account menu is a 72px
   strip of its own icons"): 72px, the names hidden by colour (they stay for
   screen readers), the section titles thin rules, and resting the mouse on it
   opens it OVER the page, which never moves. The study room keeps its strip as
   it is and shows no button.
   ⭐ The choice is the reader's and is remembered on this browser
   (localStorage mn_acct_sidebar), set on <html> before the page paints.
   ⛔ Desktop only: at 680px and under the sidebar is the ☰ menu
   (account-phone-menu.css) and the button is not shown.
   ============================================================ */

/* ---- The button: a sidebar item, first in the list. */
.sidebar .mn-acct-collapse {
  width: calc(100% - 1.3rem);
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
}

.sidebar .mn-acct-collapse .nav-icon {
  transition: transform 0.16s ease;
}

html.mn-acct-collapsed .sidebar .mn-acct-collapse .nav-icon {
  transform: rotate(180deg);
}

/* ⛔ Strong enough to beat the phone menu's own .nav-item rules (account-phone-menu.css). */
html .mn-study-shell > aside.sidebar .nav-item.mn-acct-collapse {
  display: none;
}

@media (max-width: 680px) {
  html aside.sidebar.mn-acct-drawer .nav-item.mn-acct-collapse {
    display: none;
  }
}

/* ---- Folded: 72px of icons. The page moves over by the strip's width only. */
@media (min-width: 681px) {
  html.mn-acct-collapsed body:has(> .mn-acct-rail) {
    --mn-acct-rail-w: 72px;
  }

  html.mn-acct-collapsed .mn-committee-control:not(.mn-study-shell) {
    --sidebar-w: 72px;
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer {
    width: 72px;
    overflow: hidden;
    white-space: nowrap;
    transition: width 0.16s ease, box-shadow 0.16s ease;
  }

  /* The strip scrolls by wheel; a scrollbar down a 72px strip reads as a stray line. */
  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .sidebar-nav {
    overflow-x: hidden;
    scrollbar-width: none;
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .nav-section-label {
    height: 1px;
    margin: 0.55rem 1.1rem;
    padding: 0;
    overflow: hidden;
    color: transparent;
    background: rgba(255, 255, 255, 0.1);
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .nav-item {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    overflow: hidden;
    color: transparent;
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .nav-item .nav-icon {
    color: rgba(255, 255, 255, 0.85);
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .nav-item.active .nav-icon {
    color: #ffffff;
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .nav-badge {
    visibility: hidden;
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .user-row > :not(.user-avatar) {
    opacity: 0;
    transition: opacity 0.15s;
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .sidebar-logout {
    overflow: hidden;
    color: transparent;
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .sidebar-logout .nav-icon {
    color: rgba(255, 255, 255, 0.7);
  }

  /* A visitor's Sign in (account-rail.css, .sidebar-signin): the white button shrinks to the strip's
     width with its icon alone, in the button's navy, on the icons' centre. */
  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .sidebar-logout.sidebar-signin {
    justify-content: flex-start;
    padding-left: calc((100% - 1rem) / 2);
    padding-right: 0;
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer .sidebar-logout.sidebar-signin .nav-icon {
    color: #0b2447;
  }

  /* The brand at the top (site-topnav.css, .mn-acct-brand): the logo alone, on the icons' centre
     (36px, the strip's middle), and the name back when the strip opens.
     ⛔ :has() keeps this rule stronger than site-topnav.css's own padding for the row. */
  html.mn-acct-collapsed:has(.mn-res-topnav-account.mn-acct-strip-off) :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer > .mn-acct-brand {
    padding-left: 21px;
  }

  html.mn-acct-collapsed :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer > .mn-acct-brand .mn-acct-brand-text {
    opacity: 0;
    transition: opacity 0.15s;
  }
}

/* ---- Resting the mouse on the strip opens it over the page, as in the study room.
   ⛔ Only with a mouse: a touch screen cannot rest a finger, so it uses the button.
   ⛔ Not straight after the button folded it (html.mn-acct-hold, cleared when the
   mouse leaves): the pointer is still on the strip, and opening at once would
   look as if the button did nothing. */
@media (min-width: 681px) and (hover: hover) and (pointer: fine) {
  html.mn-acct-collapsed:not(.mn-acct-hold) :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer:is(:hover, :focus-within) {
    width: 240px;
    box-shadow: 10px 0 28px rgba(13, 21, 38, 0.22);
    transition-delay: 0.12s;
  }

  html.mn-acct-collapsed:not(.mn-acct-hold) :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer:is(:hover, :focus-within) .nav-item {
    color: rgba(255, 255, 255, 0.6);
  }

  html.mn-acct-collapsed:not(.mn-acct-hold) :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer:is(:hover, :focus-within) .nav-item:hover {
    color: rgba(255, 255, 255, 0.9);
  }

  html.mn-acct-collapsed:not(.mn-acct-hold) :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer:is(:hover, :focus-within) .nav-item.active {
    color: #ffffff;
  }

  html.mn-acct-collapsed:not(.mn-acct-hold) :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer:is(:hover, :focus-within) .nav-badge {
    visibility: visible;
  }

  html.mn-acct-collapsed:not(.mn-acct-hold) :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer:is(:hover, :focus-within) .user-row > :not(.user-avatar) {
    opacity: 1;
  }

  html.mn-acct-collapsed:not(.mn-acct-hold) :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer:is(:hover, :focus-within) > .mn-acct-brand .mn-acct-brand-text {
    opacity: 1;
  }

  html.mn-acct-collapsed:not(.mn-acct-hold) :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer:is(:hover, :focus-within) .sidebar-logout {
    color: rgba(255, 255, 255, 0.55);
  }

  html.mn-acct-collapsed:not(.mn-acct-hold) :not(.mn-study-shell) > aside.sidebar.mn-acct-drawer:is(:hover, :focus-within) .sidebar-logout.sidebar-signin {
    justify-content: center;
    padding-left: 14px;
    padding-right: 14px;
    color: #0b2447;
  }
  /* ⛔ The section titles stay thin rules while it is open, as in the study room: nothing
     moves when it opens, only the names appear. */
}
