/* ============================================================
   Shared feed cards — the rich post card and the media tile.

   Both the model profile's Posts tab and My Feed render these. They
   started life in profile_v2.css; they moved here when My Feed needed
   the same card, rather than being copied.

   Loaded by the profile, My Feed and hashtag-feed V2 pages.
   Deliberately not global: only those pages render a .ppost, and
   FansStylesheetCoverageTests checks that every page which does render
   one loads this file.
   ============================================================ */

.skeleton-post--wide { width: auto; height: 420px; }

/* ---- the card ----------------------------------------------------- */
.ppost {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ppost__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
}
.ppost__head[data-model-header] { cursor: pointer; }
.ppost__avatar { width: 32px; height: 32px; flex: none; font-size: 11px; background-position: center 20%; }
.ppost__who { flex: 1; min-width: 0; }
.ppost__model { font-weight: 700; font-size: 13px; }
.ppost__date { font-size: 10.5px; color: var(--ink-soft); }

.ppost__dm {
  flex: none;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: var(--card-alt);
  border: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.ppost__dm:hover { color: var(--brand); border-color: var(--brand); }

.ppost__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background-position: center 25%;
}

.ppost__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-pill);
  background: rgba(10, 14, 22, .55);
  backdrop-filter: blur(3px);
  color: #fff;
}

.ppost__body { padding: 12px 15px 13px; }

.ppost__titlerow {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.ppost__title {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.ppost__free {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--online) 14%, transparent);
  color: var(--online);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .4px;
}

.ppost__desc {
  margin: 4px 0 9px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.ppost__desc:empty { display: none; }

.ppost__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 11px;
}
.ppost__tags:empty { display: none; }

.ppost__tag {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--card-alt);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--brand);
}

/* A rule above the reaction row, unlike the compact rail cards. */
.ppost__stats {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ppost__stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.ppost__stat.is-liked   { color: var(--heart); }
.ppost__stat.is-starred { color: var(--star); }

/* ---- inline comments in My Feed -----------------------------------
   The profile reuses the same post card but not this panel: there, comments
   remain in the shared dialog because the card can also live in a fullscreen
   viewer. My Feed keeps the conversation beside the post, as in V1, with a
   quieter V2 treatment and a three-comment preview. */
.feed-comments {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.feed-comments__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.feed-comments__input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  max-height: 96px;
  padding: 10px 12px;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: var(--card-alt);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.feed-comments__input::placeholder { color: var(--ink-soft); }
.feed-comments__input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}

.feed-comments__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--brand);
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.feed-comments__send:hover:not(:disabled) { filter: brightness(1.06); }
.feed-comments__send:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.feed-comments__send:disabled { opacity: .58; cursor: progress; }

.feed-comments__thread:not(:empty) { margin-top: 5px; }

.feed-comments__state {
  margin: 8px 2px 2px;
  color: var(--ink-soft);
  font-size: 11px;
}

.feed-comments__list {
  display: flex;
  flex-direction: column;
}

.feed-comments .post-comment {
  padding: 9px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.feed-comments .post-comment:last-child { border-bottom: 0; }

.feed-comments .post-comment__head {
  margin-bottom: 2px;
  gap: 7px;
}
.feed-comments .post-comment__author { font-size: 11.5px; }
.feed-comments .post-comment__time { font-size: 10px; }
.feed-comments .post-comment__text {
  font-size: 11.5px;
  line-height: 1.45;
}
.feed-comments:not(.is-expanded) .post-comment__text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.feed-comments .post-comment__delete { font-size: 10px; }
.feed-comments .post-comment__reply {
  margin: 7px 0 0 12px;
  padding: 7px 9px;
  border-left-width: 2px;
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--brand) 7%, transparent);
  font-size: 10.75px;
}
.feed-comments:not(.is-expanded) .post-comment__reply {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.feed-comments__expand,
.feed-comments__more {
  min-height: 32px;
  margin: 2px 0 0;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.feed-comments__expand:hover,
.feed-comments__more:hover { text-decoration: underline; }
.feed-comments__expand:focus-visible,
.feed-comments__more:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 5px;
}
.feed-comments__more:disabled { opacity: .55; cursor: progress; }

@media (max-width: 480px) {
  .feed-comments__send {
    width: 42px;
    padding: 8px;
  }
  .feed-comments__send span:last-child { display: none; }
}

/* ------------------------------------------------------------------
   MEDIA VAULT
   CSS columns rather than grid: tiles are deliberately unequal heights
   and should pack, which is what column layout does for free. Note the
   consequence — order is column-major, top to bottom then across, same
   as the prototype.
   ------------------------------------------------------------------ */
.vault-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.vault-chip {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.vault-chip:hover { color: var(--ink); border-color: var(--brand); }
.vault-chip[aria-selected="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.vault-grid {
  column-width: 205px;
  column-gap: 14px;
}

.vault-item {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 14px;
  border-radius: 13px;
  overflow: hidden;
  cursor: pointer;

  /* All three spellings: the unprefixed property is recent, and a tile that
     splits across a column boundary loses its rounded corners and its
     overlay. */
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

.vault-item--image:not(.vault-item--locked) { cursor: zoom-in; }
.vault-item--video:not(.vault-item--locked) { cursor: pointer; }
.vault-item--locked { cursor: pointer; }

/* Aspect ratios, not pixel heights.
   The prototype hardcodes heights of 160–295px, which only works at its one
   column width. Here the column width changes with the viewport, so a fixed
   height letterboxes: a 160px tile is 232x160 on a wide screen and 340x160 on
   a phone. Ratios scale with the column and hold their shape at every size,
   while still giving the uneven rhythm masonry needs. */
.vault-item--tall { aspect-ratio: 3 / 5; }
.vault-item--long { aspect-ratio: 3 / 4; }
.vault-item--box  { aspect-ratio: 1 / 1; }
.vault-item--wide { aspect-ratio: 4 / 3; }

/* Below ~560px a 205px column means a single full-width stack, which reads as
   a feed rather than a vault. Narrow the column so two survive. */
@media (max-width: 560px) {
  .vault-grid { column-width: 148px; column-gap: 10px; }
  .vault-item { margin-bottom: 10px; }
}

/* On very wide screens let the tiles grow rather than multiply indefinitely. */
@media (min-width: 1500px) {
  .vault-grid { column-width: 240px; }
}

.vault-item__video {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-pill);
  background: rgba(10, 14, 22, .55);
  color: #fff;
}

/* Only My Feed captions its tiles — on a profile every tile is the same
   model, so the label would be noise. Sits above the lock so you can still
   tell whose locked post it is. */
.vault-item__label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 22px 10px 8px;
  background: linear-gradient(180deg, transparent, rgba(10, 14, 22, .6));
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

/* Lighter blur than the post card's 26px: at tile size a heavy blur loses
   all sense of what is underneath. */
.vault-item__lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 12px;
  border: 0;
  text-align: center;
  color: #fff;
  background: var(--locked);
  backdrop-filter: blur(18px);
  font: inherit;
  cursor: pointer;
}
.vault-item__lock-label { font-size: 11px; font-weight: 700; }
.vault-item__lock-cta {
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.vault-item__lock:focus-visible,
.ppost__lock:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -5px;
}

/* Locked overlay: same treatment as elsewhere, sized for the larger card. */
.ppost__lock {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  text-align: center;
  color: #fff;
  background: var(--locked);
  backdrop-filter: blur(26px);
  width: 100%;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.ppost__lock-label { font-size: 12px; font-weight: 600; opacity: .9; }
.ppost__count {
  position: absolute;
  bottom: 9px;
  right: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(10, 14, 22, .6);
  font-size: 10.5px;
  font-weight: 700;
}
