/* CSS/upgrade-banner.css
 *
 * The quiet strip that sits under an advertisement (components/upgrade-banner.php).
 *
 * One line of small type straight under the ad box, no frame of its own. It
 * has to read as a footnote to the ad, not as a second advertisement.
 *
 * AdSense: never overlap, cover or float over the ad. Everything here is in
 * normal flow; there is no position:absolute/fixed and no transform. The strip
 * sits outside the ad box (and its "Advertentie" label), on the page's own
 * background, so it does not read as part of the ad creative.
 *
 * Nothing here loads late or resizes after paint, so the strip cannot cause
 * layout shift: it is static HTML with a fixed line box.
 */

/* `p.` rather than `.` because the strip is a <p>, and both city-pages.css
 * (`.city-section p`) and the page stylesheets style bare paragraphs. Matching
 * their specificity keeps the strip looking the same wherever it is dropped in. */
p.upgrade-banner {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    /* Own margins, stated in full: the surrounding stylesheets set paragraph
     * margins that would otherwise leak in. The ad above gives up its bottom
     * margin (below), so the strip sits right against it. */
    margin: 0;
    padding: 0 0.7rem;
    max-width: none;
    background: none;
    border: 0;
    color: var(--color-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
}

/* The whole line is the link: "Geen reclame met" + the BorderTanker Pro
 * lockup (CSS/brand-lockup.css) — the logo's own lettering, "Pro" lit and
 * glinting as in the app. */
p.upgrade-banner .upgrade-banner-link {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.3rem 0.5rem;
    min-height: 44px;
    box-sizing: border-box;
    padding-bottom: 10px;
    /* #212529 on the page background: ~15:1. */
    color: var(--color-text);
    font-weight: 600;
    text-decoration: none;
}

.upgrade-banner-text {
    white-space: nowrap;
}

/* Smaller than the app's xs step: this is a footnote to the ad, not a heading. */
p.upgrade-banner .bt-lockup {
    --bt-word-size: 20px;
    gap: 6px;
    flex-wrap: nowrap;
}

.upgrade-banner-brand {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.upgrade-banner-brand svg {
    display: block;
    width: auto;
    height: 14px;
}

.upgrade-banner-arrow {
    color: var(--color-primary-700);
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 0.15s ease;
}

/* No underline, ever (also on hover): the arrow nudging right is the feedback. */
p.upgrade-banner .upgrade-banner-link,
p.upgrade-banner .upgrade-banner-link:hover,
p.upgrade-banner .upgrade-banner-link:focus-visible {
    text-decoration: none;
}

p.upgrade-banner .upgrade-banner-link:hover .upgrade-banner-arrow {
    transform: translateX(2px);
}

p.upgrade-banner .upgrade-banner-link:focus-visible {
    outline: 2px solid var(--color-primary-700);
    outline-offset: 2px;
    border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .upgrade-banner-arrow { transition: none; }
}

/* --------------------------------------------------------------------------
 * Binding the strip to its ad
 *
 * Each ad block brings its own bottom margin, which would leave the strip
 * drifting halfway to the next section. The ad gives that margin up and the
 * strip takes it over underneath, so the strip sits right under the ad and the
 * space to the next section stays what it was. Done from here, so
 * border-benefit.css, city-pages.css and station.php stay untouched.
 * -------------------------------------------------------------------------- */

/* .benefit-ad-section — margin: 1.25rem 0 2rem (1.5rem on phones) */
.benefit-ad-section:has(+ p.upgrade-banner) {
    margin-bottom: 0;
}

.benefit-ad-section + p.upgrade-banner {
    margin-bottom: 2rem;
}

/* .city-ad-section — .city-section gives it margin-bottom: 2.75rem */
.city-ad-section:has(+ p.upgrade-banner) {
    margin-bottom: 0;
}

.city-ad-section + p.upgrade-banner {
    margin-bottom: 2.75rem;
}

/* Inside a station table ad row: as wide as the ad, centred under it. */
.city-table-ad-viewport + p.upgrade-banner {
    width: min(100%, 640px);
    margin: 0 auto 0.8rem;
}

.city-station-table td > p.upgrade-banner {
    /* The row cell has padding:0; keep the strip off the table's edges. */
    max-width: calc(100% - 1.6rem);
}

/* station.php — .station-list-ad has margin: 10px 0 !important; the ad's
 * <script> sits between the two, hence ~ rather than +. */
.station-list-ad:has(~ p.upgrade-banner) {
    margin-bottom: 0 !important;
}

.station-list-ad ~ p.upgrade-banner {
    margin-bottom: 10px;
}

/* border-benefit.css: .benefit-ad-section has margin-bottom 1.5rem here. */
@media (max-width: 640px) {
    .benefit-ad-section + p.upgrade-banner {
        margin-bottom: 1.5rem;
    }
}
