/* Keep the published theme's menu usable without its original scripts. */
@media (min-width: 801px) {
  /* Let the dropdown extend past the footer on short pages. */
  #shadow { overflow: visible; }
  #container footer { border-radius: 0 0 4px 4px; }
}

#projects-toggle {
  display: flex;
  align-items: center;
  gap: .5em;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  padding: 0 20px;
  height: 100%;
  min-height: 55px;
  cursor: pointer;
}

#projects-toggle::before {
  content: "";
  width: 1em;
  height: 1em;
  color: inherit;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1.5' y='1.5' width='13' height='13' rx='2' stroke='black' stroke-width='2.5' fill='none'/%3E%3Cpath d='m6 4 5 4-5 4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

#projects-toggle[aria-expanded="true"] {
  background: #efefef;
  color: #111;
  border-radius: 3px 3px 0 0;
}

#projects-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }

#shadow nav #projects-submenu[hidden] { display: none; }
#shadow nav #projects-submenu:not([hidden]) {
  top: 100%;
  opacity: 1;
}

@media (max-width: 800px) {
  #projects-toggle { min-height: 0; padding: .4rem; }
  #shadow nav #projects-submenu:not([hidden]) { position: static; width: auto; }
}

#shadow nav a:focus-visible,
#projects-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

#mobile-menu { display: none; }
#shadow nav li a.current::before { content: none; }

@media (max-width: 800px) {
  #shadow nav {
    display: block !important;
    position: static;
    margin: 0;
    padding: .5rem;
    background: #008080;
  }

  #shadow nav > ul { display: flex; flex-wrap: wrap; }
  #shadow nav > ul > li { float: none; }
  #shadow nav > ul > li > a { padding: .4rem; line-height: 1.5; }
  #shadow nav > ul > li > ul { z-index: 20; }
  #shadow .menu-ready #mobile-menu {
    display: block;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    background: #28666a;
    border: 1px solid currentColor;
    border-radius: 3px;
    padding: .35rem .65rem;
    font: inherit;
    cursor: pointer;
  }

  #shadow .menu-ready:not(:has(#mobile-menu[aria-expanded="true"])) nav {
    display: none !important;
  }
}

#container #content.publications { padding-top: 1.25rem; }
#container #content.publications h1 { padding-top: 0; }
#container #content.publications p { margin-bottom: .55rem; padding-bottom: 0; }
#container #content.publications img.award { height: .8em; }

.carousel { position: relative; margin-bottom: 1rem; }
.carousel figure { margin: 0; }
.carousel figure[hidden] { display: none; }

.carousel--caption-overlay figure { position: relative; }
.carousel--caption-overlay figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: clamp(.375rem, 1.5vw, .9375rem) 4%;
  background: rgb(0 0 0 / .45);
  color: white;
  font-size: clamp(.65625rem, 1.875vw, .9375rem);
  line-height: 1.25;
}

.carousel img { display: block; width: 100%; height: auto; }
.carousel iframe { display: block; width: 100%; border: 0; aspect-ratio: 16 / 9; }

.carousel .controls {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.carousel .slide-count {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.carousel button {
  position: absolute;
  background: rgb(0 0 0 / .65);
  color: white;
  border: 0;
  border-radius: .35rem;
  padding: .5rem;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
}

.carousel button:focus-visible { outline: 2px solid white; outline-offset: 2px; }

.carousel-arrow {
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
}

.carousel-arrow::before {
  content: "";
  width: .65rem;
  height: .65rem;
  border: solid currentColor;
  border-width: 0 3px 3px 0;
}

.carousel-arrow[data-step="-1"] { left: .75rem; }
.carousel-arrow[data-step="1"] { right: .75rem; }
.carousel-arrow[data-step="-1"]::before { transform: translateX(2px) rotate(135deg); }
.carousel-arrow[data-step="1"]::before { transform: translateX(-2px) rotate(-45deg); }

@media (hover: hover) and (pointer: fine) {
  .carousel:not(:hover):not(:focus-within) button { opacity: 0; pointer-events: none; }
}

.project-video,
.lab-map {
  display: block;
  width: 100%;
  border: 0;
  margin-bottom: 1rem;
}
.project-video { aspect-ratio: 16 / 9; }
.lab-map { aspect-ratio: 4 / 3; max-width: 600px; }
#content img { max-width: 100%; height: auto; }
#content img.award { height: .8em; }
#content img[alt="EQUIS Lab on YouTube"] { width: 32px; }

.person-profile {
  display: grid;
  grid-template-columns: min(25%, 9.875rem) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(.75rem, 3vw, 1.875rem);
  padding-block: .65rem;
}
.person-profile + .person-profile { border-top: 1px solid #ddd; }
.person-profile > p:first-child { grid-row: 1 / 3; }
#content .person-profile > p { margin: 0; padding: 0; }
#content .person-profile > p:nth-child(2) { margin-bottom: .65rem; }
#content .person-profile img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  border: 4px solid #eee;
}
