/* Film list layout */
.film-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;               /* 10px between cards horizontally & vertically */
    margin-bottom: 10px;          /* 10px above and below the grid, matches the gap */
    justify-content: flex-start; /* let gap handle spacing, no stretching */
}

/* Film cards: two per row on desktop */
.film-card {
    position: relative;
    flex: 0 1 calc(50% - 5px); /* 2 per row with a 10px gap */
    background-color: #535353;
    border-radius: 10px;
    overflow: hidden;
}

/* Default last card: no special treatment */
.film-list > .film-card:last-child {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* Desktop: when total count is odd, center the last one */
@media (min-width: 769px) {
    .film-list > .film-card:last-child:nth-child(odd) {
        margin-left: auto;
        margin-right: auto;
        /* width stays controlled by flex-basis above,
           so it's the same size as other cards */
    }
}

/* Poster */
.film-card img {
    width: 100%;
    height: 260px;
    object-fit: cover;
}

/* ========= TYPE PILL (Narrative, etc.) ========= */
/* (Unused now but safe to keep) */
.film-card .film-type-pill {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 7;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    font-size: 14px;
    line-height: 1;
    white-space: nowrap;
}

.film-card .film-type-pill i {
    font-size: 13px;
}

/* Category (matches single-film look) */
.category-wrapper { 
    position: absolute; 
    top: 10px; 
    left: 10px; 
    z-index: 5; 
}
.category {
    top: 10px; 
    left: 10px; 
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 16px;
}
.category i { 
    margin-right: 8px; 
}

/* Flag */
.flag-icon-wrapper {
    position: absolute;
    top: 5px;
    right: 10px;
    width: 45px;
    height: 30px;
    z-index: 5;
}
.flag-icon {
    width: 100%;
    height: 100%;
    background-size: cover;
    border-radius: 5px;
}

/* Overlay box at bottom of poster */
.film-box {
    background: rgba(83, 83, 83, 0.6);
    color: #ffffff;
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px 10px 10px; /* top padding leaves room for badges row */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;   /* ⬅ keep content floating at bottom */
}

/* ========= Title ========= */
.film-title {
    margin-bottom: 2px;
}

.film-title h3 {
    color: #fda222;
    font-size: 19px;
    font-weight: bold;
    margin: 0 0 2px 0;
    text-align: left;
}

/* ========= Meta area ========= */
.film-meta {
    display: flex;
    flex-direction: column;
    gap: 1px; /* tighter vertical spacing between director and runtime row */
    font-size: 15px;
}

/* Director line stays full width */
.film-meta .director-line {
    margin: 0;
    font-size: 15px;
    line-height: 1.25;
}

/* Runtime row: left/right split */
.film-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.film-meta-left span,
.film-meta-right {
    font-size: 15px;
    line-height: 1.25;
}

/* Optional styling for the dot between time and session (if you use one) */
.film-meta-right .dot {
    padding: 0 4px;
    opacity: 0.7;
}

/* ====== TOP PILL ROWS (ABSOLUTE) ====== */
.pill {
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.35rem .6rem;
  border-radius:999px;
  font-size:.9rem;
  line-height:1;
  white-space:nowrap;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
  backdrop-filter: blur(2px);
}
.pills-left {
  position:absolute;
  top:-15px;
  left:10px;
  z-index:3;
  display:flex;
  gap:.5rem;
}
.pills-right {
  position:absolute;
  top:-15px;
  right:10px;
  z-index:3;
  display:flex;
  gap:.5rem;
  align-items:center;
}
.pill-festival { background:#eee; color:#535353; }
.pill-premiere { background:#fda222; color:#111; }
.pill-attending { background:#9be37c; color:#0b3d00; }
.pill-qna { background:#c6d4ff; color:#0b1948; }
.pill-noms { background:#eee; color:#333; }
.pill-wins { background:#d4af37; color:#111; }

/* Responsive: stack cards on mobile */
@media (max-width: 768px) {
    .film-card {
        flex: 1 1 100%;
    }
    .film-card:last-child {
        flex: 1 1 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .film-title h3 {
        font-size: 16px;
    }
}