/* A photo that shares a text section: full strength on one side, dissolving into the section
   colour where the text sits (owner, 2026-11-03; the first version washed the whole photo to a ghost).
   Loaded by index.html and machines.html only. The photo is decorative (the text carries the
   meaning), so the wrapper is aria-hidden and the image has an empty alt.
   The text side is the section's own token background, which flips in dark mode, so legibility
   never depends on the photo. */

.photo-backdrop {
  --bd-w: 62%;     /* how much of the section the photo box covers */
  --bd-fade: 46%;  /* how far into that box the photo is fully solid */
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.photo-backdrop__img { position: absolute; top: 0; bottom: 0; right: 0; width: var(--bd-w); z-index: -1; pointer-events: none; }
.photo-backdrop__img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--bd-pos, 50% 40%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .35) calc(var(--bd-fade) * .45), #000 var(--bd-fade));
  mask-image: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, .35) calc(var(--bd-fade) * .45), #000 var(--bd-fade));
}
/* A bright photo beside light text would glare in dark mode, so it is dimmed there. */
:root[data-theme="dark"] .photo-backdrop__img img { filter: brightness(.6) saturate(.92); }
/* A photo that already has its own navy ground blends into a navy section as is. */
:root[data-theme="dark"] .photo-backdrop--navy .photo-backdrop__img img { filter: none; }

.photo-backdrop__content { max-width: var(--bd-text, 36rem); margin-inline: 0; }
.photo-backdrop__caption { margin: 1.25rem 0 0; font-size: .95rem; font-style: italic; color: var(--text-muted); }

/* Text on the right, photo on the left, for a photo whose subject sits on the left. */
.photo-backdrop--right .photo-backdrop__img { right: auto; left: 0; }
.photo-backdrop--right .photo-backdrop__img img {
  -webkit-mask-image: linear-gradient(270deg, transparent 0%, rgba(0, 0, 0, .35) calc(var(--bd-fade) * .45), #000 var(--bd-fade));
  mask-image: linear-gradient(270deg, transparent 0%, rgba(0, 0, 0, .35) calc(var(--bd-fade) * .45), #000 var(--bd-fade));
}
.photo-backdrop--right .photo-backdrop__content { margin-left: auto; }

/* Phones: the text takes the full width, so the photo becomes a strip under it that fades upward. */
@media (max-width: 860px) {
  .photo-backdrop { padding-bottom: calc(clamp(14rem, 72vw, 21rem) + 1rem); }
  .photo-backdrop__img,
  .photo-backdrop--right .photo-backdrop__img { top: auto; right: 0; left: 0; bottom: 0; width: 100%; height: clamp(14rem, 72vw, 21rem); }
  .photo-backdrop__img img,
  .photo-backdrop--right .photo-backdrop__img img {
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .4) 22%, #000 55%);
    mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, .4) 22%, #000 55%);
  }
  .photo-backdrop--right .photo-backdrop__content { margin-left: 0; }
}
