/**
 * STRANGER Built By
 *
 * @package StrangerBuiltBy
 */


/* ==========================================================================
   BASE
========================================================================== */

.stranger-built-by {
    --sbb-accent: var(--stranger-built-by-accent, #e53935);

    position: fixed;
    z-index: 99990;

    right: 24px;
    bottom: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0;

    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;

    letter-spacing: .08em;
    text-transform: uppercase;

    opacity: 0;
    visibility: hidden;

    transform: translateY(10px);

    transition:
        opacity .35s ease,
        visibility .35s ease,
        transform .35s ease;
}


/* ==========================================================================
   VISIBLE
========================================================================== */

.stranger-built-by.is-visible {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
}


/* ==========================================================================
   INNER
========================================================================== */

.stranger-built-by__inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 32px;

    padding: 0 11px;

    border: 1px solid rgba(127, 127, 127, .25);
    border-radius: 4px;

    background: rgba(255, 255, 255, .88);

    color: rgba(0, 0, 0, .55);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    box-sizing: border-box;

    transition:
        border-color .25s ease,
        background-color .25s ease,
        color .25s ease;
}


/* ==========================================================================
   BEFORE
========================================================================== */

.stranger-built-by__before {
    color: inherit;

    white-space: nowrap;
}


/* ==========================================================================
   SEPARATOR
========================================================================== */

.stranger-built-by__separator {
    color: rgba(127, 127, 127, .45);

    font-weight: 400;

    user-select: none;
}


/* ==========================================================================
   LINK
========================================================================== */

.stranger-built-by__link {
    display: inline-flex;
    align-items: center;

    gap: 4px;

    color: var(--sbb-accent);

    font-weight: 700;

    text-decoration: none;

    white-space: nowrap;

    transition:
        color .2s ease,
        opacity .2s ease;
}


.stranger-built-by__link:hover {
    color: var(--sbb-accent);

    opacity: .72;

    text-decoration: none;
}


.stranger-built-by__link:focus-visible {
    outline: 2px solid var(--sbb-accent);
    outline-offset: 3px;

    border-radius: 2px;
}


/* ==========================================================================
   STRANGER
========================================================================== */

.stranger-built-by__name {
    display: inline-block;

    transition:
        transform .2s ease;
}


.stranger-built-by__link:hover .stranger-built-by__name {
    transform: translateX(1px);
}


/* ==========================================================================
   EXTERNAL LINK ICON
========================================================================== */

.stranger-built-by__external {
    display: block;

    flex: 0 0 auto;

    width: 12px;
    height: 12px;

    color: currentColor;

    transition:
        transform .2s ease;
}


.stranger-built-by__link:hover .stranger-built-by__external {
    transform: translate(2px, -2px);
}


/* ==========================================================================
   DARK MODE
========================================================================== */

.stranger-built-by--appearance-dark .stranger-built-by__inner {
    border-color: rgba(255, 255, 255, .18);

    background: rgba(20, 20, 22, .88);

    color: rgba(255, 255, 255, .68);
}


/* ==========================================================================
   AUTO DARK MODE
========================================================================== */

@media (prefers-color-scheme: dark) {

    .stranger-built-by--appearance-auto .stranger-built-by__inner {
        border-color: rgba(255, 255, 255, .18);

        background: rgba(20, 20, 22, .88);

        color: rgba(255, 255, 255, .68);
    }
}


/* ==========================================================================
   DESKTOP POSITIONS
========================================================================== */

.stranger-built-by--desktop-fixed-bottom-right {
    right: 24px;
    left: auto;
}


.stranger-built-by--desktop-fixed-bottom-left {
    right: auto;
    left: 24px;
}


.stranger-built-by--desktop-fixed-bottom-center {
    right: auto;
    left: 50%;

    transform:
        translate(-50%, 10px);
}


.stranger-built-by--desktop-fixed-bottom-center.is-visible {
    transform:
        translate(-50%, 0);
}


/* ==========================================================================
   END OF PAGE
========================================================================== */

.stranger-built-by--desktop-end-of-page {
    position: relative;

    right: auto;
    bottom: auto;

    margin: 24px auto;

    width: fit-content;

    opacity: 1;
    visibility: visible;

    transform: none;
}


/* ==========================================================================
   MOBILE
========================================================================== */

@media (max-width: 767px) {

    .stranger-built-by {
        position: relative;

        top: auto;
        right: auto;
        bottom: auto;
        left: auto;

        width: 100%;

        margin: 0;

        padding: 22px 16px;

        opacity: 1;
        visibility: visible;

        transform: none;

        box-sizing: border-box;
    }


    .stranger-built-by__inner {
        min-height: 30px;

        padding: 0 10px;

        font-size: 10px;

        gap: 6px;
    }


    /*
     * Mobilní branding je vždy centrovaný.
     */

    .stranger-built-by--mobile-below-footer,
    .stranger-built-by--mobile-end-of-page {

        display: flex;

        align-items: center;
        justify-content: center;

        text-align: center;
    }


    /*
     * Fixed mobilní varianta,
     * pokud ji někdo explicitně zvolí.
     */

    .stranger-built-by--mobile-fixed-bottom {

        position: fixed;

        right: 0;
        bottom: 0;
        left: 0;

        width: 100%;

        z-index: 99990;

        padding:
            12px
            16px
            calc(12px + env(safe-area-inset-bottom));

        background: transparent;

        pointer-events: none;
    }


    .stranger-built-by--mobile-fixed-bottom
    .stranger-built-by__inner {

        pointer-events: auto;
    }


    /*
     * Na mobilu už nepotřebujeme scroll reveal.
     */

    .stranger-built-by--scroll {
        opacity: 1;
        visibility: visible;

        transform: none;
    }


    .stranger-built-by--scroll.is-visible {
        opacity: 1;
        visibility: visible;

        transform: none;
    }


    /*
     * Centrovaná fixed varianta.
     */

    .stranger-built-by--desktop-fixed-bottom-center {
        right: 0;
        left: 0;

        transform: none;
    }


    .stranger-built-by--desktop-fixed-bottom-center.is-visible {
        transform: none;
    }
}


/* ==========================================================================
   REDUCED MOTION
========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .stranger-built-by,
    .stranger-built-by__link,
    .stranger-built-by__name,
    .stranger-built-by__external,
    .stranger-built-by__inner {

        transition: none;
    }
}