/* Graphics browser — matches global.css tokens (1rem radius, #e9ecef border,
   var(--brand-primary)) rather than the ad-hoc greys the old inline <style>
   used. */

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

.gx-tile {
  display: block;
  border: 1px solid #e9ecef;
  border-radius: 1rem;
  padding: 0.6rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: #fff;
}

.gx-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.06);
}

.gx-tile img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  display: block;
  margin-bottom: 0.4rem;
  background: #f8f9fa;
  border-radius: 0.5rem;
}

.gx-tile-name {
  display: block;
  font-size: 0.78rem;
  color: #495057;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gx-tile.gx-tile-broken img {
  opacity: 0.4;
}

/* Children pills — the one navigation control: each is either a real
   subdirectory or the next component of an in-progress date/timestamp
   breakdown (see graphics/taxonomy.py's browse_position). Picking one
   replaces the current position; it never combines with another pill. */
.gx-child-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.gx-child-count {
  opacity: 0.65;
  font-size: 0.78rem;
}

/* Extension facet — flat and always alongside the tree, since file type
   isn't part of the directory hierarchy. */
.gx-facet-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #e9ecef;
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  margin: 0 0.3rem 0.3rem 0;
  background: #fff;
  color: #495057;
  cursor: pointer;
}

.gx-facet-pill:hover {
  background: #f8f9fa;
}

.gx-facet-pill.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.gx-facet-pill .count {
  color: inherit;
  opacity: 0.7;
  font-size: 0.7rem;
}

/* Lightbox — native <dialog> */
.gx-lightbox {
  border: none;
  border-radius: 0;
  padding: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gx-lightbox::backdrop {
  background: rgba(15, 17, 26, 0.92);
}

.gx-lightbox img#gx-lb-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
}

.gx-lb-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.gx-lb-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gx-lb-prev {
  left: 1.5rem;
}

.gx-lb-next {
  right: 1.5rem;
}

.gx-lb-close {
  top: 1.5rem;
  right: 1.5rem;
  left: auto;
  transform: none;
}

.gx-lb-caption {
  position: fixed;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 0.85rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.gx-lb-caption a {
  color: #9ec5fe;
}
