/* ============================================
   Collab Gallery — poster grid + film sheet
   Festival-programme grid; one quiet sheet per film.
   Uses the tokens from styles.css.
   ============================================ */

.collabs {
    background: var(--bg-primary);
}

.film-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 300px));
    justify-content: center;
    gap: 40px 28px;
}

/* ----- Tile ----- */
.film-tile {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    min-width: 0;
}

.film-tile:focus-visible {
    outline: none;
}

.film-tile:focus-visible .film-poster {
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--accent-blue);
}

.film-poster {
    --film-hue: 210;
    position: relative;
    aspect-ratio: 3 / 4;
    max-width: 100%;
    border-radius: 22px;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 18% 8%, hsl(var(--film-hue) 70% 34% / 0.85), transparent 62%),
        linear-gradient(165deg, hsl(var(--film-hue) 35% 15%), var(--bg-primary));
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.07),
        0 24px 48px -28px rgba(0, 0, 0, 0.8);
    transform: translateZ(0);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.film-tile:hover .film-poster {
    transform: scale(1.025);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        0 32px 64px -28px rgba(0, 0, 0, 0.9);
}

.film-poster img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Soft shade over the cover so the badge and play button stay readable */
.film-poster.has-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(6, 6, 11, 0.28), transparent 42%),
        linear-gradient(180deg, rgba(6, 6, 11, 0.35) 0%, transparent 28%, transparent 70%, rgba(6, 6, 11, 0.45) 100%);
    pointer-events: none;
}

.film-poster.has-image .film-badge,
.film-poster.has-image .film-play {
    z-index: 1;
}

/* Typographic poster when Instagram gives no thumbnail */
.film-poster-title {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.2vw, 2.5rem);
    line-height: 1;
    color: #fff;
    text-wrap: balance;
}

.film-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(10, 10, 18, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    backdrop-filter: blur(14px) saturate(160%);
}

.film-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58px;
    height: 58px;
    margin: -29px 0 0 -29px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.4s ease;
}

.film-play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -5px;
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent #fff;
}

.film-tile:hover .film-play {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.24);
}

.film-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 4px;
}

.film-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.film-credit {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.collab-status {
    text-align: center;
    color: var(--text-muted);
    margin-top: 24px;
}

.collab-status:empty {
    display: none;
}

.collab-cta {
    text-align: center;
    margin-top: 56px;
}

/* ----- Film sheet ----- */
html.film-sheet-open {
    overflow: hidden;
}

.film-sheet {
    width: min(960px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    overflow: visible;
}

.film-sheet::backdrop {
    background: rgba(4, 4, 10, 0.62);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    backdrop-filter: blur(24px) saturate(140%);
}

.film-sheet-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(326px, 420px) minmax(0, 1fr);
    gap: 36px;
    padding: 28px;
    max-height: calc(100dvh - 32px);
    overflow: auto;
    border-radius: 30px;
    background: rgba(20, 20, 32, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    backdrop-filter: blur(30px) saturate(150%);
}

.film-sheet[open] .film-sheet-panel {
    animation: film-sheet-in 0.5s cubic-bezier(0.2, 0.9, 0.25, 1);
}

@keyframes film-sheet-in {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }
}

.film-sheet-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.film-sheet-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

.film-sheet-close:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.film-sheet-embed {
    min-height: 480px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.film-sheet-embed .instagram-media {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 18px !important;
}

.film-sheet-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    align-self: center;
    padding-right: 24px;
    min-width: 0;
}

.film-sheet-context {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-blue);
}

.film-sheet-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.2rem, 4.5vw, 3.4rem);
    line-height: 1.02;
    text-wrap: balance;
}

.film-sheet-credits {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.film-credit-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.film-credit-name {
    font-weight: 600;
}

.film-credit-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 0.9rem;
}

.film-credit-links a {
    color: var(--accent-blue);
    text-decoration: none;
}

.film-credit-links a:hover {
    text-decoration: underline;
}

.film-sheet-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@media (max-width: 760px) {
    .film-sheet {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
    }

    .film-sheet-panel {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
        padding: 16px 16px 24px;
        max-height: calc(100dvh - 16px);
        border-radius: 24px;
    }

    .film-sheet-embed {
        min-height: 0;
    }

    .film-sheet-info {
        padding-right: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .film-poster,
    .film-play {
        transition: none;
    }

    .film-tile:hover .film-poster,
    .film-tile:hover .film-play {
        transform: none;
    }

    .film-sheet[open] .film-sheet-panel {
        animation: none;
    }
}

/* ----- Collab form: optional details ----- */
.collab-more {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.collab-more summary {
    cursor: pointer;
    padding: 18px 24px;
    font-family: var(--font-heading);
    font-weight: 600;
    list-style-position: inside;
}

.collab-more summary span {
    margin-left: 8px;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.collab-more summary:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
    border-radius: var(--radius-lg);
}

.collab-more-body {
    display: grid;
    gap: 16px;
    padding: 0 24px 24px;
}
