/* Gallery stylesheet, copied to dist/gallery.css by scripts/build-all.mjs. */
:root {
  color-scheme: light dark;
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #1b1b1a;
  --muted: #5f5d57;
  --line: #e2dfd6;
  --accent: #1f5fbf;
  --accent-ink: #0f3f86;
  --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --card: #1e1e1c;
    --ink: #ecebe6;
    --muted: #a3a097;
    --line: #2f2e2a;
    --accent: #7fb0ff;
    --accent-ink: #a9c9ff;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.top,
main,
.foot {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.top {
  padding-top: 3rem;
  padding-bottom: 1.5rem;
}

.top h1 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
}

.top p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem 1.2rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover,
.card:focus-within {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.card time {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.card h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

.card h2 a {
  color: var(--ink);
  text-decoration: none;
}

/* Whole card is clickable via the title link; the source link sits above it. */
.card h2 a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
}

.card h2 a:focus-visible {
  outline: none;
}

.card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.source {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--accent);
}

a.source:hover {
  color: var(--accent-ink);
}

.source.none {
  color: var(--muted);
  font-style: italic;
}

.foot {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.notfound {
  padding-top: 5rem;
}

.notfound a {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }
  .card:hover,
  .card:focus-within {
    transform: none;
  }
}
