/* Paint containment keeps transformed or animated content inside its post. */
.post-body, .mfm-preview, .mfm-boundary { overflow: clip; contain: paint; isolation: isolate; overflow-wrap: anywhere; }
.mfm-effect { display: inline-block; max-width: 100%; vertical-align: baseline; transform-origin: center; }
.mfm-plain, .mfm-fg, .mfm-bg, .mfm-font { display: inline; }
.mfm-center { display: block; text-align: center; }
.mfm-small { font-size: .8em; }
.mfm-x2 { transform: scale(2); margin-inline: .5em; }
.mfm-x3 { transform: scale(3); margin-inline: 1em; }
.mfm-x4 { transform: scale(4); margin-inline: 1.5em; }
.mfm-blur { filter: blur(4px); }
.mfm-blur:hover, .mfm-blur:focus-within { filter: none; }
.mfm-animated { animation-duration: 2s; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
.mfm-spin { animation-name: mfm-spin; animation-timing-function: linear; }
.mfm-shake, .mfm-twitch { animation-name: mfm-shake; }
.mfm-jump, .mfm-bounce { animation-name: mfm-bounce; }
.mfm-jelly, .mfm-tada { animation-name: mfm-jelly; }
.mfm-rainbow { animation-name: mfm-rainbow; }
.mfm-fade { animation-name: mfm-fade; }
@keyframes mfm-spin { to { transform: rotate(360deg); } }
@keyframes mfm-spin-x { to { transform: rotateX(360deg); } }
@keyframes mfm-spin-y { to { transform: rotateY(360deg); } }
@keyframes mfm-shake { 25% { transform: translateX(-2px) rotate(-3deg); } 75% { transform: translateX(2px) rotate(3deg); } }
@keyframes mfm-bounce { 50% { transform: translateY(-.3em); } }
@keyframes mfm-jelly { 50% { transform: scale(1.15, .85); } }
@keyframes mfm-rainbow { 0%, 100% { color: #b43a3a; } 33% { color: #247a38; } 66% { color: #435bb6; } }
@keyframes mfm-fade { 50% { opacity: .35; } }
/* Until both preferences are known, motion stays off. */
html:not([data-mfm-allowed="true"]) .mfm-animated,
html:not([data-mfm-motion="true"]) .mfm-animated { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .mfm-animated { animation: none !important; } }
