* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

section {
  display: grid;
  grid-template-columns: repeat(auto-fill, 130px);
  grid-auto-rows: 130px;
  max-width: 796px;
  min-width: 406px;
  margin: 0 auto;
  padding: 8px;
  gap: 0px;
  grid-auto-flow: dense;
  justify-content: center;
}

section>div {
  background-color: white;
  overflow: hidden;
  padding: 6px;
  grid-column: span var(--cols, 1);
  grid-row: span var(--rows, 1);
  min-width: 130px;
  position: relative;
  font-family: monospace;
}

section>div:before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: calc(100% - 16px);
  width: calc(100% - 16px);
  border-bottom: 1px solid black;
  border-right: 1px solid black;
}

section>div>img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

section>div>p {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  background-color: white;
  padding: 2px 4px;
  font-size: 14px;
}

section>div.no-border {
  6px 2px 2px 6px
}

section>div.no-border:before {
  border: none;
}

section>div.title {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: hidden;
}

section>div.title>h1 {
  position: absolute;
  bottom: 0;
  right: 0;
  margin: 0;
  font-size: 56px;
  font-weight: 400;
}

section>div.no-border>img {
  object-fit: contain;
}

section>div>img::after {
  content: attr(alt);
}
