:root { --grid-square: repeat(2, minmax(0, 1fr)); --grid-vertical: repeat(3, minmax(0, 1fr)); } .media-grid { display: grid; gap: var(--sizing-sm); margin-bottom: var(--sizing-base); &.no-pagination { margin-bottom: 0; } &.square { grid-template-columns: var(--grid-square); & a { aspect-ratio: var(--aspect-ratio-square); } & img { width: 100%; height: 100%; } } &.vertical { grid-template-columns: var(--grid-vertical); & a { aspect-ratio: var(--aspect-ratio-vertical); } & img { width: 100%; height: auto; } } & .item-wrapper { width: 100%; height: 100%; position: relative; display: flex; overflow: hidden; &.shadow::after { position: absolute; z-index: 1; content: ''; top: 0; left: 1px; box-shadow: inset 0 -85px 60px -65px var(--black); width: calc(100% - 2px); height: calc(100% - 1px); } } & a:hover img, & a:active img { border-color: var(--accent-color-hover) } & a:focus img, & a:focus-within img { border: 0 } & .meta-text { position: absolute; z-index: 2; padding: 0 var(--sizing-sm); bottom: var(--sizing-sm); width: 100%; box-sizing: border-box; & .header, & .subheader { color: var(--color-lightest); font-size: var(--font-size-sm); line-height: 1.5; text-shadow: rgba(0, 0, 0, 0.7) 0px 0px 10px; } & .header { font-weight: var(--font-weight-bold); } } & img { border: var(--border-default); transition-property: border-color; transition-timing-function: var(--transition-ease-in-out); transition-duration: 300ms; } } @media screen and (min-width: 768px) { :root { --grid-square: repeat(4, minmax(0, 1fr)); --grid-vertical: repeat(6, minmax(0, 1fr)); } }