/* Visualizations page; shared tokens, header, filters and buttons come from /compute/app.css */

.group {
  margin-top: 30px;
}

.group h2 {
  margin-bottom: 12px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.fig {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fig-open {
  aspect-ratio: 4 / 3;
  background: #111110;
  border: 0;
  border-bottom: 1px solid var(--grid);
  cursor: zoom-in;
  display: block;
  padding: 0;
  width: 100%;
}

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

.fig-open:hover img {
  opacity: 0.9;
}

.fig-body {
  padding: 10px 12px 12px;
}

.fig-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
  overflow-wrap: anywhere;
}

.fig-caption {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--ink-2);
  display: -webkit-box;
  font-size: 0.82rem;
  line-clamp: 3;
  margin: 4px 0 0;
  overflow: hidden;
}

.fig-meta {
  color: var(--muted);
  font-size: 0.76rem;
  margin: 6px 0 0;
}

/* lightbox */

.lightbox {
  background: #080808;
  display: flex;
  flex-direction: column;
  inset: 0;
  position: fixed;
  z-index: 30;
}

.lb-bar {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}

.lb-count {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
}

.lb-actions {
  display: flex;
  gap: 8px;
}

.lb-actions a.btn {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  text-decoration: none;
}

.lb-stage {
  align-items: center;
  display: flex;
  flex: 1;
  justify-content: center;
  min-height: 0;
  padding: 0 56px;
  position: relative;
}

.lb-stage img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.lb-nav {
  background: var(--raised);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
  height: 44px;
  line-height: 1;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
}

.lb-prev {
  left: 6px;
}

.lb-next {
  right: 6px;
}

.lb-nav:disabled {
  opacity: 0.3;
}

.lb-text {
  margin: 0 auto;
  max-width: 900px;
  padding: 12px 16px max(18px, env(safe-area-inset-bottom));
  width: 100%;
}

.lb-text h2 {
  font-size: 1rem;
}

.lb-text h2:focus {
  outline: none;
}

.lb-caption {
  color: var(--ink-2);
  font-size: 0.88rem;
  margin: 4px 0 0;
  white-space: pre-line;
}

.lb-meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 6px 0 0;
}

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

  .fig-body {
    padding: 8px 10px 10px;
  }

  .fig-caption {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .lb-stage {
    padding: 0 8px;
  }

  .lb-nav {
    bottom: 8px;
    top: auto;
    transform: none;
  }
}

/* site card */

.site {
  margin: -4px 0 14px;
}

.site-note {
  margin: 0 0 4px;
  max-width: 900px;
}

.site-facts {
  color: var(--ink-2);
  font-size: 0.84rem;
  margin: 2px 0;
}

.site-scores {
  margin: 0;
}

.site .scores-scroll {
  margin-top: 10px;
}

.site-scores tbody th {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: left;
}

.site-scores tr.is-base th,
.site-scores tr.is-base td {
  color: var(--muted);
}

.site-scores tr.is-ours th,
.site-scores tr.is-ours td {
  color: var(--ink);
  font-weight: 650;
}

.site-scores tr.is-ours th {
  box-shadow: inset 3px 0 0 var(--s3);
}

.site-legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.76rem;
  gap: 4px 8px;
  margin: 6px 0 0;
}

.swatch {
  border-radius: 2px;
  display: inline-block;
  height: 10px;
  width: 10px;
}

.swatch.base {
  background: var(--muted);
}

.swatch.ours {
  background: var(--s3);
  margin-left: 8px;
}
