.ws-gallery{
  --ws-accent:var(--e-global-color-primary,#f15a29);
  --ws-video:#2757c7;
  --ws-ink:var(--e-global-color-text,#17202a);
  --ws-heading:var(--e-global-color-secondary,var(--ws-ink));
  --ws-muted:color-mix(in srgb,var(--ws-ink) 62%,transparent);
  --ws-surface:#fff;
  --ws-radius:18px;
  --ws-grid-gap:18px;
  --ws-columns:3;
  width:100%;color:var(--ws-ink)
}
.ws-gallery *{box-sizing:border-box}
.ws-gallery__title{margin:0 0 28px;color:var(--ws-heading);font-weight:760;letter-spacing:-.035em}
.ws-gallery__toolbar{display:flex;justify-content:flex-end;width:100%;margin:0 0 10px}
.ws-gallery__reset{display:inline-flex;align-items:center;gap:5px;min-height:34px;padding:0 3px;color:var(--ws-ink);font-size:.9rem;font-weight:740;line-height:1;text-decoration:none;transition:color .2s ease,transform .2s ease}
.ws-gallery__reset:hover,.ws-gallery__reset:focus-visible{color:var(--ws-accent);transform:translateY(-1px)}
.ws-gallery__reset:focus-visible{outline:2px solid currentColor;outline-offset:4px;border-radius:4px}
.ws-gallery__filters{display:flex;align-items:flex-end;justify-content:space-between;gap:18px 28px;flex-wrap:wrap;margin:0 0 34px;padding:0;border:0;background:transparent}
.ws-gallery__filter-group{display:flex;align-items:center;gap:12px 16px;flex-wrap:wrap}
.ws-gallery__filter-label{width:100%;margin:0;color:var(--ws-ink);font-size:.76rem;font-weight:780;letter-spacing:.09em;text-transform:uppercase;line-height:1.2}
.ws-gallery__choices{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.ws-gallery__choice{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:11px 21px;border:1.5px solid rgba(23,32,42,.18);border-radius:999px;background:#fff;color:var(--ws-ink);font-size:.9rem;font-weight:750;line-height:1;text-decoration:none;transition:transform .2s ease,box-shadow .2s ease,background .2s ease,color .2s ease,border-color .2s ease}
.ws-gallery__choice:hover,.ws-gallery__choice:focus-visible{transform:translateY(-2px);box-shadow:0 8px 20px rgba(20,29,38,.09)}
.ws-gallery__choice:nth-child(1),.ws-gallery__choice:nth-child(2){color:#ef5d25;border-color:#ef5d25}
.ws-gallery__choice:nth-child(3){color:var(--ws-video);border-color:var(--ws-video)}
.ws-gallery__choice:nth-child(1):not(.is-active):hover,.ws-gallery__choice:nth-child(2):not(.is-active):hover{background:#fff3ed}
.ws-gallery__choice:nth-child(3):not(.is-active):hover{background:#f0f4ff}
.ws-gallery__choice:nth-child(1).is-active,.ws-gallery__choice:nth-child(2).is-active{background:#ef5d25;color:#fff}
.ws-gallery__choice:nth-child(3).is-active{background:var(--ws-video);color:#fff}
.ws-gallery__select-wrap{position:relative;display:inline-flex;min-width:165px}
.ws-gallery__year-select{appearance:none;width:100%;min-height:44px;padding:11px 44px 11px 17px;border:1.5px solid rgba(23,32,42,.25);border-radius:999px;background:#fff;color:var(--ws-ink);font:inherit;font-size:.9rem;font-weight:750;cursor:pointer;transition:border-color .2s ease,box-shadow .2s ease,transform .2s ease}
.ws-gallery__year-select:hover,.ws-gallery__year-select:focus{border-color:var(--ws-ink);box-shadow:0 8px 20px rgba(20,29,38,.09);transform:translateY(-1px)}
.ws-gallery__year-select:focus-visible{outline:2px solid var(--ws-ink);outline-offset:3px}
.ws-gallery__select-arrow{position:absolute;right:18px;top:50%;width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;pointer-events:none;transform:translateY(-70%) rotate(45deg)}

/* Editorial mosaic with chronological rows; CSS grid is the fallback before JS positioning. */
.ws-gallery__grid{display:grid;grid-template-columns:repeat(var(--ws-columns),minmax(0,1fr));grid-auto-flow:row;align-items:start;gap:var(--ws-grid-gap);width:100%}
.ws-gallery__card{position:relative;display:block;min-width:0;width:100%;margin:0;aspect-ratio:4/5;overflow:hidden;break-inside:avoid;border:0;border-radius:var(--ws-radius);background:#101418;box-shadow:0 10px 32px rgba(10,18,25,.10);isolation:isolate;content-visibility:auto;contain-intrinsic-size:380px;opacity:0;transform:translateY(18px);transition:opacity .55s ease,transform .55s cubic-bezier(.2,.7,.2,1),box-shadow .4s ease}
.ws-gallery__card.is-visible{opacity:1;transform:none}
.ws-gallery__card:nth-child(6n+1){aspect-ratio:4/5}
.ws-gallery__card:nth-child(6n+2){aspect-ratio:1/1}
.ws-gallery__card:nth-child(6n+3){aspect-ratio:5/4}
.ws-gallery__card:nth-child(6n+4){aspect-ratio:3/4}
.ws-gallery__card:nth-child(6n+5){aspect-ratio:16/11}
.ws-gallery__card:nth-child(6n){aspect-ratio:1/1}
.ws-gallery__grid.is-mosaic{position:relative;display:block}
.ws-gallery__grid.is-mosaic>.ws-gallery__card{position:absolute;top:var(--ws-card-top);left:var(--ws-card-left);width:var(--ws-card-width);height:var(--ws-card-height)}

.ws-gallery__card:hover{box-shadow:0 22px 52px rgba(12,20,27,.18)}
.ws-gallery__card-link{position:absolute;inset:0;display:block;color:inherit;text-decoration:none}
.ws-gallery__card-link:focus-visible{outline:3px solid #fff;outline-offset:-6px;border-radius:inherit}
.ws-gallery__media{position:absolute;inset:0;overflow:hidden;background:#e9ecef}
.ws-gallery__image,.ws-gallery__media>img{position:absolute!important;inset:0!important;display:block!important;width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;margin:0!important;padding:0!important;object-fit:cover!important;transform:scale(1.001);transition:transform .85s cubic-bezier(.2,.65,.2,1),filter .55s ease}
.ws-gallery__card:hover .ws-gallery__image,.ws-gallery__card:hover .ws-gallery__media>img{transform:scale(1.075);filter:saturate(1.08) contrast(1.02)}
.ws-gallery__placeholder{position:absolute;inset:0;background:linear-gradient(135deg,#ebe9e4,#d6d8da)}
.ws-gallery__shade{position:absolute;z-index:1;inset:0;background:linear-gradient(180deg,rgba(4,7,10,.05) 0%,rgba(4,7,10,.01) 42%,rgba(4,7,10,.22) 67%,rgba(4,7,10,.88) 100%);transition:background .4s ease}
.ws-gallery__card:hover .ws-gallery__shade{background:linear-gradient(180deg,rgba(4,7,10,.13) 0%,rgba(4,7,10,.04) 38%,rgba(4,7,10,.28) 66%,rgba(4,7,10,.91) 100%)}
.ws-gallery__media::after{content:"";position:absolute;z-index:2;inset:0;border:1px solid rgba(255,255,255,.18);border-radius:inherit;pointer-events:none}
.ws-gallery__badge{position:absolute;z-index:4;top:14px;left:14px;display:inline-flex;align-items:center;gap:7px;padding:8px 11px;border:1px solid rgba(255,255,255,.42);border-radius:999px;background:rgba(8,12,16,.42);color:#fff;font-size:.69rem;font-weight:800;letter-spacing:.04em;line-height:1;text-transform:uppercase;box-shadow:0 7px 20px rgba(0,0,0,.14);backdrop-filter:blur(8px)}
.ws-gallery__badge i{width:7px;height:7px;border-radius:50%;background:#ff6b2b;box-shadow:0 0 0 4px rgba(255,107,43,.16)}
.ws-gallery__card--video .ws-gallery__badge i{background:#6f93ff;box-shadow:0 0 0 4px rgba(111,147,255,.17)}
.ws-gallery__visual-icon{position:absolute;z-index:4;top:50%;left:50%;display:grid;place-items:center;width:66px;height:66px;border:1px solid rgba(255,255,255,.72);border-radius:50%;background:rgba(7,11,15,.28);color:#fff;box-shadow:0 10px 30px rgba(0,0,0,.18);backdrop-filter:blur(6px);transform:translate(-50%,-50%) scale(.92);opacity:0;transition:opacity .32s ease,transform .4s cubic-bezier(.2,.75,.2,1),background .3s ease,color .3s ease}
.ws-gallery__visual-icon svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ws-gallery__visual-icon--play svg{width:25px;height:25px;margin-left:3px;fill:currentColor;stroke:none}
.ws-gallery__card--video .ws-gallery__visual-icon{opacity:1;transform:translate(-50%,-50%) scale(1)}
.ws-gallery__card:hover .ws-gallery__visual-icon{opacity:1;transform:translate(-50%,-50%) scale(1.07);background:#fff;color:#111}
.ws-gallery__content{position:absolute;z-index:3;right:0;bottom:0;left:0;padding:clamp(20px,2.6vw,32px);color:#fff;pointer-events:none;transform:translateY(4px);transition:transform .4s cubic-bezier(.2,.7,.2,1)}
.ws-gallery__card:hover .ws-gallery__content{transform:none}
.ws-gallery__date{display:block;margin:0 0 7px;color:rgba(255,255,255,.88)!important;font-size:.72rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase;text-shadow:0 2px 8px rgba(0,0,0,.55)}
.ws-gallery__card-title{max-width:25ch;margin:0;color:#fff!important;font-size:clamp(1.2rem,1.55vw,1.62rem);font-weight:760;line-height:1.08;letter-spacing:-.032em;text-wrap:balance;text-shadow:0 3px 12px rgba(0,0,0,.7)}
.ws-gallery__open-label{display:inline-flex;align-items:center;gap:8px;margin-top:12px;color:rgba(255,255,255,.9);font-size:.72rem;font-weight:780;letter-spacing:.055em;text-transform:uppercase;opacity:0;transform:translateY(7px);transition:opacity .3s ease,transform .35s ease}
.ws-gallery__open-label::after{content:"↗";font-size:1rem;line-height:1}
.ws-gallery__card:hover .ws-gallery__open-label{opacity:1;transform:none}
.ws-gallery__load-more-wrap{display:flex;justify-content:center;margin-top:clamp(30px,5vw,52px)}
.ws-gallery__load-more{position:relative;appearance:none;min-height:52px;padding:14px 28px;overflow:hidden;border:1px solid var(--ws-ink);border-radius:999px;background:transparent;color:var(--ws-ink);font:inherit;font-size:.84rem;font-weight:800;letter-spacing:.045em;cursor:pointer;transition:transform .25s ease,background .25s ease,color .25s ease,box-shadow .25s ease}
.ws-gallery__load-more:hover{transform:translateY(-3px);background:var(--ws-ink);color:#fff;box-shadow:0 14px 30px rgba(20,29,38,.18)}
.ws-gallery__load-more:disabled{opacity:.65;cursor:wait}
.ws-gallery__load-more span{position:relative;z-index:1}
.ws-gallery__empty{padding:34px;text-align:center;border:1px solid rgba(23,32,42,.1);border-radius:var(--ws-radius);background:#f7f7f5;color:var(--ws-muted)}
.ws-gallery__empty p{margin:0}
@media(max-width:1024px){.ws-gallery{--ws-columns:2}.ws-gallery__filters{align-items:stretch;justify-content:flex-start}.ws-gallery__filter-group{flex:1 1 100%}}
@media(max-width:640px){.ws-gallery{--ws-columns:1;--ws-grid-gap:16px}.ws-gallery__filters{margin-bottom:27px;gap:21px}.ws-gallery__filter-group{display:grid;width:100%;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.ws-gallery__filter-label{grid-column:1/-1}.ws-gallery__choices{display:contents}.ws-gallery__choice{min-height:43px;padding:10px 9px}.ws-gallery__filter-group--year{display:flex}.ws-gallery__filter-group--year .ws-gallery__select-wrap{width:min(100%,240px)}.ws-gallery__card:nth-child(n){aspect-ratio:4/5}.ws-gallery__card:nth-child(3n+2){aspect-ratio:1/1}.ws-gallery__content{padding:22px}.ws-gallery__visual-icon{width:58px;height:58px}.ws-gallery__open-label{opacity:1;transform:none}}
@media(max-width:430px){.ws-gallery__filter-group{grid-template-columns:1fr}.ws-gallery__choice{width:100%}.ws-gallery__filter-group--year .ws-gallery__select-wrap{width:100%}}
@media(prefers-reduced-motion:reduce){.ws-gallery__card{opacity:1;transform:none}.ws-gallery__card,.ws-gallery__image,.ws-gallery__visual-icon,.ws-gallery__choice,.ws-gallery__load-more,.ws-gallery__content,.ws-gallery__open-label{transition:none!important}}

/* 3.0.1 — barra filtri allineata alla UI di Progetti Websolidale. */
.ws-gallery__toolbar{display:flex;width:100%;justify-content:flex-end;margin:0 0 10px}
.ws-gallery__reset{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 4px;color:var(--ws-ink);font-size:.9rem;font-weight:750;line-height:1;text-decoration:none;white-space:nowrap;transition:color .2s ease,transform .2s ease}
.ws-gallery__reset:hover,.ws-gallery__reset:focus-visible{color:var(--ws-accent);transform:translateY(-1px)}
.ws-gallery__reset:focus-visible{outline:2px solid currentColor;outline-offset:4px;border-radius:4px}
.ws-gallery__filters{display:flex;align-items:flex-end;justify-content:space-between;gap:18px 28px;flex-wrap:wrap;margin:0 0 38px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;backdrop-filter:none}
.ws-gallery__filter-group{display:flex;align-items:center;gap:12px 16px;flex-wrap:wrap}
.ws-gallery__filter-label{width:100%;margin:0;color:var(--ws-ink);font-size:.78rem;font-weight:750;letter-spacing:.08em;text-transform:uppercase;line-height:1.2}
.ws-gallery__choices{display:flex;align-items:center;gap:12px 16px;flex-wrap:wrap}
.ws-gallery__choice{appearance:none;position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:46px;padding:12px 23px;overflow:hidden;border:2px solid rgba(16,36,58,.18);border-radius:9px;background:#fff;color:var(--ws-ink);font-size:.92rem;font-weight:750;line-height:1;text-decoration:none;box-shadow:none;transition:transform .2s ease,box-shadow .2s ease,background-color .2s ease,color .2s ease,border-color .2s ease}
.ws-gallery__choice:hover,.ws-gallery__choice:focus-visible{transform:translateY(-2px);box-shadow:0 8px 18px rgba(16,36,58,.10)}
.ws-gallery__choice.is-active{color:#fff;box-shadow:0 8px 18px rgba(16,36,58,.15)}
.ws-gallery__choice:nth-child(1),.ws-gallery__choice:nth-child(2){color:#ff641e;border-color:#ff641e}
.ws-gallery__choice:nth-child(1):not(.is-active):hover,.ws-gallery__choice:nth-child(2):not(.is-active):hover{background:#fff3ec}
.ws-gallery__choice:nth-child(1).is-active,.ws-gallery__choice:nth-child(2).is-active{background:#ff641e;color:#fff}
.ws-gallery__choice:nth-child(3){color:#2455c3;border-color:#2455c3}
.ws-gallery__choice:nth-child(3):not(.is-active):hover{background:#f1f5ff}
.ws-gallery__choice:nth-child(3).is-active{background:#2455c3;color:#fff}
.ws-gallery__filter-group--year{margin-left:auto}
.ws-gallery__select-wrap{position:relative;display:inline-flex;min-width:176px}
.ws-gallery__year-select{appearance:none;width:100%;height:48px;min-height:48px;padding:0 44px 0 16px;border:1px solid rgba(16,36,58,.18);border-radius:10px;background-color:#fff;color:var(--ws-ink);font:inherit;font-size:.92rem;font-weight:700;cursor:pointer;box-shadow:0 5px 15px rgba(16,36,58,.045);transition:border-color .2s ease,box-shadow .2s ease}
.ws-gallery__year-select:hover{border-color:rgba(16,36,58,.32);box-shadow:0 5px 15px rgba(16,36,58,.045);transform:none}
.ws-gallery__year-select:focus{outline:0;border-color:var(--ws-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--ws-accent) 16%,transparent);transform:none}
.ws-gallery__select-arrow{position:absolute;right:18px;top:50%;width:8px;height:8px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;pointer-events:none;transform:translateY(-70%) rotate(45deg)}
@media(max-width:1024px){.ws-gallery__filters{align-items:stretch;justify-content:flex-start}.ws-gallery__filter-group{flex:1 1 100%}.ws-gallery__filter-group--year{width:100%;margin-left:0}.ws-gallery__select-wrap{width:100%}.ws-gallery__year-select{width:100%}}
@media(max-width:640px){.ws-gallery__filters{margin-bottom:28px;gap:22px}.ws-gallery__filter-group{display:grid;width:100%;grid-template-columns:1fr 1fr;gap:9px}.ws-gallery__filter-label{grid-column:1/-1;margin-bottom:1px}.ws-gallery__choices{display:contents}.ws-gallery__choice{min-height:44px;padding:11px 12px;text-align:center}.ws-gallery__filter-group--year{display:flex;width:100%}.ws-gallery__filter-group--year .ws-gallery__select-wrap{width:100%;max-width:none}.ws-gallery__toolbar{margin-bottom:8px}.ws-gallery__reset{min-height:36px}}
@media(max-width:430px){.ws-gallery__filter-group{grid-template-columns:1fr}.ws-gallery__choice{width:100%}}


/* 3.0.3 — tutte le icone centrali compaiono solo in hover/focus. */
.ws-gallery__card--video .ws-gallery__visual-icon{opacity:0;transform:translate(-50%,-50%) scale(.92)}
.ws-gallery__card:hover .ws-gallery__visual-icon,
.ws-gallery__card:focus-within .ws-gallery__visual-icon{opacity:1;transform:translate(-50%,-50%) scale(1.07);background:#fff;color:#111}
@media(hover:none){.ws-gallery__visual-icon{opacity:0!important}.ws-gallery__card:focus-within .ws-gallery__visual-icon{opacity:1!important}}

/* 3.0.4 — select Anno allineata come nel plugin Progetti. */
.ws-gallery__filter-group--year{margin-left:auto}
@media(min-width:1025px){.ws-gallery__filter-group--year{flex:0 0 auto}}

/* 3.0.5 — layout filtri a due colonne: tipologia a sinistra, anno all'estrema destra. */
@media (min-width: 641px) {
  .ws-gallery__filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    width: 100%;
    column-gap: 32px;
  }
  .ws-gallery__filter-group {
    min-width: 0;
  }
  .ws-gallery__filter-group--year {
    justify-self: end;
    width: auto;
    margin-left: 0;
    flex: none;
  }
  .ws-gallery__filter-group--year .ws-gallery__select-wrap {
    width: 190px;
    min-width: 190px;
  }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .ws-gallery__filters {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
  .ws-gallery__filter-group {
    flex: none;
    width: auto;
  }
  .ws-gallery__filter-group--year {
    width: auto;
    margin-left: 0;
  }
  .ws-gallery__filter-group--year .ws-gallery__select-wrap,
  .ws-gallery__filter-group--year .ws-gallery__year-select {
    width: 190px;
  }
}

/* 3.0.7: keep the year control flush with the gallery's right edge. */
.ws-gallery .ws-gallery__filters-wrap,
.ws-gallery .ws-gallery__filters {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
@media (min-width: 641px) {
  .ws-gallery .ws-gallery__filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    justify-content: stretch;
    align-items: end;
  }
  .ws-gallery .ws-gallery__filter-group--year {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-self: end;
    width: 190px;
    min-width: 0;
    margin: 0;
    padding: 0;
  }
  .ws-gallery .ws-gallery__filter-group--year .ws-gallery__select-wrap,
  .ws-gallery .ws-gallery__filter-group--year .ws-gallery__year-select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
  }
}
@media (max-width: 640px) {
  .ws-gallery .ws-gallery__filter-group--year {
    width: 100%;
    margin: 0;
  }
  .ws-gallery .ws-gallery__filter-group--year .ws-gallery__select-wrap,
  .ws-gallery .ws-gallery__filter-group--year .ws-gallery__year-select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
  }
}
