body {
  background-color: #1c1f24;
}

#thumbs {
  column-count: 1;
  column-gap: 8px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 400px) {
  #thumbs {
    column-count: 2;
  }
}

@media (min-width: 600px) {
  #thumbs {
    column-count: 3;
  }
}

@media (min-width: 800px) {
  #thumbs {
    column-count: 4;
  }
}

@media (min-width: 1000px) {
  #thumbs {
    column-count: 5;
  }
}

.thumb {
  display: flex;
  aspect-ratio: var(--mm-width) / var(--mm-height);
  margin-bottom: 8px;
  position: relative;
}

.thumb-toggle { display: none; }

.thumb .main-image {
  width: 100%;
  border-radius: 8px;
}

.thumb:has(.thumb-toggle:checked) .main-image {
  filter: brightness(0.3);
}

.thumb .details {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  color: #cfcfcf;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.thumb:has(.thumb-toggle:checked) .details {
  opacity: 1;
  pointer-events: auto;
}

.detail-actions {
  display: flex;
  gap: 8px;
  position: absolute;
  right: 18px;
  bottom: 18px;
}

.detail-actions .ar-link,
.detail-actions .preview-btn {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}

.detail-actions img {
  width: 24px;
  height: 24px;
}

.no-ar [rel="ar"]{
  display: none;
}

.preview-btn {
  padding: 0;
  border: none;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  cursor: pointer;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal img {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}
