:root {
  color: #111;
  background: #fffbcf;
  font-family: 'Major Mono Display', 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', monospace;
  font-size: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
a { color: inherit; }

.site-header,
#posts {
  width: min(calc(100% - 20px), 1100px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  justify-content: space-between;
  padding: 5px;
  background: #fffbcf;
  border-bottom: 1px solid #111;
}

.site-header a { text-decoration: none; }
.site-header a:hover,
.site-header a:focus-visible { text-decoration: underline; }

#posts { padding: 60px 0 180px; }
.post + .post { margin-top: 60px; }

.post-row {
  display: grid;
  gap: 15px;
}

.media-line {
  display: grid;
  grid-template-columns: repeat(var(--items), minmax(0, 1fr));
  gap: 15px;
  align-items: start;
  transition: gap 160ms ease, grid-template-columns 160ms ease;
}

.media-item {
  min-width: 0;
  display: block;
  text-decoration: none;
  outline-offset: 3px;
}

.media-frame {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #eee;
}

.media-description,
.post-caption,
.post-date {
  display: block;
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.2;
}

.media-description { display: none; }
.emoji { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.media-item:is(:hover, :focus) .media-description { display: block; }
.media-item[data-caption-alignment="left"] .media-description { text-align: left; }
.media-item[data-caption-alignment="center"] .media-description { text-align: center; }
.media-item[data-caption-alignment="right"] .media-description { text-align: right; }

.post-caption { max-width: 70ch; }
.post-date { color: #555; }

.media-line.is-expanded { gap: 30px; }
.media-item:focus-visible { outline: 1px solid #111; }

@media (prefers-reduced-motion: reduce) {
  .media-line { transition: none; }
}
