/* Radar Nieba 0.2.24 — approved visual identity integration */
:root {
    --rn-brand-navy: #07182b;
    --rn-brand-blue: #168cff;
    --rn-brand-cyan: #18d6ed;
    --rn-brand-alert: #ff4338;
}

.rn-brand-head {
    padding: 13px 15px 12px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 84px;
}
.rn-brand-logo {
    display: block;
    width: 100%;
    max-width: 310px;
    height: auto;
    object-fit: contain;
}
.rn-mobile-brand {
    display: none;
}

/* Radar Nieba 0.2.38 — logo publiczne jest linkiem do strony głównej. */
.rn-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.rn-brand-link:focus-visible {
    outline: 2px solid var(--rn-brand-cyan);
    outline-offset: 3px;
    border-radius: 10px;
}
.rn-desktop-brand-link {
    max-width: 310px;
}

/* CMS: the existing RN square becomes the approved Radar Nieba mark. */
.brand-mark,
.rn-admin-brand-mark {
    color: transparent !important;
    font-size: 0 !important;
    background-color: transparent !important;
    background-image: url('/brand/app-icon-128.png?v=224') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
}
.rn-admin-brand-mark {
    border-radius: 12px !important;
}

.rn-info-brand-logo {
    display: block;
    width: min(225px, 52vw);
    height: auto;
}

@media (max-width: 760px) {
    .rn-brand-head {
        min-height: 76px;
        padding: 10px 12px !important;
    }
    .rn-brand-logo {
        max-width: 285px;
    }
    .rn-mobile-brand {
        position: fixed;
        z-index: 1310;
        top: calc(8px + env(safe-area-inset-top, 0px));
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        height: 46px;
        width: min(205px, calc(100vw - 136px));
        padding: 4px 8px;
        border: 1px solid rgba(255,255,255,.08);
        border-radius: 11px;
        background: rgba(7,24,43,.92);
        box-shadow: 0 6px 20px rgba(0,0,0,.25);
        pointer-events: auto;
    }
    .rn-mobile-brand-link {
        width: 100%;
        height: 100%;
        border-radius: 8px;
    }

    /* 0.2.32: logo zawsze zajmuje górny rząd; alert jest renderowany pod nim. */
    body.rn-mobile-ui:has(.rn-airspace-banner:not(.hidden)) .rn-mobile-brand {
        top: calc(8px + env(safe-area-inset-top, 0px));
        opacity: 1;
        visibility: visible;
    }
    body.rn-mobile-ui:has(.rn-airspace-banner.is-expanded:not(.hidden)) .rn-mobile-brand {
        top: calc(8px + env(safe-area-inset-top, 0px));
        opacity: 1;
        visibility: visible;
    }
    .rn-mobile-brand img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}


/* Radar Nieba 0.2.51 — obowiązkowy branding mapy osadzonej w iframe. */
.rn-embed-brand {
    display: none;
}
html.rn-embedded .rn-embed-brand {
    position: fixed;
    z-index: 1405;
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(230px, calc(100vw - 150px));
    height: 54px;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 12px;
    background: rgba(7,24,43,.94);
    box-shadow: 0 8px 28px rgba(0,0,0,.34);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    text-decoration: none;
    cursor: pointer;
}
html.rn-embedded .rn-embed-brand img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
html.rn-embedded .rn-embed-brand:focus-visible {
    outline: 2px solid var(--rn-brand-cyan);
    outline-offset: 3px;
}
/* W iframe logo zawsze jest nad paskiem sytuacyjnym. */
html.rn-embedded body .rn-airspace-banner,
html.rn-embedded body .rn-airspace-passive-status {
    top: calc(70px + env(safe-area-inset-top, 0px)) !important;
}
@media (max-width: 760px) {
    html.rn-embedded .rn-embed-brand {
        width: min(205px, calc(100vw - 136px));
        height: 46px;
    }
    html.rn-embedded body.rn-mobile-ui .rn-airspace-banner,
    html.rn-embedded body.rn-mobile-ui .rn-airspace-passive-status {
        top: calc(62px + env(safe-area-inset-top, 0px)) !important;
    }
    /* W embedzie używamy jednego, wymuszonego logo zamiast zwykłego nagłówka mobile. */
    html.rn-embedded .rn-mobile-brand {
        display: none !important;
    }
}
