/* Fix246 Advertising Manager 1.6.0: presentation only.
   Keep each slot inside its page column. No page-wide section overrides. */
.fix246-ad-slot[data-fix246-ad-surface] {
    /* Do not override the pre-existing 300px mobile Homepage limit. */
    min-width: 0;
}

/* Do not reserve an incorrect 1:3 height for My Guide. In some Fix246
   legacy styles this forced a large blank frame for short Trident creatives. */
.fix246-ad-slot[data-placement="my_guide"][data-fix246-ad-surface] {
    aspect-ratio: auto !important;
    height: auto !important;
}

/* The direct campaign itself is a complete designed creative. It does not
   need a second outline or decorative shadow around the image. */
@media (min-width: 48rem) {
    .fix246-ad-slot[data-desktop-frame="flat"] .fix246-ad-creative__link {
        box-shadow: none;
        border: 0;
        border-radius: 0.375rem;
    }
}

/* Keep the useful existing ad semantics/disclosure label and allow a keyboard
   focus indicator. Only the visual decoration on the ad wrapper is removed. */
.fix246-ad-slot .fix246-ad-creative__link:focus-visible {
    outline: 0.1875rem solid rgba(16, 66, 145, 0.35);
    outline-offset: 0.1875rem;
}

/* The normal and direct ad widths are limited by their actual page column;
   the new JavaScript fitter handles Trident's internal native-size scaling. */
@media (min-width: 48rem) {
    .fix246-ad-slot[data-desktop-width="fill"],
    .fix246-ad-slot[data-desktop-width="fill"] .fix246-ad-trident-host,
    .fix246-ad-slot[data-desktop-width="fill"] .fix246-ad-creative {
        width: 100%;
        max-width: 100%;
    }

    /* A category advertisement does not need a nested white card. */
    .fix246-service-network__category-ad:has(> .fix246-ad-slot[data-desktop-frame="flat"]) {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    /* Standalone Advertising widget only. Never remove vendor/listing cards. */
    .widget_fix246_ad_widget:has(.fix246-ad-slot[data-desktop-frame="flat"]) {
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }
}

@media (max-width: 47.99rem) {
    /* The mobile Homepage and Network defaults remain at 300px. Only surfaces
       explicitly set to "More room" can use up to 360px. */
    .fix246-ad-slot[data-mobile-width="relaxed"].fix246-ad-slot--device-mobile,
    .fix246-ad-slot[data-mobile-width="relaxed"] .fix246-ad-creative--mobile {
        box-sizing: border-box;
        width: 100%;
        max-width: min(100%, 360px) !important;
        margin-left: auto;
        margin-right: auto;
    }

    .fix246-service-network__category-ad:has(> .fix246-ad-slot[data-mobile-width="relaxed"]) {
        max-width: min(100%, 360px) !important;
    }

    .fix246-service-network__category-ad:has(> .fix246-ad-slot[data-mobile-frame="flat"]) {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .widget_fix246_ad_widget:has(.fix246-ad-slot[data-mobile-frame="flat"]) {
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .fix246-ad-slot[data-mobile-frame="flat"] .fix246-ad-creative__link {
        box-shadow: none;
        border: 0;
        border-radius: 0.375rem;
    }

    .fix246-ad-slot[data-mobile-frame="original"] .fix246-ad-creative__link {
        /* Mobile preview can use the theme's original campaign link styling. */
        border: 0.0625rem solid rgba(21, 98, 69, 0.16);
    }
}

/* 1.8.2: Conservative desktop sidebar presentation. This affects only outer
   ad widgets when the administrator opts in to "Minimal". Never edit the
   Trident creative subtree or enclosing listing/vendor information cards. */
@media (min-width: 48rem) {
    .fix246-ad-slot--profile-sidebar,
    .fix246-ad-slot--profile-sidebar .fix246-ad-trident-host,
    .fix246-ad-slot--profile-sidebar .fix246-ad-creative {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
    }

    /* The outer widget sometimes has its own padding even when the creative
       itself has no frame. Apply only when minimal frame is selected. */
    .widget_fix246_ad_widget:has(.fix246-ad-slot--profile-sidebar[data-desktop-frame="flat"]) {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    .widget_fix246_ad_widget:has(.fix246-ad-slot--profile-sidebar[data-desktop-frame="flat"]) > :where(.widget__content, .hp-widget__content, .widget-content) {
        padding: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
