/* Controlled Yandex RTB slots for editorial pages: never show empty boxes. */
.snbk-rtb-slot {width:100%;max-width:100%;min-width:0;box-sizing:border-box;overflow:clip;border-radius:10px;margin:0 auto}
.snbk-rtb-slot:has(>div:not(:empty)){margin:20px auto 23px}
.snbk-rtb-slot>div{max-width:100%;overflow:clip}
.snbk-rtb-article-inline{max-width:900px}
.snbk-rtb-article-sidebar{}
.snbk-rtb-article-footer{}
.snbk-rtb-category-top,.snbk-rtb-category-bottom{max-width:1160px}
@media(max-width:650px){.snbk-rtb-slot{border-radius:9px}.snbk-rtb-slot:has(>div:not(:empty)){margin:13px auto 16px}}

/* 18/19: mobile Yandex banners need actual room for adaptive 300x250 creatives.
   Collapse on a confirmed no-fill callback; never crop a filled ad. */
@media (max-width:650px) {
  .snbk-rtb-mobile-fit > div {
    height:250px;
    min-height:250px;
    overflow:visible;
  }
  .snbk-rtb-mobile-fit.snbk-rtb-filled > div {
    height:auto;
    min-height:250px;
  }
  .snbk-rtb-mobile-fit.snbk-rtb-empty,
  .snbk-rtb-mobile-fit.snbk-rtb-empty > div {
    height:0;
    min-height:0;
    margin-top:0;
    margin-bottom:0;
    overflow:hidden;
  }
}

/* Desktop RTB reserve: offer Yandex real 250px container geometry.
   A no-fill callback collapses empty slots without affecting other ads. */
@media (min-width:651px) {
  .snbk-rtb-desktop-fit > div {
    height:250px;
    min-height:250px;
  }
  .snbk-rtb-desktop-fit.snbk-rtb-filled > div {
    height:auto;
    min-height:0;
  }
  .snbk-rtb-desktop-fit.snbk-rtb-empty,
  .snbk-rtb-desktop-fit.snbk-rtb-empty > div {
    height:0;
    min-height:0;
    margin-top:0;
    margin-bottom:0;
    overflow:hidden;
  }
}

/* The dedicated desktop-only top/sidebar slots are not used on phones.
   Phones retain the 18/19 responsive 250px RTB slots. */
@media(max-width:650px) {
  .snbk-rtb-desktop-fit {display:none!important;}
}


/* Keep empty 250px-sized auction targets out of the document flow.
   Allocate layout height only once the ad renderer confirms a creative. */
@media (max-width:650px) {
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit {
    position:relative;
    height:0;
    min-height:0;
    margin:0 auto;
    overflow:visible;
  }
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit > div {
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:250px;
    min-height:250px;
    overflow:visible;
  }
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit.snbk-rtb-filled {
    height:auto;
    min-height:250px;
    margin:13px auto 16px;
  }
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit.snbk-rtb-filled > div {
    position:relative;
    height:auto;
    min-height:250px;
  }
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit.snbk-rtb-empty,
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit.snbk-rtb-empty > div {
    height:0;
    min-height:0;
    margin-top:0;
    margin-bottom:0;
    overflow:hidden;
  }
}


/* Mobile RTB: 1px viewport sentinel until near scroll, then a visible 250px
   in-flow auction container. Never submit RTB from a zero-height parent. */
@media (max-width:650px) {
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit:not(.snbk-rtb-loading):not(.snbk-rtb-filled) {
    position:relative;
    height:1px;
    min-height:1px;
    margin:0 auto;
    overflow:visible;
  }
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit:not(.snbk-rtb-loading):not(.snbk-rtb-filled) > div {
    position:absolute;
    top:0;
    left:0;
    height:1px;
    min-height:1px;
    width:100%;
    visibility:hidden;
  }
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit.snbk-rtb-loading,
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit.snbk-rtb-filled {
    position:relative;
    height:auto;
    min-height:250px;
    margin:13px auto 16px;
    overflow:visible;
  }
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit.snbk-rtb-loading > div,
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit.snbk-rtb-filled > div {
    position:relative;
    height:auto;
    min-height:250px;
    visibility:visible;
    width:100%;
  }
}

/* SNBK natural-height RTB fix 2026-11-11:
   A compact creative may be 50-110px high. Reserve 250px ONLY during
   the auction; after onRender, match the rendered creative's natural
   height instead of leaving a large empty panel under it. */
@media (max-width:650px) {
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit.snbk-rtb-filled,
  .gp-site .snbk-rtb-slot.snbk-rtb-mobile-fit.snbk-rtb-filled > div {
    height:auto;
    min-height:0;
  }
}
