:root { --grid-square: repeat(2, minmax(0, 1fr)); --grid-vertical: repeat(3, minmax(0, 1fr)); } .media-grid { display: grid; gap: var(--spacing-sm); margin-bottom: var(--spacing-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%; border-radius: var(--border-radius-slight); } } &.vertical { grid-template-columns: var(--grid-vertical); & a { aspect-ratio: var(--aspect-ratio-vertical); } & img { width: 100%; height: auto; border-radius: var(--border-radius-slight); } } & .item { width: 100%; height: 100%; position: relative; display: flex; &::after { position: absolute; z-index: 1; content: ''; top: 0; left: 0; box-shadow: var(--box-shadow-media); width: 100%; height: 100%; border: var(--border-default); border-radius: var(--border-radius-slight); transition-property: border-color; transition-timing-function: var(--transition-ease-in-out); transition-duration: var(--transition-duration-default); } } & a:hover .item::after, & a:active .item::after { border-color: var(--accent-color-hover) } & a:focus .item::after, & a:focus-within .item::after { border: 0; outline: var(--outline-default); } & .meta-text { position: absolute; z-index: 2; padding: 0 var(--spacing-sm); bottom: var(--spacing-sm); width: 100%; box-sizing: border-box; & .header, & .subheader { color: var(--color-lightest); font-size: var(--font-size-sm); line-height: var(--line-height-md); text-shadow: var(--text-shadow-default); } & .header { font-weight: var(--font-weight-bold); } } } @media screen and (min-width: 768px) { :root { --grid-square: repeat(4, minmax(0, 1fr)); --grid-vertical: repeat(6, minmax(0, 1fr)); } }