/*
 * Banner strip for the static HTML pages: the same sizes as src/app/components/ads/ads.module.css, keep both in sync.
 * --ad-h is the strip's height at each screen size. The page's app takes it off its own height
 * (calc(100dvh - var(--ad-h, 0px))) so the strip and the app together fill exactly one screen.
 */
:root {
  --ad-h: 50px;
}

/* Tall phones can spare 50px more for a 320x100, which sells much better than a 320x50 */
@media (min-height: 700px) {
  :root { --ad-h: 100px; }
}

@media (min-width: 500px) {
  :root { --ad-h: 60px; }
}

@media (min-width: 760px) and (min-height: 600px) {
  :root { --ad-h: 90px; }
}

/* Landscape phones: there's no height to spare, so no banner */
@media (max-height: 450px) {
  :root { --ad-h: 0px; }
}

.ad_strip {
  display: flex;
  justify-content: center;
  align-items: center;
  height: var(--ad-h);
  overflow: hidden;
}

/* Fixed size per breakpoint, so the space is reserved before the ad loads and nothing jumps.
   Two classes, to win over _globals.css's margin on every .adsbygoogle. */
.ad_strip > .ad_banner {
  display: inline-block;
  width: 320px;
  height: 50px;
  margin: 0;
}

@media (min-height: 700px) {
  .ad_strip > .ad_banner { height: 100px; }
}

@media (min-width: 500px) {
  .ad_strip > .ad_banner { width: 468px; height: 60px; }
}

/* Up to 970 wide, so a 970x90 can bid as well as a 728x90 (Google fills with whatever fits) */
@media (min-width: 760px) and (min-height: 600px) {
  .ad_strip > .ad_banner { width: min(970px, 100%); height: 90px; }
}

@media (max-height: 450px) {
  .ad_strip > .ad_banner { display: none; }
}

/*
 * Landscape-only sites (class ad_landscape on <body>) keep a 320x50 on landscape phones, which otherwise get no strip:
 * those are the only phones they work on. Not below 360px tall, where 50px is too much of the screen.
 */
@media (max-height: 450px) and (min-height: 360px) {
  .ad_landscape { --ad-h: 50px; }
  .ad_landscape .ad_strip > .ad_banner { display: inline-block; width: 320px; height: 50px; }
}
