/* public/css/ads.css — ad-unit placement wrappers.
 *
 * Inline is the default: no wrapper styling. The other three place the ad
 * relative to the viewport, with a close button that dismisses it for the
 * rest of the browsing session (JS stores the unit slug in sessionStorage).
 *
 * IMPORTANT: Google's AdSense program policies require a clear close/dismiss
 * control on sticky/overlay ads, and prohibit ads that cover essential page
 * content. The close button satisfies both.
 */

.ad-inline { margin: 16px 0; }

.ad-sticky, .ad-float {
    position: fixed;
    z-index: 850;                   /* above page content, below modals (1100+) */
    background: #fff;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    border-top: 1px solid #e5e7eb;
    padding: 8px 12px 8px 12px;
    max-width: 100%;
    box-sizing: border-box;
}
.ad-sticky--bottom {
    bottom: 0;
    left: 0;
    right: 0;
}
.ad-sticky--top {
    top: var(--site-header-h, 64px);
    left: 0;
    right: 0;
    border-top: 0;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.ad-float--corner {
    bottom: 16px;
    right: 16px;
    width: 320px;
    max-width: calc(100vw - 32px);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
}

.ad-sticky-close {
    position: absolute;
    top: -10px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    z-index: 2;
}
.ad-sticky-close:hover { background: #f3f4f6; color: #111827; }

.ad-sticky-body { min-height: 40px; }
.ad-float--corner .ad-sticky-body { min-height: 100px; }

/* Hidden state — applied by JS after user clicks close */
.ad-sticky[hidden], .ad-float[hidden] { display: none; }

[data-theme="dark"] .ad-sticky,
[data-theme="dark"] .ad-float { background: var(--card-bg); border-color: var(--border-color); }
[data-theme="dark"] .ad-sticky-close { background: var(--card-bg); border-color: var(--border-color); color: var(--text-color); }
[data-theme="dark"] .ad-sticky-close:hover { background: var(--card-hover-bg); }

/* Hide all of these when printing */
@media print {
    .ad-inline, .ad-sticky, .ad-float { display: none !important; }
}
