/**
 * Custom CSS for Zonkey Ads
 * Add this to your theme's stylesheet or in the WordPress Customizer
 */

/* Basic styling for the ad wrapper */
.zonkey-ad-wrapper {
    margin: 20px 0;
    clear: both;
}

/* First page ads at bottom - show ads, keep title visible */
body.single:not([class*="paged-"]) .zonkey-ad-wrapper.zonkey-first-page-bottom {
    display: block;
    margin: 30px 0 20px 0;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

/* First page ads at top - hide them (not used anymore, but keep for safety) */
body.single:not([class*="paged-"]) .zonkey-ad-wrapper:not(.zonkey-first-page-bottom) {
    display: none;
}

/* Keep the entry header visible on first page */
body.single:not([class*="paged-"]) .entry-header {
    display: block;
}

/* Paginated pages: show ads at top, hide title */
body.single[class*="paged-"] .zonkey-ad-wrapper.zonkey-pagination-page {
    display: block;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
}

body.single[class*="paged-"] .entry-header {
    display: none;
}

/* Styling for the ads on paginated pages */
body.single[class*="paged-"] .zonkey-ad-container {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Styling for first page bottom ads */
.zonkey-first-page-bottom .zonkey-ad-container {
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 20px;
}

/* Make sure the ad appears smoothly when loaded via JS */
.zonkey-first-page-bottom {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.zonkey-first-page-bottom.loaded {
    opacity: 1;
}

/* If using Automatically Paginate Posts, ensure it works with AJAX navigation */
body.single[class*="app-pagination-page-"] .zonkey-ad-wrapper {
    display: block;
}

body.single[class*="app-pagination-page-"] .entry-header {
    display: none;
}