/************* GENERAL DEVICE-SIZE-BASED ITEMS *************/

/* CLASS KEYWORDS: */
.container, .contained {
    margin: auto;
}

/* NOTE:  IE-specific logic further down uses padding-right, padding-bottom to create grid gaps, and then it unsets the padding if display: grid is supported, so never use padding in columns */
.columns { /* Equal sized columns - these are set up with automatic doubling and stacking below */
    display: -ms-grid;
    display: grid;
    width: 100%;
}

/* A wrapper that centers content using flexbox */
.content-wrapper {
    display: flex;
    flex-direction: column;
}
.content-wrapper .centered {
    align-self: center;
}

*.padded {
    padding-top: calc(50px + 1.2vw);
    padding-bottom: calc(50px + 1.2vw);
}
*.bottom-padded {
    padding-bottom: calc(50px + 1.2vw);
}
*.bottom-spaced {
    margin-bottom: calc(50px + 1.2vw);
}
*.content-centered {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

/* Class refinements */
/* IE fix: grid-gap not supported in IE, so simulate with padding; NOTE: the following padding-right pads all columns the same and so therefore lets the last item in a little from the right-most content border, but this is fine for IE */
/* bottom padding (grid gap) the same for any number of columns (only apply when multiple columns - 449px and lower is shown at one column). */
@media screen and (min-width: 450px) {
    .columns > div {
        padding-bottom: calc(15px + 0.5vw);
        /* Set to relative in case need to do any absolutely positioned overlays within the div */
        position: relative;
    }
    /* different right padding (grid gap) depending upon number of columns */
    .two.columns > div , .two-2fr-1fr.columns > div {
        padding-right: calc(25px + 1vw);
    }
    .three.columns > div {
        padding-right: calc(20px + 1vw);
    }
    .four.columns > div {
        padding-right: calc(25px + 1vw);
    }
}
/* IE fix:  Must tell IE which column each block goes in - IMPORTANT NOTE:  not concerned about re-ordering at smaller screen sizes - assuming IE only being used on desktops */
.columns > div:nth-of-type(1) {
    -ms-grid-column: 1;
}
.columns > div:nth-of-type(2) {
    -ms-grid-column: 2;
}
.columns > div:nth-of-type(3) {
    -ms-grid-column: 3;
}
.columns > div:nth-of-type(4) {
    -ms-grid-column: 4;
}
.columns > div:nth-of-type(5) {
    -ms-grid-column: 5;
}
@supports (display: grid) {
    @media screen and (min-width: 450px) {
        /* Remove padding applied above for IE (only for multiple column layouts - single-column layout does not use the word columns) - selector has to be as specific as the one applied for IE otherwise !important is needed */
        /* image_grid is a special case - since the image_grid div is where Isotope Layout js library lays out images */
        .columns:not(#image_grid) > div {
            padding: 0 !important;
        }
    }
    /* Basing number of columns on the class attribute covers both equal-width and unequal-width columns */
    .columns[class^='two'] {
        grid-gap: calc(25px + 1vw) calc(15px + 0.5vw);
    }
    .columns[class^='three'] {
        grid-gap: calc(20px + 1vw) calc(15px + 0.5vw);
    }
    .columns[class^='four'] {
        grid-gap: calc(15px + 1vw) calc(15px + 0.5vw);
    }
    .columns[class^='five'] {
        grid-gap: calc(10px + 1vw) calc(10px + 0.5vw);
    }
}
/* @media queries */
@media only screen and (max-width: 449px) {
    .columns {
        display: -webkit-box !important;
        display: -ms-flexbox !important;
        display: flex !important; /* Override grid to make single column */
        flex-direction: column;
        align-items: flex-start;
    }
    .columns > div {
        padding: 0 3vw;
    }
    .columns > div:not(:last-child) {
        margin-bottom: calc(15px + 3vw);
    }
    .container {
        max-width: 96vw;
    }
    .contained {
        padding-left: 4vw;
        padding-right: 4vw;
    }
}
@media only screen and (min-width: 450px) and (max-width: 767px) {
    .container {
        max-width: 92vw;
    }
    .contained {
        padding-left: 6vw;
        padding-right: 6vw;
    }
    .two.columns {
        -ms-grid-columns: 1fr 1fr;
        grid-template-columns: 1fr 1fr;
    }
    .three.columns {
        -ms-grid-columns: 1fr 1fr 1fr;
        grid-template-columns: 1fr 1fr 1fr;
    }
    .four.columns {
        -ms-grid-columns: 1fr 1fr;
        grid-template-columns: 1fr 1fr;
    }
    .two-2fr-1fr.columns {
        -ms-grid-columns: 2fr 1fr;
        grid-template-columns: 2fr 1fr;
    }    
}
@media only screen and (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 89vw;
    }
    .contained {
        padding-left: 5.5vw;
        padding-right: 5.5vw;
    }
    .two.columns {
        -ms-grid-columns: 1fr 1fr;
        grid-template-columns: 1fr 1fr;
    }
    .three.columns {
        -ms-grid-columns: 1fr 1fr 1fr;
        grid-template-columns: 1fr 1fr 1fr;
    }
    .four.columns {
        -ms-grid-columns: 1fr 1fr;
        grid-template-columns: 1fr 1fr;
    }
    .two-2fr-1fr.columns {
        -ms-grid-columns: 2fr 1fr;
        grid-template-columns: 2fr 1fr;
    }    
}
@media only screen and (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 86vw;
    }
    .contained {
        padding-left: 7vw;
        padding-right: 7vw;
    }
    .two.columns {
        -ms-grid-columns: 1fr 1fr;
        grid-template-columns: 1fr 1fr;
    }
    .three.columns {
        -ms-grid-columns: 1fr 1fr 1fr;
        grid-template-columns: 1fr 1fr 1fr;
    }
    .four.columns {
        -ms-grid-columns: 1fr 1fr 1fr 1fr;
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
    .two-2fr-1fr.columns {
        -ms-grid-columns: 2fr 1fr;
        grid-template-columns: 2fr 1fr;
    }    
}
@media only screen and (min-width: 1200px) and (max-width: 1919px) {
    .container {
        max-width: 80vw;
    }
    .contained {
        padding-left: 10vw;
        padding-right: 10vw;
    }
    .two.columns {
        -ms-grid-columns: 1fr 1fr;
        grid-template-columns: 1fr 1fr;
    }
    .three.columns {
        -ms-grid-columns: 1fr 1fr 1fr;
        grid-template-columns: 1fr 1fr 1fr;
    }
    .four.columns {
        -ms-grid-columns: 1fr 1fr 1fr 1fr;
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
    .two-2fr-1fr.columns {
        -ms-grid-columns: 2fr 1fr;
        grid-template-columns: 2fr 1fr;
    }    
}
@media only screen and (min-width: 1920px) {
    .container {
        max-width: 74vw;
    }
    .contained {
        padding-left: 13vw;
        padding-right: 13vw;
    }
    .two.columns {
        -ms-grid-columns: 1fr 1fr;
        grid-template-columns: 1fr 1fr;
    }
    .three.columns {
        -ms-grid-columns: 1fr 1fr 1fr;
        grid-template-columns: 1fr 1fr 1fr;
    }
    .four.columns {
        -ms-grid-columns: 1fr 1fr 1fr 1fr;
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
    .two-2fr-1fr.columns {
        -ms-grid-columns: 2fr 1fr;
        grid-template-columns: 2fr 1fr;
    }    
}

/* Wagtail-specific */
/* The .responsive-object class is automatically added by Wagtail:
https://docs.wagtail.io/en/latest/topics/writing_templates.html#responsive-embeds */
[class^="block-"] img {
    max-width: 100%;
    height: auto;
}
.responsive-object {
    position: relative;
    margin-bottom: 2rem;
    padding-bottom: 0 !important;
}
.responsive-object iframe,
.responsive-object object,
.responsive-object embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
@media screen and (max-width:450px) {
    .responsive-object {
        max-width: 96vw;
        min-height: 54vw;    
    }
}
@media screen and (min-width:451px) and (max-width:784px) {
    .responsive-object {
        max-width: 60vw;
        min-height: 33.75vw;    
    }
}
@media screen and (min-width:785px) {
    .responsive-object {
        max-width: 40vw;
        min-height: 22.5vw;    
    }
}

iframe {
    width: 100%;
    height:;
}