/* Make marginfigure behave exactly like a marginnote */
div.marginfigure {
    float: right;
    clear: right;
    width: 30%;
    margin-right: -37%;
    margin-left: 1.5rem;
    position: relative;
    margin-top: 0.3rem;
    
    /* display: inline-block !important;   /* IMPORTANT fix */ */
    /* vertical-align: top; */
    /* width: 30% !important; */
    /* max-width: 30% !important; */
    float: right;
    clear: right;
    margin-right: 10%;
    margin-left: 1.5rem;
    margin-top: 0.3rem;
    position: relative;
}

div.marginfigure > figure {
    display: block;
    float: none !important;
    max-width: 100% !important;
    margin: 0;
}

/* Fix the TRUE cause: figcaption float */
div.marginfigure > figure > figcaption {
    float: none !important;        /* REQUIRED */
    clear: none !important;        /* REQUIRED */
    max-width: 100% !important;    /* REQUIRED */
    /* position: static !important; */
    line-height: 1.3;
    margin-top: 0.4rem;
}

/* Good: let image fill the margin column */
div.marginfigure > figure > img {
    max-width: 100%;
    height: auto;
    display: block;
}


