/* Full-bleed Home feed (browse-only; engagement gated later) */

body.page-home-feed {
  background: #000;
  color: #fff;
  overflow: hidden;
  height: 100%;
}

html:has(body.page-home-feed) {
  height: 100%;
  overflow: hidden;
}

.site-feed {
  position: relative;
  height: 100dvh;
  max-height: 100dvh;
  background: #000;
  color: #fff;
  overflow: hidden;
}

.site-feed[hidden] {
  display: none !important;
}

.feed-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 8px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent);
}

.feed-tabs,
.feed-topbar-actions {
  pointer-events: auto;
}

.feed-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: 4px;
}

.feed-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 6px 0;
  cursor: pointer;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.feed-tab.is-active {
  color: #fff;
  font-weight: 700;
}

.feed-topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feed-top-link {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  opacity: 0.92;
}

.feed-top-link:hover {
  text-decoration: underline;
  opacity: 1;
}

.feed-scroller {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.feed-status {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 80px 24px 120px;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 15px;
  scroll-snap-align: start;
}

.feed-status.is-error {
  color: #ffb4a0;
}

.feed-post {
  position: relative;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #0a0a0a;
  overflow: hidden;
}

.feed-media {
  position: absolute;
  inset: 0;
  background: #111;
}

.feed-media img,
.feed-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #111;
}

.feed-media-empty {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

.feed-gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.28) 28%, transparent 48%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, transparent 18%);
}

.feed-meta {
  position: absolute;
  left: 16px;
  right: 84px;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.feed-meta a,
.feed-meta button {
  pointer-events: auto;
}

.feed-author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  max-width: 100%;
}

.feed-author:hover {
  text-decoration: none;
}

.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

.feed-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.feed-username {
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-caption {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-location {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

.feed-actions {
  position: absolute;
  right: 12px;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.feed-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.feed-action svg {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45));
}

.feed-action-count {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.site-feed .navbar {
  z-index: 40;
}

.feed-footer {
  display: none;
}

@media (min-width: 900px) {
  .site-feed {
    display: grid;
    grid-template-columns: 1fr min(440px, 42vw) 1fr;
    background: #0b0b0b;
  }

  .feed-topbar {
    left: 50%;
    right: auto;
    width: min(440px, 42vw);
    transform: translateX(-50%);
  }

  .feed-scroller {
    grid-column: 2;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }

  .site-feed .navbar {
    left: 50%;
    transform: translateX(-50%);
  }
}
