/* =============================================================================
   feed.css — post cards and the feed column
   Linked by pages that render a feed (home, explore, profile).
   Depends on: tokens.css, base.css, components.css, app.css
   ============================================================================= */

/* --- Feed container ----------------------------------------------------- */
.feed {
  display: flex;
  flex-direction: column;
}

/* --- Post card ---------------------------------------------------------- */
/* --- Post card ---------------------------------------------------------- */
.post {
  position: relative; /* so the link's ::before can cover the whole card */
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--rule);
  transition: background 0.15s ease;
}

@media (min-width: 768px) {
  .post {
    padding: 2rem 2rem 1.75rem;
  }
}

.post:hover {
  background: var(--paper-deep);
}

/* The clickable area. The ::before is stretched over the whole card so
   tapping anywhere on the card (except the footer) opens the post. */
.post__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* The footer sits above the link's ::before so its children stay clickable. */
.post__footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
}

/* --- Author row --------------------------------------------------------- */
.post__author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.post__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.post__avatar--initial {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--oxblood);
  color: var(--on-oxblood);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
}

.post__author-info {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

.post__author-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.post__author-handle {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.post__author-time {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.post__author-time::before {
  content: "·";
  margin-right: 0.5rem;
}

/* --- Title -------------------------------------------------------------- */
.post__title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 500;
  font-variation-settings:
    "opsz" 96,
    "WONK" 1;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.75rem;
  max-width: 32ch;
}

@media (min-width: 768px) {
  .post__title {
    font-size: 1.75rem;
    line-height: 1.12;
  }
}

/* --- Excerpt ------------------------------------------------------------ */
.post__excerpt {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  max-width: 60ch;

  /* clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  .post__excerpt {
    font-size: 1.1rem;
  }
}

/* --- Cover image -------------------------------------------------------- */
.post__cover {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: 1.25rem 0 1.25rem;
  border: 1px solid var(--rule);
}

/* --- Meta row ----------------------------------------------------------- */
.post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
}

.post__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.post__meta-item + .post__meta-item::before {
  content: "·";
  margin-right: 0.75rem;
  color: var(--ink-muted);
}

/* --- Ad slot ------------------------------------------------------------ */
.ad-slot {
  padding: 1.75rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  background: rgba(var(--oxblood-text-rgb), 0.02);
}

.ad-slot__placeholder {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide the placeholder outline once the creative loads. */
.ad-slot__placeholder:has(iframe),
.ad-slot__placeholder:has(img) {
  border: none;
  min-height: 0;
  padding: 0;
}

.ad-slot__placeholder.ad-slot--filled {
  border: none;
  min-height: 0;
  padding: 0;
}

@media (min-width: 768px) {
  .ad-slot {
    padding: 2rem;
  }
}

.ad-slot__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}

.ad-slot__placeholder {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot:not(.ad-slot--loaded) .ad-slot__placeholder {
  border: 1px dashed var(--rule);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

/* --- House ad ----------------------------------------------------------- */
.house-ad {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.house-ad:hover {
  border-color: var(--oxblood-text);
  background: var(--paper-deep);
}

.house-ad__kicker {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--oxblood-text);
}

.house-ad__headline {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  font-variation-settings:
    "opsz" 96,
    "WONK" 1;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.house-ad__body {
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.house-ad__cta {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--oxblood-text);
}

/* --- Feed footer / load more -------------------------------------------- */
.feed__more {
  padding: 2rem 1.5rem;
  text-align: center;
}

.feed__more .link-arrow {
  font-size: 0.9rem;
}

/* --- Empty state -------------------------------------------------------- */
.feed__empty {
  padding: 4rem 1.5rem;
  max-width: 44ch;
}

@media (min-width: 768px) {
  .feed__empty {
    padding: 5rem 2rem;
  }
}

.feed__empty-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood-text);
  margin-bottom: 1rem;
}

.feed__empty-body {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.post__tags {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}
.post__tag {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.post__tag:hover {
  color: var(--oxblood-text);
  border-bottom-color: var(--oxblood-text);
}
