html {
  font-family: sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: inherit;
}

body {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
}

h1 {
  margin-bottom: 1rem;
}

.cards > ul {
  list-style: none;
}

.card + .card {
  margin-top: 1.5rem;
}

@supports (display: grid) {
  .cards > ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    grid-column-gap: 1.5rem;
    grid-row-gap: 1.5rem;
  }

  .card + .card {
    margin-top: 0;
  }
}

.card {
  border: 1px solid;
  border-radius: 0.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.card .text {
  padding: 1rem;
  flex: 1 0 auto;
  order: 2;
  display: flex;
  flex-direction: column;
}

.card p {
  max-width: 60ch;
}

.card .img {
  height: 6.5rem;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 1rem));
}

.card .img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(100%);
}

.card a {
  text-decoration: none;
}

.card a::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
}

.card a:focus {
  outline: none;
  text-decoration: underline;
}

.card:focus-within,
.card:hover {
  box-shadow: 0 0 0 0.25rem;
  outline: 2px solid transparent;
}

.card:focus-within a:focus {
  text-decoration: none;
}

.card small {
  display: block;
}

.card .text > * + * {
  margin-top: 0.75rem;
}

.card .text > :last-child {
  margin-top: auto;
  padding-top: 0.75rem;
}
