/* BookMyShow-style poster cards — shared by Events + Things to do + Home */

@keyframes posterRise {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: var(--poster-end-opacity, 1); transform: translateY(0) scale(1); }
}
@keyframes posterBarIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes posterOverlayIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes posterSeeAllNudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}
@keyframes posterSheen {
  0% { transform: translateX(-120%) skewX(-18deg); opacity: 0; }
  35% { opacity: 0.35; }
  100% { transform: translateX(160%) skewX(-18deg); opacity: 0; }
}

.poster-rail {
  /* Container-like side padding on large screens */
  --poster-gutter: 1.25rem;
  --poster-max: 72rem;
  position: relative;
  margin-left: -1rem;
  margin-right: -1rem;
}
@media (min-width: 768px) {
  .poster-rail { --poster-gutter: 2.25rem; }
}
@media (min-width: 1024px) {
  .poster-rail { --poster-gutter: 3rem; }
}
@media (min-width: 1280px) {
  .poster-rail { --poster-gutter: 4.5rem; }
}
@media (min-width: 1536px) {
  .poster-rail { --poster-gutter: 6rem; }
}

.poster-rail__head {
  padding: 0;
  margin-bottom: 1rem;
}

.poster-rail__head-inner {
  max-width: var(--poster-max);
  margin: 0 auto;
  padding: 0 var(--poster-gutter);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
}

.poster-rail__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.poster-rail__see-all {
  color: #d4f600;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  transition: color 0.15s ease;
}
.poster-rail__see-all:hover {
  text-decoration: none;
  animation: posterSeeAllNudge 0.55s ease;
}

/* Mobile: 2-up poster grid */
.poster-rail__track {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 0.75rem;
  max-width: var(--poster-max);
  margin: 0 auto;
  padding: 0.15rem var(--poster-gutter) 1.25rem;
  overflow: visible;
  align-items: stretch;
}

/* Desktop: horizontal carousel — same gutters as header */
@media (min-width: 768px) {
  .poster-rail__track {
    display: flex;
    gap: 1.35rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.45rem var(--poster-gutter) 1.35rem;
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--poster-gutter);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: stretch;
  }
  .poster-rail__track::-webkit-scrollbar { display: none; }
}

.poster-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  animation: posterRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--poster-i, 0) * 50ms);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.poster-card:hover { transform: translateY(-4px); }
.poster-card--past { --poster-end-opacity: 0.7; }
.poster-card--past:hover { transform: none; }

@media (min-width: 768px) {
  .poster-card {
    flex: 0 0 auto;
    width: 15.5rem;
    height: auto;
    align-self: stretch;
    scroll-snap-align: start;
  }
}
@media (min-width: 1024px) {
  .poster-card { width: 17.25rem; }
}
@media (min-width: 1280px) {
  .poster-card { width: 18.5rem; }
}

.poster-card__media {
  position: relative;
  aspect-ratio: 2 / 3;
  flex: 1 1 auto;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
/* Hover sheen */
.poster-card__media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.14) 50%, transparent 60%);
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
  opacity: 0;
}
.poster-card:hover .poster-card__media::before {
  animation: posterSheen 0.85s ease;
}
/* Dark gradient from bottom for overlay content */
.poster-card__shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.94) 0%,
    rgba(0, 0, 0, 0.78) 42%,
    rgba(0, 0, 0, 0.32) 74%,
    transparent 100%
  );
}
.poster-card__media > a[aria-label] {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}
.poster-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.poster-card:hover .poster-card__media img { transform: scale(1.05); }

.poster-card__fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.22);
  font-size: 2rem;
  background: linear-gradient(160deg, #222 0%, #141414 100%);
}

/* Daypart + time chip row — top of poster */
.poster-card__bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.55rem 0.55rem 0;
  background: transparent;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  z-index: 4;
  animation: posterBarIn 0.4s ease forwards;
  animation-delay: calc(var(--poster-i, 0) * 50ms + 80ms);
  opacity: 0;
}
.poster-card__bar-left,
.poster-card__bar-right {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.poster-card__bar-left { color: #d4f600; }
.poster-card__bar-right {
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
  justify-content: flex-end;
}
.poster-card__bar i { font-size: 0.72rem; flex-shrink: 0; }

/* Title + center/locality + Book overlaid on bottom gradient */
.poster-card__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 1rem 0.75rem 0.85rem;
  pointer-events: none;
  animation: posterOverlayIn 0.45s ease forwards;
  animation-delay: calc(var(--poster-i, 0) * 50ms + 140ms);
  opacity: 0;
}
.poster-card__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  min-height: calc(1.25em * 2);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.poster-card__dayline {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.3;
}
.poster-card__place {
  margin: 0 0 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #d4f600;
  line-height: 1.4;
  min-height: calc(1.4em * 2);
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.poster-card__center { color: #d4f600; }
.poster-card__area { color: #d4f600; font-weight: 600; }
.poster-card__sep { color: rgba(212, 246, 0, 0.7); font-weight: 500; }

/* Legacy single-line sub (event cards / older markup) */
.poster-card__sub {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.35;
  min-height: 1.35em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.poster-card__book {
  position: relative;
  z-index: 5;
  pointer-events: auto;
  margin-top: 0;
  width: 100%;
  border: none;
  border-radius: 0.55rem;
  padding: 0.55rem 0.65rem;
  background: #d4f600;
  color: #111;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.poster-card__book:hover {
  background: #c2e200;
  box-shadow: 0 8px 22px rgba(212, 246, 0, 0.35);
}
.poster-card__book:active { transform: scale(0.98); }
.poster-card__book:disabled,
.poster-card__book.enrolled {
  background: rgba(255, 255, 255, 0.16);
  color: #d1d5db;
  cursor: default;
  box-shadow: none;
}

/* Class cards use overlay; event cards keep a body below the poster */
.poster-card__body {
  padding: 0.55rem 0.15rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.poster-card:has(.poster-card__overlay) .poster-card__body {
  display: none;
}
.poster-card__body .poster-card__title {
  text-shadow: none;
  color: #fff;
}
.poster-card__body .poster-card__sub {
  color: rgba(255, 255, 255, 0.5);
}

@media (min-width: 768px) {
  .poster-card__title { font-size: 0.95rem; }
  .poster-card__sub { font-size: 0.78rem; }
  .poster-card__dayline { font-size: 0.74rem; }
  .poster-card__place { font-size: 0.8rem; margin-bottom: 0.75rem; }
  .poster-card__bar { font-size: 0.72rem; padding: 0.6rem 0.6rem 0; }
  .poster-card__overlay { padding: 1.1rem 0.8rem 0.95rem; }
}
@media (min-width: 1024px) {
  .poster-card__title { font-size: 1.05rem; }
  .poster-card__place { font-size: 0.88rem; margin-bottom: 0.85rem; }
  .poster-card__book { font-size: 0.85rem; padding: 0.65rem 0.75rem; }
  .poster-card__sub { font-size: 0.82rem; }
}

/* Desktop carousel nudge buttons */
.poster-rail__nav {
  display: none;
}
@media (min-width: 768px) {
  .poster-rail__nav {
    display: flex;
    position: absolute;
    top: calc(50% + 0.5rem);
    right: max(0.65rem, calc((100% - var(--poster-max)) / 2 + 0.5rem));
    transform: translateY(-50%);
    z-index: 5;
  }
  .poster-rail__nav-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 0;
    background: rgba(26, 26, 26, 0.92);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
  }
  .poster-rail__nav-btn:hover {
    background: #d4f600;
    color: #111;
  }
  .poster-rail__nav-btn:active { transform: scale(0.96); }
}

/* Full-page poster grid (things-to-do) — same card size as homepage rail */
.poster-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 0.75rem;
  align-items: stretch;
}
.poster-page-grid .poster-card { width: auto; height: 100%; }
@media (min-width: 768px) {
  .poster-page-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.35rem;
  }
  .poster-page-grid .poster-card {
    flex: 0 0 auto;
    width: 15.5rem;
    height: auto;
  }
}
@media (min-width: 1024px) {
  .poster-page-grid .poster-card { width: 17.25rem; }
}
@media (min-width: 1280px) {
  .poster-page-grid .poster-card { width: 18.5rem; }
}
