@layer componenti {
/* Job cards on the trade pages ("Cosa puoi chiedere"): balanced masonry of photo cards, Pinterest-like, without JS.
   The server (JobMasonry.cs) gives every card a column and a span per layout: --ca/--sa phones (<640, 2 columns),
   --cb/--sb tablets (640-1023, 2), --cc/--sc from 1024 (3), --cd/--sd from 1440 (4); --na..--nd are the column counts
   (fewer when a trade has few jobs). The row unit is 1/24 of the column width (container query units on .jc-wrap), so
   spans scale with the cards and all columns end on the same grid line. Cards are placed in DOM order (row by row:
   reading and keyboard order follow it); the photo fills what the title leaves (object-fit: cover). The card size never
   depends on the image: no layout shift. Radii are concentric: card 18 = photo 11 + 6 inner padding + 1 border.
   Motion only through moto.css tokens. Loaded from Mestiere.razor next to the list (below the fold), so it never
   blocks the hero photo (LCP). */

.jc-wrap{container-type:inline-size;margin:var(--s5) 0 0}
.jc-grid{--n:var(--na,2);--g:var(--s3);list-style:none;margin:0;padding:0;display:grid;
  grid-template-columns:repeat(var(--n),minmax(0,1fr));column-gap:var(--g);row-gap:0;grid-auto-flow:row dense;
  grid-auto-rows:8px;grid-auto-rows:calc((100cqi - (var(--n) - 1) * var(--g)) / var(--n) / 24)}
.jc-item{display:flex;min-width:0;min-height:0;padding:0 0 var(--g);grid-column:var(--ca);grid-row:span var(--sa)}
@media (min-width:640px){
  .jc-grid{--n:var(--nb,2)}
  .jc-item{grid-column:var(--cb);grid-row:span var(--sb)}
}
@media (min-width:1024px){
  .jc-grid{--n:var(--nc,3);--g:var(--s4)}
  .jc-item{grid-column:var(--cc);grid-row:span var(--sc)}
}
@media (min-width:1440px){
  .jc-grid{--n:var(--nd,4)}
  .jc-item{grid-column:var(--cd);grid-row:span var(--sd)}
}

.jc-card{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:var(--sp-half);padding:var(--sp-2);border:1px solid var(--linea);border-radius:var(--r-xl);background:var(--sup);
  color:var(--ink);text-decoration:none;box-shadow:var(--om-1);-webkit-tap-highlight-color:transparent;
  transition:transform var(--d-3) var(--c-lusso),box-shadow var(--d-3) var(--c-lusso),border-color var(--d-2) var(--c-std)}
.jc-media{display:block;flex:1 1 0;min-height:48px;position:relative;overflow:hidden;border-radius:var(--r-md);background:var(--sup-3);isolation:isolate}
.jc-media img{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:cover;transition:transform var(--d-5) var(--c-lusso),opacity var(--d-3) var(--c-lusso)}
.jc-body{flex:none;display:flex;align-items:flex-start;justify-content:space-between;gap:var(--s2);min-height:44px;padding:var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-2)}
.jc-text{display:flex;flex-direction:column;gap:var(--sp-half);min-width:0}
.jc-n{font-size:var(--t-body);font-weight:600;line-height:var(--lh-body);overflow-wrap:break-word;hyphens:manual;text-wrap:balance}
.jc-p{font-size:var(--t-caption);line-height:var(--lh-caption);color:var(--t2);font-variant-numeric:tabular-nums}
.jc-body .ico{width:16px;height:16px;flex:none;margin-top:var(--sp-half);color:var(--t3);transition:transform var(--d-3) var(--c-lusso),color var(--d-2) var(--c-std)}
.jc-nofoto .jc-body{flex:1 1 auto;min-height:72px;padding:var(--sp-3) var(--sp-2)}
@media (min-width:1024px){.jc-n{font-size:var(--t-body)}}

/* hover (pointer devices only) and press: lift by --m-1, photo breathes in slowly, arrow nudges */
@media (hover:hover){
  .jc-card:hover{transform:translateY(calc(var(--m-1) * -1));box-shadow:var(--om-2);border-color:var(--linea-f)}
  .jc-card:hover .jc-media img{transform:scale(1.04)}
  .jc-card:hover .ico{transform:translateX(var(--m-1));color:var(--ink)}
  .jc-card:hover .jc-n{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px}
}
.jc-card:active{transform:scale(.98);box-shadow:var(--om-1);transition-duration:var(--d-1)}
.jc-card:focus-visible{outline:2px solid var(--ink);outline-offset:3px}

/* staggered entrance: each card rises like the other .mo-sale blocks (moto.css §4), offset by its column
   (--k = column in the 4-column layout). Scroll-linked where animation-timeline exists, otherwise comune.js adds .mo-in once. */
@supports (animation-timeline:view()){
  @media (prefers-reduced-motion:no-preference){
    html:not(.ridotto) .jc-item.mo-sale{animation-range:entry calc(var(--k,0) * 6%) entry calc(55% + var(--k,0) * 6%)}
  }
}
html.mo-io .jc-item.mo-in{transition-delay:calc(var(--k,0) * var(--passo))}

/* dark theme: photos slightly dimmed like the other photos of the site (v2.css img.fx) */
html[data-tema="scuro"] .jc-card{box-shadow:none}
@media (hover:hover){html[data-tema="scuro"] .jc-card:hover{box-shadow:0 10px 28px rgba(0,0,0,.35)}}

/* reduced motion: no lift, no zoom, no entrance */
@media (prefers-reduced-motion:reduce){
  .jc-card,.jc-media img,.jc-body .ico{transition:none}
  .jc-card:hover,.jc-card:active,.jc-card:hover .jc-media img,.jc-card:hover .ico{transform:none}
  .jc-item.mo-sale{animation:none;opacity:1;transform:none}
}
html.ridotto .jc-card,html.ridotto .jc-media img,html.ridotto .jc-body .ico{transition:none}
html.ridotto .jc-card:hover,html.ridotto .jc-card:active,html.ridotto .jc-card:hover .jc-media img,html.ridotto .jc-card:hover .ico{transform:none}
html.ridotto .jc-item.mo-sale{animation:none;opacity:1;transform:none}

}
