/* UI Lists & Feeds gallery — page chrome + shared tokens */

:root {
  --ink: #1a2332;
  --ink-muted: #5a6578;
  --ink-faint: #8b95a8;
  --surface: #f0f3f7;
  --surface-raised: #ffffff;
  --accent: #0d7a6f;
  --accent-soft: #e4f4f2;
  --accent-deep: #085c54;
  --border: #d5dce6;
  --border-strong: #b8c2d0;
  --danger: #b42318;
  --warn: #b54708;
  --success: #067647;
  --list-radius: 12px;
  --list-shadow: 0 1px 2px rgb(26 35 50 / 0.06), 0 8px 24px rgb(26 35 50 / 0.06);
  --motion: 200ms ease;
  --font-sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  --max: 72rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #d9ebe8 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #e2e8f2 0%, transparent 50%),
    var(--surface);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
  padding-block: 2rem 2.5rem;
}

@media (max-width: 40rem) {
  .page {
    width: min(100% - 1.25rem, var(--max));
    padding-block: 1.25rem 2rem;
  }

  .wb-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .wb-nav__spacer {
    flex: 0 0 0.75rem;
  }

  .pattern {
    padding: 1rem;
  }
}

.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 0;
  max-width: 46rem;
  color: var(--ink-muted);
}

.page-header code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
}

.toc a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-raised);
  font-size: 0.8125rem;
  font-weight: 600;
}

.toc a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.gallery {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.pattern {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--list-radius) + 4px);
  background: rgb(255 255 255 / 0.55);
  backdrop-filter: blur(6px);
}

.pattern__meta {
  margin-bottom: 1.25rem;
}

.pattern__meta h2 {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  font-weight: 700;
}

.pattern__meta .slug {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.pattern__meta p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.pattern__stage {
  position: relative;
  border-radius: var(--list-radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--list-shadow);
  min-width: 0;
}

.pattern__stage--pad {
  padding: 0;
  background: #f7f9fb;
}

.pattern__stage--inset {
  padding: 1rem;
  background: #e8edf3;
}

.list-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}

.list-btn:hover {
  background: var(--accent-deep);
}

.list-btn--ghost {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--ink);
}

.list-btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.list-btn--soft {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.list-btn--sm {
  padding: 0.3rem 0.55rem;
  font-size: 0.75rem;
}

.list-avatar {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

.list-avatar--sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.65rem;
}

.list-avatar--lg {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.8rem;
}

.list-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.65rem;
  font-weight: 800;
  white-space: nowrap;
}

.list-badge--warn {
  background: #fffaeb;
  color: var(--warn);
}

.list-badge--danger {
  background: #fef3f2;
  color: var(--danger);
}

.list-badge--muted {
  background: #eef2f6;
  color: var(--ink-muted);
}

.list-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
