@layer componenti {
/* Full-bleed hero: the ONE place for the hero of the home (.hf.hf-home), the trade pages and the price guides
   (.hf.hf-inner), their deep-navy scrim and the header that sits transparent over them.
   Loaded by App.razor after vetrina.css (and after home4.css on the home): selectors start with "html body" to stay
   above the page sheets. Change the hero here, never in the page sheets.

   Desktop (>= 1024): the photo or video covers the WHOLE width, edge to edge (no navy block, no seam). Legibility comes
   from one wide scrim: navy at ~86% on the far left, still ~68% at the right edge of the text column (--hf-T, so white
   text keeps AA contrast over the brightest frames) and 0 twelve viewport-percent further (55-60% of the width), plus
   a header band on top and a soft vignette at the bottom. The text column starts on the header column (--gx).
   Faces stay out of the text: on the home the video is placed with a length object-position (--hf-l) computed from the
   frame sheets (leftmost face of every scene at source x 0.52, rightmost face edge at 0.90); on the inner pages every photo is framed the same way (right of the text column, focus point from Foto.cs).
   Checked by verifica/hero-fullbleed/check_hero.py at 1024/1100/1280/1440/1920/2560. */

:root{                   /* #041B37 */                       /* header height */                         /* staging banner above the header */                         /* bottom corners of the desktop stage */
}
body:has(.avviso-cat){--hf-av:47px}
@media (min-width:1024px){body:has(.avviso-cat){--hf-av:31px}}

/* ======================================== shared: stage, scrim, text colour ======================================== */
html body .hf{position:relative;margin-top:calc(var(--hf-top) * -1);isolation:isolate}
html body .hf .hf-media{position:absolute;top:0;left:0;right:0;height:var(--hf-h);margin:0;z-index:0;overflow:hidden;
  border-radius:0;background:none;box-shadow:none;aspect-ratio:auto}
html body .hf .hf-media img,html body .hf .hf-media video{display:block;width:100%;height:100%;object-fit:cover}
html body .hf .hf-scrim{position:absolute;top:0;left:0;right:0;height:var(--hf-h);z-index:1;pointer-events:none}
html body .hf .hf-in{position:relative;z-index:2;color:#fff}
html body .hf .hf-in h1{color:#fff}
html body .hf .hf-sent{position:absolute;top:0;left:0;width:1px;height:calc(var(--hf-top) + 24px);pointer-events:none;visibility:hidden}
/* captions and pause button: pill of 44, radius 22 (concentric with the 44 px pause circle beside it) */
html body .hf :is(.hx-dida,figcaption){border-radius:var(--r-pill);min-height:32px;display:flex;align-items:center}

/* ============================================== header over the hero ============================================== */
/* transparent while the hero is under it (html.hf-on: only while vetrina.js runs, else it would stay transparent over
   white content); solid again once the page scrolls (.hf-solid) or the phone menu is open. Colours only: CLS 0 */
html body .top,html body .top :is(.logo,.nav a,.tema,.tasto-s,.menu-t){transition:background-color var(--d-3,240ms) var(--c-entra,ease),border-color var(--d-3,240ms) var(--c-entra,ease),color var(--d-3,240ms) var(--c-entra,ease)}
html.hf-on body:has(.hf):not(:has(.menu-m:popover-open)) .top:not(.hf-solid){background:transparent!important;border-bottom-color:transparent;-webkit-backdrop-filter:none;backdrop-filter:none;color:#fff}
html.hf-on body:has(.hf):not(:has(.menu-m:popover-open)) .top:not(.hf-solid) :is(.logo,.logo small,.tema,.nav a,.nav a[aria-current]){color:#fff}
html.hf-on body:has(.hf):not(:has(.menu-m:popover-open)) .top:not(.hf-solid) .nav a:not([aria-current]){color:rgba(255,255,255,.88)}
html.hf-on body:has(.hf):not(:has(.menu-m:popover-open)) .top:not(.hf-solid) .tasto-s.bordo{color:#fff;border-color:rgba(255,255,255,.55);background:transparent}
html.hf-on body:has(.hf):not(:has(.menu-m:popover-open)) .top:not(.hf-solid) .tasto-s.bordo:hover{background:rgba(255,255,255,.12);border-color:#fff}
html.hf-on body:has(.hf):not(:has(.menu-m:popover-open)) .top:not(.hf-solid) .menu-t{color:#fff;background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.32)}
html.hf-on body:has(.hf):not(:has(.menu-m:popover-open)) .top:not(.hf-solid) :is(a,button):focus-visible{outline:2px solid #fff;outline-offset:2px}
@media (prefers-reduced-motion:reduce){html body .top,html body .top :is(.logo,.nav a,.tema,.tasto-s,.menu-t){transition:none}}
/* the page scrollbar: with classic (non-overlay) scrollbars the default grey thumb on its light track sat beside the
   dark hero like a stray tab at the right edge. Thin, and a quiet thumb on a transparent track in both themes */
html{scrollbar-width:thin;scrollbar-color:rgba(16,22,31,.28) transparent}
html[data-tema="scuro"]{scrollbar-color:rgba(255,255,255,.28) transparent}

/* ====================================================== HOME ====================================================== */
html body .hf.hf-home{--hf-h:max(560px,calc(100svh - var(--hf-av)));display:block;min-height:0;padding:0}
html body .hf-home .e4-scena{top:0;left:0;right:0;bottom:auto;height:var(--hf-h);border:0;border-radius:0;background:rgb(var(--hf-navy))}
html body .hf-home .hf-media{-webkit-mask-image:none;mask-image:none}
html body .hf-home .hx-eroe-img{object-position:50% 0}
html body .hf-home .e4-video{object-position:50% 0}
/* phone scrim: header band on top, deep navy from the bottom where title and controls sit */
html body .hf-home .hf-scrim{background:
  linear-gradient(180deg,rgba(var(--hf-navy),.8) 0,rgba(var(--hf-navy),.35) 96px,rgba(var(--hf-navy),0) 170px),
  linear-gradient(0deg,rgba(var(--hf-navy),.94) 0,rgba(var(--hf-navy),.88) 30%,rgba(var(--hf-navy),.5) 40%,rgba(var(--hf-navy),0) 50%)}
/* caption + pause: phone top right under the header, clear of the title; desktop bottom right on the column edge */
html body .hf.hf-home .e4-ctl{top:calc(var(--hf-top) + 12px);bottom:auto;right:var(--m)}
html body .hf-home .hf-cue{display:none}
html body .hf-home .hf-in{padding:0 var(--m)}
html body .hf-home .hf-tx{max-width:none}
html body .hf-home .hf-first{min-height:var(--hf-h);box-sizing:border-box;display:flex;flex-direction:column;justify-content:flex-end;padding:calc(var(--hf-top) + var(--sp-6)) 0 var(--sp-5)}
html body .hf-home h1{font-size:var(--t-display);line-height:.96;letter-spacing:-.015em;margin:0;max-width:none;width:auto;text-wrap:balance}
html body .hf-home .hf-more{padding:var(--s5) 0 var(--s2);color:var(--ink)}
html body .hf-home .hf-more .hx-sotto{margin:0;color:var(--t2)}

/* ---- controls: ONE search field with the yellow arrow, the voice action as a separate glass button (no box around
   them). Both 60 tall, radius 30; the round arrow and the round mic (44) sit 8 px from the edge: 22 + 8 = 30 ---- */
html body .hf .hf-azioni{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;align-content:flex-start;gap:var(--sp-3);margin:var(--sp-5) 0 0;padding:0;width:auto;max-width:none;background:none;border:0;border-radius:0;box-shadow:none}
html body .hf .hf-azioni .barra-w{flex:1 1 280px;min-width:0}
html body .hf .hf-azioni .barra{height:60px;border-radius:var(--r-pill);padding:0 var(--sp-2) 0 var(--sp-5);background:#fff;border:0;
  box-shadow:0 1px 2px rgba(0,0,0,.12),0 12px 32px rgba(0,0,0,.22)}
html body .hf .hf-azioni .barra .campo-in{color:#10161F;font-size:var(--t-body)}
html body .hf .hf-azioni .barra .campo-in::placeholder{color:#5B6575}
html body .hf .hf-azioni .barra>.hx-lente{color:#5B6575}
html body .hf .hf-azioni .barra:focus-within{box-shadow:0 0 0 3px rgba(255,255,255,.6),0 12px 32px rgba(0,0,0,.22)}
html body .hf .hf-azioni .barra .invia{width:44px;height:44px;aspect-ratio:auto;border-radius:var(--r-pill);flex:none;background:var(--giallo);color:#1A1A1A}
html body .hf .hf-azioni .barra .invia:hover{background:var(--giallo-h)}
html body .hf .hf-azioni .hx-parla{flex:1 1 100%;width:auto;height:60px;border-radius:var(--r-pill);padding:0 var(--sp-6) 0 var(--sp-2);gap:var(--sp-3);
  background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.32);color:#fff;
  -webkit-backdrop-filter:blur(14px) saturate(1.3);backdrop-filter:blur(14px) saturate(1.3)}
html body .hf .hf-azioni .hx-parla:hover{background:rgba(255,255,255,.2);border-color:rgba(255,255,255,.5);opacity:1}
html body .hf .hf-azioni .hx-parla:focus-visible{outline:2px solid #fff;outline-offset:3px}
html body .hf .hf-azioni .hx-parla .mic{width:42px;height:42px;aspect-ratio:auto;border-radius:var(--r-pill);background:#fff;color:rgb(var(--hf-navy))}
html body .hf .hf-azioni .hx-parla b{color:#fff}
html body .hf .hf-azioni .hx-parla small{color:rgba(255,255,255,.78)}

/* ---- trust ticks: one icon colour, icon centred on the x-height of the first line ---- */
html body .hf-home .hx-fatti{display:grid;gap:var(--sp-2);margin:var(--sp-5) 0 0;padding:0;list-style:none;font-size:var(--t-small);line-height:20px;color:var(--t2)}
html body .hf-home .hx-fatti li{display:grid;grid-template-columns:16px minmax(0,1fr);column-gap:var(--sp-2);align-items:start}
html body .hf-home .hx-fatti .ico{width:16px;height:16px;margin-top:var(--sp-1);color:var(--ok)}
/* ---- chips: one row that scrolls sideways, fading out on the right ---- */
html body .hf-home .hx-pillole{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;gap:var(--sp-2);margin:var(--sp-5) calc(var(--m) * -1) 0;padding:0 var(--m);
  -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 48px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 48px),transparent)}

@media (min-width:1024px){
  html body .hf.hf-home{
    --hf-h:clamp(600px,100svh - var(--hf-av),1000px);
    --hf-tx:min(600px,40cqw);                                       /* text column */
    --hf-T:calc(var(--gx) + var(--hf-tx));                          /* its right edge */
    /* video (16:9) drawn at cover size; left edge as far right as the rightmost face (0.90) allows, never leaving a
       gap on either side. Poster (3:2, rightmost face 0.80) the same way */
    --hf-vw:max(100cqw,1.7778 * var(--hf-h));
    --hf-l:max(100cqw - var(--hf-vw),min(0px,100cqw - 16px - .9 * var(--hf-vw)));
    --hf-pw:max(100cqw,1.5 * var(--hf-h));
    --hf-pl:max(100cqw - var(--hf-pw),min(0px,100cqw - 16px - .8 * var(--hf-pw)));
    min-height:var(--hf-h)}
  html body .hf-home .e4-scena{border-radius:0 0 var(--hf-r) var(--hf-r);overflow:hidden}
  html body .hf-home .hf-media{left:0;right:0;-webkit-mask-image:none;mask-image:none}
  html body .hf-home .hx-eroe-img{object-position:var(--hf-pl) 20%}
  html body .hf-home .e4-video{object-position:var(--hf-l) 10%}
  /* header band, bottom vignette, then the wide left-to-right fade (see the header comment) */
  html body .hf .hf-scrim{background:linear-gradient(180deg,rgba(var(--hf-navy),.72) 0,rgba(var(--hf-navy),.5) calc(var(--hf-top) + var(--hf-av)),rgba(var(--hf-navy),0) calc(var(--hf-top) + var(--hf-av) + 160px)),
      linear-gradient(0deg,rgba(var(--hf-navy),.5) 0,rgba(var(--hf-navy),0) 200px),
      linear-gradient(90deg,rgba(var(--hf-navy),.86) 0,rgba(var(--hf-navy),.82) calc(var(--hf-T) * .6),rgba(var(--hf-navy),.68) var(--hf-T),
        rgba(var(--hf-navy),.34) calc(var(--hf-T) + 5cqw),rgba(var(--hf-navy),0) calc(var(--hf-T) + 12cqw))}
  html body .hf.hf-home .e4-ctl{top:auto;bottom:24px;right:var(--gx)}
  html body .hf-home .hf-cue{display:block;position:absolute;z-index:3;left:var(--gx);bottom:24px;width:24px;height:38px;box-sizing:border-box;
    border:1.5px solid rgba(255,255,255,.6);border-radius:var(--r-md);pointer-events:none}
  html body .hf-home .hf-cue::before{content:"";position:absolute;left:50%;top:7px;width:3px;height:7px;margin-left:-1.5px;border-radius:var(--r-xs);background:#fff}
  html body .hf-home .hf-in{min-height:var(--hf-h);box-sizing:border-box;display:flex;align-items:center;padding:calc(var(--hf-top) + var(--hf-av) + var(--sp-6)) 0 var(--sp-24) var(--gx)}
  html body .hf-home .hf-tx{width:var(--hf-tx);display:flex;flex-direction:column}
  html body .hf-home :is(.hf-first,.hf-more){display:contents}
  html body .hf-home h1{order:1;font-size:var(--t-hero);line-height:.94;text-shadow:0 1px 24px rgba(var(--hf-navy),.35)}
  html body .hf-home .hf-more .hx-sotto{order:2;margin:var(--sp-4) 0 0;font-size:var(--t-body-lg);line-height:var(--lh-body-lg);color:rgba(255,255,255,.92);max-width:none}
  html body .hf-home .hf-azioni{order:3;margin-top:var(--sp-8)}
  html body .hf-home .hf-azioni .hx-parla{flex:0 0 auto}
  html body .hf-home .hx-pillole{order:4;margin:var(--sp-5) 0 0;padding:0;flex-wrap:wrap;overflow:visible;-webkit-mask-image:none;mask-image:none}
  html body .hf-home .hx-pillole-e{color:rgba(255,255,255,.88)}
  html body .hf-home .hx-pillole .pillola{background:rgba(255,255,255,.1);border-color:rgba(255,255,255,.34);color:#fff;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
  html body .hf-home .hx-pillole .pillola:hover{background:rgba(255,255,255,.2);border-color:#fff}
  html body .hf-home .hx-pillole .pillola:focus-visible{outline:2px solid #fff;outline-offset:2px}
  html body .hf-home .hx-fatti{order:5;color:rgba(255,255,255,.92)}
  html body .hf-home .hx-fatti .ico{color:#8FE3B4}
}
/* short desktop heroes (1024-1279): tighter vertical rhythm so everything fits in the 640 px stage */
@media (min-width:1024px) and (max-width:1279.98px){
  /* the content fills the short stage: no room for the scroll cue under the ticks */
  html body .hf-home .hf-cue{display:none}
  html body .hf-home .hx-fatti{gap:var(--sp-1)}
  html body .hf-home .hf-in{padding-top:calc(var(--hf-top) + var(--sp-4));padding-bottom:var(--sp-12)}
  html body .hf-home .hf-more .hx-sotto{font-size:var(--t-body)}
  html body .hf-home .hf-azioni{margin-top:var(--sp-5)}
  html body .hf-home :is(.hx-pillole,.hx-fatti){margin-top:var(--sp-4)}
}
@media (prefers-reduced-motion:no-preference){
  html:not(.ridotto) body .hf-home .hf-cue::before{animation:hf-cue 2.4s var(--c-lusso,ease) infinite}
}
@keyframes hf-cue{0%{opacity:0;transform:translateY(0)}20%{opacity:1}70%{opacity:0;transform:translateY(10px)}100%{opacity:0}}

/* ================================================ INNER PAGES ================================================ */
/* trade pages (/servizi/{slug}) and price guides (/prezzi/{trade}/{job}): same stage, shorter. Photo on the right of
   the text column with a soft left edge (people are never under the text), title at the bottom on the column */
html body .pg-testa.hf.hf-inner{--hf-h:clamp(440px,64svh,560px);display:block;padding:0;border-bottom:0}
html body .hf-inner::before{content:"";position:absolute;top:0;left:0;right:0;height:var(--hf-h);background:rgb(var(--hf-navy));z-index:0}
html body .hf-inner .hf-media{grid-area:auto}
html body .hf-inner .hf-media::after{display:none}
html body .hf-inner .hf-scrim{background:
  linear-gradient(180deg,rgba(var(--hf-navy),.62) 0,rgba(var(--hf-navy),0) 140px),
  linear-gradient(0deg,rgba(var(--hf-navy),.9) 0,rgba(var(--hf-navy),.66) 38%,rgba(var(--hf-navy),0) 70%)}
/* caption sits after the scrim in the markup, so it is never dimmed by it */
html body .hf-inner > :is(.hx-dida,figcaption){position:absolute;z-index:3;left:auto;right:var(--m);top:calc(var(--hf-top) + 12px);bottom:auto}
html body .hf-inner .hf-in{min-height:var(--hf-h);box-sizing:border-box;display:flex;flex-direction:column;justify-content:flex-end;padding-top:calc(var(--hf-top) + var(--sp-6));padding-bottom:var(--s7)}
html body .hf-inner .hf-in :is(.pg-bric,.pg-bric a){color:#fff}
html body .hf-inner .hf-in .pg-bric li+li::before{color:rgba(255,255,255,.75)}
html body .hf-inner .hf-in h1{font-size:var(--t-display);line-height:.96;max-width:none;margin-top:var(--s3)}
/* price guide below the stage: answer, range, actions (the trade page keeps its own panel) */
html body .gp-eroe .gp-testa{display:block;padding-top:var(--s5)}
html body .gp-eroe .gp-tx{max-width:760px}

@media (min-width:1024px){
  html body .pg-testa.hf.hf-inner{
    --hf-h:max(560px,70svh);
    --hf-tx:min(600px,40cqw);
    --hf-T:calc(var(--gx) + var(--hf-tx))}
  /* the stage (backdrop, photo, scrim) ends with rounded corners; the intro follows as its own section */
  html body .hf-inner::before{border-radius:0 0 var(--hf-r) var(--hf-r)}
  html body .hf-inner .hf-media{right:0;border-radius:0 0 var(--hf-r) var(--hf-r);background:rgb(var(--hf-navy))}
  html body .hf-inner .hf-scrim{background:linear-gradient(180deg,rgba(var(--hf-navy),.72) 0,rgba(var(--hf-navy),.5) calc(var(--hf-top) + var(--hf-av)),rgba(var(--hf-navy),0) calc(var(--hf-top) + var(--hf-av) + 160px)),
      linear-gradient(0deg,rgba(var(--hf-navy),.5) 0,rgba(var(--hf-navy),0) 200px),
      linear-gradient(90deg,rgba(var(--hf-navy),.86) 0,rgba(var(--hf-navy),.82) calc(var(--hf-T) * .6),rgba(var(--hf-navy),.68) var(--hf-T),
        rgba(var(--hf-navy),.34) calc(var(--hf-T) + 5cqw),rgba(var(--hf-navy),0) calc(var(--hf-T) + 12cqw));border-radius:0 0 var(--hf-r) var(--hf-r)}
  /* one rule for every photo: no manual crop per photo. The photo fills the part of the stage to the right of the text
     column and is framed on its own focus point (Foto.cs: Punto, written inline on the img), so a new image only needs
     its point. The scrim softens the seam with the text column. */
  html body .hf-inner .hf-media{left:calc(var(--hf-T) - 14cqw);-webkit-mask-image:linear-gradient(90deg,transparent,#000 12cqw);mask-image:linear-gradient(90deg,transparent,#000 12cqw)}
  html body .hf-inner .hf-media img{animation:none}
  /* caption: bottom left on the scrim, under the text column, so it never touches the person in the photo */
  html body .hf-inner > :is(.hx-dida,figcaption){top:calc(var(--hf-h) - 56px);bottom:auto;right:auto;left:var(--gx)}
  html body .hf-inner .hf-in{width:auto;max-width:none;margin:0;padding:calc(var(--hf-top) + var(--hf-av) + var(--sp-6)) var(--gx) var(--sp-24)}
  html body .hf-inner .hf-in :is(h1,p,.pg-bric){max-width:var(--hf-tx)}
  html body .hf-inner .hf-in h1{font-size:var(--t-hero);line-height:.95;letter-spacing:-.02em;margin-top:var(--s4);text-wrap:balance;
    text-shadow:0 1px 24px rgba(var(--hf-navy),.35)}
  html body .hf-inner .hf-in .ms-conta{max-width:none;width:fit-content;white-space:nowrap;margin-top:var(--s4);font-size:var(--t-body-lg);color:rgba(255,255,255,.94)}
  /* intro: a clean section under the stage, on the column, with generous room */
  html body .hf-inner .ms-pannello{margin:0;padding:var(--s7,var(--sp-12)) 0 0;border-radius:0;max-width:none;background:none;box-shadow:none}
  html[data-tema="scuro"] body .hf-inner .ms-pannello{background:none;box-shadow:none}
  html body .hf-inner .ms-pannello .pg-sotto{max-width:760px;font-size:var(--t-body-lg);line-height:var(--lh-body-lg)}
  html body .gp-eroe .gp-testa{padding-top:var(--s7,var(--sp-12))}
}

}
