/* Language switch under the logo in the sidebar */
.lang-switch {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin: 0 var(--sidebar-item-spacing-horizontal) 0.75rem;
  font-size: var(--sidebar-item-font-size);
}

.lang-switch a {
  color: var(--color-sidebar-link-text);
  text-decoration: none;
}

.lang-switch a:hover {
  color: var(--color-brand-content);
  text-decoration: underline;
}

.lang-switch-current {
  color: var(--color-brand-primary);
  font-weight: 600;
}

/* Figures: the image and its caption in one frame, with space before the next figure */
article figure {
  margin: 1.75rem 0 2.25rem;
  padding: 0.75rem 0.75rem 0.6rem;
  border: 1px solid var(--color-background-border);
  border-radius: 0.4rem;
  background: var(--color-background-secondary);
}

article figure img {
  display: block;
  margin: 0 auto;
  border-radius: 0.2rem;
  background: #fff;
}

article figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.9em;
  text-align: left;
  color: var(--color-foreground-secondary);
}

article figure figcaption p {
  margin: 0;
}

/* Images open over the page (see lightbox.js) */
article img.zoomable {
  cursor: zoom-in;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 7rem);
  object-fit: contain;
  border-radius: 0.25rem;
  background: #fff;
  box-shadow: 0 0 2rem rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  max-width: 70rem;
  font-size: 0.9rem;
  text-align: center;
  color: #eee;
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  border: 0;
  background: none;
  font-size: 2rem;
  line-height: 1;
  color: #eee;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
}
