/* /gallery (views/types-gallery.ejs). Theme tokens only: the page follows
   whichever of the twelve palettes the reader picked. */

.tg [hidden] { display: none !important; }
.tg .pgv2-head code { font-size: 0.95em; }

.tg .tg-filters .sk-select { flex: 0 1 16rem; }

.tg .tg-cats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.75rem; min-width: 0; }
.tg .tg-subcats { padding-left: 0.75rem; border-left: 2px solid var(--sk-border); margin-bottom: 1.25rem; }
.tg .tg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--sk-border);
  border-radius: 999px;
  background: var(--sk-surface);
  color: var(--sk-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tg .tg-chip span { color: var(--sk-muted); font-weight: 500; }
.tg .tg-chip:hover, .tg .tg-chip:focus-visible { border-color: var(--sk-primary); }
.tg .tg-chip[aria-current="page"] { background: var(--sk-primary); border-color: var(--sk-primary); color: #fff; }
.tg .tg-chip[aria-current="page"] span { color: #fff; }
@media (pointer: coarse) { .tg .tg-chip { min-height: 44px; } }
/* Thirty-odd categories wrap to a dozen rows on a phone, above the pictures;
   there they are one row that scrolls sideways (the select has them all too). */
@media (max-width: 40em) {
  .tg .tg-cats { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: thin; }
  .tg .tg-chip { flex: 0 0 auto; }
}

.tg .tg-group { margin: 0 0 1.75rem; min-width: 0; }
.tg .tg-group-title { margin: 0 0 0.75rem; font-size: 1.1rem; font-weight: 700; }
.tg .tg-group-title a { color: var(--sk-text); text-decoration: none; }
.tg .tg-group-title a:hover, .tg .tg-group-title a:focus-visible { color: var(--sk-primary-text); text-decoration: underline; }

.tg .tg-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.75rem;
}
@media (max-width: 22em) { .tg .tg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; } }
.tg .tg-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--sk-border);
  border-radius: var(--sk-radius, 10px);
  background: var(--sk-surface);
  overflow: hidden;
}
.tg .tg-pic {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--sk-surface-2);
}
.tg .tg-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.5rem;
  box-sizing: border-box;
}
.tg .tg-pic:focus-visible { outline: 2px solid var(--sk-primary); outline-offset: -2px; }
.tg .tg-name {
  display: block;
  padding: 0.5rem 0.6rem;
  border-top: 1px solid var(--sk-border);
  color: var(--sk-text);
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
  user-select: all;
}
.tg .tg-name[role="button"] { cursor: copy; }
.tg .tg-name[role="button"]:hover,
.tg .tg-name[role="button"]:focus-visible { color: var(--sk-primary-text); outline: none; background: var(--sk-surface-2); }
.tg .tg-name.is-copied { color: var(--sk-success-text); }

.tg .tg-note { margin-top: 2rem; }

.tg-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 1rem);
  max-width: calc(100vw - 2rem);
  padding: 0.6rem 1rem;
  border: 1px solid var(--sk-border);
  border-radius: 999px;
  background: var(--sk-surface);
  color: var(--sk-text);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10001;
}
.tg-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .tg-toast { transition: none; } }
