/*
 * Ads and partner modules (src/Monetise). Loaded only on pages that show one of them.
 * Uses the colour tokens of site.css (docs/design-t29.md). An ad box reserves the height of its unit (--ad-h on a
 * phone, --ad-h-wide from 48rem), so an ad that loads late does not push the text below it down (layout shift).
 * A full-width responsive unit reserves more on a phone, see below.
 * An ad box and a partner box are never yellow and never black: those are the site's own signs and boards. An ad
 * stands on the page's own background, with no visible label; a partner box is a white, ruled box with the tag
 * "Sponsored".
 */
.ad-slot {
    display: block;
    clear: both;
    margin: 2rem auto;
    max-width: 100%;
    min-height: var(--ad-h, 250px);
    text-align: center;
    overflow: hidden;
}
.ad-slot ins.adsbygoogle { min-height: var(--ad-h, 250px); }
.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--ad-h, 250px);
    padding: 1rem;
    border: 1px dashed var(--muted);
    color: var(--muted);
    font-size: .85rem;
}
/* On a phone held upright a full-width responsive unit (format "auto") most often takes the screen's width divided
   by 1.2: 300px on a 360px phone, 325px on 390px, 343px on 412px (docs/monetisation.md). Its box reserves that, and
   never less than the unit's own minimum. Up to 30rem (480px): wider screens get the fixed sizes the minimum covers.
   An in-article unit (format "fluid") keeps its reserve. */
@media (max-width: 30rem) {
    .ad-slot[data-format="auto"],
    .ad-slot[data-format="auto"] ins.adsbygoogle, .ad-slot[data-format="auto"] .ad-placeholder { min-height: max(var(--ad-h, 250px), 100vw / 1.2); }
}
@media (min-width: 48rem) {
    .ad-slot, .ad-slot ins.adsbygoogle, .ad-placeholder { min-height: var(--ad-h-wide, var(--ad-h, 250px)); }
}
/* The unit inside a board's flight list stands between two dark panels, on the page's background, with more than a
   finger's width of clear space to the flights (and their links) above and below it. */
.board-ad { margin: 2.75rem 0; }
.board-ad .ad-slot { margin-top: 0; margin-bottom: 0; }

.affiliate-disclosure {
    max-width: var(--measure);
    margin: 1.5rem 0 .6rem;
    color: var(--muted);
    font-size: .9rem;
}
.affiliate-modules { margin: 1.5rem 0; }
.affiliate-module {
    max-width: var(--measure);
    margin: 0 0 1rem;
    padding: .9rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--strong);
}
.affiliate-module p { margin: 0 0 .5rem; }
.affiliate-module p:last-child { margin-bottom: 0; }
.affiliate-tag {
    display: inline-block;
    margin-left: .3rem;
    padding: 0 .4rem;
    border: 1px solid var(--muted);
    border-radius: 2px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 600;
    vertical-align: .08em;
}
.affiliate-partner { color: var(--muted); font-size: .85rem; }
/* On a phone the partner's name stands on its own line under the button. */
@media (max-width: 40rem) {
    .affiliate-partner { display: block; margin-top: .35rem; }
}
.affiliate-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 3px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
.affiliate-cta:hover { background: var(--btn-hover); }
/* The load button starts hidden and the page's script shows it: without JavaScript it would do nothing. */
.affiliate-cta[hidden] { display: none; }
.affiliate-widget:empty { display: none; }
.affiliate-widget { margin-top: .75rem; min-height: 0; }
.affiliate-widget iframe { display: block; width: 100%; border: 0; }
