/**
 * Featherlight – spinner above everything, disappears after 2.5s
 */

html.with-featherlight {
    overflow: hidden;
}

.featherlight {
    display: none;
    position: fixed !important;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 100;
    text-align: center;
    cursor: pointer;
    background: transparent !important;
}

/* Spinner: above all, gone at 2.5s */
.featherlight::before {
    content: "";
    position: fixed;
    top: calc(50% + 50px); /* account for 100px sticky header */
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(0,0,0,0.2);
    border-top: 4px solid #000;
    border-radius: 50%;

    /* Spin for 2s, then fade out over 0.5s */
    animation: featherlight-spin 1s linear infinite,
               featherlight-fadeout 0.5s ease forwards;
    animation-delay: 0s, 2s;

    z-index: 10000; /* stays on top */
    pointer-events: none;
}

/* Overlay */
.featherlight::after {
    content: "";
    position: fixed !important;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    background-image:
        radial-gradient(ellipse at top center,
                        rgba(255,255,255,0.6) 0%,
                        rgba(255,255,255,0.4) 20%,
                        rgba(0,0,0,0.65) 60%,
                        rgba(0,0,0,0.85) 100%);
    background-repeat: no-repeat;
    background-size: cover;
    z-index: 1;
}

@keyframes featherlight-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes featherlight-fadeout {
    to { opacity: 0; visibility: hidden; }
}

.featherlight > * {
    position: relative;
    z-index: 2;
}

/* Content */
.featherlight .featherlight-content {
    position: absolute !important;
    top: calc(50% + 50px);
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 0;
    margin: 0;
    max-height: calc(95% - 100px);
    max-width: 95%;
    overflow: auto;
    text-align: left;
    cursor: auto;
    white-space: normal;
}

.featherlight .featherlight-inner {
    display: block;
}

/* Close icon */
.featherlight .featherlight-close-icon {
    position: absolute;
    z-index: 9999; /* spinner uses 10000 */
    top: 5px;
    right: 5px;
    width: 35px;
    height: 35px;
    line-height: 35px;
    font-size: 22px;
    font-weight: bold;
    color: #000;
    background: rgba(255,255,255,0.8);
    cursor: pointer;
    text-align: center;
    border: none;
    padding: 0;
}

.featherlight .featherlight-close-icon::-moz-focus-inner {
    border: 0; padding: 0;
}

.featherlight-iframe .featherlight-content {
    border: 0; padding: 0;
    -webkit-overflow-scrolling: touch;
}

.featherlight iframe { border: none; }

.featherlight * { box-sizing: border-box; }

/* Mobile & Tablet */
@media only screen and (max-width: 1024px) {
    .featherlight::after {
        backdrop-filter: blur(1px);
        -webkit-backdrop-filter: blur(1px);
    }
    .featherlight .featherlight-content {
        top: calc(50% + 50px);
        left: 50%;
        transform: translate(-50%, -50%) !important;
        width: 94% !important;
        height: calc(94% - 100px) !important;
        max-width: 94% !important;
        max-height: calc(94% - 100px) !important;
        margin: 0;
        padding: 0;
        border: none !important;
    }
}
