/* Trailer Theater */

.trailer-theater {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.trailer-theater.is-open {
    display: flex;
}

.trailer-theater-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 12, 0.92);
    backdrop-filter: blur(4px);
}

.trailer-theater-dialog {
    --theater-header-h: 64px;
    position: relative;
    z-index: 1;
    /* Bound width by the 1100px design cap, the available viewport width, and
       the width that keeps a 16:9 screen (plus header) within the available
       viewport height, so the dialog never grows taller than the viewport. */
    width: min(1100px, 100%, calc((100vh - 48px - var(--theater-header-h)) * 16 / 9));
    background: #17130f;
    border: 1px solid #40372f;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.trailer-theater-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: var(--theater-header-h);
    padding: 0 20px;
    box-sizing: border-box;
    color: #fffaf3;
}

.trailer-theater-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.trailer-theater-save {
    margin-left: auto;
    padding: 7px 10px;
    border: 1px solid #86766a;
    border-radius: 6px;
    background: transparent;
    color: #fffaf3;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.trailer-theater-save:hover {
    background: #40372f;
}

.trailer-theater-save:focus-visible {
    outline: 2px solid #fffaf3;
    outline-offset: 2px;
}

.trailer-theater-close {
    border: 0;
    background: transparent;
    color: #fffaf3;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.trailer-theater-screen {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.trailer-theater-screen iframe,
#trailer-theater-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.trailer-theater-open {
    overflow: hidden;
}