:root {
  color-scheme: light;
  --page: #ededeb;
  --surface: #ffffff;
  --ink: #171817;
  --gap: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 280px;
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
}

button {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 2px solid #1c6380;
  outline-offset: 3px;
}

.pinboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  align-items: start;
  gap: var(--gap);
  padding: var(--gap);
}

.pin-column {
  display: grid;
  min-width: 0;
  gap: var(--gap);
  align-content: start;
}

.pin {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(18, 20, 19, 0.13);
  cursor: zoom-in;
  break-inside: avoid;
}

.pin img {
  display: block;
  width: 100%;
  height: auto;
}

.viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #181a19;
  color: #ffffff;
}

.viewer::backdrop {
  background: #181a19;
}

.viewer-stage {
  width: 100%;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}

.viewer-stage img {
  display: block;
  width: auto;
  min-width: min(100%, 720px);
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  object-position: top center;
  background: #ffffff;
}

.viewer-close,
.viewer-nav {
  position: fixed;
  z-index: 2;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  background: rgba(18, 20, 19, 0.82);
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.viewer-close {
  top: 12px;
  right: 12px;
}

.viewer-nav {
  top: 50%;
  transform: translateY(-50%);
}

.viewer-previous {
  left: 12px;
}

.viewer-next {
  right: 12px;
}

.viewer-nav:disabled {
  visibility: hidden;
}

@media (max-width: 1023px) {
  .pinboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  :root {
    --gap: 8px;
  }

  .pinboard {
    grid-template-columns: minmax(0, 1fr);
  }

  .pin {
    border-radius: 2px;
    box-shadow: 0 1px 5px rgba(18, 20, 19, 0.12);
  }

  .viewer-stage img {
    min-width: 100%;
  }

  .viewer-close,
  .viewer-nav {
    width: 40px;
    height: 40px;
  }

  .viewer-close {
    top: 8px;
    right: 8px;
  }

  .viewer-previous {
    left: 8px;
  }

  .viewer-next {
    right: 8px;
  }
}