/**
 * Advertisement Responsive Styles
 * Optimized for AdSense responsive ads
 * Date: November 2025
 * All ads now use data-ad-format="auto" for true responsiveness
 */

/* Base AdSense ad - let Google handle sizing */
.adsbygoogle {
    display: block;
    text-align: center;
    /* Reserve minimum space to prevent CLS - will expand as needed */
    min-height: 90px;
    transition: min-height 0.3s ease, opacity 0.3s ease;
}

/* Ad container spacing and alignment */
.container_resp {
    margin: 0 auto;
    text-align: center !important;
    max-width: 100%;
    transition: margin 0.3s ease, min-height 0.3s ease;
    padding: 20px 5px !important;
}

/* Banner holder - reserve space for typical banner ads */
.bannerHolder {
    min-height: 100px; /* Reserve space to prevent layout shift */
    transition: min-height 0.3s ease, margin 0.3s ease;
}

/* Collapsed state for unfilled ads */
.adsbygoogle[data-ad-status="unfilled"],
.adsbygoogle.ad-empty {
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none !important;
}

/* Hide parent containers when ad is empty */
.ad-container-empty {
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none !important;
}

/* Fix for overlay ads that block interaction */
#ad_position_box {
    /* Prevent blocking user interaction */
    pointer-events: none !important;
    /* Limit z-index to prevent covering important content */
    z-index: 1 !important;
    /* Ensure it doesn't cover the entire page */
    max-width: 100%;
    max-height: 100vh;
    overflow: hidden;
}

/* Allow interaction with ad content itself */
#ad_position_box > * {
    pointer-events: auto;
}

/* Prevent transparent overlays from blocking clicks */
#ad_position_box [data-magicword],
#ad_position_box iframe,
#ad_position_box .creative {
    pointer-events: auto !important;
}

/* Ensure dismiss button is always clickable */
#ad_position_box .close-button,
#ad_position_box #dismiss-button,
#ad_position_box #dismiss-button-element {
    pointer-events: auto !important;
    z-index: 9999 !important;
    cursor: pointer !important;
}

/* MOBILE (0-767px) */
@media (max-width: 767px) {
    .container_resp {
        padding: 10px 5px !important;
    }

    /* Smaller min-height for mobile ads */
    .adsbygoogle {
        min-height: 90px; /* Increased from 50px for better visibility */
    }

    .bannerHolder {
        min-height: 90px; /* Increased from 50px for better visibility */
    }
}
