/* =============================================================================
   CEDIS Lab — css/responsive.css
   -----------------------------------------------------------------------------
   Phone and tablet layouts, and reduced-motion overrides. Load this file last.
   Breakpoints (max-width): 1000 tablets · 900 · 760 phones · 600 · 520
   ============================================================================= */
/* Navigation: on phones the page links open as a panel under the bar
   (js/lab.js toggles .menu-open); the bar keeps the lab name, "Join the lab"
   and the menu button. */
@media (max-width: 900px) {
  .nav-r { gap: 16px; }
  .nav-menu { display: grid; }
  .nav-links { display: none; position: absolute; top: calc(100% + 8px); right: max(12px, env(safe-area-inset-right, 0px)); width: min(260px, calc(100vw - 24px));
    flex-direction: column; align-items: stretch; gap: 2px; padding: 8px; border-radius: 20px;
    background: rgba(22, 22, 24, .94); -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .8); }
  .menu-open .nav-links { display: flex; }
  .nav-links a.nl { display: block; padding: 12px 14px; border-radius: 12px; font-size: 1.0625rem; color: var(--white); }
  .nav-links a.nl:hover, .nav-links a.nl[aria-current="page"] { background: rgba(255, 255, 255, .08); box-shadow: none; padding-bottom: 12px; }
}
@media (max-width: 380px) { .nav .lab-n b { display: none; } }

/* Home */
@media (max-width: 900px) {
  .feature, .origin { grid-template-columns: minmax(0, 1fr); }
  .big-mark { max-width: 300px; }
}
@media (max-width: 600px) {
  .web .lbl { font-size: 34px; }
  .web .hub-t { display: none; }
}
/* (The research areas quadrant has its own sizes in components.css.) */
@media (max-width: 520px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* Inner pages: the faint mark behind the page title stays off small screens */
@media (max-width: 760px) { .page-head .ghost-mark { display: none; } }

/* Research: the area title above its body; no sticky column */
@media (max-width: 900px) {
  .area { grid-template-columns: minmax(0, 1fr); }
  .area-intro { position: static; }
}

/* Projects */
@media (max-width: 900px) {
  .proj { grid-template-columns: minmax(0, 1fr); }
  .next-list { grid-template-columns: minmax(0, 1fr); }
}

/* People */
@media (max-width: 760px) {
  .pair { grid-template-columns: minmax(0, 1fr); }
  .director { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 280px; }
}
@media (max-width: 520px) { .profile { grid-template-columns: minmax(0, 1fr); gap: 2px; } .profile dd { margin-bottom: 10px; } }

/* Join */
@media (max-width: 1000px) { .opp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .ways, .apply { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .opp-grid { grid-template-columns: minmax(0, 1fr); } }

/* Contact */
@media (max-width: 900px) { .contact { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .row2 { grid-template-columns: minmax(0, 1fr); } }

/* Footer: link columns wrap under the lab line; a mark opposite the CEDIS
   Lab mark (when there is one) shrinks a little on phones to stay on its row */
@media (max-width: 520px) { .foot-brand { margin-bottom: -18px; } .foot-brand .mcgill img { height: 30px; } }
@media (max-width: 360px) { .foot-brand { gap: 12px; } .foot-brand .mcgill img { height: 26px; } }
@media (max-width: 900px) { .foot-top { grid-template-columns: repeat(3, minmax(0, 1fr)); } .foot-id { grid-column: 1 / -1; } }
/* Phones: the three link columns stay side by side, and the bottom bar drops
   "Join the lab" (it is already under Get involved and in the menu bar). */
@media (max-width: 520px) { .foot-top { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 16px; } .foot .bot nav a[href$="join.html"] { display: none; } }

/* Reduced motion: no smooth scrolling, reveal, travelling packets or pulses. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rise:not(.in) { transform: none; }
  .web .pk, .web .ping { display: none; }
  .nav-menu path, .toast, .area-card { transition: none; }
}
