/**
 * Fluid images for responsive purposes.
 * Offset `alt` text from surrounding copy.
 */
img {
    max-width: 100%;
    height: auto;
    font-style: italic;
}

// Google Maps breaks if `max-width: 100%` acts upon it; use their selector
// .gm-style img {
//     max-width: none;
// }

.aligncenter,
.alignnone,
.alignleft,
.alignright {
    display: block;
    width: auto !important;
    margin: 0;
    margin-bottom: rhythm(1);

    @include query-below($small) {
        margin-bottom: rhythm(0.7);
    }

    .archive__grid & {
        margin-bottom: 0;
    }
}

.aligncenter, .alignnone {
    margin-left: auto;
    margin-right: auto;
    text-align: center;

    img {
        margin: 0 auto;
    }
}

.alignleft, .alignright {
    margin-top: rhythm(1);
    max-width: 50%;

    p + & {
        margin-top: 0;
    }

    p > &:first-child,
    p > :first-child > &:first-child {
        margin-top: 0; 
    }
}

.alignleft {
    float: left;
    margin-right: rhythm(2);
}

.alignright {
    float: right;
    margin-left: rhythm(2);
}

@include query-below($small) {
    .alignleft {
        margin-right: rhythm(0.7);
    }

    .alignright {
        margin-left: rhythm(0.7);
    }
}

figure {
    max-width: 100%;

    img {
        display: block;
    }
}

figcaption {

}