/* =========================================================
   Componente isolato — "Eventi precedenti", concept C: la parete
   Markup: template-parts/eventi-precedenti(.php|-item.php) · JS: assets/js/eventi-precedenti.js
   Per cambiare design basta riscrivere questo file (e, se serve, il markup del componente).
   ========================================================= */

.past { border-top: 1px solid var(--c-line); overflow-x: hidden; overflow-x: clip; } /* le locandine ruotate non devono creare scroll laterale */
.past__head { margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.past__head .h2 { margin-top: var(--s-4); }
.past__head .prose { margin-top: var(--s-4); }
.past__foot { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); margin-top: clamp(3.5rem, 7vw, 6rem); }

.wall {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.25rem, 4vw, 4.5rem) clamp(1rem, 4vw, 4.5rem);
  align-items: start; max-width: 1120px; margin-inline: auto; padding-block: var(--s-5);
}
.wall__item {
  position: relative; display: block; width: 100%; text-align: left; cursor: zoom-in;
  --rot: 0deg; --y: 0;
  transform: rotate(var(--rot)) translateY(var(--y));
  transition: transform var(--t-slow) var(--ease-out);
}
/* Rotazioni e sfalsamenti ciclici: sembrano casuali, ma sono stabili */
.wall__cell:nth-child(6n+1) .wall__item { --rot: -2.2deg; --y: 1.5rem; }
.wall__cell:nth-child(6n+2) .wall__item { --rot: 1.4deg;  --y: -.5rem; }
.wall__cell:nth-child(6n+3) .wall__item { --rot: -.8deg;  --y: 2.5rem; }
.wall__cell:nth-child(6n+4) .wall__item { --rot: 1.8deg;  --y: .5rem; }
.wall__cell:nth-child(6n+5) .wall__item { --rot: -1.4deg; --y: 2rem; }
.wall__cell:nth-child(6n+6) .wall__item { --rot: .9deg;   --y: -1rem; }

.wall__item img { width: 100%; height: auto; box-shadow: 0 34px 60px -26px rgba(0,0,0,.95); outline: 1px solid var(--c-line); }
/* Pezzo di nastro */
.wall__item::before {
  content: ""; position: absolute; top: -10px; left: 50%; z-index: 1; width: 44px; height: 18px;
  transform: translateX(-50%) rotate(-3deg); background: rgba(242, 239, 234, .16);
}
.wall__cap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: var(--s-4); opacity: .78; transition: opacity var(--t-base); }
.wall__title { font-size: var(--fs-small); line-height: 1.3; }
.wall__item:hover, .wall__item:focus-visible { transform: rotate(0) translateY(-.5rem) scale(1.02); z-index: 2; }
.wall__item:hover .wall__cap, .wall__item:focus-visible .wall__cap { opacity: 1; }

/* Evento senza locandina: cartellino tipografico */
.wall__item--text {
  display: grid; align-content: space-between; gap: var(--s-6); aspect-ratio: 4 / 5; padding: var(--s-5);
  background: var(--c-paper); color: var(--c-ink); cursor: pointer;
}
.wall__item--text .wall__title { font-size: var(--fs-h3); font-weight: 300; letter-spacing: -.02em; }
.wall__item--text .label { color: rgba(12,12,12,.6); }

/* Locandine appena caricate con "Mostra altri" */
.wall__cell.is-new { animation: wallIn var(--t-slow) var(--ease-out) both; }
@keyframes wallIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

@media (min-width: 1025px) {
  .wall { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .wall__item, .wall__item:hover { transform: none; }
}
