:root {
  color-scheme: light;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

.site-header {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f6f6;
}

.brand { display: block; width: 40px; height: 40px; }
.brand img { display: block; width: 40px; height: 40px; }
.brand:focus-visible { outline: 2px solid #111; outline-offset: 4px; }

main {
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 118px);
  margin-top: 70px;
}

.archive-grid {
  display: grid;
  width: min(1116px, calc(100% - 32px));
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 2px;
  align-content: start;
  padding: 48px 0;
}

.archive-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
  aspect-ratio: 1;
  overflow: hidden;
}

.archive-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.archive-item:focus-visible, .close-dialog:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

.status {
  margin: 3rem auto;
  text-align: center;
  font-size: 14px;
  color: #555;
}

.status[hidden] { display: none; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  background: #f6f6f6;
  color: #707072;
  font-size: 10px;
  letter-spacing: .02em;
}

dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .84);
  color: #fff;
}

dialog::backdrop { background: transparent; }

.dialog-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 52px 20px 20px;
}

.dialog-inner img {
  display: block;
  max-width: min(90vw, 1400px);
  max-height: calc(100vh - 76px);
  object-fit: contain;
}

.image-caption {
  position: absolute;
  top: 14px;
  left: 50%;
  max-width: calc(100% - 100px);
  margin: 0;
  transform: translateX(-50%);
  text-align: center;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.close-dialog {
  position: absolute;
  top: 6px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 768px) {
  main { padding-top: 16px; }

  .archive-grid {
    width: calc(100% - 32px);
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 16px;
  }
}
