/* ==========================================================================
   Images — figures with captions, a soft frame, and pictures that follow
   light / dark mode. (Images never overflow: the reboot sets max-width: 100%.)
   ========================================================================== */

.figure { display: inline-block; margin: 0 0 1rem; }
.figure-img { margin-bottom: .5rem; border-radius: var(--mo-radius-card); }
.figure-caption { font-size: .8125rem; color: var(--mo-fg-3); }

/* A soft frame instead of a hard border: the picture sits on a light panel */
.img-frame { display: inline-block; max-width: 100%; padding: .375rem; background: var(--mo-bg-1); border-radius: var(--mo-radius-card); }
.img-frame > img { display: block; border-radius: calc(var(--mo-radius-card) - .375rem); }

/* One picture per mode: <img class="light-only" src="shot-light.png"> + <img class="dark-only" src="shot-dark.png">
   Follows the theme toggle, the system setting, and sections with their own data-mo-theme.
   (Images that are hidden are never downloaded when they also have loading="lazy".) */
@media (prefers-color-scheme: light) { :root:not([data-mo-theme="dark"]) .dark-only { display: none !important; } }
@media (prefers-color-scheme: dark) { :root:not([data-mo-theme="light"]) .light-only { display: none !important; } }
:root[data-mo-theme="light"] .dark-only, :root[data-mo-theme="dark"] .light-only { display: none !important; }
[data-mo-theme="dark"]:not(:root) .light-only, [data-mo-theme="light"]:not(:root) .dark-only { display: none !important; }
[data-mo-theme="dark"]:not(:root) .dark-only, [data-mo-theme="light"]:not(:root) .light-only { display: revert !important; }
