/* ============================================================
   Picker preview — the long-press item card in the media pickers.
   Markup is built by assets/js/picker-preview.js and appended to <body>.

   Same visual family as the club long-press preview (club-preview.css):
   dark card, blurred backdrop, teal accent, quick scale-in.
   ============================================================ */

body.pk-preview-open { overflow: hidden; }

.pk-preview {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
}
.pk-preview[hidden] { display: none; }

.pk-preview__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.62);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.pk-preview__card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 380px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    background: #15151a;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.6);
    color: #fff;
    animation: pkPreviewIn .16s ease-out both;
}
@keyframes pkPreviewIn {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .pk-preview__card { animation: none; }
}

/* Backdrop still across the top, fading into the card so the poster can
   overlap it. Without a backdrop it collapses to a slim gradient band. */
.pk-preview__hero {
    position: relative;
    flex-shrink: 0;
    height: 64px;
    background: linear-gradient(135deg, #1d2a29, #101014);
}
.pk-preview__hero:has(.pk-preview__hero-img:not([hidden])) { height: 132px; }
.pk-preview__hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pk-preview__hero-img[hidden] { display: none; }
.pk-preview__hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(21,21,26,0) 35%, #15151a 100%);
    pointer-events: none;
}
.pk-preview__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #fff;
    cursor: pointer;
}
.pk-preview__close .material-icons { font-size: 19px; }

.pk-preview__head {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: -44px;
    padding: 0 16px;
    flex-shrink: 0;
}
.pk-preview__poster {
    flex: 0 0 84px;
    width: 84px;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #24242c;
    box-shadow: 0 8px 20px rgba(0,0,0,.5);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pk-preview__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Cover art rather than a poster — albums are square, so the 2:3 well
   above would letterbox them into a film-shaped frame. Set by
   PickerPreview.open({ shape: 'square' }). */
.pk-preview--square .pk-preview__poster {
    aspect-ratio: 1 / 1;
}
/* A YouTube thumbnail — 16:9, so the well is wider. shape: 'wide'. */
.pk-preview--wide .pk-preview__poster {
    flex-basis: 136px;
    width: 136px;
    aspect-ratio: 16 / 9;
}
.pk-preview__poster .material-icons { font-size: 32px; color: rgba(255,255,255,.3); }
.pk-preview__head-text {
    min-width: 0;
    padding-bottom: 2px;
}
.pk-preview__eyebrow {
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #34d8c7;
}
.pk-preview__eyebrow[hidden] { display: none; }
.pk-preview__title {
    margin: 3px 0 4px;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.pk-preview__meta {
    font-size: .76rem;
    color: rgba(255,255,255,.6);
}
.pk-preview__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.pk-preview__chips:empty { display: none; }
.pk-preview__chip {
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    font-size: .64rem;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    white-space: nowrap;
}

/* Scrolls on its own so the actions stay pinned at the bottom of a
   long synopsis on short phones. */
.pk-preview__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 12px 16px 4px;
}
.pk-preview__row {
    display: flex;
    gap: 6px;
    font-size: .78rem;
    line-height: 1.4;
    margin-bottom: 4px;
}
.pk-preview__label {
    flex-shrink: 0;
    color: rgba(255,255,255,.45);
    font-weight: 600;
}
.pk-preview__value { color: rgba(255,255,255,.9); }
.pk-preview__overview {
    margin: 10px 0 8px;
    font-size: .84rem;
    line-height: 1.5;
    color: rgba(255,255,255,.82);
}
.pk-preview__overview--empty { color: rgba(255,255,255,.45); font-style: italic; }
.pk-preview__note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 8px;
    padding: 7px 9px;
    border-radius: 8px;
    font-size: .74rem;
    line-height: 1.35;
    background: rgba(251,191,36,.12);
    border: 1px solid rgba(251,191,36,.3);
    color: #fde68a;
}
.pk-preview__note .material-icons { font-size: 16px; flex-shrink: 0; }
.pk-preview__error {
    margin: 12px 0;
    font-size: .84rem;
    color: #fecaca;
}

.pk-preview__skeleton span {
    display: block;
    height: 10px;
    margin: 10px 0;
    border-radius: 5px;
    background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.13) 50%, rgba(255,255,255,.06) 75%);
    background-size: 200% 100%;
    animation: pkPreviewShimmer 1.2s linear infinite;
}
.pk-preview__skeleton span:nth-child(1) { width: 55%; }
.pk-preview__skeleton span:nth-child(2) { width: 80%; }
.pk-preview__skeleton span:nth-child(4) { width: 70%; }
@keyframes pkPreviewShimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

.pk-preview__actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.pk-preview__actions:empty { display: none; }
.pk-preview__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 9px;
    background: #2B988F;
    color: #fff;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
}
.pk-preview__btn .material-icons { font-size: 1.1em; margin: 0 !important; }
.pk-preview__btn:hover,
.pk-preview__btn:focus-visible { background: #34ada2; color: #fff; }
.pk-preview__btn:disabled,
.pk-preview__btn.disabled { opacity: .5; cursor: default; pointer-events: none; }
/* removeFromQueue()/addToQueue() in the film picker toggle .btn-danger on
   the button they're handed — style that state here. */
.pk-preview__btn.btn-danger { background: #dc3545; }
.pk-preview__btn.btn-danger:hover,
.pk-preview__btn.btn-danger:focus-visible { background: #e04b59; }
.pk-preview__btn--ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.9);
}
.pk-preview__btn--ghost:hover,
.pk-preview__btn--ghost:focus-visible { background: rgba(255,255,255,.08); }

/* Mobile hint under "Add a Film to Your Queue" (partials/tabs/queue.php).
   Same muted tone as the "Press and hold a club to preview it" hint. */
.queue-add-hint {
    margin: 4px 0 0;
    font-size: .74rem;
    color: #9aa1b3;
}

/* ── Host pickers ─────────────────────────────────────────────────────
   Holding a poster must not raise the iOS image callout or start a text
   selection, and the held item shrinks slightly so the gesture registers
   before the card appears. */
.pk-preview-host img { -webkit-touch-callout: none; }
.pk-preview-host [data-preview-film-id],
.pk-preview-host .fp-slider__card,
.pk-preview-host .fp-person__list-row,
.pk-preview-host .fp-oscar__card,
.pk-preview-host .mx-home__card,
.pk-preview-host .mx-grammy__card {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.pk-is-holding {
    transform: scale(.96) !important;
    transition: transform .25s ease !important;
}

/* Profile + Edit Profile favourites (assets/js/profile-media-preview.js):
   no text selection or image callout while holding an item. */
.pk-preview-host .album-card,
.pk-preview-host .artist-card,
.pk-preview-host .fd-film,
.pk-preview-host .cw-artist-card,
.pk-preview-host .cw-album-thumb {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* While a long-press on a previewable item is in progress (picker-preview.js
   and club-preview.js add this on touchstart, drop it on release), nothing on
   the page may start a text selection — otherwise the OS treats the same hold
   as "select text" and highlights whatever is under the finger behind the
   preview. Scoped to the hold, so chat/reviews stay copyable. */
html.pk-no-select,
html.pk-no-select * {
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}
