/* post-card-audio.css  (OPTIONAL add-on: the hosted-audio player.)
   Needs the design tokens from post-card.css. Delete this file together with post-card-audio.js
   if you do not want the player. */

/* =====================================================================
   AUDIO PLAYER (shown between the text and the footer)
   ===================================================================== */
.post-card-media { background: var(--post-card-media-background, #111218); padding: var(--post-card-padding); display: flex; flex-direction: column; gap: 16px; }

/* Player layout: [play][title + stats][cover art] on the first row, waveform on the second.
   The cover art spans both rows so it sits tall on the right, like in the whysper reference. */
.post-card-player { display: grid; align-items: center; column-gap: 14px; row-gap: 10px;
                    grid-template-columns: auto minmax(0, 1fr) auto;
                    grid-template-areas: "play text cover" "waveform waveform cover"; }
.post-card-player.without-cover { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "play text" "waveform waveform"; }
.post-card-play-button {
  all: unset; cursor: pointer; flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; color: #fff; grid-area: play;
  background: linear-gradient(135deg, #8b4df0, #b25cf0);
}
.post-card-play-button svg { width: 18px; height: 18px; }
.post-card-play-button:hover { filter: brightness(1.12); }
.post-card-play-button.small { width: 30px; height: 30px; grid-area: auto; }   /* the buttons inside the track list */
.post-card-play-button.small svg { width: 13px; height: 13px; }
.post-card-play-button:focus-visible, .post-card-queue-button:focus-visible, .post-card-waveform:focus-visible,
.post-card-comment-timestamp-toggle:focus-visible { outline: 2px solid var(--post-card-accent); outline-offset: 2px; }
.post-card-player-text { grid-area: text; min-width: 0; }
.post-card-player-title { font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }
.post-card-player-stats { font-size: 13px; color: var(--post-card-text-muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.post-card-cover-art { grid-area: cover; width: 96px; height: 96px; border-radius: 8px; background: var(--post-card-chip-background) center / cover no-repeat; }

/* Waveform: two identical bar drawings stacked. The bottom one is dim (unplayed). The top one is bright
   (played) and is clipped from the right so only the part up to --playback-progress (0 to 1) shows. */
.post-card-waveform { grid-area: waveform; position: relative; height: 56px; cursor: pointer; touch-action: none;
                      color: color-mix(in srgb, var(--post-card-accent) 32%, transparent); border-radius: 4px; }
.post-card-waveform svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.post-card-waveform .waveform-played { color: var(--post-card-accent); clip-path: inset(0 calc((1 - var(--playback-progress, 0)) * 100%) 0 0); }

/* "Comment on this post..." pill with the optional clock (timestamp) toggle */
.post-card-comment-form { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 999px;
                          background: color-mix(in srgb, var(--post-card-accent) 9%, #0d0e12);
                          border: 1px solid color-mix(in srgb, var(--post-card-accent) 22%, transparent); }
.post-card-comment-timestamp-toggle { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
                                      font-size: 12px; font-weight: 700; color: var(--post-card-text-muted); font-variant-numeric: tabular-nums; }
.post-card-comment-timestamp-toggle svg { width: 15px; height: 15px; }
.post-card-comment-timestamp-toggle[aria-pressed="true"] { color: var(--post-card-accent); background: #a974f522; }
.post-card-comment-input { all: unset; flex: 1; min-width: 0; font-size: 14px; color: var(--post-card-text); }
.post-card-comment-input::placeholder { color: var(--post-card-text-muted); }

/* Track list (shown only when a post has 2+ tracks). The negative margins make the divider lines
   run edge to edge while the content keeps the normal padding. */
.post-card-track-list { display: flex; flex-direction: column; margin: 0 calc(var(--post-card-padding) * -1) calc(var(--post-card-padding) * -1); padding: 0 var(--post-card-padding); }
.post-card-track-row { display: grid; grid-template-columns: auto 18px minmax(0, 1fr) auto auto auto; align-items: center; gap: 12px;
                       padding: 12px 0; border-top: 1px solid var(--post-card-border); font-size: 14px; }
.post-card-track-row:first-child { border-top: 0; }
.post-card-track-row .track-number { color: var(--post-card-text-muted); text-align: center; font-size: 13px; }
.post-card-track-row .track-title { font-weight: 600; overflow-wrap: anywhere; }
.post-card-track-row.is-active .track-title { color: var(--post-card-accent); }       /* the track shown in the player above */
.post-card-track-row .track-stat { color: var(--post-card-text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.post-card-queue-button { all: unset; cursor: pointer; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; color: var(--post-card-text-muted); }
.post-card-queue-button:hover { background: #ffffff0d; color: var(--post-card-text-secondary); }
.post-card-queue-button svg { width: 18px; height: 18px; }


/* phones: smaller cover art, hide the per-track play counts */
@media (max-width: 520px) {
  .post-card-cover-art { width: 72px; height: 72px; }
  .post-card-track-row { grid-template-columns: auto 14px minmax(0, 1fr) auto auto; }
  .post-card-track-row .track-plays-stat { display: none; }
}
