:root {
  color-scheme: light dark;
  --gap: 4px;
  --bg: #fafafa;
  --placeholder: #e4e4e4;
  --text: #111;
  --text-muted: #f5f5f5;
  --overlay: rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  width: 100%;
  max-width: 935px;
  margin: 0 auto;
}

.feed-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--placeholder);
  display: block;
  text-decoration: none;
  color: inherit;
}

.feed-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feed-tile.is-loading {
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { background-color: var(--placeholder); }
  50% { background-color: #d0d0d0; }
}

.feed-tile.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #999;
  text-align: center;
  padding: 8px;
}

.feed-badges {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
}

.feed-badge {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 11px;
  line-height: 1.4;
}

.feed-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.feed-tile:hover .feed-overlay,
.feed-tile:focus-visible .feed-overlay {
  opacity: 1;
}

.feed-overlay-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 2px;
}

.feed-overlay-date {
  font-size: 11px;
  opacity: 0.85;
  margin: 0;
}

.feed-empty-state {
  max-width: 935px;
  margin: 40px auto;
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  padding: 0 16px;
}

.feed-error-state {
  max-width: 935px;
  margin: 40px auto;
  text-align: center;
  color: #b3261e;
  font-size: 0.9rem;
  padding: 0 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111;
    --placeholder: #2a2a2a;
    --text: #f2f2f2;
  }
  @keyframes pulse {
    0%, 100% { background-color: var(--placeholder); }
    50% { background-color: #3a3a3a; }
  }
}
