/*
 * Content Grid (`teach_grid_section`)
 *
 * Loaded only on pages that use this element, after common.css. Rules
 * shared with other elements are in common.css.
 */

/* The gap between Content Grid cards when they wrap onto another row.
*
* This was `mb-3` on each card, which is the right gap between rows but also
* sits under the last row, leaving 16px of empty space under the whole grid.
* `row-gap` is only applied between wrapped flex lines, so the spacing between
* rows is identical and there is nothing trailing. 1rem to match the mb-3 it
* replaces. */
.cwb-grid-row{row-gap:1rem}

/* Content Grid images render as a real <img> inside the box rather than as a
CSS background, so they carry alt text, a srcset and lazy loading. object-fit
takes over from the background-size: cover the background version relied on,
and object-position stands in for background-position, so the Image Position
field keeps working exactly as it did.

Scoped to .cwb-grid-image, which only this element emits. `.halfcol--img`
looks like the class to use, but Flexible Content paints the same
`.callout-img.halfcol--img` box, so naming it would restyle that element's
images too. */
.cwb-grid-image>img{width:100%;height:100%;object-fit:cover;object-position:center;display:block;border-radius:inherit}

/* A chosen shape outweighs the theme's fixed height.
*
* The box carries both a Bootstrap ratio class and `min-height`, and between
* roughly 576px and 767px the min-height was the larger of the two and won - a
* 16:9 image measured 1.21 at a 600px viewport instead of 1.78. The height only
* comes from the min-height when no shape was chosen, which is what the empty
* choice in that field means. */
.cwb-grid-image[class*="ratio-"]{min-height:0}
