/**
 * Hero background for WoT Personal Missions calculator pages.
 * The top image lives in wrapSectionHeader, while the calculator starts below it in pmPageMain.
 */

body:has(.pmMissionProtoPage--wotPm) {
    --bh-pm-catalog-page-bg: linear-gradient(180deg, #111b29 0%, #0a0e14 45%, #11131e 100%);
    background-color: #111b29;
    background-image: var(--bh-pm-catalog-page-bg);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

.pmMissionProtoPage--wotPm {
    background-color: transparent;
    background-image: var(
        --bh-pm-catalog-page-bg,
        linear-gradient(180deg, #111b29 0%, #0a0e14 45%, #11131e 100%)
    );
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

main.pageCard_1:has(.pmMissionProtoPage--wotPm) > .wrapSectionHeader {
    --bh-hero-blend-bg: #111b29;
    --bh-hero-vignette-v-top: 0.34;
    --bh-hero-vignette-v-bot: 0.18;
    --bh-hero-photo-mask-x: 22%;
    --bh-hero-photo-mask-bottom: 28%;
    position: relative;
    box-sizing: border-box;
    background-color: var(--bh-hero-blend-bg);
    background-image: var(--bh-pm-catalog-page-bg) !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
}

main.pageCard_1:has(.pmMissionProtoPage--wotPm) > .wrapSectionHeader::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--bh-bg-detail-pic, none);
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    -webkit-mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-x),
            #000 calc(100% - var(--bh-hero-photo-mask-x)),
            transparent 100%
        ),
        linear-gradient(
            0deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-bottom),
            #000 100%
        );
    -webkit-mask-size: 100% 100%;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-x),
            #000 calc(100% - var(--bh-hero-photo-mask-x)),
            transparent 100%
        ),
        linear-gradient(
            0deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-bottom),
            #000 100%
        );
    mask-size: 100% 100%;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-composite: intersect;
}

/* Same photo mask on the real LCP <img> (::before disabled when img exists — see custom.css) */
main.pageCard_1:has(.pmMissionProtoPage--wotPm) > .wrapSectionHeader > .bhHeroLcpImg {
    -webkit-mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-x),
            #000 calc(100% - var(--bh-hero-photo-mask-x)),
            transparent 100%
        ),
        linear-gradient(
            0deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-bottom),
            #000 100%
        );
    -webkit-mask-size: 100% 100%;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-x),
            #000 calc(100% - var(--bh-hero-photo-mask-x)),
            transparent 100%
        ),
        linear-gradient(
            0deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-bottom),
            #000 100%
        );
    mask-size: 100% 100%;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-composite: intersect;
}

main.pageCard_1:has(.pmMissionProtoPage--wotPm) > .wrapSectionHeader::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, 0.28) 0%,
            rgba(0, 0, 0, 0.18) 14%,
            rgba(0, 0, 0, 0.08) 32%,
            transparent 58%
        ),
        linear-gradient(
            270deg,
            rgba(0, 0, 0, 0.28) 0%,
            rgba(0, 0, 0, 0.18) 14%,
            rgba(0, 0, 0, 0.08) 32%,
            transparent 58%
        ),
        linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.18) 0%,
            rgba(0, 0, 0, 0.12) 14%,
            rgba(0, 0, 0, 0.05) 30%,
            transparent 62%
        ),
        linear-gradient(
            180deg,
            rgba(0, 0, 0, var(--bh-hero-vignette-v-top)) 0%,
            rgba(0, 0, 0, var(--bh-hero-vignette-v-bot)) 54%,
            transparent 100%
        );
    -webkit-mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-x),
            #000 calc(100% - var(--bh-hero-photo-mask-x)),
            transparent 100%
        ),
        linear-gradient(
            0deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-bottom),
            #000 100%
        );
    -webkit-mask-size: 100% 100%;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(
            90deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-x),
            #000 calc(100% - var(--bh-hero-photo-mask-x)),
            transparent 100%
        ),
        linear-gradient(
            0deg,
            transparent 0%,
            #000 var(--bh-hero-photo-mask-bottom),
            #000 100%
        );
    mask-size: 100% 100%;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-composite: intersect;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

main.pageCard_1:has(.pmMissionProtoPage--wotPm) > .wrapSectionHeader > .sectionHeader {
    position: relative;
    z-index: 2;
    background: transparent !important;
    padding-bottom: 0;
}

/* Align with catalog / game section: .pageCatalogService__section_1--refresh { padding: 22px 0 0 } */
.pmWotPmHero {
    position: relative;
    z-index: 2;
    padding: 22px 0 0;
}

/*
 * Hero sits outside .pmMissionProtoPage, so it misses the page-wide border-box reset.
 * Without border-box, width:100%/max-width:1370 + side padding overflows the parent
 * and margin:auto cannot center — crumbs shift left vs catalog/section pages.
 */
.pmWotPmHero .pmPageContainer {
    box-sizing: border-box;
    max-width: 1370px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

.pmWotPmHero .pmPageBreadcrumb {
    margin: 0 0 18px;
}

.pmWotPmHero .pmPageHero--productHead {
    margin-bottom: 0;
}

.pmWotPmHero .pmPageHero__title {
    position: relative;
    margin: 0;
    display: block;
    width: fit-content;
    max-width: 100%;
    padding-bottom: 14px;
    font-size: clamp(2.35rem, 3.8vw, 3.25rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -0.025em;
    color: rgba(255, 255, 255, 0.98);
    text-wrap: balance;
}

.pmWotPmHero .pmPageHero__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: min(11rem, 42%);
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #fe9900 0%, rgba(254, 153, 0, 0.2) 100%);
    pointer-events: none;
}

.pmMissionProtoPage--wotPm .pmPageMain {
    padding-top: 0;
}

.pmMissionProtoPage--wotPm .pmPageCard {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, #152238 0%, #0f1828 100%);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

@media (max-width: 767px) {
    .pmWotPmHero {
        padding: 22px 0 0;
    }

    .pmWotPmHero .pmPageHero__title {
        font-size: clamp(2.05rem, 5.5vw, 2.85rem);
        padding-bottom: 12px;
    }

    .pmWotPmHero .pmPageBreadcrumb {
        flex-wrap: nowrap;
        gap: 6px 8px;
        margin: 0 0 18px;
        font-size: 1.25rem;
        line-height: 1.35;
        overflow: hidden;
    }

    .pmWotPmHero .pmPageBreadcrumb__mid {
        display: none !important;
    }

    .pmWotPmHero .pmPageBreadcrumb__current {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: min(58vw, 14em);
    }
}
