/* CORE — CARDS */
.thelisting {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:20px;
  margin:24px 0 36px;
  contain:layout style;
}
/* Homepage New Releases — 6 across (full width, no sidebar pressure) */
body.home .thelisting,
body.blog .thelisting {
  grid-template-columns:repeat(6,minmax(0,1fr));
}
.movie-card {
  position:relative;
  display:flex;
  flex-direction:column;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  transition:border-color .2s ease,box-shadow .2s ease;
  box-shadow:0 8px 20px rgba(0,0,0,.28);
}
.thelisting .movie-card:nth-child(n+9) {
  content-visibility:auto;
  contain-intrinsic-size:auto 205px auto 420px;
}
.movie-link {
  position:relative;
  display:flex;
  flex-direction:column;
  height:100%;
  color:inherit;
  text-decoration:none;
}
.movie-poster {
  position:relative;
  aspect-ratio:.68;
  overflow:hidden;
  background:var(--bg-2);
}
.movie-poster img {
  width:100%;
  height:100%;
  object-fit:cover;
  transition:transform .3s ease,filter .3s ease;
}
.movie-poster.has-ep::after {content:"";position:absolute;inset:auto 0 0;height:34%;background:linear-gradient(to top,rgba(8,8,10,.72),rgba(8,8,10,0));z-index:20;pointer-events:none;}
/* EPISODE BADGE — frosted dark pill, bottom-left of the poster.
   "EP" is dimmed, the number is bold white, and a finished series gets a green "Complete" segment. */
/* Episode badge — matches card system (compact Apple-TV style pill) */
.tx-ep {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  bottom: auto;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 20px);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--tx-font, "SF Pro Display", system-ui, sans-serif);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  background: rgba(20, 20, 22, 0.92);
  /* solid bg instead of backdrop-filter — dozens of cards * blur = scroll jank */
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.tx-ep-n {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  color: #fff;
}
.tx-ep-n i {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.tx-ep-n b {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.tx-ep-done {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 6px 10px 6px 0;
  margin-right: 2px;
  border-left: 0;
  color: #6eecab;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tx-ep-done::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2fd47c;
  box-shadow: 0 0 0 2px rgba(47, 212, 124, 0.25);
  flex-shrink: 0;
  margin-left: 2px;
}
.tx-ep.is-complete .tx-ep-done {
  display: inline-flex;
}
.tx-ep.is-complete {
  border-color: rgba(47, 212, 124, 0.28);
}
@media (hover: hover) {
  .tx-card:hover .tx-ep,
  .movie-card:hover .tx-ep {
    background: rgba(12, 12, 14, 0.88);
    border-color: rgba(255, 255, 255, 0.22);
  }
}
@media (max-width: 600px) {
  .tx-ep {
    top: 8px;
    right: 8px;
  }
  .tx-ep-n {
    padding: 5px 9px;
  }
  .tx-ep-n b {
    font-size: 11px;
  }
  .tx-ep-done {
    font-size: 8px;
    padding: 5px 8px 5px 0;
  }
}

}
.movie-overlay {
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.45);
  opacity:0;
  transition:opacity .25s ease;
  z-index:15;
  pointer-events:none;
}
.movie-info {
  display:flex;
  flex-direction:column;
  flex:1;
  padding:12px 14px 14px;
  background:var(--surface);
}
.movie-info .movie-title {
  margin-bottom:0;
}
.movie-title {
  margin:0 0 10px;
  line-height:1.4;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  color:var(--text);
  font-size:17px;
  font-weight:700;
  transition:color .2s ease;
}
.movie-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:auto;
  padding-top:10px;
  border-top:1px solid var(--border);
}
.movie-date,.movie-comments {
  display:flex;
  align-items:center;
  gap:5px;
  color:var(--text-dim);
  font-size:11px;
  font-weight:500;
}
.movie-date .icon,.movie-comments .icon {
  color:var(--accent);
}
@media (hover: hover) {
  .movie-card:hover {
    border-color: rgba(var(--accent-rgb), 0.28);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
  }
  /* Poster hover: soft black wash + slight blur */
  .movie-card:hover .movie-poster img,
  .movie-poster:hover img {
    transform: scale(1.03);
    filter: brightness(0.72) blur(1.5px);
  }
  .movie-card:hover .movie-overlay,
  .movie-poster:hover .movie-overlay {
    opacity: 1;
  }
  .movie-card:hover .movie-title {
    color: var(--accent);
  }
}

/* Ensure overlay is ready for hover */
.movie-poster .movie-overlay,
.movie-link .movie-overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.movie-poster img {
  transition: transform 0.3s ease, filter 0.3s ease;
}

@media(max-width:1200px) {
  .thelisting {
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px;
  }
  body.home .thelisting,
  body.blog .thelisting {
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:14px;
  }
}
@media(max-width:991px) {
  .thelisting,
  body.home .thelisting,
  body.blog .thelisting {
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
  }
}
@media(max-width:768px) {
  .thelisting,
  body.home .thelisting,
  body.blog .thelisting {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
    margin:18px 0 30px;
  }
  .movie-info {
    padding:12px;
  }
  .movie-title {
    font-size:16px;
  }
  .movie-date,.movie-comments {
    font-size:11px;
  }
}
@media(max-width:480px) {
  .thelisting {
    gap:12px;
  }
  .movie-title {
    font-size:15px;
  }
  .movie-info {
    padding:10px;
  }
}
.movie-title {
  letter-spacing:-.015em;
}
.movie-title {
  line-height:1.35;
}

/* dark placeholder behind posters so a late-loading image never leaves a blank hole */
.movie-poster,.tx-card-art {background-color:#1a2338;}

.movie-footer{display:none!important}


/* Rating on poster — only on hover (desktop) */
.movie-rating-badge {
  position:absolute;
  top:10px;
  left:10px;
  z-index:25;
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:5px 9px;
  border-radius:999px;
  background:rgba(0,0,0,.72);
  border:1px solid rgba(255,255,255,.14);
  color:#fff;
  font-size:12px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  letter-spacing:.02em;
  opacity:0;
  transform:translateY(-4px);
  pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
  /* no backdrop-filter on rating badge */
}
.movie-rating-star {
  color:#f5c518;
  flex-shrink:0;
}
@media (hover:hover) {
  .movie-card:hover .movie-rating-badge,
  .movie-poster:hover .movie-rating-badge {
    opacity:1;
    transform:translateY(0);
  }
}
/* Touch devices: show a subtle always-on badge if preferred — keep hover-only for clean cards */


/* Movie cards: EP badge bottom-left so it never covers hover rating (top-left) */
.movie-poster .tx-ep {
  top: auto;
  right: auto;
  left: 10px;
  bottom: 10px;
}
@media (max-width: 600px) {
  .movie-poster .tx-ep {
    left: 8px;
    bottom: 8px;
  }
  /* Complete label can be long — keep badge readable, stack if needed */
  .movie-poster .tx-ep.is-complete {
    max-width: calc(100% - 16px);
  }
  .movie-poster .tx-ep-done {
    font-size: 8px;
    letter-spacing: 0.06em;
  }
  /* Rating stays top-left; slightly smaller on mobile if ever shown */
  .movie-rating-badge {
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    font-size: 11px;
  }
}


/* Card meta under clean title: S02 · 2026 */
.movie-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.movie-card-season,
.movie-card-year {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.2;
}
.movie-card-season {
  color: rgba(255, 255, 255, 0.72);
  font-variant-numeric: tabular-nums;
}
.movie-title {
  margin: 0;
}
