/* מילנר TV — feature: the trailer (js/features/trailer.js) */

/* ===== Download page: poster card above the download buttons ===== */
.trailer-card {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 0;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    text-align: start;
    cursor: pointer;
    transition: all var(--dur-normal) var(--ease-out);
}

.trailer-card:hover,
.trailer-card:focus-visible {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.15);
    transform: translateY(-2px);
}

.trailer-card:active {
    transform: scale(0.98);
}

.trailer-card-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--bg-surface);
}

.trailer-card-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* The play button sits beside the text, so the poster (the logo) stays uncovered */
.trailer-card-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px 14px;
}

.trailer-card-play {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 24px rgba(220, 38, 38, 0.45);
    transition: transform var(--dur-normal) var(--ease-out);
}

.trailer-card:hover .trailer-card-play,
.trailer-card:focus-visible .trailer-card-play {
    transform: scale(1.08);
}

/* The triangle sits a touch off-centre, so nudge it into the circle's optical centre */
.trailer-card-play .icon,
.trailer-pill .icon {
    transform: translateX(1px);
}

.trailer-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trailer-card-title {
    font-size: 16px;
    font-weight: 700;
}

.trailer-card-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== "מי צופה?" screen: pill in the corner opposite the options button ===== */
.trailer-pill {
    position: absolute;
    bottom: 20px;
    right: 20px;
    height: 44px;
    padding: 0 16px 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--dur-normal);
    z-index: 5;
}

.trailer-pill .icon {
    width: 16px;
    height: 16px;
    color: var(--primary-light);
}

.trailer-pill:hover,
.trailer-pill:focus-visible {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    color: var(--text-primary);
}

.trailer-pill:active {
    transform: scale(0.94);
}

/* ===== The player: full screen, above every view, panel and dialog ===== */
.trailer-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
    background: rgba(0, 0, 0, 0.92);
}

.trailer-overlay[hidden] {
    display: none;
}

.trailer-video {
    display: block;
    width: 100%;
    max-width: min(100%, calc((100vh - var(--safe-top) - var(--safe-bottom)) * 16 / 9));
    max-width: min(100%, calc((100dvh - var(--safe-top) - var(--safe-bottom)) * 16 / 9));
    max-height: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    outline: none;
}

.trailer-close {
    position: absolute;
    top: calc(var(--safe-top) + 10px);
    left: calc(var(--safe-left) + 10px);
    z-index: 1;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
}

.trailer-close:hover,
.trailer-close:focus-visible {
    background: var(--primary);
    color: #fff;
}
