/*
 * Image on its own: text column (like running text, from 1024px), wide
 * (content width of the area) or full (to the edges of the page).
 */
.ef-figure {
  margin: 0;
}

.ef-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.ef-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.375rem;
  color: var(--color-base-content);
}

@media (min-width: 64rem) {
  .ef-figure--text {
    width: 100%;
    max-width: var(--text-measure);
    justify-self: center;
    margin-inline: auto;
  }
}

/* Out of the container to the page edges; the Navigation module's sidebar is not part of the page. */
.ef-figure--full {
  --ef-page-width: calc(100vw - var(--drupal-displace-offset-left, 0px));
  width: var(--ef-page-width);
  max-width: none;
  margin-inline: calc((100% - var(--ef-page-width)) / 2);
}

.ef-figure--full figcaption {
  padding-inline: 1rem;
}

/* ponytail: 100vw includes a classic (always visible) scrollbar, so the image sits ~8px off centre there; clip instead of scrolling. A JS-measured scrollbar width would fix it if it bothers. */
section:has(.ef-figure--full) {
  overflow-x: clip;
}
