/* Marketing campaign creative — popup, footer banner, sticky bar, side card, in-feed card and
 * feature block. Shared by every portal that renders TXP.ComponentLibrary/Marketing.
 *
 * ONE stylesheet rather than a <style> block per component, because a zone renders every eligible
 * candidate and a per-component block would then emit the same rules three or four times per page.
 *
 * THEMING: never fork this file. Every colour, radius and font size reads a --txp-promo-* custom
 * property with a neutral fallback, so a portal brands its adverts by setting those properties once
 * (e.g. in its own site stylesheet under :root). The campaign's own accent and feature-card fill
 * still come from the campaign record and are applied inline, so a partner's brand colour always
 * wins over the site's.
 */

:root {
    /* Surfaces */
    --txp-promo-surface: #ffffff;
    --txp-promo-surface-alt: #f4f4f8;
    --txp-promo-line: #e3e3ec;
    --txp-promo-text: #1f2333;
    --txp-promo-text-strong: #10121c;
    --txp-promo-text-muted: #5c6070;

    /* Brand defaults, overridden per portal */
    --txp-promo-accent: #4B2A86;
    --txp-promo-feature-bg: #191242;

    /* Shape and rhythm */
    --txp-promo-radius: 0.5rem;
    --txp-promo-radius-lg: 1rem;
    --txp-promo-radius-xl: 1.5rem;
    --txp-promo-pill: 999px;
    --txp-promo-shadow-sm: 0 1px 2px rgba(16, 18, 28, .06);
    --txp-promo-shadow-md: 0 4px 12px rgba(16, 18, 28, .10);
    --txp-promo-shadow-lg: 0 18px 40px rgba(16, 18, 28, .22);

    /* Width of the page gutter the full-bleed formats align their content to */
    --txp-promo-container: 1440px;

    /* Layering. Above ordinary page content, below the site's own nav dropdowns and dialogs. */
    --txp-promo-z-sticky: 1050;
    --txp-promo-z-modal: 1100;
}

/* ---------------------------------------------------------------------------
 * Visibility gate.
 *
 * The `hidden` attribute is how the client gates and dismisses these, but it only works via the UA
 * rule `[hidden] { display: none }` at specificity (0,0,1). `.promo-modal` below sets
 * `display: flex` at (0,1,0) and would silently beat it — so without these rules EVERY modal renders
 * at once and clicking close (which just sets .hidden = true) appears to do nothing.
 *
 * Must stay ahead of any future `display` declaration on these classes.
 * ------------------------------------------------------------------------ */
.promo-root[hidden], .promo-config[hidden], .promo-zone[hidden], .promo-zone-wrap[hidden],
.promo-slot[hidden], .promo-modal[hidden], .promo-banner[hidden], .promo-sticky[hidden],
.promo-days[hidden] {
    display: none !important;
}

/* ---- Shared bits ---- */
.promo-cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .7rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--txp-promo-pill);
    font-weight: 600;
    font-size: .9375rem;
    line-height: 1.2;
    text-decoration: none;
    flex: 0 0 auto;
    transition: transform .15s ease, filter .15s ease;
}
.promo-cta:hover { text-decoration: none; transform: translateY(-1px); filter: brightness(1.04); }

.promo-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    align-self: flex-start;
    padding: .28rem .7rem;
    border-radius: var(--txp-promo-pill);
    font-size: .8125rem;
    font-weight: 600;
}
.promo-tag {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: .28rem .7rem;
    border-radius: var(--txp-promo-pill);
    font-size: .8125rem;
    font-weight: 700;
}
.promo-arrow { flex: 0 0 auto; }
.promo-slot .is-dim, .promo-modal .is-dim { opacity: .6; }

/* ---------------------------------------------------------------------------
 * Above-footer banner. Full-bleed strip; its inner row is constrained so the copy lines up with the
 * rest of the page rather than running to the window edges on a wide monitor.
 * ------------------------------------------------------------------------ */
.promo-banner {
    background: var(--txp-promo-surface);
    border-top: 1px solid var(--txp-promo-line);
}
.promo-banner__inner {
    max-width: var(--txp-promo-container);
    margin-inline: auto;
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.promo-banner__media {
    flex: 0 0 auto;
    width: 5rem;
    height: 5rem;
    border-radius: var(--txp-promo-radius);
    overflow: hidden;
    background: var(--txp-promo-surface-alt);
}
.promo-banner__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-banner__text {
    flex: 1 1 16rem;
    min-width: 12rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.promo-banner__title { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--txp-promo-text-strong); }
.promo-banner__body {
    margin: 0;
    color: var(--txp-promo-text-muted);
    font-size: .875rem;
    /* Two lines: a banner is a strip, and letting a long body reflow it into a block pushes the
       footer down the page on every render. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------------------------------------------------------------------------
 * Sticky bottom bar. The client measures this and reserves matching padding at the foot of the
 * document, so it never covers the last section's own call to action.
 * ------------------------------------------------------------------------ */
.promo-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--txp-promo-z-sticky);
    background: var(--txp-promo-surface);
    border-top: 1px solid var(--txp-promo-line);
    box-shadow: var(--txp-promo-shadow-lg);
}
.promo-sticky__inner {
    max-width: var(--txp-promo-container);
    margin-inline: auto;
    padding: .75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.promo-sticky__logo { flex: 0 0 auto; max-height: 2rem; width: auto; }
.promo-sticky__text {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: .875rem;
    color: var(--txp-promo-text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.promo-sticky__cta {
    flex: 0 0 auto;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--txp-promo-pill);
    font-weight: 600;
    font-size: .875rem;
    text-decoration: none;
}
.promo-sticky__cta:hover { text-decoration: none; filter: brightness(1.05); }
.promo-sticky__close {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    background: var(--txp-promo-surface-alt);
    color: var(--txp-promo-text-muted);
    font-size: 1.1rem;
    line-height: 1;
}

/* ---------------------------------------------------------------------------
 * Popup modal.
 * ------------------------------------------------------------------------ */
.promo-modal {
    position: fixed;
    inset: 0;
    z-index: var(--txp-promo-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.promo-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 18, 28, .62);
    backdrop-filter: blur(3px);
}
.promo-modal__card {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(46rem, 100%);
    max-height: 90vh;
    overflow: hidden;
    background: var(--txp-promo-surface);
    border: 1px solid var(--txp-promo-line);
    border-radius: var(--txp-promo-radius-lg);
    box-shadow: var(--txp-promo-shadow-lg);
}
.promo-modal__close {
    position: absolute;
    top: .6rem;
    right: .6rem;
    z-index: 2;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}
.promo-modal__media { position: relative; flex: 0 0 40%; background: var(--txp-promo-surface-alt); }
.promo-modal__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-modal__logo {
    position: absolute;
    left: 50%;
    bottom: .75rem;
    transform: translateX(-50%);
    background: #fff;
    border-radius: var(--txp-promo-radius);
    padding: .35rem .6rem;
    box-shadow: var(--txp-promo-shadow-sm);
}
.promo-modal__logo img { max-height: 2rem; width: auto; display: block; }
.promo-modal__body {
    flex: 1 1 auto;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    overflow-y: auto;
}
.promo-modal__title { margin: 0; font-size: 1.5rem; font-weight: 800; color: var(--txp-promo-text-strong); line-height: 1.2; }
.promo-modal__text { margin: 0; color: var(--txp-promo-text-muted); }

/* ---------------------------------------------------------------------------
 * Side banner (a page's side rail).
 * ------------------------------------------------------------------------ */
.promo-side {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--txp-promo-surface);
    border: 1px solid var(--txp-promo-line);
    border-radius: var(--txp-promo-radius-lg);
    box-shadow: var(--txp-promo-shadow-sm);
}
.promo-side__media { aspect-ratio: 16 / 9; background: var(--txp-promo-surface-alt); }
.promo-side__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-side__body { display: flex; flex-direction: column; gap: .5rem; padding: 1.125rem; }
.promo-side__eyebrow { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.promo-side__title { margin: 0; font-size: 1.0625rem; font-weight: 700; color: var(--txp-promo-text-strong); line-height: 1.25; }
.promo-side__text {
    margin: 0;
    color: var(--txp-promo-text-muted);
    font-size: .875rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.promo-side__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: .25rem;
    padding: .6rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--txp-promo-pill);
    font-weight: 600;
    font-size: .875rem;
    text-decoration: none;
}
.promo-side__cta:hover { text-decoration: none; filter: brightness(1.05); }

/* ---------------------------------------------------------------------------
 * In-feed card. Sits in a results grid; carries a visible "Sponsored" label so it reads as an
 * advert rather than as another result.
 * ------------------------------------------------------------------------ */
.promo-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--txp-promo-surface);
    border: 1px solid var(--txp-promo-line);
    border-radius: var(--txp-promo-radius-lg);
    box-shadow: var(--txp-promo-shadow-sm);
    flex-wrap: wrap;
}
.promo-inline__media {
    flex: 0 0 auto;
    width: 6rem;
    height: 6rem;
    overflow: hidden;
    border-radius: var(--txp-promo-radius);
    background: var(--txp-promo-surface-alt);
}
.promo-inline__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-inline__body { flex: 1 1 14rem; min-width: 11rem; display: flex; flex-direction: column; gap: .35rem; }
.promo-inline__head { display: flex; flex-wrap: wrap; gap: .4rem; }
.promo-inline__tag { padding: .2rem .6rem; border-radius: var(--txp-promo-pill); font-size: .75rem; font-weight: 700; }
.promo-inline__title { margin: 0; font-size: 1.0625rem; font-weight: 700; color: var(--txp-promo-text-strong); }
.promo-inline__text {
    margin: 0;
    color: var(--txp-promo-text-muted);
    font-size: .875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.promo-inline__cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--txp-promo-pill);
    font-weight: 600;
    font-size: .875rem;
    text-decoration: none;
}
.promo-inline__cta:hover { text-decoration: none; filter: brightness(1.05); }

/* ---------------------------------------------------------------------------
 * Feature block — the richest format. Renders as its own full-width card; the zone it sits in is
 * expected to be at page top level, not inside a narrow column.
 * ------------------------------------------------------------------------ */
.promo-zone--feature { display: block; }
.promo-feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 1.75rem;
    max-width: var(--txp-promo-container);
    margin: 2.5rem auto;
    padding: 2rem;
    border-radius: var(--txp-promo-radius-xl);
    color: #fff;
    box-shadow: var(--txp-promo-shadow-lg);
}
.promo-feature__aside {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
}
.promo-feature__logo {
    max-width: 100%;
    height: auto;
    border-radius: var(--txp-promo-radius-lg);
    box-shadow: var(--txp-promo-shadow-md);
}
.promo-feature__cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .7rem 1.2rem;
    border-radius: var(--txp-promo-pill);
    background: #fff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--txp-promo-shadow-md);
    transition: transform .15s ease;
}
.promo-feature__cta:hover { transform: translateY(-1px) scale(1.02); text-decoration: none; }
.promo-feature__eyebrow {
    display: block;
    margin-bottom: .5rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: .75;
}
.promo-feature__title {
    margin: 0 0 1rem;
    font-size: clamp(1.5rem, 2.6vw, 2.125rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--promo-fb-accent);
}
.promo-feature__title span { color: var(--promo-fb-accent); }
.promo-feature__body { margin: 0 0 .5rem; font-size: 1.0625rem; opacity: .92; }
.promo-feature__note { margin: .75rem 0 0; font-weight: 600; font-size: .875rem; color: var(--promo-fb-accent); }
.promo-feature__pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.promo-feature__pill {
    padding: .3rem .8rem;
    border-radius: var(--txp-promo-pill);
    background: rgba(255, 255, 255, .88);
    font-size: .8125rem;
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
 * Narrow viewports.
 * ------------------------------------------------------------------------ */
@media (max-width: 48rem) {
    .promo-feature {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.5rem;
        margin-block: 1.5rem;
    }
    .promo-feature__pills { justify-content: center; }
}

@media (max-width: 40rem) {
    .promo-modal__card { flex-direction: column; }
    .promo-modal__media { flex-basis: 8rem; height: 8rem; }
    .promo-modal__body { padding: 1.25rem; }

    .promo-sticky__text { white-space: normal; -webkit-line-clamp: 2; }

    .promo-inline { flex-direction: column; align-items: flex-start; }
    .promo-inline__media { width: 100%; height: 8rem; }
    /* flex-basis is a WIDTH in the row layout but a HEIGHT once the card stacks, so the grow factor
       stretches the copy block down the card and strands the CTA below a tall empty gap. */
    .promo-inline__body { flex: 0 0 auto; }
    .promo-inline__cta { width: 100%; justify-content: center; }

    .promo-banner__inner { gap: 1rem; }
    .promo-cta { width: 100%; justify-content: center; }
}

/* Respect a visitor who has asked for less motion — these are decorative flourishes. */
@media (prefers-reduced-motion: reduce) {
    .promo-cta, .promo-feature__cta { transition: none; }
    .promo-cta:hover, .promo-feature__cta:hover { transform: none; }
}
