.community-ad[hidden] { display: none !important; }
.community-ad {
  display: none;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  margin: 24px 0 0;
}
.community-ad-label {
  margin-bottom: 8px;
  color: #6b7280;
  font: 11px/1.5 system-ui, sans-serif;
  text-align: center;
}
.community-ad ins.adsbygoogle { display: block; width: 300px; height: 250px; }
.community-ad-rail { min-width: 0; }
.community-ad-rail > :is(.community-sidebar, .community-detail-sidebar) { position: static; }

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  /* Hidden overflow would make main the sticky scrolling ancestor. */
  .community-main.community-has-ads { overflow: visible; overflow: clip; }
  .community-has-ads :is(.community-layout, .community-detail-layout) {
    grid-template-columns: minmax(0, 1fr) 300px;
    direction: ltr;
  }
  html[dir="rtl"] .community-has-ads :is(.community-layout, .community-detail-layout) > * {
    direction: rtl;
  }
  .community-ad-rail {
    align-self: stretch;
    display: flex;
    flex-direction: column;
  }
  .community-ad {
    display: block;
    position: sticky;
    top: 24px;
    width: 300px;
    min-height: 275px;
  }
}

/* A short browser window must be able to scroll past the whole creative. */
@media (max-height: 359px) {
  .community-ad { position: static; }
}
