/* Hide unnecessary navigation elements */
.site-main .comment-navigation,
.site-main .posts-navigation,
.site-main .post-navigation {
    display: none;
    margin: 0 0 1.5em;
}

/* Hide author box if unused */
.articlewave-site-layout--separate .articlewave-author-container {
    display: none;
}

/* Footer must always display */
footer#colophon {
    display: block !important;
}

/* Hide footer links */
.footer-text a {
    display: none;
    color: #fff;
}

/* Ad containers styling */
.ad-container,
.widget_advertisement,
.articlewave-ad {
    display: block;
    visibility: visible;
    opacity: 1;
    min-height: 100px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 10;
    clear: both;
}

/* Consistent ad spacing on single posts */
.single-post .ad-container,
.single-post .articlewave-ad {
    margin: 60px 0;
}

/* Sidebar ad spacing */
.sidebar .widget_advertisement {
    margin: 0 0 25px 15px;
}

/* Responsive ad images */
.ad-container img,
.widget_advertisement img,
.articlewave-ad img {
    display: block;
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 10;
}

/* Lightweight ad placeholder */
.ad-container::before {
    content: "";
    display: block;
    height: 100px;
    background: #f3f3f3;
}

/* Disable sticky sidebar behavior from Theia Sticky Sidebar */
.theiaStickySidebar {
    position: static !important;
    top: auto !important;
    transform: none !important;
}
#secondary.widget-area.sidebar-layout-right-sidebar {
    position: static !important;
}

/* --- NEW SECTION FOR SIDEBAR AD LOADING BEHAVIOR --- */

/* Placeholder shown while ads are NOT loaded */
.sidebar-inner-wrap[data-slot-rendered-sidebarbtf="false"]::before {
    content: "Loading ads...";
    display: block;
    height: 150px;
    background: #f3f3f3;
    color: #888;
    text-align: center;
    line-height: 150px;
    font-style: italic;
    font-size: 14px;
    user-select: none;
}

/* Hide ads before loading */
.sidebar-inner-wrap[data-slot-rendered-sidebarbtf="false"] .widget_advertisement,
.sidebar-inner-wrap[data-slot-rendered-sidebarbtf="false"] .ad-container {
    visibility: hidden;
    opacity: 0;
    height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition: opacity 0.4s ease-out;
}

/* Show ads after loading */
.sidebar-inner-wrap[data-slot-rendered-sidebarbtf="true"] .widget_advertisement,
.sidebar-inner-wrap[data-slot-rendered-sidebarbtf="true"] .ad-container {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.4s ease-in;
}

/* Sidebar ad container spacing and styling */
.sidebar-inner-wrap .widget_advertisement,
.sidebar-inner-wrap .ad-container {
    margin-bottom: 25px;
    width: 100%;
    min-height: 100px;
    text-align: center;
    position: relative;
    z-index: 10;
}