/**
 * The card that slides in over a story with one ad (Spotlight\Corner): the bottom corner on a computer, across the
 * bottom on a phone. The look of the From Our Community Partners box: a navy edge and name strip, the ad on a light
 * blurred copy of itself. Hidden until corner.js opens it.
 */

.xtra-corner {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9998; /* where the membership bar sat */
    width: min(21rem, calc(100vw - 2rem));
    overflow: hidden;
    border: 2px solid var(--wp--preset--color--navy, #1B2A4A);
    border-radius: 14px;
    background: var(--wp--preset--color--navy, #1B2A4A);
    box-shadow: 0 14px 44px rgba(15, 23, 42, 0.3);
    opacity: 0;
    transform: translateY(calc(100% + 2rem));
    transition: transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease;
}

.xtra-corner[hidden] {
    display: none;
}

.xtra-corner.is-open {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .xtra-corner {
        transition: none;
    }
}

.xtra-corner__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-left: 0.9rem;
    color: #fff;
}

.xtra-corner__name {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.3;
}

.xtra-corner__close {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}

.xtra-corner__close:hover,
.xtra-corner__close:focus-visible {
    opacity: 1;
}

.xtra-corner__body {
    position: relative;
    display: flex;
    justify-content: center;
    overflow: hidden;
    padding: 0.75rem;
    border-radius: 0 0 12px 12px;
    background: #fff;
}

.xtra-corner__blur {
    position: absolute;
    inset: -2rem;
    background-position: center;
    background-size: cover;
    filter: blur(24px) saturate(1.1);
    opacity: 0.3;
}

.xtra-corner__pick {
    position: relative;
    display: flex;
    justify-content: center;
    max-width: 100%;
}

.xtra-corner__pick[hidden] {
    display: none;
}

.xtra-corner .xtra-spotlight {
    margin: 0;
}

.xtra-corner .xtra-spotlight a {
    display: block;
}

/* Never taller than half the window: a tall ad narrows, it is never cut. */
.xtra-corner .xtra-spotlight__media {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(50vh, 26rem);
    border-radius: 10px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, 0.22);
}

/* A phone: across the bottom, and shorter, so the story still shows above it. */
@media (max-width: 600px) {
    .xtra-corner {
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        border-bottom: 0;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -8px 30px rgba(15, 23, 42, 0.28);
        transform: translateY(105%);
    }

    .xtra-corner__body {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
        border-radius: 0;
    }

    .xtra-corner .xtra-spotlight__media {
        max-height: 34vh;
    }
}
