/* Round-4 photo frames (October 26, 2026): photographs show cleanly in every theme.
   No blue, navy, or black fill or border beside a photograph: light themes let the
   card show through; dark themes use a neutral dark frame. Photographs stay whole. */
:root { --photo-edge-light: rgba(0, 0, 0, .16); --photo-edge-dark: rgba(255, 255, 255, .14); --photo-frame-dark: #101010; }

/* Every theme: the image element itself never paints a fill behind the photograph. */
body[data-design] :is(figure, .gallery, .gallery-open, .card-thumb, .archive-item, .people-portrait-card, .person-kinship-figure, .binding-image, .hero-book, .stone-figure, .lightbox-image-stage, .lightbox-inner) img {
  background: transparent !important;
}
/* Pure photo wrappers carry no fill of their own. */
body[data-design] :is(.gallery-open, .lightbox-image-stage) { background: transparent !important; }

/* Light themes: no navy frame fill or border around photographs. */
body[data-design="egyptian"] :is(.card-thumb, .stone-figure) { background: transparent !important; }
body[data-design="egyptian"] :is(figure, .card-thumb, .archive-item, .people-portrait-card, .person-kinship-figure, .stone-figure, .hero-book, .binding-image),
body[data-design="egyptian"] :is(figure, .card-thumb, .archive-item, .people-portrait-card, .person-kinship-figure, .stone-figure, .hero-book, .binding-image) img {
  border-color: var(--photo-edge-light) !important;
}

/* Dark themes: keep the dark look, but neutral rather than blue. */
body[data-design="midnight"] :is(.gallery figure, figure, .stone-figure, .card-thumb, .archive-item, .people-portrait-card, .person-kinship-figure, .binding-image, .gallery-open) {
  background-color: var(--photo-frame-dark) !important;
}
body[data-design="midnight"] :is(figure, .card-thumb, .archive-item, .people-portrait-card, .person-kinship-figure, .stone-figure, .hero-book, .binding-image, .gallery-open),
body[data-design="midnight"] :is(figure, .card-thumb, .archive-item, .people-portrait-card, .person-kinship-figure, .stone-figure, .hero-book, .binding-image, .gallery-open) img {
  border-color: var(--photo-edge-dark) !important;
}

/* Lightbox: a neutral dark backdrop in the themes that used a blue or teal one. */
body:is([data-design="midnight"], [data-design="egyptian"], [data-design="atlas"]) .lightbox { background: rgba(12, 12, 12, .95) !important; }
body:is([data-design="midnight"], [data-design="egyptian"], [data-design="atlas"]) .lightbox-inner {
  background: #151515 !important; border-color: var(--photo-edge-dark) !important;
}

/* Caption rules directly under photographs: neutral, not navy. */
body[data-design="egyptian"] :is(.archive-item, figure, .stone-figure, .people-portrait-card, .card-thumb) > :is(div, figcaption, span, small) { border-color: var(--photo-edge-light) !important; }
body[data-design="midnight"] :is(.archive-item, figure, .stone-figure, .people-portrait-card, .card-thumb) > :is(div, figcaption, span, small) { border-color: var(--photo-edge-dark) !important; }
