/* Sidebar advertisement (sponsors app).
   A "rail" runs down the free space right of the 1200px content column (it is
   placed inside .content, so it starts below the menu and ends above the
   footer on every page); the banner sticks to the top of the screen while
   scrolling inside it. Only shown where a 160px banner fits. */
.sidebar-ad-rail {
    display: none;
}

@media screen and (min-width: 1600px) {
    .sidebar-ad-rail {
        display: block;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 100%;                          /* right edge of the content column */
        width: calc((100vw - 100%) / 2);     /* the free space up to the screen edge */
        padding-top: 24px;
        box-sizing: border-box;
        z-index: 1;
        pointer-events: none;
    }

    .sidebar-ad {
        position: sticky;
        top: 84px;   /* just below the menu bar that stays at the top of the screen (65px) */
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        width: min(300px, calc(100% - 40px));
        min-width: 160px;
        margin: 0 auto;
        pointer-events: auto;
    }

    .sidebar-ad-label {
        font-size: 0.7rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #f2e8dc;
        background: rgba(45, 33, 28, 0.75);
        padding: 2px 8px;
        border-radius: 4px;
    }

    .sidebar-ad-link {
        display: block;
        width: 100%;
        line-height: 0;
        border-radius: 6px;
        overflow: hidden;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
        background: #fff;
    }

    .sidebar-ad-link img {
        display: block;
        width: 100%;
        max-height: calc(100vh - 140px);
        object-fit: contain;
    }

    .sidebar-ad-link:focus-visible {
        outline: 3px solid var(--accent-gold, #c9954e);
        outline-offset: 3px;
    }
}
