/* Palette mirrors the corresponding card on the home page. */
body[data-section="stock"], body[data-section="bulls"] {
    --banner-color: #f0e5db;
    --banner-art: url("../images/home/semen.jpg");
}
body[data-section="shipments"] {
    --banner-color: #e3edf5;
    --banner-art: url("../images/home/shipments.webp");
}
body[data-section="goods"] {
    --banner-color: #eee8db;
    --banner-art: url("../images/sections/01-goods-warehouse.webp");
}
body[data-section="fleet"] {
    --banner-color: #e7eee4;
    --banner-art: url("../images/home/fleet.webp");
}
body[data-section="analysis"] {
    --banner-color: #ebe9f1;
    --banner-art: url("../images/sections/11-semen-shipment-analysis.webp");
}
body[data-section="calendar"] {
    --banner-color: #f2e7dc;
    --banner-art: url("../images/sections/12-shipment-calendar.webp");
}
body[data-section="vessels"] {
    --banner-color: #f0e5db;
    --banner-art: url("../images/sections/13-vessel-registry.webp");
}
body[data-section="nitrogen"] {
    --banner-color: #f0e5db;
    --banner-art: url("../images/sections/14-vessel-top-up.webp");
}
body[data-section="disinfection"] {
    --banner-color: #e7eee4;
    --banner-art: url("../images/sections/15-disinfection-record.webp");
}
body[data-section="settings"] {
    --banner-color: #ebe9f1;
    --banner-art: url("../images/sections/16-settings.webp");
}
body[data-section="organizations"] {
    --banner-color: #eee8db;
    --banner-art: url("../images/sections/17-organizations.webp");
}
body:is([data-section="users"], [data-section="activity"]) {
    --banner-color: #e7eee4;
    --banner-art: url("../images/sections/18-users.webp");
}

body:is([data-page="goods.goods_add"], [data-page="goods.goods"],
        [data-page="goods.goods_edit"], [data-page^="goods.suppliers"]) {
    --banner-art: url("../images/sections/02-goods-organization-directory.webp");
}
body:is([data-page="goods.goods_analytics"], [data-page="goods.goods_summary"]) {
    --banner-art: url("../images/sections/03-goods-analytics.webp");
}
body:is([data-page="stock.stock_add"], [data-page="bulls.bulls_add"], [data-page="bulls.bulls_edit"]) {
    --banner-art: url("../images/sections/04-add-bull.webp");
}
body[data-page="stock.stock_vessels"] {
    --banner-art: url("../images/sections/05-canister-capacity.webp");
}
body:is([data-page="shipments.shipment_new"], [data-page="shipments.shipment_edit"],
        [data-page="goods.goods_shipment_new"], [data-page="goods.goods_shipment_edit"]) {
    --banner-art: url("../images/sections/06-new-shipment.webp");
}
body[data-page^="fleet.fleet_driver"] {
    --banner-art: url("../images/sections/07-drivers.webp");
}
body:is([data-page^="fleet.fleet_service"], [data-page^="fleet.fleet_maintenance"]) {
    --banner-art: url("../images/sections/08-vehicle-service.webp");
}
body[data-page^="fleet.fleet_tire"] {
    --banner-art: url("../images/sections/09-tires.webp");
}
body[data-page="fleet.fleet_forecast"] {
    --banner-art: url("../images/sections/10-fleet-budget-forecast.webp");
}
body[data-page="goods.goods_shipments"] {
    --banner-art: url("../images/home/goods-dispatch.webp");
}

body:not([data-section="auth"], [data-section=""]) .app-main .page-header:has(h1) {
    min-height: 128px;
    padding: clamp(14px, 2.1vw, 26px);
    padding-inline-end: clamp(80px, 29%, 330px);
    border: 0;
    border-radius: 18px;
    background-color: var(--banner-color, #eef1ea);
    background-image:
        linear-gradient(90deg, var(--banner-color, #eef1ea) 57%, transparent 82%),
        var(--banner-art, none);
    background-position: center, right center;
    background-size: 100% 100%, auto 124%;
    background-repeat: no-repeat;
}
body[data-page="goods.goods_shipments"] .app-main .page-header.shipment-hero {
    min-height: 185px;
    background-size: 100% 100%, auto 135%;
}
.shipment-hero::before { content: none; }
@media (max-width: 560px) {
    body:not([data-section="auth"], [data-section=""]) .app-main .page-header:has(h1) {
        min-height: 110px;
        padding-inline-end: 23%;
        background-image:
            linear-gradient(90deg, var(--banner-color, #eef1ea) 54%, transparent 97%),
            var(--banner-art, none);
    }
    body[data-page="goods.goods_shipments"] .app-main .page-header.shipment-hero { min-height: 150px; }
    .shipment-hero .shipment-hero-copy { max-width: 100%; }
}

/* Blend relative to the actual image edge, including landscape and portrait artwork. */
body:not([data-section="auth"], [data-section=""]) .app-main .page-header:has(h1) {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background-image: none;
}
body:not([data-section="auth"], [data-section=""]) .app-main .page-header:has(h1)::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 0 auto;
    width: clamp(130px, 42%, 490px);
    pointer-events: none;
    background: var(--banner-art, none) right center / cover no-repeat;
    mask-image: linear-gradient(to right, transparent, #000 54%);

}


body[data-section="bulls"]:not([data-page="bulls.bulls_add"], [data-page="bulls.bulls_edit"]) {
    --banner-art: url("../images/sections/bull-directory.webp");
}
body[data-section="bulls"]:not([data-page="bulls.bulls_add"], [data-page="bulls.bulls_edit"]) .app-main .page-header:has(h1)::before {
    width: auto;
    aspect-ratio: 1;
    max-width: 43%;
    background-size: contain;
    mask-image: linear-gradient(to right, transparent, #000 32%);
}
