/* The site's nav, one for every page: the main site (index.html), the Orbit page
   and the watchlist. Each page says only where it sits: sticky with a rule under
   it, or laid over the globe (.is-over, and Explore on the main site), where its
   links are Ink and only they take the pointer, so the globe drags up to them.

   Six links, the logos and on the main site the name button share one line, so
   the sizes step down with the width. On a phone, credits.js puts About and
   Credits into a "More" menu (.has-more), which leaves room for 15px words and a
   44px target per link. Until that script has run (or if it can't), the six fit
   at 13px, and at 12px below 390. */

:root {
  --nav-bar: 68px; /* the bar itself, without a rule */
  --nav-pad: 24px;
}

@media (max-width: 599px) {
  :root { --nav-bar: 52px; --nav-pad: 16px; }
}

.site-nav {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--nav-bar);
  padding: 0 calc(var(--nav-pad) + env(safe-area-inset-right, 0px)) 0 calc(var(--nav-pad) + env(safe-area-inset-left, 0px));
  font: 500 14px/1.45 "Jost", "Futura", "Century Gothic", "Helvetica Neue", Arial, sans-serif;
}

.brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  color: #E6EBF0;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 48px;
}

/* The Schulich School of Engineering's logo, beside the team's own: on its own white
   card, as it's drawn for white, so its black lettering and the gear's dark side show */
.brand-partner {
  display: block;
  width: auto;
  height: 58px;
  border-radius: 7px;
}

.wordmark {
  padding-left: 14px;
  border-left: 1px solid #34414E;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  min-width: 0;
}

/* 44px tall to tap, whatever the size of the words. Credits opens a pop-up, so
   it's a button that looks like the links. */
.nav-links > a,
.nav-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 0;
  padding: 0;
  background: none;
  color: #8A96A3;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.nav-links > a:hover,
.nav-btn:hover,
.nav-btn[aria-expanded="true"],
.nav-links > a[aria-current="page"] { color: #E6EBF0; }

/* The current page: an Ink underline. The team blue is for the satellite's path
   and focus rings. */
.nav-links > a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

.site-nav a:focus-visible,
.site-nav button:focus-visible {
  outline: 2px solid #3C9DF5;
  outline-offset: 2px;
}

/* Over the globe */

.site-nav.is-over,
body[data-view="explore"] .site-nav { pointer-events: none; }

.site-nav.is-over .brand,
.site-nav.is-over .nav-links > *,
body[data-view="explore"] .site-nav .brand,
body[data-view="explore"] .site-nav .nav-links > * { pointer-events: auto; }

.site-nav.is-over .nav-links > a,
.site-nav.is-over .nav-btn,
body[data-view="explore"] .site-nav .nav-links > a,
body[data-view="explore"] .site-nav .nav-btn { color: #E6EBF0; }

.site-nav.is-over .nav-links > a:hover,
.site-nav.is-over .nav-btn:hover,
.site-nav.is-over .nav-btn[aria-expanded="true"],
body[data-view="explore"] .site-nav .nav-links > a:hover,
body[data-view="explore"] .site-nav .nav-btn:hover,
body[data-view="explore"] .site-nav .nav-btn[aria-expanded="true"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  text-decoration-color: rgba(230, 235, 240, 0.4);
}

.site-nav.is-over .nav-links > a[aria-current="page"],
body[data-view="explore"] .site-nav .nav-links > a[aria-current="page"] { text-decoration-color: currentColor; }

/* Big screens (a desktop, a TV; not a 768px-tall laptop, whose picture needs the room):
   the two logos a size up, and the bar with them.
   assets/style.css gives Explore's globe the same room under it. */
@media (min-width: 1200px) and (min-height: 860px) {
  :root { --nav-bar: 88px; }
  .brand-logo { height: 64px; }
  .brand-partner { height: 76px; border-radius: 9px; }
}

/* Stepping down with the width */

@media (max-width: 999px) {
  .wordmark { display: none; }
}

@media (max-width: 899px) {
  .nav-links { gap: 16px; }
  .brand-logo { height: 44px; }
  .brand-partner { height: 52px; border-radius: 6px; }
}

@media (max-width: 779px) {
  .brand-logo { height: 36px; }
  .brand-partner { height: 44px; border-radius: 5px; }
}

@media (max-width: 699px) {
  .nav-links { gap: 14px; }
  .brand-logo { height: 28px; }
  .brand-partner { height: 34px; border-radius: 4px; }
}

@media (max-width: 599px) {
  .site-nav { gap: 10px; font-size: 13px; }
  .nav-links { gap: 10px; }
  .brand { gap: 10px; }
  .brand-logo { height: 25px; }
  .brand-partner { height: 34px; border-radius: 4px; }
}

/* Phones have no room for it beside the links: it stays in Credits */
@media (max-width: 489px) {
  .brand-partner { display: none; }
}

@media (max-width: 430px) {
  .site-nav { gap: 8px; }
  .nav-links { gap: 8px; }
  .brand-logo { height: 20px; }
}

@media (max-width: 389px) {
  .site-nav { font-size: 12px; }
}

/* The six links alone fill the narrowest phones; Explore goes to the same place as the logo. */
@media (max-width: 359px) {
  .site-nav { justify-content: flex-end; }
  .brand { display: none; }
}

/* Touch: every link at least 44px wide as well as tall, its words centred, and
   15px words (phones get theirs with the More menu, below) */
@media (pointer: coarse) {
  .nav-links > a,
  .nav-btn { justify-content: center; min-width: 44px; }
}
@media (pointer: coarse) and (min-width: 600px) {
  .site-nav { font-size: 15px; }
}

/* The "More" menu (credits.js): phones only. About and Credits move into it. */

.nav-more { position: relative; display: none; }

/* hangs from the bar's bottom edge, out to the screen's edge */
.nav-more-menu {
  position: absolute;
  top: calc(100% + (var(--nav-bar) - 44px) / 2);
  right: calc(-1 * (var(--nav-pad) + env(safe-area-inset-right, 0px)));
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: 8px 0;
  background: #1A2129;
  pointer-events: auto;
}
.nav-more-menu[hidden] { display: none; } /* not every page has a [hidden] rule of its own */

.nav-more-menu > a,
.nav-more-menu > button {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 0;
  padding: 0 var(--nav-pad);
  background: none;
  color: #E6EBF0;
  font: inherit;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.nav-more-menu > a:hover,
.nav-more-menu > button:hover { background: #262F39; }
.nav-more-menu > a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

/* On About, More is where the page is */
.nav-more:has(a[aria-current="page"]) > .nav-more-btn {
  color: #E6EBF0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

@media (max-width: 599px) {
  .nav-links.has-more { gap: 0; font-size: 15px; }
  .nav-links.has-more > .nav-in-more { display: none; }
  .nav-links.has-more > .nav-more { display: block; }
  /* 44px or wider each, with the gap between the words inside the links */
  .nav-links.has-more > a,
  .nav-links.has-more .nav-more-btn { justify-content: center; min-width: 44px; padding: 0 5px; }
  .nav-links.has-more .nav-more-btn { padding-right: 0; }
}

/* 360 to 389: a smaller logo and closer links keep all five on the line */
@media (max-width: 389px) {
  .brand-logo { height: 16px; }
  .nav-links.has-more > a,
  .nav-links.has-more .nav-more-btn { padding: 0 4px; }
  .nav-links.has-more .nav-more-btn { padding-right: 0; }
}

/* A phone on its side: the phone's 52px bar, so the page keeps the height, and only the
   team's logo (the Schulich logo stays in Credits) */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --nav-bar: 52px; }
  .brand-partner { display: none; }
}
@media (max-height: 500px) and (orientation: landscape) and (min-width: 600px) {
  .brand-logo { height: 32px; }
}
