/* ─────────────────────────────────────────────────────────
   Making Science – Geotargeting Banner
   Non-intrusive, anchored bottom-left, slide-up animation
   ───────────────────────────────────────────────────────── */

/* ── Custom properties (override in theme if needed) ── */
:root {
    --ms-geo-bg: #0f0f0f;
    --ms-geo-bg-hover: #1a1a1a;
    --ms-geo-border: rgba(255, 255, 255, 0.08);
    --ms-geo-text: #f0f0f0;
    --ms-geo-text-muted: rgba(240, 240, 240, 0.55);
    --ms-geo-accent: #e8ff00;
    /* Making Science yellow */
    --ms-geo-accent-dark: #c8dc00;
    --ms-geo-radius: 12px;
    --ms-geo-shadow: 0 8px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
    --ms-geo-font: inherit;
    --ms-geo-z: 99999;
    --ms-geo-width: 400px;
}

/* ── Base banner ── */
#ms-geo-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: var(--ms-geo-z);
    width: var(--ms-geo-width);
    max-width: calc(100vw - 48px);
    background: var(--ms-geo-bg);
    border: 1px solid var(--ms-geo-border);
    border-radius: var(--ms-geo-radius);
    box-shadow: var(--ms-geo-shadow);
    font-family: var(--ms-geo-font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--ms-geo-text);
    overflow: hidden;

    /* Enter state — hidden below */
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);

    /* Subtle top accent line */
    &::before {
        content: '';
        display: block;
        height: 2px;
        background: var(--ms-geo-accent);
        opacity: 0.7;
    }
}

/* ── Visible state ── */
#ms-geo-banner.ms-geo-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Hiding state (exit) ── */
#ms-geo-banner.ms-geo-hiding {
    opacity: 0;
    transform: translateY(12px);
}

/* ── Inner layout ── */
.ms-geo-inner {
    padding: 16px 16px 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

/* ── Content row ── */
.ms-geo-content {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

/* ── Flag ── */
.ms-geo-flag {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

/* ── Text block ── */
.ms-geo-text {
    flex: 1;
    min-width: 0;
}

.ms-geo-headline {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ms-geo-text);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ms-geo-sub {
    margin: 0;
    font-size: 12px;
    color: var(--ms-geo-text-muted);
}

/* ── Actions column ── */
.ms-geo-actions {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

/* ── CTA button ── */
.ms-geo-cta {
    display: inline-block;
    padding: 7px 13px;
    background: var(--ms-geo-accent);
    color: #0f0f0f;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    border-radius: 7px;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.15s ease;
    line-height: 1.3;
}

.ms-geo-cta:hover,
.ms-geo-cta:focus-visible {
    background: var(--ms-geo-accent-dark);
    transform: translateY(-1px);
    color: #0f0f0f;
    text-decoration: none;
    outline: none;
}

.ms-geo-cta:active {
    transform: translateY(0);
}

/* ── Dismiss button ── */
.ms-geo-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--ms-geo-text-muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
    position: absolute;
    right: .5em;
    top: .5em;
}

.ms-geo-dismiss:hover,
.ms-geo-dismiss:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ms-geo-text);
    outline: none;
}

/* ── Focus ring (keyboard nav) ── */
.ms-geo-cta:focus-visible,
.ms-geo-dismiss:focus-visible {
    box-shadow: 0 0 0 2px var(--ms-geo-accent);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    #ms-geo-banner {
        transition: opacity 0.2s ease;
    }

    .ms-geo-cta,
    .ms-geo-dismiss {
        transition: none;
    }
}

/* ── Mobile ── */
@media (max-width: 480px) {
    #ms-geo-banner {
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        width: 100%;
        border-radius: var(--ms-geo-radius) var(--ms-geo-radius) 0 0;
        transform: translateY(100%);
    }

    #ms-geo-banner.ms-geo-visible {
        transform: translateY(0);
    }

    #ms-geo-banner.ms-geo-hiding {
        transform: translateY(100%);
    }

    .ms-geo-inner {
        padding: 14px 16px 18px;
        /* extra bottom for safe area */
    }
}

/* Safe area support (iOS notch) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 480px) {
        .ms-geo-inner {
            padding-bottom: calc(18px + env(safe-area-inset-bottom));
        }
    }
}