/* Shared listing-modal sponsored-card presentation. Creative content lives in SponsoredCardPlacement. */
.sponsor-card {
    position: relative;
    margin: 0.8rem auto 1.5rem;
    /* Top padding is lighter than bottom — the sc-top header row carries its own space */
    padding: 12px 24px 18px;
    border-radius: 12px;
    /* Shrink-wrap to content (centered via auto margins) so short copy doesn't
       leave a dead-space gulf before the CTA. The min-width floor keeps tiny-copy
       cards from looking puny; space-between soaks up the slack if it kicks in. */
    width: fit-content;
    min-width: min(640px, 100%);
    max-width: 100%;
    /* Plain fallbacks first, then color-mix (baseline-supported, but cheap insurance) */
    background: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--sc-accent) 7%, #fff) 0%, #fff 70%);
    border: 1px solid #e2e5ea;
    border-color: color-mix(in srgb, var(--sc-accent) 28%, #fff);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 14px rgba(0,0,0,0.05);
    /* Own stacking context so the hover-tint ::before (z-index:-1) stays
       above the card's background but below everything else in the card */
    z-index: 0;
    transition: border-color 0.15s ease;
}
/* Hint that the whole card is a click target: nudge the border toward the brand color */
.sponsor-card.sc-clickable:hover {
    border-color: #c6cad3;
    border-color: color-mix(in srgb, var(--sc-accent) 52%, #fff);
}

/* Second hover cue: a slightly richer brand wash over the whole card.
   The resting background is a gradient and gradients can't transition,
   so this layer crossfades in over it instead. No color-mix support →
   no tint layer; the border change still carries the hover cue. */
.sponsor-card.sc-clickable::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    /* 1px inside the card's 12px radius so corners stay tucked behind the border */
    border-radius: 11px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--sc-accent) 14%, #fff) 0%, color-mix(in srgb, var(--sc-accent) 4%, #fff) 100%);
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* 0.3 caps the crossfade — dial the wash's strength here */
.sponsor-card.sc-clickable:hover::before {
    opacity: 0.3;
}

/* Whole-card link (card_href): stretched over the card, under the CTA and
   info icon, which lift above it via z-index below. */
.sc-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.sc-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    /* Contribute zero intrinsic width: a long nowrap street address in .sc-avail
       must never widen the card — the modal's listing container is display:table,
       so any min-content bloat here stretches the whole modal (tables included)
       past the viewport on phones. width:0 + min-width:100% keeps the row
       full-width in layout while intrinsic sizing sees nothing. */
    width: 0;
    min-width: 100%;
}

.sc-avail {
    /* Allowed to shrink + ellipsize so a long street address never crowds the tag */
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--sc-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sc-tag {
    flex: none;
    color: #8a8f98;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sc-info-tip {
    display: inline-block;
    /* Above the whole-card link — tapping the icon opens the tooltip, not the offer */
    position: relative;
    z-index: 2;
    margin-left: 5px;
    /* Sits at the end of the pricing line; muted + slightly smaller so it reads
       as an affordance, not part of the copy */
    font-size: 0.9em;
    color: #8a8f98;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.sc-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    /* Matches the natural height of a three-feature card, so short-copy cards
       (e.g. a one-line headline) get the same height instead of squeezing the
       CTA up against the Sponsored tag. */
    min-height: 72px;
}

.sc-logo {
    flex: none;
    display: flex;
    align-items: center;
}

.sc-logo img {
    display: block;
    height: var(--sc-logo-h, 48px);
    width: auto;
    max-width: 220px;
    object-fit: contain;
}

.sc-body {
    /* Content-sized (no grow) so the card can shrink-wrap; still allowed to
       shrink so text wraps instead of overflowing at mid widths */
    flex: 0 1 auto;
    min-width: 0;
    /* Subtle divider picks up the brand color */
    border-left: 1px solid color-mix(in srgb, var(--sc-accent) 16%, #fff);
    padding-left: 24px;
}

/* no_divider param: narrow shrink-wrapped cards read asymmetrical with the
   divider (32px gap + line + 24px padding on the left vs a bare 32px gap on
   the right), so they can opt out and keep the plain flex gap on both sides. */
.sponsor-card.sc-no-divider .sc-body {
    border-left: none;
    padding-left: 0;
}

/* wide param: widen past the shrink-wrap without going full-bleed —
   space-between spreads logo/text/CTA into the extra room. */
.sponsor-card.sc-wide {
    width: 90%;
}

.sc-headline {
    margin: 0;
    font-size: 15px;
    line-height: 1.45;
    color: #333;
    /* Centering + balance only matter once the headline wraps: balance evens
       out the line lengths so a wrap doesn't leave a stubby second line. */
    text-align: center;
    text-wrap: balance;
}

.sc-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sc-features li {
    display: flex;
    align-items: baseline;
    gap: 9px;
    font-size: 15px;
    line-height: 1.4;
    color: #333;
}

.sc-check {
    flex: none;
    width: 13px;
    height: 13px;
    color: var(--sc-accent);
    align-self: center;
}

.sc-cta {
    flex: none;
    /* Above the whole-card link so the button keeps its own ?p= source */
    position: relative;
    z-index: 2;
    /* Optical correction: the button is geometrically centered in the row, but
       its downward drop shadow makes it read ~2px low. Undone on mobile, where
       the button sits on its own row and there's nothing to center against. */
    top: -2px;
}

.sc-button {
    display: inline-block;
    background: var(--sc-accent);
    color: #fff;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--sc-accent) 30%, transparent);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.sc-button:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.sc-nowrap {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .sponsor-card {
        padding: 12px 16px 16px;
        /* Stacked layout goes back to full width */
        width: auto;
        min-width: 0;
    }

    .sc-inner {
        flex-direction: column;
        gap: 12px;
    }

    .sc-logo img {
        height: calc(var(--sc-logo-h, 48px) * 0.82);
    }

    .sc-body {
        border-left: none;
        padding-left: 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .sc-headline {
        text-align: center;
        font-size: 14px;
    }

    .sc-features {
        gap: 4px;
    }

    .sc-features li {
        font-size: 14px;
    }

    .sc-cta {
        width: 100%;
        text-align: center;
        top: 0;
    }

    .sc-button {
        display: block;
        max-width: 320px;
        margin: 0 auto;
        text-align: center;
        padding: 12px 22px;
    }
}
