/* ==========================================
   CALENDAR PAGE
   ========================================== */

.cal-body {
  background: #E6E5DF;
  padding-top: 64px;
  flex: 1;         /* fill the flex body */
  display: flex;
  flex-direction: column;
}



/* ---- Calendar page fills viewport ---- */
.cal-page {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ---- Bento grid ---- */
.cal-grid {
  flex: 1;                          /* grow to fill cal-page */
  display: grid;
  gap: 0;
  grid-template-columns: repeat(1, 1fr);
  grid-auto-rows: minmax(160px, 1fr); /* rows share height equally, min 160px */
}

.cal-cell {
  /* No fixed aspect-ratio — rows fill the available height */
  overflow: hidden;
  position: relative;
}

/* Image cells — dark placeholder */
.cal-cell--image {
  background-color: var(--img-bg, #141414);
}

/* Filler cells — complete the last row, continuing the checkerboard */
.cal-cell--filler-light { background: #E6E5DF; }
.cal-cell--filler-dark  { background: #D3D2D2; }

.cal-cell--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cal-cell--image:hover img {
  transform: scale(1.06);
}

/* Event cells — cream */
.cal-cell--event {
  background: #E6E5DF;
  padding: clamp(14px, 3vw, 28px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.18s ease;
  overflow: visible;        /* let the vote tooltip escape the cell */
}

.cal-event-top {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-event-bottom {
  display: flex;
  flex-direction: column;
}

/* Hover: dark panel + light text, matching the Buy Tickets modal.
   Only on clickable (upcoming) cells — not past or on-air. */
.cal-cell--event:not(.cal-cell--past):not(.cal-cell--onair):hover {
  background: #111;
}

.cal-cell--event:not(.cal-cell--past):not(.cal-cell--onair):hover .cal-event-date,
.cal-cell--event:not(.cal-cell--past):not(.cal-cell--onair):hover .cal-event-title,
.cal-cell--event:not(.cal-cell--past):not(.cal-cell--onair):hover .cal-event-time {
  color: #E6E5DF;
}

.cal-cell--event:not(.cal-cell--past):not(.cal-cell--onair):hover .cal-event-director,
.cal-cell--event:not(.cal-cell--past):not(.cal-cell--onair):hover .cal-event-venue {
  color: rgba(230, 229, 223, 0.6);
}

/* Event cell used as a ticket link */
.cal-cell--link {
  text-decoration: none;
  color: inherit;
}

/* Past + on-air screenings — not clickable */
.cal-cell--past,
.cal-cell--onair {
  cursor: default;
}

.cal-cell--past.cal-cell--event:hover {
  background: #E6E5DF; /* no dark hover for past */
}


/* "Past screening" badge */
.cal-badge {
  display: inline-block;
  font-family: var(--font-main);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff5b5b;
  background: none;
  padding: 4px 0;
}

/* "On air" badge — live indicator with a pulsing dot */
.cal-badge--live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1e9e4a;
}

.cal-badge--live::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1e9e4a;
  animation: cal-live-pulse 1.4s ease-in-out infinite;
}

@keyframes cal-live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* Vote button on past screenings */
.cal-vote-btn {
  position: relative;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  color: #E6E5DF;
  border: none;
  border-radius: 0;
  padding: 8px 12px;
  font-family: var(--font-main);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-start;
  text-align: left;
}

.cal-vote-btn:hover:not(:disabled) {
  background: #333;
}

/* Tooltip explaining the vote button */
.cal-vote-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: 240px;
  background: #1a1a1a;
  color: #E6E5DF;
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.01em;
  padding: 9px 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 10;
}

.cal-vote-btn[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* No tooltip once the vote has been cast */
.cal-vote-btn.is-voted[data-tooltip]::after {
  content: none;
}

.cal-vote-btn.is-voted {
  background: rgba(26, 26, 26, 0.15);
  color: #1a1a1a;
  cursor: default;
}

.cal-vote-count {
  background: rgba(230, 229, 223, 0.25);
  padding: 1px 7px;
  font-weight: 700;
}

.cal-vote-btn.is-voted .cal-vote-count {
  background: rgba(26, 26, 26, 0.15);
}

.cal-event-date {
  display: block;
  font-family: var(--font-main);
  font-size: clamp(3rem, 3.5vw, 2.8rem);
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.cal-event-title {
  font-family: var(--font-main);
  font-size: clamp(0.8rem, 1.5vw, 1.8rem);
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.cal-event-director {
  font-family: var(--font-main);
  font-size: clamp(0.66rem, 1vw, 1rem);
  color: #666;
  font-weight: 400;
  margin: 0 0 6px;
}

.cal-event-time {
  font-family: var(--font-main);
  font-size: clamp(0.78rem, 1.2vw, 0.95rem);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.2;
}

.cal-event-venue {
  font-family: var(--font-main);
  font-size: clamp(0.62rem, 0.9vw, 1rem);
  color: #999;
  font-weight: 400;
  margin: 0;
  line-height: 1.3;
}

.cal-empty {
  grid-column: 1 / -1;
  padding: 80px 24px;
  font-size: 0.9rem;
  color: rgba(26, 26, 26, 0.35);
  font-family: var(--font-main);
}

/* Active nav link */
.navbar__link--active {
  background: rgba(0, 0, 0, 0.07);
  border-radius: 0;
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   Aligned to the 4 defined site ranges.
   Odd columns only — even cols break the chess board.
   ========================================== */

/* Small  320–767px  → 1 col  (odd ✓) */
.cal-grid {
  grid-template-columns: repeat(1, 1fr);
}

/* Medium  768px+    → 3 cols (odd ✓, range: 768–1199px) */
@media (min-width: 768px) {
  .cal-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Large   1200px+   → 5 cols (odd ✓, range: 1200–1599px) */
@media (min-width: 1200px) {
  .cal-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* XL      1600px+   → 7 cols (odd ✓, range: 1600px+) */
@media (min-width: 1600px) {
  .cal-grid {
    grid-template-columns: repeat(7, 1fr);
  }
}

/* Mobile (1-column): cells are full width, so enlarge text for readability.
   Hierarchy kept: date > title > time > director > venue */
@media (max-width: 767px) {
  .cal-event-date {
    font-size: 2rem;
  }
  .cal-event-title {
    font-size: 2rem;
    line-height: 1;
  }
  .cal-event-time {
    font-size: 1.2rem;
  }
  .cal-event-director {
    font-size: 1rem;
  }
  .cal-event-venue {
    font-size: 1rem;
  }

  /* Text aligns 1rem (16px) from the screen edges — matching the navbar logo
     (left) and burger icon (right). */
  .cal-cell--event {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Two groups side by side, pulled up toward the image above, with the
     hour/venue (or "Past screening" badge) top-aligned with the date.
     Applies to upcoming AND past cells so they're laid out the same way. */
  .cal-cell--event {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 12px;
    align-content: start;         /* move all the text up toward the image above */
    align-items: start;           /* right group lines up with the date at the top */
  }
  .cal-cell--event .cal-event-bottom {
    grid-column: 1;
    grid-row: 1;                  /* same row as the right group */
    min-width: 0;                 /* let the title wrap instead of overflowing */
  }
  .cal-cell--event .cal-event-top {
    grid-column: 2;
    grid-row: 1;                  /* same row as the title block */
    align-items: flex-end;        /* right-align the hour/venue (or badge) */
    text-align: right;
  }
  /* Vote button sits right under the "Past screening" badge, right-aligned */
  .cal-cell--event .cal-event-top .cal-vote-btn {
    align-self: flex-end;
  }
}
