
/* Contextual Affiliate CTA --------------------------------------------------
 * Structured, tag-triggered CTA only. No arbitrary HTML is accepted here.
 * Colors inherit Core's shared CTA tokens when available.
 */
.fapswipe-feed .fapswipe-affiliate-cta-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin-top: 8px;
    pointer-events: auto;
    text-shadow: none;
}

.fapswipe-feed .fapswipe-affiliate-cta-label {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin: 0;
    padding: 0 9px;
    border: 1px solid rgb(255 255 255 / 0.28);
    border-radius: 999px;
    background: rgb(0 0 0 / 0.42);
    color: var(--fapswipe-text, #fff);
    font: 600 11px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    white-space: nowrap;
}

.fapswipe-feed .fapswipe-affiliate-cta {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    max-width: 100%;
    margin: 0;
    padding: 8px 14px;
    overflow: hidden;
    border: 1px solid var(--fapswipe-cta-border, rgb(255 255 255 / 0.24));
    border-radius: 999px;
    background: var(--fapswipe-cta-bg, #fff);
    color: var(--fapswipe-cta-text, #111);
    font-family: inherit;
    font-size: 16px;
    font-style: normal;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: normal;
    text-decoration: none;
    text-overflow: ellipsis;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.fapswipe-feed .fapswipe-affiliate-cta:hover,
.fapswipe-feed .fapswipe-affiliate-cta:focus-visible {
    color: var(--fapswipe-cta-text, #111);
    text-decoration: none;
}

.fapswipe-feed .fapswipe-affiliate-cta:focus-visible {
    outline: 2px solid var(--fapswipe-accent, #fff);
    outline-offset: 2px;
}

@media (max-width: 767px) {
    .fapswipe-feed .fapswipe-affiliate-cta-wrap {
        gap: 6px;
        margin-top: 7px;
    }

    .fapswipe-feed .fapswipe-affiliate-cta {
        min-height: 34px;
        padding: 7px 12px;
        font-size: 15px;
    }
}

/* FapSwipe Ads 0.4.6 — monetization layout remains independent; CTA chrome can consume shared Core appearance tokens. */
.fapswipe-feed.fapswipe-ad-dock-enabled {
    --fapswipe-ad-dock-height: max(var(--fapswipe-ad-dock-desktop-height, 90px), var(--fapswipe-ad-dock-measured-height, 0px));
}

/*
 * Floating ad card integration
 * ----------------------------
 * The card no longer reserves a permanent strip or shrinks the media viewport.
 * Instead, Core overlay copy/feedback are nudged upward by a lightweight
 * footprint hint so captions and the dismissible card can coexist cleanly.
 */
.fapswipe-feed.fapswipe-ad-dock-enabled.fapswipe-ad-dock-visible .fapswipe-overlay {
    bottom: calc(24px + var(--fapswipe-ad-dock-height));
}

.fapswipe-feed.fapswipe-ad-dock-enabled.fapswipe-ad-dock-visible .fapswipe-feedback {
    bottom: calc(20px + var(--fapswipe-ad-dock-height));
}

@media (min-width: 768px) {
    .fapswipe-feed.fapswipe-ad-dock-enabled.fapswipe-ad-dock-visible .fapswipe-actions {
        bottom: calc(32px + var(--fapswipe-ad-dock-height));
    }
}

/*
 * Immersive ad state
 * ------------------
 * SAFE TO RESTYLE: this is intentionally neutral so future skins can replace the
 * chrome without touching VAST/direct-delivery logic.
 *
 * DO NOT remove the class-driven separation between organic controls and ad
 * controls unless an equivalent collision-free layout is provided.
 */
.fapswipe-feed .fapswipe-feed-controls,
.fapswipe-feed .fapswipe-info-toggle {
    transition: opacity 140ms ease, visibility 140ms ease;
}

.fapswipe-feed.fapswipe-ad-active .fapswipe-feed-controls,
.fapswipe-feed.fapswipe-ad-active .fapswipe-info-toggle {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.fapswipe-ad-slide {
    background: #000;
    color: #fff;
}

.fapswipe-ad-stage {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 720px);
    height: 100%;
    margin-inline: auto;
    overflow: hidden;
    isolation: isolate;
    background: #000;
}

.fapswipe-ad-stage.is-clickable {
    cursor: pointer;
}

.fapswipe-ad-stage.is-clickable:focus-visible {
    outline: 2px solid rgb(255 255 255 / 0.92);
    outline-offset: -4px;
}

/* Subtle lower fade gives labels/CTA a predictable contrast surface. */
.fapswipe-ad-stage::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    z-index: 2;
    height: min(34%, 300px);
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(180deg, transparent 0%, rgb(0 0 0 / 0.18) 28%, rgb(0 0 0 / 0.78) 100%);
    transition: opacity 120ms ease;
}

.fapswipe-ad-stage.has-ad-copy::after {
    opacity: 1;
}

.fapswipe-ad-media,
.fapswipe-ad-media-link {
    display: block;
    width: 100%;
    height: 100%;
}

.fapswipe-ad-media {
    object-fit: cover;
    background: #000;
}

/* Ad-local mute stays clear of the Core up/down navigation rail. */
.fapswipe-ad-mute {
    position: absolute;
    top: 50%;
    right: 14px;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid rgb(255 255 255 / 0.42);
    border-radius: 999px;
    background: rgb(8 8 8 / 0.66);
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.48);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.fapswipe-ad-mute:hover,
.fapswipe-ad-mute:focus-visible {
    background: rgb(8 8 8 / 0.88);
    border-color: rgb(255 255 255 / 0.68);
}

.fapswipe-ad-mute:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/*
 * Bottom ad chrome
 * ----------------
 * Compact neutral presentation inspired by reels-style placements: identity and
 * optional copy above a broad CTA. No skin-specific colors are hard-coded here.
 */
.fapswipe-ad-copy {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    z-index: 4;
    box-sizing: border-box;
    display: grid;
    gap: 8px;
    max-width: 620px;
    max-height: calc(100% - 32px);
    margin-inline: auto;
    overflow: hidden;
    pointer-events: none;
    text-shadow: 0 1px 3px rgb(0 0 0 / 0.92);
}

.fapswipe-ad-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    min-width: 0;
}

.fapswipe-ad-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 5px 8px;
    border: 1px solid rgb(255 255 255 / 0.34);
    border-radius: 999px;
    background: rgb(8 8 8 / 0.68);
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.36);
    color: rgb(255 255 255 / 0.96);
    font: 750 10px/1.1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.fapswipe-ad-title {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: #fff;
    font: 750 15px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fapswipe-ad-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: rgb(255 255 255 / 0.9);
    font: 520 12px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.fapswipe-ad-cta {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 11px 16px;
    pointer-events: auto;
    border: 1px solid var(--fapswipe-cta-border, rgb(255 255 255 / 0.7));
    border-radius: 14px;
    background: var(--fapswipe-cta-bg, rgb(255 255 255 / 0.96));
    box-shadow: 0 5px 18px rgb(0 0 0 / 0.3);
    color: var(--fapswipe-cta-text, #111);
    font: 800 13px/1.15 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    text-decoration: none;
    text-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.fapswipe-ad-cta:hover,
.fapswipe-ad-cta:focus-visible {
    background: var(--fapswipe-cta-bg, #fff);
    color: var(--fapswipe-cta-text, #111);
    filter: brightness(1.05);
}

.fapswipe-ad-cta:focus-visible {
    outline: 2px solid var(--fapswipe-accent, #fff);
    outline-offset: 3px;
}

.fapswipe-ad-loading {
    color: rgb(255 255 255 / 0.78);
    font: 650 12px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Floating card remains independent from full-swipe interstitial styling. */
.fapswipe-ad-dock {
    position: absolute;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    z-index: 35;
    width: auto;
    max-width: calc(100% - 18px);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 14px);
    transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.fapswipe-ad-dock.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.fapswipe-ad-dock.is-hidden,
.fapswipe-ad-dock.is-dismissed {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 14px);
}

/*
 * STABILITY CONTRACT — EDIT AT YOUR OWN PERIL:
 * The floating card intentionally has no decorative padding around the creative.
 * Network banners should occupy their declared footprint (for example 300x100).
 * If a creative is wider/taller than the available viewport, the shell clips it
 * rather than stretching the ad or growing the feed viewport.
 */
.fapswipe-ad-dock-card {
    position: relative;
    pointer-events: auto;
    display: grid;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 0.14);
    border-radius: 12px;
    background: #0b0b0c;
    box-shadow: 0 14px 34px rgb(0 0 0 / 0.42);
}

/* Optional labels are overlays/compact rows and consume no space when absent. */
.fapswipe-ad-dock-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 6px;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 999px;
    background: rgb(8 8 8 / 0.68);
    color: rgb(255 255 255 / 0.94);
    font: 700 9px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.fapswipe-ad-dock-close {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 4;
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 999px;
    background: rgb(8 8 8 / 0.72);
    color: #fff;
    font: 700 15px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.fapswipe-ad-dock-close:hover,
.fapswipe-ad-dock-close:focus-visible {
    background: rgb(8 8 8 / 0.92);
    border-color: rgb(255 255 255 / 0.42);
}

.fapswipe-ad-dock-close:focus-visible,
.fapswipe-ad-dock-cta:focus-visible,
.fapswipe-ad-dock-creative:focus-visible {
    outline: 2px solid rgb(255 255 255 / 0.92);
    outline-offset: 2px;
}

.fapswipe-ad-dock-creative,
.fapswipe-ad-dock-frame-wrap {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.fapswipe-ad-dock-creative img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    object-fit: cover;
}

.fapswipe-ad-dock-frame {
    display: block;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.fapswipe-ad-dock-title,
.fapswipe-ad-dock-description,
.fapswipe-ad-dock-footer {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
}

.fapswipe-ad-dock-title {
    padding: 8px 10px 0;
    color: #fff;
    font: 750 14px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fapswipe-ad-dock-description {
    padding: 5px 10px 0;
    color: rgb(255 255 255 / 0.84);
    font: 520 11px/1.3 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.fapswipe-ad-dock-footer {
    padding: 8px 10px 10px;
}

.fapswipe-ad-dock-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--fapswipe-cta-border, rgb(255 255 255 / 0.18));
    border-radius: 9px;
    background: var(--fapswipe-cta-bg, rgb(255 255 255 / 0.06));
    color: var(--fapswipe-cta-text, #fff);
    font: 700 12px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-decoration: none;
}

.fapswipe-ad-dock-cta:hover,
.fapswipe-ad-dock-cta:focus-visible {
    background: var(--fapswipe-cta-bg, rgb(255 255 255 / 0.09));
    color: var(--fapswipe-cta-text, #fff);
    filter: brightness(1.05);
}

.fapswipe-ad-dock-creative:hover,
.fapswipe-ad-dock-creative:focus-visible {
    background: rgb(255 255 255 / 0.09);
}

@media (max-width: 767px) {
    .fapswipe-feed.fapswipe-ad-dock-enabled {
        --fapswipe-ad-dock-height: max(var(--fapswipe-ad-dock-mobile-height, 96px), var(--fapswipe-ad-dock-measured-height, 0px));
    }

    .fapswipe-ad-copy {
        left: 10px;
        right: 10px;
        bottom: calc(max(8px, env(safe-area-inset-bottom, 0px)) + var(--fapswipe-ad-mobile-viewport-bottom, 0px));
        gap: 5px;
        max-height: min(34dvh, 220px);
    }

    .fapswipe-ad-meta {
        gap: 5px;
    }

    .fapswipe-ad-badge {
        min-height: 21px;
        padding: 4px 7px;
        font-size: 9px;
    }

    .fapswipe-ad-title {
        font-size: 13px;
    }

    .fapswipe-ad-description {
        font-size: 10px;
        -webkit-line-clamp: 1;
    }

    .fapswipe-ad-cta {
        min-height: 40px;
        padding: 9px 12px;
        border-radius: 11px;
        font-size: 12px;
    }

    .fapswipe-ad-mute {
        right: 12px;
        width: 40px;
        height: 40px;
    }

    /*
     * Mobile Chrome/Safari can keep the layout viewport taller than the visible
     * viewport while browser chrome is expanded. Anchor the floating card to
     * the visual viewport so the entire banner + CTA stays above that chrome.
     */
    .fapswipe-ad-dock {
        position: fixed;
        left: 50%;
        width: auto;
        max-width: calc(100vw - 12px);
        bottom: max(8px, env(safe-area-inset-bottom, 0px));
    }

    .fapswipe-ad-dock-card {
        max-width: calc(100vw - 12px);
    }

    .fapswipe-ad-dock-creative,
    .fapswipe-ad-dock-frame-wrap {
        max-width: calc(100vw - 12px);
    }

    .fapswipe-ad-dock-card {
        border-radius: 10px;
    }

    .fapswipe-ad-dock-close {
        top: 4px;
        right: 4px;
        width: 22px;
        height: 22px;
        font-size: 14px;
    }

    .fapswipe-ad-dock-badge {
        top: 4px;
        left: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fapswipe-feed .fapswipe-feed-controls,
    .fapswipe-feed .fapswipe-info-toggle,
    .fapswipe-ad-dock {
        transition: none;
    }
}
