/* RPW Ads */
.rpwad { box-sizing: border-box; clear: both; text-align: center; line-height: 0; }
.rpwad *, .rpwad *::before, .rpwad *::after { box-sizing: border-box; }
.rpwad-inner { position: relative; display: inline-flex; align-items: center; justify-content: center; max-width: 100%; line-height: 0; vertical-align: top; }
/* Fixed boxes, same as the notes site: rectangle 300 x 100, square 196 x 196. The whole image always shows. */
.rpwad-top .rpwad-inner, .rpwad-article .rpwad-inner, .rpwad-sticky .rpwad-inner { width: 300px; height: 100px; }
.rpwad-sidebar .rpwad-inner { width: 196px; height: 196px; }
/* A soft frame behind images that don't fill the box, like the notes site */
.rpwad .rpwad-inner { background: rgba(128, 128, 128, .10); border: 1px solid rgba(128, 128, 128, .22); border-radius: 6px; }
.rpwad .rpwad-inner a, .rpwad .rpwad-inner a:hover, .rpwad .rpwad-inner a:focus { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; line-height: 0; border: 0 !important; box-shadow: none !important; text-decoration: none !important; background: none !important; }
.rpwad .rpwad-inner img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.rpwad-label {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  font: 600 10px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: .3px; padding: 3px 5px; border-radius: 3px;
  background: rgba(0, 0, 0, .6); color: #fff; pointer-events: none;
}

/* Top of every page */
.rpwad-top { position: relative; z-index: 10; width: 100%; padding: 10px 16px; background: #f3f3f3; border-bottom: 1px solid rgba(0, 0, 0, .08); }
@media (prefers-color-scheme: dark) { .rpwad-top { background: #1b1b1b; border-bottom-color: rgba(255, 255, 255, .08); } }
@media (max-width: 600px) { .rpwad-top { padding: 8px 10px; } }

/* Inside articles */
.rpwad-in-article { margin: 1.5em auto; }

/* Sidebar, or placed with the shortcode */
.rpwad-placed { margin: 0 auto 1.5em; }
.rpwad-top.rpwad-placed { background: none; border: 0; padding: 0; }

/* Phone bar: phones only */
.rpwad-sticky { display: none; }
@media (max-width: 782px) {
  .rpwad-sticky {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 99990;
    padding: 6px 40px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .15);
  }
  body.rpwad-has-sticky { padding-bottom: 120px; }
}
@media (max-width: 782px) and (prefers-color-scheme: dark) { .rpwad-sticky { background: rgba(24, 24, 24, .97); } }
.rpwad-sticky.rpwad-closed { display: none !important; }
.rpwad-close {
  position: absolute; top: 50%; right: -34px; transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0; margin: 0; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font: 400 20px/28px Arial, sans-serif; cursor: pointer;
}
