/* Technical figure behaviour; typography, palette and article width use the shared theme. */
:is(.marine-project-page, .device-project-page, .microgrid-project-page) .page__content [id] { scroll-margin-top: 7rem; }
:is(.marine-project-page, .device-project-page, .microgrid-project-page) figure:not(.half) > a { width: 100%; }
:is(.marine-project-page, .device-project-page, .microgrid-project-page) figure img { height: auto; }
@media (min-width: 600px) {
  :is(.marine-project-page, .device-project-page, .microgrid-project-page) figure:not(.project-blueprint) {
    width: 80%;
    margin-left: auto;
    margin-right: auto;
  }
}
.device-project-page .device-experiment-rotation {
  position: relative;
  display: block;
  aspect-ratio: 2474 / 3301;
  overflow: hidden;
}
.device-project-page .device-experiment-rotation img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% * 3301 / 2474);
  max-width: none;
  transform: translate(-50%, -50%) rotate(90deg);
}

/* Contents use the existing right-hand gutter; narrower screens keep them above the article. */
.project-contents.is-sidebar {
  position: fixed;
  top: var(--contents-top);
  left: var(--contents-left);
  width: var(--contents-width);
  max-height: calc(100vh - var(--contents-top) - 1.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 0.8em;
}
.project-contents.is-sidebar ul { margin: 0; padding: 0; list-style: none; }
.project-contents.is-sidebar li { margin: 0; }
.project-contents.is-sidebar a { overflow-wrap: anywhere; }
.project-contents a[aria-current="location"] { font-weight: 700; }
.project-contents.is-sidebar li { padding: .35em .25em; }
.page__content h2[tabindex="-1"]:focus { outline: none; }
.project-table-scroll { overflow-x: auto; }
.project-table-scroll table { min-width: 560px; }
.math-display { overflow-x: auto; overflow-y: hidden; }
@media (max-width: 1199px) {
  .project-contents.is-sidebar { position: static; width: auto; max-height: none; overflow: visible; }
}
@media print {
  .project-contents { display: none; }
}
