.gallery-main {
  display: block;
  width: 100%;
  max-width: 1136px;
  margin: 0 auto;
}

.gallery-header {
  margin-bottom: 64px;
}

.back-link {
  display: flex;
  gap: 16px;
  width: fit-content;
  margin-bottom: 56px;
  color: var(--fg);
  font-size: 15px;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.gallery {
  display: grid;
  gap: 72px;
}

.gallery figure {
  margin: 0;
}

.gallery figure > a,
.gallery-picture {
  display: block;
}

.gallery-image {
  display: block;
  width: 100%;
  height: auto;
  background: color-mix(in oklch, var(--bg), var(--fg) 4%);
}

.gallery figcaption {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1.5;
}

.gallery figcaption time {
  flex: none;
}

.empty-gallery {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.14em;
}

@media (hover: hover) {
  .back-link:hover {
    background: var(--fg);
    color: var(--bg);
  }

  .gallery figure > a:hover {
    opacity: 0.9;
  }
}

.back-link:focus-visible {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

@media (max-width: 700px) {
  .gallery-header {
    margin-bottom: 44px;
  }

  .back-link {
    min-height: 48px;
    align-items: center;
    margin-bottom: 36px;
  }

  .gallery {
    gap: 52px;
  }

  .gallery figcaption {
    display: grid;
    gap: 4px;
  }
}
