/**
 * AlphaStreet Ad Placement Styles
 *
 * @package AlphaStreet_News
 * @version 2.3.0
 */

/* ==========================================================================
   BASE AD UNIT STYLES
   ========================================================================== */

.as-ad-unit {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    text-align: center;
    overflow: hidden;
}

/* Lazy loading state */
.as-ad-lazy {
    min-height: 100px;
    background: var(--color-bg-tertiary);
}

.as-ad-loaded {
    background: transparent;
}

/* ==========================================================================
   AD PLACEHOLDERS (Admin Preview)
   ========================================================================== */

.as-ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    background: var(--color-bg-tertiary);
    border: 2px dashed var(--color-border);
    border-radius: 8px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.as-ad-placeholder span:first-child {
    font-size: 1.25rem;
    font-weight: 600;
}

.as-ad-placeholder .placeholder-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

/* ==========================================================================
   HEADER LEADERBOARD (970x250)
   ========================================================================== */

.as-ad-header_leaderboard {
    width: 100%;
    max-width: 970px;
    min-height: 250px;
    margin: 0 auto 1rem;
    padding: 0.5rem 0;
}

.as-ad-header_leaderboard .as-ad-placeholder {
    width: 100%;
    max-width: 970px;
    height: 250px;
}

/* ==========================================================================
   SIDEBAR ADS (300x250)
   ========================================================================== */

.as-ad-sidebar {
    width: 100%;
    max-width: 300px;
    min-height: 250px;
    margin: 0 auto 1.5rem;
}

.as-ad-sidebar .as-ad-placeholder {
    width: 300px;
    height: 250px;
}

/* ==========================================================================
   IN-CONTENT ADS
   ========================================================================== */

.as-ad-in_content,
.as-ad-inline {
    width: 100%;
    max-width: 728px;
    margin: 2rem auto;
    padding: 1rem 0;
    clear: both;
}

.as-ad-in_content .as-ad-placeholder,
.as-ad-inline .as-ad-placeholder {
    width: 100%;
    max-width: 336px;
    height: 280px;
    margin: 0 auto;
}

/* Center in-content ads in article */
.single-post .as-ad-inline,
.single-transcript .as-ad-inline,
.single-research .as-ad-inline {
    display: block;
    text-align: center;
}

/* ==========================================================================
   BETWEEN POSTS ADS (728x90)
   ========================================================================== */

.as-ad-between_posts {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    margin: 1.5rem auto;
    padding: 1rem 0;
}

.as-ad-between_posts .as-ad-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
}

/* ==========================================================================
   FOOTER BANNER (728x90)
   ========================================================================== */

.as-ad-footer_banner {
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    margin: 2rem auto 0;
    padding: 1rem 0;
}

.as-ad-footer_banner .as-ad-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
}

/* ==========================================================================
   STICKY SIDEBAR AD (300x600)
   ========================================================================== */

.as-ad-sticky_sidebar {
    width: 100%;
    max-width: 300px;
    min-height: 600px;
}

.as-ad-sticky_sidebar .as-ad-placeholder {
    width: 300px;
    height: 600px;
}

/* Sticky behavior */
.as-ad-sticky {
    position: sticky;
    top: 100px;
    z-index: 10;
}

/* ==========================================================================
   AD WIDGET STYLES
   ========================================================================== */

.as-ad-widget {
    margin-bottom: 1.5rem;
}

.as-ad-widget .as-ad-unit {
    margin: 0;
}

/* ==========================================================================
   RESPONSIVE AD CONTAINERS
   ========================================================================== */

/* Desktop/Mobile switching */
.as-ad-mobile {
    display: none;
}

.as-ad-desktop {
    display: block;
}

/* ==========================================================================
   ADSENSE SPECIFIC
   ========================================================================== */

.as-ad-unit .adsbygoogle {
    display: block;
    margin: 0 auto;
}

/* Ensure ins elements fill container */
.as-ad-unit ins.adsbygoogle {
    width: 100%;
}

/* ==========================================================================
   AD LABELS (Optional)
   ========================================================================== */

.as-ad-label {
    display: block;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 0.25rem;
    opacity: 0.6;
}

/* ==========================================================================
   RESPONSIVE STYLES
   ========================================================================== */

@media screen and (max-width: 1024px) {
    /* Disable sticky on tablets */
    .as-ad-sticky {
        position: relative;
        top: auto;
    }

    .as-ad-sticky_sidebar {
        min-height: 250px;
    }

    .as-ad-sticky_sidebar .as-ad-placeholder {
        height: 250px;
    }
}

@media screen and (max-width: 768px) {
    /* Switch to mobile ads */
    .as-ad-mobile {
        display: block;
    }

    .as-ad-desktop {
        display: none;
    }

    /* Header leaderboard - mobile size (320x100) */
    .as-ad-header_leaderboard {
        max-width: 320px;
        min-height: 100px;
    }

    .as-ad-header_leaderboard .as-ad-placeholder {
        width: 320px;
        height: 100px;
    }

    /* Footer banner - mobile size (320x50) */
    .as-ad-footer_banner {
        max-width: 320px;
        min-height: 50px;
    }

    .as-ad-footer_banner .as-ad-placeholder {
        width: 320px;
        height: 50px;
    }

    /* Between posts - responsive */
    .as-ad-between_posts {
        max-width: 100%;
        min-height: 100px;
    }

    .as-ad-between_posts .as-ad-placeholder {
        width: 100%;
        height: 100px;
    }

    /* In-content - responsive */
    .as-ad-in_content .as-ad-placeholder,
    .as-ad-inline .as-ad-placeholder {
        max-width: 300px;
        height: 250px;
    }

    /* Sidebar becomes full width */
    .as-ad-sidebar {
        max-width: 100%;
    }

    .as-ad-sidebar .as-ad-placeholder {
        width: 100%;
        max-width: 300px;
    }
}

@media screen and (max-width: 480px) {
    /* Reduce ad spacing on small screens */
    .as-ad-in_content,
    .as-ad-inline {
        margin: 1.5rem auto;
        padding: 0.75rem 0;
    }

    .as-ad-between_posts {
        margin: 1rem auto;
    }

    /* Smaller placeholder text */
    .as-ad-placeholder {
        padding: 1rem;
        font-size: 0.75rem;
    }

    .as-ad-placeholder span:first-child {
        font-size: 1rem;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .as-ad-unit,
    .as-ad-placeholder {
        display: none !important;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .as-ad-lazy {
        transition: none;
    }
}

/* ==========================================================================
   HIGH CONTRAST MODE
   ========================================================================== */

@media (prefers-contrast: high) {
    .as-ad-placeholder {
        border-width: 3px;
        border-style: solid;
    }
}
