/**
 * Async Ad Rotator – Frontend Styles v1.1
 */

/* -------------------------------------------------------
   SLOT WRAPPER (auto-placement only)
   A clean, isolated block-level container. This is what
   prevents ad CSS from bleeding into surrounding content.
   ------------------------------------------------------- */
.aar-slot {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    clear: both;
    overflow: hidden;
    /* Isolation: stop child styles from leaking out */
    contain: layout style;
}

/* Vertical breathing room for auto-placed slots */
.aar-slot--header,
.aar-slot--below-header {
    width: 100%;
    text-align: center;
}

.aar-slot--below-header {
    border-top: 1px solid rgba(0,0,0,.06);
    border-bottom: 1px solid rgba(0,0,0,.06);
    background: transparent;
}

.aar-slot--content {
    margin: 1.5em 0;
}

.aar-slot--above-footer {
    width: 100%;
    text-align: center;
    padding: 16px 0;
    border-top: 1px solid rgba(0,0,0,.06);
}

/* -------------------------------------------------------
   PLACEHOLDER DIV
   Reserves space before the ad loads (reduces CLS).
   min-height removed once the ad is injected.
   ------------------------------------------------------- */
.aar-placeholder {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 90px;
    text-align: center;
    overflow: hidden;
}

/* When used as a shortcode — own margin */
.aar-slot:not([class*="aar-slot--"]) > .aar-placeholder,
.aar-placeholder:not(.aar-slot > .aar-placeholder) {
    margin: 1em 0;
}

/* Remove reserved height once ad is loaded */
.aar-placeholder[data-aar-loaded="1"] {
    min-height: 0;
}

/* Force any ad network child elements to be fluid */
.aar-placeholder > * {
    max-width: 100% !important;
}
.aar-placeholder iframe {
    border: 0;
    display: block;
    max-width: 100%;
    margin: 0 auto;
}

/* -------------------------------------------------------
   RESPONSIVE STACKING
   When placed inside a flex/grid header row (e.g. Astra
   Header Builder), the ad column grows to fill space on
   desktop and stacks to full-width on mobile.
   ------------------------------------------------------- */
.aar-placeholder {
    flex-shrink: 0;
    flex-grow: 1;
    align-self: center;
}

@media (max-width: 768px) {
    .aar-placeholder {
        width: 100% !important;
        flex-basis: 100%;
        order: 99;
    }
}
