:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #767676;
  --line: #e6e6e6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 28px 32px;
}

.site-title {
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}

main {
  padding: 0 32px 96px;
  max-width: 1800px;
  margin: 0 auto;
}

/* Masonry-style grid */
.grid {
  column-count: 4;
  column-gap: 28px;
}

@media (max-width: 1200px) { .grid { column-count: 3; } }
@media (max-width: 860px)  { .grid { column-count: 2; } }
@media (max-width: 540px)  { .grid { column-count: 1; } }

.card {
  display: block;
  break-inside: avoid;
  margin-bottom: 34px;
  text-decoration: none;
  color: var(--fg);
}

.card picture,
.card img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--line);
}

.card-noimage {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 160px;
  padding: 24px 18px;
  border: 1px solid var(--line);
}

.card-body { padding-top: 10px; }

.card-title {
  font-weight: 400;
  font-size: 0.88rem;
  margin: 0;
}

.card-date { color: var(--muted); font-size: 0.78rem; margin-top: 2px; }

.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 6px;
}

.tag {
  font-size: 0.72rem;
  color: var(--muted);
}
.tag::after { content: ","; }
.tag:last-child::after { content: ""; }

.empty-state {
  color: var(--muted);
  padding: 4rem 0;
  font-size: 0.9rem;
}

/* Item detail page */
.item-images { margin: 0 0 40px; }
.item-images picture,
.item-images img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 8px;
  background: var(--line);
}

article h1 {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0 0 4px;
}

.attachments { margin-top: 2.5rem; }
.attachments h3 {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}
.attachments ul { list-style: none; padding: 0; margin: 0; }
.attachments li { margin-bottom: 4px; }
.attachments a { text-decoration: underline; font-size: 0.9rem; }

.body { margin: 20px 0; max-width: 60ch; }
.body p:first-child { margin-top: 0; }

.back-link {
  display: inline-block;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover { color: var(--fg); }
