/* =========================================
   OFFBRAND — NEW RELEASE POPUP
   Uses the site's own colour variables, so it matches
   dark / light mode and whatever look is chosen in Settings.
   Layers: navbar 1000, settings 1400, popup 1500,
   page transition 2000.
========================================= */

html.ob-popup-open {
    overflow: hidden;
}

.ob-popup {
    position: fixed;
    inset: 0;
    z-index: 1500;

    display: grid;
    place-items: center;
    padding: 20px;

    background: rgba(8, 8, 11, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    opacity: 0;
    transition: opacity 0.35s ease;
}

.ob-popup.is-open {
    opacity: 1;
}

.ob-popup-card {
    position: relative;

    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    overflow-y: auto;

    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);

    transform: translateY(24px) scale(0.97);
    transition: transform 0.45s cubic-bezier(.22, 1, .36, 1);
}

.ob-popup.is-open .ob-popup-card {
    transform: none;
}


/* ---------- poster ---------- */

.ob-popup-poster {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;

    /* shows if the picture is missing or still loading */
    background:
        radial-gradient(circle at 30% 20%, rgba(var(--accent-rgb), 0.45), transparent 60%),
        var(--surface-light);
}

.ob-popup-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ob-popup-poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--surface) 0%, transparent 55%);
    pointer-events: none;
}

.ob-popup-tag {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1;

    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;

    background: var(--accent);
    color: #fff;
    border-radius: 4px;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: calc(2px * var(--ob-label-tracking, 1));
}

.ob-popup-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: ob-popup-pulse 1.8s ease-in-out infinite;
}

@keyframes ob-popup-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.25; }
}


/* ---------- close ---------- */

.ob-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;

    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;

    background: rgba(8, 8, 11, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;

    transition: background 0.3s ease, border-color 0.3s ease;
}

.ob-popup-close:hover {
    background: var(--accent);
    border-color: var(--accent);
}


/* ---------- text ---------- */

.ob-popup-body {
    padding: 4px 32px 32px;
}

.ob-popup-released {
    display: block;
    margin-bottom: 10px;

    color: var(--accent-light);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: calc(2px * var(--ob-label-tracking, 1));
    text-transform: uppercase;
}

.ob-popup-title {
    font-size: clamp(30px, 6vw, 42px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.ob-popup-meta {
    display: block;
    margin-top: 10px;

    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: calc(1.5px * var(--ob-label-tracking, 1));
    text-transform: uppercase;
}

.ob-popup-description {
    margin-top: 18px;

    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;

    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ob-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.ob-popup-actions .button {
    flex: 1 1 180px;
    cursor: pointer;
}

/* the dismiss button is a <button>, so clear the browser's default fill */
.ob-popup-actions button.button-outline {
    background: transparent;
}

.ob-popup-actions button.button-outline:hover {
    background: var(--surface-light);
}

.ob-popup-close:focus-visible,
.ob-popup-actions .button:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 3px;
}


/* ---------- small screens ---------- */

@media (max-width: 520px) {

    .ob-popup {
        padding: 14px;
    }

    .ob-popup-body {
        padding: 4px 22px 24px;
    }

    .ob-popup-actions .button {
        flex-basis: 100%;
    }

}


/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {

    .ob-popup,
    .ob-popup-card {
        transition: none;
    }

    .ob-popup-tag::before {
        animation: none;
    }

}
