/*
 * BabyNamePopularity.com first-party advertising placements.
 *
 * Loaded only when the advertising system is enabled and at least one
 * campaign has been rendered. Fixed minimum heights and explicit image
 * sizing prevent layout shift when a rotation replaces a creative.
 */

.bnp-ad {
    --bnp-ad-border: #e3e9ef;
    --bnp-ad-bg: #ffffff;
    --bnp-ad-text: #1e2a38;
    --bnp-ad-muted: #4a5b6e;
    --bnp-ad-accent: #4a90b8;
    --bnp-ad-accent-strong: #2e7097;

    position: relative;
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 1rem 1.1rem 1.15rem;
    border: 1px solid var(--bnp-ad-border);
    border-radius: 12px;
    background: var(--bnp-ad-bg);
    color: var(--bnp-ad-text);
    text-align: center;
}

.bnp-ad * {
    box-sizing: border-box;
}

.bnp-ad--standard {
    min-height: 168px;
}

.bnp-ad--compact {
    min-height: 108px;
    padding: 0.75rem 0.9rem 0.85rem;
}

.bnp-ad__label {
    display: block;
    margin-bottom: 0.6rem;
    color: #8594a6;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    line-height: 1.35;
    text-transform: uppercase;
}

.bnp-ad__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
}

.bnp-ad__logo {
    display: block;
    max-width: 190px;
    max-height: 64px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.bnp-ad--compact .bnp-ad__logo {
    max-width: 140px;
    max-height: 44px;
}

.bnp-ad__name {
    margin: 0;
    color: var(--bnp-ad-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.bnp-ad__tagline {
    margin: 0;
    max-width: 46ch;
    color: var(--bnp-ad-muted);
    font-size: 1.02rem;
    line-height: 1.45;
}

.bnp-ad__support {
    margin: 0;
    max-width: 48ch;
    color: #8594a6;
    font-size: 0.95rem;
    line-height: 1.45;
}

.bnp-ad__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 0.15rem;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    background: var(--bnp-ad-accent);
    color: #ffffff !important;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color 0.18s ease, transform 0.15s ease;
}

.bnp-ad__cta:hover,
.bnp-ad__cta:focus-visible {
    background: var(--bnp-ad-accent-strong);
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

.bnp-ad__cta:focus-visible {
    outline: 3px solid rgba(74, 144, 184, 0.35);
    outline-offset: 3px;
}

@media (min-width: 700px) {
    .bnp-ad--compact .bnp-ad__body {
        flex-direction: row;
        justify-content: center;
        gap: 0.9rem;
    }

    .bnp-ad--compact .bnp-ad__tagline {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bnp-ad__cta {
        transition: none;
    }

    .bnp-ad__cta:hover,
    .bnp-ad__cta:focus-visible {
        transform: none;
    }
}
