/* Shared photo fades for the homepage and editorial pages. */
body.editorial-site.editorial-product {
  background: radial-gradient(ellipse at 35% 0%, #171718e8, #0d0d0ee8),
    url('../image/editorial/ref/carbon-grain.jpg') repeat #0d0d0e !important;
}

body.editorial-site.memoir-page {
  background: radial-gradient(ellipse at 37% 16%, #1b1714e8 0%, #0d0d0ee8 58%) fixed,
    url('../image/editorial/ref/carbon-grain.jpg') repeat #0d0d0e !important;
}

.editorial-product .hero .hero-overlay {
  background: linear-gradient(180deg, #0d0d0e82, #0d0d0e4d 45%, #0d0d0eb0);
}

@supports (mask-composite: intersect) {
  :is(
    .ed-photo,
    .photo-edge,
    .ed-home :is(.home-image, .story-media img),
    .ref-creator-group img,
    .editorial-product .hero-bg img,
    .editorial-product .hero-overlay,
    .memoir-page .memoir-main-portrait,
    .memoir-page .memoir-birth img,
    .memoir-page .memoir-dates img,
    .memoir-page .node-avatar,
    .memoir-page .person-head img,
    .memoir-page .timeline-photo
  ),
  .ed-drama .ed-cinema-hero::after {
    --photo-edge-side: var(--photo-fade-side, clamp(12px, 6%, 84px));
    --photo-edge-top: var(--photo-fade-top, clamp(10px, 9%, 74px));
    --photo-edge-bottom: var(--photo-fade-bottom, clamp(18px, 18%, 110px));
    mask-image:
      linear-gradient(to right, transparent, #000 var(--photo-edge-side),
        #000 var(--photo-fade-right-start, calc(100% - var(--photo-edge-side))),
        transparent var(--photo-fade-right-end, 100%)),
      linear-gradient(to bottom, transparent, #000 var(--photo-edge-top),
        #000 calc(100% - var(--photo-edge-bottom)), transparent);
    mask-composite: intersect;
  }

  :is(.memoir-page :is(.memoir-birth img, .memoir-dates img, .node-avatar, .person-head img, .timeline-photo), .photo-edge--thumbnail) {
    --photo-fade-side: clamp(4px, 6%, 12px);
    --photo-fade-top: 9%;
    --photo-fade-bottom: 12%;
  }

  .memoir-page .memoir-birth {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: var(--memoir-muted) !important;
  }

  .memoir-page :is(.memoir-dates img, .node-avatar) { border-color: transparent; }

  .memoir-page .person-node:is(:hover, .active, .lineage-focus, :focus-visible) {
    outline: 1px solid var(--memoir-accent);
    outline-offset: 2px;
  }

  /* The contact photograph contains a dark strip in its last 3.6%. */
  .ed-home #contact .ref-contact-photo > .ed-photo {
    --photo-fade-right-start: 84%;
    --photo-fade-right-end: 96%;
  }
  .ed-home .ed-archive-bridge > .ed-figure img {
    --photo-fade-bottom: 24%;
  }
  .ed-home .story-media img {
    --photo-fade-top: clamp(16px, 10%, 88px);
    --photo-fade-bottom: clamp(18px, 12%, 100px);
  }
}
