/*
 * A video floating in a corner while its place is scrolled away (site/spilari/fylgja.js: an episode's page, an article's
 * main slot): small, over the page, with a × to close it; on a phone across most of its width, at the foot of the
 * screen. (The site's rules place a frame in its box absolutely: here they're undone.)
 */
.fylgir.is-floating > iframe {
    position: fixed !important;
    top: auto !important;
    left: auto !important;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 900;
    /* (the site's own rules give the frame its height in its place: its own here) */
    width: 380px !important;
    height: calc(380px * 9 / 16) !important;
    min-height: 0 !important;
    border-radius: 10px;
    background: #000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    animation: fylgja-inn 220ms ease-out;
}

.fylgja__loka {
    position: fixed;
    right: 8px;
    bottom: calc(16px + 380px * 9 / 16 - 16px + env(safe-area-inset-bottom, 0px));
    z-index: 901;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #151515;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.fylgja__loka[hidden] {
    display: none;
}

.fylgja__loka svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.fylgja__loka:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

@keyframes fylgja-inn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
    .fylgir.is-floating > iframe {
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        width: min(320px, calc(100vw - 16px)) !important;
        height: calc(min(320px, calc(100vw - 16px)) * 9 / 16) !important;
        min-height: 0 !important;
    }

    .fylgja__loka {
        right: 2px;
        bottom: calc(8px + min(320px, calc(100vw - 16px)) * 9 / 16 - 16px + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .fylgir.is-floating > iframe {
        animation: none;
    }
}
