/* ── Back link ── */
.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 1.25rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--accent); }

/* ── Feed ── */
.feed-container {
  max-width: 600px;
  margin: 0 auto;
}

/* ── Post card ── */
.post-card {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.post-card:first-child { padding-top: 0.5rem; }

.post-content {
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 0.75rem;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.post-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.post-share-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
  opacity: 0;
}
.post-card:hover .post-share-btn { opacity: 1; }
.post-share-btn:hover { color: var(--accent); background: var(--bg-subtle); }
.post-share-btn.copied { color: var(--accent); opacity: 1; }
.post-share-label { font-family: var(--font-body); }

/* ── Image grid ── */
.image-grid {
  display: grid;
  gap: 3px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.75rem;
  max-height: 520px;
}

.image-grid[data-count="1"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}
.image-grid[data-count="2"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}
.image-grid[data-count="3"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.image-grid[data-count="3"] .image-cell:first-child {
  grid-row: 1 / 3;
}
.image-grid[data-count="4"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.image-cell {
  position: relative;
  overflow: hidden;
  background: var(--bg-subtle);
  min-height: 120px;
  max-height: 260px;
}

.image-grid[data-count="1"] .image-cell {
  max-height: 520px;
}

.post-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}
.post-img:hover { transform: scale(1.02); }

.more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  cursor: pointer;
}

/* ── Link preview ── */
.link-preview {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 0.75rem;
  text-decoration: none;
}
.link-preview:hover { border-color: var(--accent); background: var(--bg-subtle); }

.link-preview-img-wrap {
  width: 100%;
  max-height: 220px;
  overflow: hidden;
  background: var(--bg-subtle);
}
.link-preview-img-wrap img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.link-preview-body {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.link-domain {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.link-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0 1rem;
}
.page-info { font-size: 0.85rem; color: var(--text-secondary); }

/* ── Empty state ── */
.empty-feed {
  text-align: center;
  padding: 4rem 0;
  color: var(--text-secondary);
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.lightbox-close:hover { opacity: 1; }
