/* Working Glitches hub — controls, jumps, dense list rows */

.wg-controls {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.wg-controls-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.wg-controls-top .search-shell {
  flex: 1 1 16rem;
  min-width: 0;
}

.wg-count {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

.wg-count strong {
  color: var(--text-primary);
  font-weight: 600;
}

.wg-filter-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.wg-filter-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.wg-filter-row .filter-bar {
  flex-wrap: wrap;
}

.wg-jump {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.wg-jump a {
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--neu-raised);
  box-shadow:
    2px 2px 6px var(--neu-shadow-dark),
    -1px -1px 4px var(--neu-shadow-light);
}

.wg-jump a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.wg-jump[hidden],
.wg-empty[hidden] {
  display: none !important;
}

.wg-empty {
  text-align: center;
  padding: var(--space-10) var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.wg-section {
  margin-bottom: var(--space-3);
}

.wg-section[hidden] {
  display: none !important;
}

.wg-section-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  margin: 0;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  background: var(--neu-raised);
  box-shadow:
    3px 3px 8px var(--neu-shadow-dark),
    -2px -2px 6px var(--neu-shadow-light);
  transition: box-shadow var(--duration-fast) var(--ease);
}

.wg-section-head:hover {
  box-shadow:
    inset 2px 2px 6px var(--neu-shadow-dark),
    inset -2px -2px 5px var(--neu-shadow-light);
}

.wg-section-title {
  flex: 1;
  min-width: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}

.wg-section-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
}

.wg-section-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  transition: transform var(--duration-fast) var(--ease);
  flex-shrink: 0;
}

.wg-section.is-open .wg-section-chevron {
  transform: rotate(225deg);
  margin-top: 0.2rem;
}

.wg-section.is-open .wg-section-head {
  margin-bottom: var(--space-2);
}

.wg-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--neu-inset);
  box-shadow:
    inset 4px 4px 10px var(--neu-shadow-dark),
    inset -3px -3px 8px var(--neu-shadow-light);
}

.wg-list[hidden] {
  display: none !important;
}

.wg-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-4);
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: background var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}

.wg-row:hover {
  background: var(--neu-raised);
  color: inherit;
  text-decoration: none;
  box-shadow:
    3px 3px 8px var(--neu-shadow-dark),
    -2px -2px 6px var(--neu-shadow-light);
}

.wg-row-title {
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.wg-row-notes {
  grid-column: 1 / -1;
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}

.wg-row-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.wg-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  background: var(--neu-raised);
  box-shadow:
    2px 2px 4px var(--neu-shadow-dark),
    -1px -1px 3px var(--neu-shadow-light);
}

.wg-pill-mode {
  color: var(--accent);
}

.wg-status {
  padding: var(--space-10) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.wg-reddit-redirect {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background: color-mix(in srgb, var(--neu-base) 88%, transparent);
  backdrop-filter: blur(6px);
}

.wg-reddit-redirect[hidden] {
  display: none !important;
}

.wg-reddit-redirect-card {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--neu-raised);
  box-shadow:
    8px 8px 24px var(--neu-shadow-dark),
    -4px -4px 14px var(--neu-shadow-light);
  max-width: 20rem;
  width: 100%;
}

.wg-reddit-spinner {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 auto var(--space-4);
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: wg-spin 0.7s linear infinite;
}

@keyframes wg-spin {
  to {
    transform: rotate(360deg);
  }
}

.wg-reddit-redirect-msg {
  margin: 0 0 var(--space-2);
  font-weight: 600;
  color: var(--text-primary);
}

.wg-reddit-redirect-title {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

html.wg-redirecting,
html.wg-redirecting body {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .wg-reddit-spinner {
    animation: none;
    border-top-color: var(--border-subtle);
    border-right-color: var(--accent);
  }
}

@media (max-width: 640px) {
  .wg-row {
    grid-template-columns: 1fr;
  }

  .wg-row-pills {
    justify-content: flex-start;
  }
}
