/* Small layout tweaks. Main site colour lives in theme.scss. */

/* The three lab colours: Critical / Flows / Lab, and the three research themes
   (carbon = purple, socio-economic = cyan, material & transition = orange).
   Change them here only. */
:root {
  --cfl-purple: #7c4dbd;
  --cfl-orange: #d46b08;
  --cfl-cyan: #0e8f8f;
}

body.quarto-dark {
  --cfl-purple: #b794f4;
  --cfl-orange: #f6ad55;
  --cfl-cyan: #4fd1c5;
}

.cfl-1, .theme-carbon   { --theme-color: var(--cfl-purple); }
.cfl-2, .theme-material { --theme-color: var(--cfl-orange); }
.cfl-3, .theme-socio    { --theme-color: var(--cfl-cyan); }

/* Coloured title words: home page heading and navbar title use the same colours */
.cfl-1, .cfl-2, .cfl-3 { color: var(--theme-color); }

/* Navbar: thin line under the pale teal bar (bar colours are in theme.scss / theme-dark.scss) */
.navbar { border-bottom: 1px solid #d3e8e6; }
body.quarto-dark .navbar { border-bottom-color: #27403f; }

/* Navbar right: icons the same size and centred on one line */
.navbar .navbar-nav.ms-auto .nav-link .bi,
.navbar .navbar-nav.ms-auto .nav-link .ai,
.navbar .quarto-color-scheme-toggle .bi {
  font-size: 1.2rem;
  line-height: 1;
  vertical-align: 0;
}

/* Quarto's search icon is drawn at 26px; match the other icons */
.navbar #quarto-search .aa-DetachedSearchButtonIcon svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* The Google Scholar and ResearchGate glyphs are drawn smaller, so enlarge them to match */
.navbar .navbar-nav.ms-auto .nav-link .ai-google-scholar,
.navbar .navbar-nav.ms-auto .nav-link .ai-researchgate {
  font-size: 1.45rem;
}

/* On wide screens, give every icon link the same box so they line up exactly */
@media (min-width: 992px) {
  .navbar .navbar-nav.ms-auto .nav-link,
  .navbar .quarto-color-scheme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.25rem;
    min-width: 2.1rem;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Navbar: dark mode button shows a moon (switch to dark) or a sun (switch to light) */
.navbar .quarto-color-scheme-toggle .bi::before {
  background-image: none !important;
  width: auto;
  height: auto;
  content: "\f497";  /* Bootstrap icon: moon */
}

.navbar .quarto-color-scheme-toggle.alternate .bi::before {
  content: "\f5a2";  /* Bootstrap icon: sun */
}

/* Navbar: 中/EN language switch */
.navbar .lang-switch {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

/* Navbar: bold lab title; page links a little lighter, current page underlined */
.navbar .navbar-title {
  font-weight: 700;
}

.navbar .nav-link .menu-text {
  opacity: 0.8;
}

.navbar .nav-link:hover .menu-text,
.navbar .nav-link.active .menu-text {
  opacity: 1;
}

.navbar .nav-link.active .menu-text {
  padding-bottom: 2px;
  border-bottom: 2px solid currentColor;
}

/* Join us page: more space between sections */
.join-page #title-block-header {
  margin-bottom: 2rem;
}

.join-page main h2 {
  margin-top: 2.75rem;
  margin-bottom: 1rem;
}

.join-page main p,
.join-page main ul {
  margin-bottom: 1.1rem;
}

/* Research theme cards on the home page.
   Flex column so the featured/"more" links line up at the bottom of every card. */
.theme-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--theme-color, var(--bs-primary));
  background: rgba(127, 127, 127, 0.07);
  border-radius: 4px;
}

.theme-card img {
  width: 100%;
  height: 70px;
  margin-bottom: 0.5rem;
}

.theme-card h3 {
  margin-top: 0;
  font-size: 1.15rem;
}

.theme-card h3 a {
  color: var(--theme-color, inherit);
  text-decoration: none;
}

.theme-card .theme-links {
  margin-top: auto;
  font-size: 0.95rem;
}

.theme-card .theme-links p {
  margin-bottom: 0.4rem;
}

/* On wide screens, reserve two lines for card titles so the cards line up */
@media (min-width: 768px) {
  .theme-card h3 {
    min-height: 2.6em;
  }
}

/* Publication lists (publications.ejs) */
.pub-year {
  font-size: 1.1rem;
  margin-top: 1.5rem;
}

.pub-list li {
  margin-bottom: 0.6rem;
}

/* Small theme labels after each publication, in the theme colour */
.pub-theme {
  display: inline-block;
  padding: 0 0.4rem;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--theme-color, inherit);
  border: 1px solid color-mix(in srgb, var(--theme-color, #7f7f7f) 50%, transparent);
  background: color-mix(in srgb, var(--theme-color, #7f7f7f) 8%, transparent);
  border-radius: 1rem;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: 1px;
}

/* Compact news list on the home page (news.ejs) */
.news-list {
  list-style: none;
  padding-left: 0;
}

.news-list li {
  margin-bottom: 0.3rem;
}

.news-date {
  display: inline-block;
  min-width: 5.5rem;
  color: var(--bs-secondary-color, #8a8f98);
}

/* Full news list on the News page: date on its own line, then the news text */
.news-full li {
  margin-bottom: 1.4rem;
}

.news-full .news-date {
  display: block;
  font-size: 0.9rem;
}
