/* ---------------------------------------------------------------
   Advertisement slot - admin managed image advertisements.
   One slot per page. No carousel chrome: no arrows, dots or counters.
   --------------------------------------------------------------- */

.ss-ad {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 24px auto;
    box-sizing: border-box;
}

/* Slot used as a full-width item of a product/post grid */
.ss-ad--grid {
    grid-column: 1 / -1;
    margin: 4px 0 8px;
}

.ss-ad-label {
    display: block;
    margin: 0 0 6px;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

/* Height is reserved before any image downloads -> rotation never reflows
   the surrounding page. Aspect ratios come from the stored image sizes. */
.ss-ad-stage {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: var(--ss-ad-ar-d, 3);
    background: transparent;
    overflow: hidden;
}

.ss-ad-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    line-height: 0;
}

.ss-ad-link picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* contain only: proportional fit, never cropped, never stretched */
.ss-ad-link img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    border: 0;
}

/* Mobile image (when present) is selected by the <source media> rule;
   the slot follows the mobile image aspect ratio at 640px and below. */
@media (max-width: 640px) {
    .ss-ad {
        margin: 16px auto;
    }

    .ss-ad-stage {
        aspect-ratio: var(--ss-ad-ar-m, var(--ss-ad-ar-d, 3));
    }

    .ss-ad--grid {
        margin: 2px 0 6px;
    }
}
