/*
 * Google AdSense ad slot content element (#2366).
 *
 * Deliberately minimal: the slot's visibility is NOT controlled here but by the inline
 * display:none in the template, which the consent callback removes. A failure to load this
 * stylesheet can therefore never reveal an unconsented ad slot.
 */

/*
 * max-width/overflow are the safety net for a fixed unit that is wider than the content
 * column (#2370). The TCA caps adsense_width at 336 px, which is what actually prevents
 * the overflow; this rule catches a width that arrives another way (import, direct DB
 * edit, a later raised cap) and clips it instead of letting it scroll the whole page.
 */
.vinum-adsense-slot {
    margin: 1.5rem 0;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
}

/*
 * Collapse a slot Google could not fill (#2370). On a no-fill AdSense sets
 * data-ad-status="unfilled" on the <ins> and collapses it to 0 px, but the wrapper keeps
 * its reserved min-height and the "Anzeige" label — an empty labelled box. Hiding the
 * wrapper afterwards costs a layout shift; that is the deliberate trade-off, because the
 * reserved height has to stay for the filled case (it is what keeps the page from jumping).
 *
 * This works without !important: the consent callback REMOVES the inline display
 * (style.display = '') rather than setting a value, so a stylesheet rule wins afterwards.
 *
 * :has() is baseline in every browser the site targets (Chrome 105+, Safari 15.4+,
 * Firefox 121+), so no JS fallback is provided. In an older browser the selector is simply
 * dropped and the slot keeps the pre-#2370 behaviour — an empty box, never a broken page.
 * A slot that is still loading has no data-ad-status at all and is deliberately not matched.
 */
.vinum-adsense-slot:has(> ins.adsbygoogle[data-ad-status="unfilled"]) {
    display: none;
}

.vinum-adsense-slot__label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 11px;
    line-height: 1.4;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #999;
}

.vinum-adsense-slot .adsbygoogle {
    margin: 0 auto;
}
