/* UniCheatSheet: mobile header + course identity (Mobile Home-Screen UX, 2026-11-21). Loaded after evo.*.css on every page.
   Header rule: the brand (logo + wordmark) and the header controls are two separate position:fixed boxes, so nothing in layout
   stops them meeting. Each width below is sized so the controls always end before the wordmark starts (tests/ui-gate.mjs). */

/* The first-generation nav stylesheet pushed the controls 20px further in than the page gutter, on Course Hubs and type pages. */
.header-right { margin-right: 0 !important; }

/* Course Hub on phones: Brand + Search + Menu, like every other page. The course switcher moves to the top of the Menu. */
.hub-nav-courses { display: none; }
@media (max-width: 559px) {
  .header-right .hub-switch { display: none !important; }
  #navbar .hub-nav-courses { display: block; order: 1; }
  /* The course list FOLLOWS the Menu's own items, so Courses -> Semester N opens exactly where it always has (rig rehearsal: at the
     top it pushed the semesters below a 664px screen). */
  #navbar .nav-items:has(> .hub-nav-courses) { display: flex; flex-direction: column; gap: 0; } /* gap: the desktop row gap must not reach this column */
}
/* The open Menu scrolls whenever its content is taller than the screen, at every width: phone landscape (844x390) already cut off
   Semester 4-5 before this release (gate overlay.unreachable on production code). Only scrolls when it overflows. */
#navbar.active { overflow-y: auto; overscroll-behavior: contain; }
/* One wordmark size on every inner page phone width (it used to grow at 381px just as the space shrank). */
@media (max-width: 560px) {
  body:not(.home-v3) .fixed-logo a { gap: 8px !important; }
  body:not(.home-v3) .fixed-logo img { width: 28px !important; height: 28px !important; }
  body:not(.home-v3) .evo-wm { font-size: 17px; }
}
/* Homepage + paid home: ".com" and the 22px wordmark only once there is room beside Search + Menu (it met Search at 421-470px). */
@media (min-width: 421px) and (max-width: 479px) {
  body.home-v3 .fixed-logo img { width: 32px !important; height: 32px !important; }
  body.home-v3 .evo-wm { font-size: 19px; }
  body.home-v3 .evo-dot { display: none; }
}
/* ...and at 341-370px the "Menu" word left the wordmark 4px of air: icon-only there, as at 320px (accessible name unchanged). */
@media (max-width: 370px) {
  body.home-v3 .header-right .hamburger { width: 44px !important; padding: 0 !important; justify-content: center; }
  body.home-v3 .header-right .menu-text { display: inline !important; position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Below 320 CSS px (a 390px phone at 200% zoom) the word cannot fit beside the controls: keep the mark, keep the name for screen readers. */
@media (max-width: 319px) {
  .fixed-logo .evo-wm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Menu copy of the course switcher (Course Hub, phones). Same chips as the header panel. */
#navbar .hub-nav-courses { list-style: none; margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--e-line2, rgba(255,255,255,.14)); }
#navbar .hub-nav-courses .hub-switch-h, #navbar .hub-nav-courses .hub-switch-sub { margin: 0 0 10px; padding: 0; font-size: 13px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--e-muted, #96A1B3); }
#navbar .hub-nav-courses ul + .hub-switch-sub { margin-top: 14px; }
#navbar .hub-nav-courses > * { margin-left: 10px !important; margin-right: 10px !important; } /* the menu items' own 10px text inset */
#navbar .hub-nav-courses ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
#navbar .hub-nav-courses li { margin: 0; padding: 0; }
#navbar .hub-nav-courses .hub-chip { display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0 14px; border-radius: 10px; border: 0;
  background: var(--e-s2, #1A2231); color: var(--e-soft, #D3DAE4); font-size: 15px; font-weight: 600; letter-spacing: 0; text-decoration: none; }
#navbar .hub-nav-courses .hub-chip.is-active { background: var(--e-cy, #22E5FF); color: var(--e-on-cy, #03252D); }
#navbar .hub-nav-courses .hub-sem { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; padding: 0; font-size: 15px; font-weight: 600; color: var(--e-cy, #22E5FF); }
#navbar .hub-nav-courses a:focus-visible { outline: 2px solid var(--e-cy, #22E5FF); outline-offset: 2px; }

/* Course Hub hero: Semester and the course read as one group. The title carried a first-generation 10px/14px padding on top of the grid gap
   (26px from badge to letters at 390px; the paid home's "Sem 5 -> Your Semester 5" is ~13px). */
h1.hub-title { row-gap: 10px !important; }
h1.hub-title .lecture-notes-title { padding: 0 !important; }
/* Long titles wrap to 2-3 lines: the course icon sits with the first line instead of floating at the block's middle. */
h1.hub-title .evo-ico { align-self: start; }

/* Semester type pages: the badge lost its inner padding to a reset ("Semester 5" touched its border). */
.header-wrapper:not(:has(.hub-title)) .page-title > .lect-sem { padding-left: 13px !important; padding-right: 13px !important; }

/* Search dialog at 320px: flexbox squeezed the 48px close button to 18px wide (below the 24px minimum target). */
.search-header .close-search { flex-shrink: 0; }
.search-header input { min-width: 0; }
/* "What's new" in the desktop header is drawn 34px tall: keep the look, give it the same 44px hit area as Search and Menu (offsets count from inside its 1px border). */
.header-right .wn-trigger { position: relative; }
.header-right .wn-trigger::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; } /* ::after is the yellow "new" dot */
