html, body { height: 100%; background: #f2f2f2; } *, *:before, *:after { box-sizing: border-box; } /* Controls ---------------------------------------------------------------------- */ .controls { padding: 1rem; background: #333; font-size: 0.1px; } .control { position: relative; display: inline-block; width: 2.7rem; height: 2.7rem; background: #444; cursor: pointer; font-size: 0.1px; color: white; transition: background 150ms; } .control:not(.control-active):hover { background: #3f3f3f; } .control-filter:after { content: ''; position: absolute; width: 10px; height: 10px; top: calc(50% - 6px); left: calc(50% - 6px); border: 2px solid currentColor; border-radius: 2px; background: currentColor; transition: background-color 150ms, border-color 150ms; } .control-sort:after { content: ''; position: absolute; width: 10px; height: 10px; border-top: 2px solid; border-left: 2px solid; top: calc(50% - 6px); left: calc(50% - 6px); transform: translateY(1px) rotate(45deg); } .control-sort[data-order="desc"]:after { transform: translateY(-4px) rotate(-135deg); } .control-active { background: #393939; } .control-filter.control-active:after { background: transparent; } .control:first-of-type { border-radius: 3px 0 0 3px; } .control:last-of-type { border-radius: 0 3px 3px 0; } .control-filter + .control-sort { margin-left: .75rem; } .control-filter[data-color="green"] { color: #91e6c7; } .control-filter[data-color="blue"] { color: #5ecdde; } .control-filter[data-color="pink"] { color: #d595aa; } .control-filter[data-color="none"] { color: #2f2f2f; } /* Container ---------------------------------------------------------------------- */ .container { padding: 1rem; text-align: justify; font-size: 0.1px; } .container:after { content: ''; display: inline-block; width: 100%; } /* Target Elements ---------------------------------------------------------------------- */ .item, .gap { display: inline-block; vertical-align: top; } .item { background: #fff; border-top: .5rem solid currentColor; border-radius: 2px; margin-bottom: 1rem; position: relative; } .item:before { content: ''; display: inline-block; padding-top: 56.25%; } .item.green { color: #91e6c7; } .item.pink { color: #d595aa; } .item.blue { color: #5ecdde; } .item .published-date { position: absolute; top: 0; left: 0; padding: 1rem; font-size: 1rem; color: #333; font-family: 'helvetica-neue', arial, sans-serif; font-weight: 700; } /* Grid Breakpoints ---------------------------------------------------------------------- */ /* 2 Columns */ .item, .gap { width: calc(100%/2 - (((2 - 1) * 1rem) / 2)); } /* 3 Columns */ @media screen and (min-width: 541px) { .item, .gap { width: calc(100%/3 - (((3 - 1) * 1rem) / 3)); } } /* 4 Columns */ @media screen and (min-width: 961px) { .item, .gap { width: calc(100%/4 - (((4 - 1) * 1rem) / 4)); } } /* 5 Columns */ @media screen and (min-width: 1281px) { .item, .gap { width: calc(100%/5 - (((5 - 1) * 1rem) / 5)); } }