/* =====================================================================
   The video card — one card for the whole site
   (homepage rails, Videos page, artist pages). Markup: usersc/includes/video-card.php
   Size comes from where the card sits: a .js-video-grid (Videos, artist
   pages) or a homepage .video-rail (see /css/home.css).
   ===================================================================== */

/* ── Video grid ──────────────────────────────────────────────────── */
.js-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.25rem;
    width: 100%;
}

/* ── Video card ──────────────────────────────────────────────────── */
.js-video-card {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}
.js-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.13);
    border-color: #2e7d32;
}

/* Thumbnail area */
.js-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}
.js-player-wrap {
    width: 100%;
    height: 100%;
}
.js-card-thumb img.placeholder {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}
.js-video-card:hover .js-card-thumb img.placeholder {
    opacity: 0.88;
}
/* Play overlay */
.js-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.js-play-overlay span {
    font-size: 3rem;
    color: rgba(255,255,255,0.88);
    text-shadow: 0 2px 8px rgba(0,0,0,0.55);
    transition: transform 0.18s, opacity 0.18s;
    opacity: 0;
}
.js-video-card:hover .js-play-overlay span {
    opacity: 1;
    transform: scale(1.15);
}

/* Card info */
.js-card-info {
    padding: 0.75rem 0.9rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}
.js-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: #111;
}
.js-card-title a {
    color: inherit;
    text-decoration: none;
}
.js-card-title a:hover {
    color: #2e7d32;
    text-decoration: underline;
}
.js-card-artist {
    font-size: 0.85rem;
    color: #444;
    margin: 0;
    line-height: 1.3;
}
.js-card-artist a {
    color: #2e7d32;
    text-decoration: none;
    font-weight: 600;
}
.js-card-artist a:hover { text-decoration: underline; }

/* Badge pills */
.js-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}
.js-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    letter-spacing: 0.03em;
    line-height: 1.5;
}
.js-badge-type {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}
.js-badge-vq {
    background: #f5e49c;
    color: #7a5c00;
    border: 1px solid #c8a200;
}
.js-badge-aq {
    background: #7a5c00;
    color: #f5e49c;
    border: 1px solid #a07800;
}

/* ─── Card layout fixes ───────────────────────────────── */
.js-video-card {
  position: relative;
}
.js-card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 8px 8px;
}
.js-card-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.js-card-ratings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ─── Broken? button ─────────────────────────────────── */
.js-broken-btn {
  position: absolute;
  bottom: 8px;
  right: 0.9rem;
  z-index: 6;
  background: none;
  border: none;
  padding: 2px 0;
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .3px;
  line-height: 1.4;
  color: #b8860b;
}
.js-broken-btn:hover,
.js-broken-btn:focus {
  color: #8a6408;
  text-decoration: underline;
  outline: none;
}

/* ─── Badge label style ──────────────────────────────── */
.js-badge-vq, .js-badge-aq {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.js-badge-vq .js-badge-star,
.js-badge-aq .js-badge-star {
  font-size: 0.9em;
  margin-left: 1px;
}

/* Duration label on the thumbnail */
.js-player-wrap { position: relative; }
.js-card-duration { position: absolute; bottom: .5rem; right: .5rem; background: rgba(0,0,0,.78); color: #fff; font-size: .78rem; font-weight: 600; padding: .15rem .4rem; border-radius: 4px; pointer-events: none; z-index: 2; line-height: 1.2; font-variant-numeric: tabular-nums; }

/* Narrow phones: one full-width card per row */
@media (max-width: 600px) {
    .js-video-grid { grid-template-columns: 1fr; }
}

/* Room for the bottom link row (Broken? / admin Edit · Artists) */
.js-video-card:has(.js-broken-btn, .jse-card-links) .js-card-info {
  padding-bottom: 2.1rem;
}

/* Type pill on the left, rating pills on the right, on one line */
.js-card-meta {
  flex-direction: row;
  flex-wrap: wrap;          /* only if a long type + both ratings can't fit */
  align-items: center;
  justify-content: space-between;
  gap: 4px 6px;
}
.js-card-meta .js-badge { white-space: nowrap; }
.js-card-ratings-row {
  margin-left: auto;
  flex-wrap: nowrap;
  flex-shrink: 0;
  justify-content: flex-end;
}
/* Both rating pills: light gold with dark gold text */
.js-badge-vq,
.js-badge-aq {
  background: #fbf0c8;
  color: #7a5c00;
  border: 1px solid #e3c766;
}
/* Narrow cards (homepage rails, phones): trim the pills' side padding so all three fit on one line */
.js-card-info { container-type: inline-size; }
@container (max-width: 330px) {
  .js-card-meta { padding-left: 4px; padding-right: 4px; gap: 4px; }
  .js-card-meta .js-badge { padding: 0.15rem 0.35rem; letter-spacing: 0; }
}
/* Phone-width homepage cards (~280px card, ~250px inside) */
@container (max-width: 260px) {
  .js-card-meta .js-badge { font-size: 0.68rem; padding: 0.12rem 0.35rem; }
}