/* Shishana brand hero: editorial breakout.
   The hero product stands IN FRONT of the panel on one shared floor line. Tall subjects (shishas, vases, bottles) rise from a
   floor just below the panel and overlap its bottom edge; small subjects (bowls, tongs, coals) sit on a floor inside it.
   Only heroes prepared by includes/design-refine.php carry the class .shs-bh, so without the geometry data the live layout stays.

   Per image (inline, from data/brand-hero.json or measured from the file itself):
     --ia  image width / height            --a   subject width / height (trimmed box)
     --t --b  empty share of the canvas above / below the subject      --cx  subject centre, share of canvas width
     --s   optional size trim (1 = rule), --sm the same for phone and tablet only   --dx  optional sideways nudge, share of the stage width
     --dy  optional lift, share of the panel height
   Per image set and on the hero: --bh-om / --bh-od = 1 when the phone / desktop composition stands out of the panel.

   Two hero types share the rules: the plain hero (.shs-bp__stage, one to three product images) and the brand identity hero
   (.shs-bi-on, one composed artwork in .shs-bi__art). */

/* --bh-D: how far the floor lies below the panel. --bh-top: air kept above a full-height subject.
   --bh-W: width of the image area. For the plain hero it is worked out from the page width (the hero is the page wrap minus its
   side padding, the stage a fixed share of it): no container query and no z-index on the stage, because either would isolate it
   and the white-ground photographs must keep blending with the panel behind them.
   overflow-x:clip: the empty canvas around a subject may pass the page edge and must never add a sideways scroll. */
.shs-bp.shs-bh{overflow-x:clip;--bh-D:26px;--bh-top:12px;--bh-W:calc((min(100vw,1400px) - 32px)*.34)}
@media (min-width:750px){.shs-bp.shs-bh{--bh-D:36px;--bh-top:16px;--bh-W:calc((min(100vw,1400px) - 48px)*.4)}}
@media (min-width:1024px){.shs-bp.shs-bh{--bh-D:56px;--bh-top:22px;--bh-W:calc((min(100vw,1400px) - 80px)*.5)}}
.shs-bp.shs-bh .shs-bp__hero,.shs-bp.shs-bh .shs-bp__stage-set,.shs-bp.shs-bh .shs-bi__art-set{--bh-out:var(--bh-om,0)}
@media (min-width:1024px){.shs-bp.shs-bh .shs-bp__hero,.shs-bp.shs-bh .shs-bp__stage-set,.shs-bp.shs-bh .shs-bi__art-set{--bh-out:var(--bh-od,0)}}

/* the panel keeps its colour and radius; nothing is clipped any more, and the content below starts under the floor */
.shs-bp.shs-bh:not(.is-dark) .shs-bp__hero{overflow:visible;position:relative;margin-bottom:calc(var(--bh-out)*var(--bh-D))}
.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage{overflow:visible;background:transparent;pointer-events:none}
/* tallest a subject may stand, and how far the floor lies below the panel edge (negative = inside the panel).
   These percentages are only ever used in height and bottom, so 100% is the height of the image area. */
.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage-set{padding:0;
	--bh-hmax:calc(100% + var(--bh-out)*(var(--bh-D) - var(--bh-top)) - (1 - var(--bh-out))*32%);
	--bh-floor:calc(var(--bh-out)*var(--bh-D) - (1 - var(--bh-out))*13%)}

/* the image: sized so the SUBJECT (not the canvas) meets the rule, standing on the floor, centred on its slot */
.shs-bp.shs-bh:not(.is-dark) .shs-bp__hero .shs-bh__img{
	--sx:.5;--sw:.9;--ss:1;
	--z:var(--sm,var(--s,1));
	--hs:min(calc(var(--bh-hmax)*var(--ss)*var(--z)),calc(var(--bh-hmax)*var(--bh-box,.78)*var(--ss)*var(--z)/var(--a,1)),calc(var(--sw)*var(--z)*var(--bh-W)/var(--a,1)));
	--ih:calc(var(--hs)/(1 - var(--t,0) - var(--b,0)));
	position:absolute;top:auto;right:auto;
	left:calc((var(--sx) + var(--dx,0))*100%);
	bottom:calc(0px - var(--bh-floor) - var(--b,0)*var(--ih) + var(--dy,0)*100%);
	height:var(--ih);width:auto;max-width:none;min-width:0;flex:none;align-self:auto;order:0;margin:0;padding:0;
	aspect-ratio:var(--ia,1);object-fit:contain;object-position:50% 50%;
	transform:translateX(calc(var(--cx,.5)*-100%));transform-origin:50% 100%;
	mix-blend-mode:darken;z-index:1}
@media (min-width:1024px){.shs-bp.shs-bh:not(.is-dark) .shs-bp__hero .shs-bh__img{--z:var(--s,1)}}
/* true cut-outs need no blending; a whisper of contact shadow grounds them on the page */
.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage .shs-bh__img[data-bh-cut="1"]{mix-blend-mode:normal;filter:drop-shadow(0 10px 9px rgba(17,17,17,.07))}

/* plain hero: phone and tablet show the first image only (as live) */
@media (max-width:1023px){
	.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage .shs-bh__img:nth-child(n+2){display:none}
	.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage .shs-bh__img{--sw:.94}
}
@media (min-width:750px) and (max-width:1023px){
	.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage .shs-bh__img{--sw:.8}
}
/* plain hero, desktop: one, two or three subjects on the same floor; the second image is the lead and stands in front */
@media (min-width:1024px){
	.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage .shs-bh__img{display:block;--sw:.72}
	.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage-set[data-bh-n="2"] .shs-bh__img:nth-child(1){--sx:.27;--sw:.38;--ss:.92;z-index:1}
	.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage-set[data-bh-n="2"] .shs-bh__img:nth-child(2){--sx:.72;--sw:.42;z-index:2}
	.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage-set[data-bh-n="3"] .shs-bh__img:nth-child(1){--sx:.19;--sw:.3;--ss:.88;z-index:1}
	.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage-set[data-bh-n="3"] .shs-bh__img:nth-child(2){--sx:.5;--sw:.38;z-index:2}
	.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage-set[data-bh-n="3"] .shs-bh__img:nth-child(3){--sx:.81;--sw:.3;--ss:.88;z-index:1}
	.shs-bp.shs-bh:not(.is-dark) .shs-bp__stage-set[data-bh-n="3"] .shs-bh__img:nth-child(n+4){display:none}
}

/* brand identity hero: the artwork area already rises above the panel (live); the same floor rule now sets where it stands.
   The area is its own size container (its width is a per-brand share of the hero), all artwork is cut out, so no blending. */
.shs-bp.shs-bh.shs-bi-on .shs-bi__art{container-type:inline-size;--bh-W:100cqw;--bh-box:9}
.shs-bp.shs-bh.shs-bi-on .shs-bi__art-set{
	--bh-hmax:calc(100% + var(--bh-out)*(var(--bh-D) - var(--bh-top)) - (1 - var(--bh-out))*24%);
	--bh-floor:calc(var(--bh-out)*var(--bh-D) - (1 - var(--bh-out))*9%)}
.shs-bp.shs-bh.shs-bi-on .shs-bp__hero .shs-bi__art-img.shs-bh__img{--sx:.47;--sw:.9;mix-blend-mode:normal;filter:none}
/* the live soft ground shadow moves from the area to the active artwork set, so it always lies on that set's floor */
.shs-bp.shs-bh.shs-bi-on .shs-bi__art:after{content:none}
.shs-bp.shs-bh.shs-bi-on .shs-bi__art-set[data-bh-n]:after{content:"";position:absolute;left:10%;right:14%;bottom:calc(0px - var(--bh-floor) - 9px);height:18px;border-radius:50%;background:radial-gradient(closest-side,rgba(0,0,0,.34),transparent);filter:blur(4px);z-index:0;pointer-events:none}
@media (min-width:1024px){.shs-bp.shs-bh.shs-bi-on .shs-bi__art-set[data-bh-n]:after{bottom:calc(0px - var(--bh-floor) - 13px);height:26px}}

/* ---------------- 0.9.52 brand pages: a steady hero ----------------
   Owner report (iPhone, XKAH): the hero picture changed size between All, Pro and Lite, stood out of the panel at the top, and the
   Lite photograph sat on a white box over the text. Three rules, for every brand page with line buttons (class shs-bp--steady,
   added by SHS_Brand_Pages::hero_stable):
   1. The intro text and the small heading of every line share one cell; only the chosen one is visible. The hero therefore keeps
      the height of its longest text, and the artwork, which is sized from the hero, keeps its size and place. */
.shs-bp--steady .shs-bp__leads,.shs-bp--steady .shs-bp__eyebrows{display:grid;grid-template-columns:minmax(0,1fr)}
.shs-bp--steady .shs-bp__leads>.shs-bp__lead,.shs-bp--steady .shs-bp__eyebrows>.shs-bp__eyebrow{grid-area:1/1;display:block!important;visibility:hidden}
/* 2. Phones: a tall subject keeps 12px of panel above it (it used to pass the top edge by a few pixels on a short hero).
      It still stands on the floor line just below the panel, as designed. */
@media (max-width:749px){
	.shs-bp.shs-bh.shs-bi-on .shs-bi__art-set{--bh-hmax:calc(100% - var(--bh-out)*(var(--bi-lift-m,14px) + 12px - var(--bh-D)) - (1 - var(--bh-out))*24%)}
}
/* 3. A line whose picture is a photograph on a white ground is framed: one tile of a fixed size in the brand's tile tone, the
      photograph blended into it, centred in the picture column and always clear of the text. No bare white box on the panel. */
.shs-bi-on .shs-bi__art-set--tile{--bh-tl:var(--bi-lift-m,14px)}
.shs-bi-on .shs-bi__tile{position:absolute;right:16px;top:calc(var(--bh-tl) + (100% - var(--bh-tl))/2);width:calc(100% - 48px);max-height:calc(100% - var(--bh-tl) - 32px);aspect-ratio:1;transform:translateY(-50%);
	border-radius:var(--bp-r,8px);background:var(--bi-tile,#f4f4f4);overflow:hidden;box-shadow:0 12px 28px rgba(0,0,0,.2)}
.woocommerce-page .shs-bi__tile .shs-bi__tile-img,.shs-bi__tile .shs-bi__tile-img{position:static;display:block;width:100%;height:100%;max-width:none;padding:7%;object-fit:contain;object-position:50% 50%;mix-blend-mode:multiply;transform:none;filter:none}
.shs-bi__art:has(.shs-bi__art-set--tile):after{content:none}
@media (min-width:750px){
	.shs-bi-on .shs-bi__art-set--tile{--bh-tl:28px}
	.shs-bi-on .shs-bi__tile{right:32px;width:min(calc(100% - 72px),300px)}
}
@media (min-width:1024px){
	.shs-bi-on .shs-bi__art-set--tile{--bh-tl:var(--bi-lift,44px)}
	.shs-bi-on .shs-bi__tile{right:14%;width:min(62%,380px)}
}
