/* ── Black Friday 2026 homepage hero (template-parts/content-hero-bf.php) ───── */

/* The theme only loads Light and Regular; the design's buttons and "20% OFF" are bolder. */
@font-face { font-family: 'HpBfSemibold'; src: url('../fonts/SuisseIntl-Semibold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'HpBfBold'; src: url('../fonts/SuisseIntl-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

.hp-bf {
    --hp-bf-bg: #000f0d;
    --hp-bf-mint: #9af5bd;
    --hp-bf-ink: #042820;
    --hp-bf-text: #cce7d7;
    position: relative;
    width: 100%;
    /* Up to 758px tall; the inline script in content-hero-bf.php lowers it so the counter strip shows on first load. */
    height: var(--hp-bf-h, clamp(460px, 52.64vw, 758px));
    background: var(--hp-bf-bg);
    overflow: hidden;
    font-family: 'SuisseIntl', sans-serif;
}

/* Desktop art is 1440×659 with a dark left side; it keeps its right edge and scales with the width. */
.hp-bf__art img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

@media (min-width: 1441px) {
    .hp-bf__art img {
        left: auto;
        width: 1440px;
    }
}

.hp-bf__inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(24px, 6vw, 86px);
    box-sizing: border-box;
}

.hp-bf__copy {
    max-width: 640px;
}

.hp-bf__title {
    margin: 0 0 24px;
    font-family: 'SuisseIntl-Light', 'SuisseIntl', sans-serif;
    font-size: clamp(40px, 3.9vw, 56px);
    font-weight: 300;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #fff;
}

/* Each line runs white → mint → dark green, like the design. */
.hp-bf__title span {
    background: linear-gradient(81deg, #fff 0.5%, var(--hp-bf-mint) 79%, #4c7b5e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.hp-bf__perk {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 36px;
    color: var(--hp-bf-text);
    font-family: 'SuisseIntl-Light', 'SuisseIntl', sans-serif;
    font-size: 24px;
    font-weight: 300;
    line-height: 31px;
}

/* Several perk lines (Turbo Trade adds its own): tight between them, the usual gap after the last. */
.hp-bf__perk:has(+ .hp-bf__perk) {
    margin-bottom: 10px;
}

.hp-bf__perk svg {
    flex: none;
    width: 20px;
    height: 20px;
}

.hp-bf__perk strong {
    font-family: 'HpBfBold', 'SuisseIntl', sans-serif;
    font-weight: 700;
}

.hp-bf__actions {
    display: flex;
    align-items: center;
    gap: 21px;
    margin-bottom: 26px;
}

/* "CLAIM 20% OFF": yellow pill, 65px high (design: 229 × 65, padding 19.8 / 36.8). */
.hp-bf__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 229px;
    height: 65px;
    padding: 0 36.76px;
    border-radius: 999px;
    background: #ffee00;
    color: var(--hp-bf-ink);
    font-family: 'HpBfBold', 'SuisseIntl', sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 21px;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.hp-bf__cta:hover,
.hp-bf__cta:focus-visible {
    color: var(--hp-bf-ink);
    filter: brightness(1.06);
    transform: translateY(-1px);
}

/* Offer box: "20 OFF %" lockup + copy-code tile (design: 209 × 62, padding 8, gap 9). */
.hp-bf__offer {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 62px;
    padding: 8px;
    border: 1px solid #212423;
    border-radius: 12px;
    background: #0f1211;
    box-sizing: border-box;
}

/* "20 OFF %" lockup: inline SVG from the design. */
.hp-bf__off {
    display: block;
    flex: none;
    width: 95px;
    height: 40px;
}

/* Copy-code tile (design: 87 × 44, #171a19, radius 6). */
.hp-bf__code {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 87px;
    height: 44px;
    padding: 0 9px;
    border: 1px solid #212423;
    border-radius: 6px;
    background: #171a19;
    color: #c5ead5;
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.hp-bf__code-label {
    font-family: 'SuisseIntl-Light', 'SuisseIntl', sans-serif;
    font-size: 11px;
    font-weight: 300;
    line-height: 8px;
    text-transform: uppercase;
}

.hp-bf__code strong {
    color: var(--hp-bf-mint);
    font-family: 'HpBfBold', 'SuisseIntl', sans-serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 13px;
}

.hp-bf__code:hover,
.hp-bf__code:focus-visible {
    border-color: rgba(154, 245, 189, 0.45);
}

.hp-bf__code::after {
    content: 'Copied!';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--hp-bf-mint);
    color: var(--hp-bf-ink);
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.hp-bf__code.is-copied::after {
    opacity: 1;
}

.hp-bf__rating {
    display: inline-block;
}

.hp-bf__rating img {
    display: block;
    width: 273px;
    height: auto;
}

/* ── Mobile / tablet: art on top, copy centred below ───────────────────────── */

@media (max-width: 991.98px) {
    .hp-bf {
        height: auto;
        background: #0f1211;
    }

    .hp-bf__art {
        position: relative;
        display: block;
        max-width: 520px;
        margin: 0 auto;
    }

    /* Up to 360px tall; the inline script lowers it on short phones so more of the copy shows on first load,
       but never so far that "BLACK FRIDAY" or the -20% get cut. */
    .hp-bf__art img {
        position: static;
        display: block;
        width: 100%;
        height: var(--hp-bf-art-h, 360px);
        object-fit: cover;
        object-position: 50% 50%;
    }

    /* Melt the art into the background under it. */
    .hp-bf__art::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 16%;
        background: linear-gradient(180deg, rgba(15, 18, 17, 0) 0%, #0f1211 100%);
        pointer-events: none;
    }

    .hp-bf__inner {
        display: block;
        height: auto;
        max-width: 520px;
        padding: 4px 24px 40px;
        text-align: center;
    }

    .hp-bf__copy {
        max-width: none;
    }

    .hp-bf__title {
        margin-bottom: 26px;
        font-size: clamp(40px, 14vw, 58px);
        line-height: 1.1;
    }

    .hp-bf__title br {
        display: none;
    }

    .hp-bf__perk {
        justify-content: center;
        margin-bottom: 30px;
    }

    .hp-bf__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-bottom: 30px;
    }

    .hp-bf__cta {
        width: 100%;
        box-sizing: border-box;
    }

    .hp-bf__perk {
        font-size: 20px;
    }

    .hp-bf__offer {
        justify-content: center;
        gap: 16px;
    }
}

/* Short phones (iPhone SE and similar): tighter spacing so the buttons and rating fit the first screen. */
@media (max-width: 991.98px) and (max-height: 760px) {
    .hp-bf__title {
        margin-bottom: 14px;
        font-size: clamp(36px, 11.5vw, 58px);
    }

    .hp-bf__perk {
        margin-bottom: 18px;
    }

    .hp-bf__actions {
        gap: 12px;
        margin-bottom: 18px;
    }

    .hp-bf__cta {
        height: 58px;
    }

    .hp-bf__perk {
        font-size: 18px;
    }
}

/* Tablet: the art is narrower than the screen, so fade its sides into the background. */
@media (min-width: 521px) and (max-width: 991.98px) {
    .hp-bf__art img {
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
    }
}

/* The sitewide payout toast (parent theme, .lev-ticker) waits until the visitor scrolls,
   so it doesn't cover the hero on first load. The inline script in content-hero-bf.php sets the class. */
body:not(.hp-bf-scrolled) .lev-ticker {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ── Split layout (Turbo Trade): copy left, the art as a card on the right ─────
   Mobile keeps the homepage layout: art on top, copy centred below. */
.hp-bf--split {
    height: auto;
    background: transparent;
    overflow: visible;
}

@media (min-width: 992px) {
    .hp-bf--split {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
        align-items: center;
        gap: 48px;
    }

    .hp-bf--split .hp-bf__inner {
        grid-row: 1;
        grid-column: 1;
        height: auto;
        padding: 0;
    }

    /* In place of the Turbo Trade image: only the right half of the art (the -20% panel is centred
       at 75% of its width, so the right 720 of 1440px puts it in the middle), edges faded into the page.
       The bottom stops at 545 of 659px, above the "20% OFF ALL PROGRAMS" line baked into the art. */
    .hp-bf--split .hp-bf__art {
        grid-row: 1;
        grid-column: 2;
        position: relative;
        justify-self: center;
        width: 100%;
        max-width: 520px;
        aspect-ratio: 720 / 545;
        overflow: hidden;
        -webkit-mask-image:
            linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
            linear-gradient(to bottom, transparent, #000 10%, #000 88%, transparent);
        -webkit-mask-composite: source-in;
        mask-image:
            linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
            linear-gradient(to bottom, transparent, #000 10%, #000 88%, transparent);
        mask-composite: intersect;
    }

    /* Image twice the box width, right edge and top pinned: the box shows the right half, top 545px. */
    .hp-bf--split .hp-bf__art img {
        position: absolute;
        top: 0;
        right: 0;
        left: auto;
        width: 200%;
        max-width: none;
        height: auto;
    }
}

/* Mobile split: the art goes edge to edge out of the page container, and fades into the
   page background (Turbo Trade's), not the homepage's. */
@media (max-width: 991.98px) {
    .hp-bf--split {
        margin-inline: -16px;
        width: auto;
    }

    .hp-bf--split .hp-bf__art::after {
        background: linear-gradient(180deg, transparent 0%, var(--tt-bg, #0f1211) 100%);
    }
}

/* Turbo Trade with its own "Hero image" (ACF): the picture shown whole, not the default art's crop. */
@media (min-width: 992px) {
    .hp-bf--split.hp-bf--custom-art .hp-bf__art {
        aspect-ratio: auto;
    }

    .hp-bf--split.hp-bf--custom-art .hp-bf__art img {
        position: static;
        width: 100%;
        height: auto;
    }
}
