: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); &.square { grid-template-columns: var(--grid-square); & img { width: 100%; height: 100%; } } &.vertical { grid-template-columns: var(--grid-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 -70px 50px -40px #000; width: calc(100% - 2px); height: calc(100% - 1px); } } & a:hover img, & a:focus img, & a:active img { border-color: var(--accent-color-hover) } & .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-xs); line-height: 1.5; text-shadow: rgba(0, 0, 0, 0.7) 0px 0px 10px; } & .header { font-weight: var(--font-weight-bold); } } & img { border: 1px solid var(--accent-color); 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)); } }