/* I ferri del mestiere · visore 3D + pannello. Senza JavaScript, senza WebGL o con meno movimento resta la versione statica (sei schede con illustrazione). */

.ferri { position: relative; overflow: hidden; }
.ferri::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 60% at 28% 55%, rgba(200, 162, 74, .1), transparent 70%); pointer-events: none; }
.ferri .wrap { position: relative; }
.ferri__grid { display: grid; gap: 22px; }
.ferri__stage { display: none; }
.ferri__nota { margin-top: 22px; font-size: 13px; color: var(--muted-d); }

/* ---------- versione statica: sei schede ---------- */
.ferri__pannello { display: grid; gap: 14px; }
@media (min-width: 720px) { .ferri__pannello { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .ferri__pannello { grid-template-columns: repeat(3, 1fr); } }
.ferro { display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--line-d); border-radius: 8px; background: rgba(255, 255, 255, .035); }
.ferro__fig { margin: 0 0 6px; padding: 6px 0 12px; border-bottom: 1px solid var(--line-d); }
.ferro__img { width: 100%; height: 120px; }
.ferro__n { font: 600 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--brass); }
.ferro h3 { font-size: 1.55rem; color: var(--bone); }
.ferro__sub { font: italic 500 1.05rem/1.3 var(--serif); color: var(--brass-2); }
.ferro__cosa { color: var(--muted-d); font-size: 15px; }
.ferro__punti { display: grid; gap: 0; margin-top: 6px; }
.punto { padding: 12px 0; border-top: 1px solid var(--line-d); }
.punto__t { display: flex; align-items: center; gap: 12px; font: 600 15px/1.2 var(--sans); letter-spacing: 0; color: var(--bone); margin: 0; }
.punto__t b { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--brass); color: var(--brass-2); font-size: 12px; transition: background .25s, color .25s; }
.punto p { margin: 8px 0 0 38px; color: var(--muted-d); font-size: 14.5px; line-height: 1.55; }
.ferro__tec { display: grid; gap: 6px; margin-top: 4px; padding: 14px 16px; border-left: 2px solid var(--brass); background: rgba(200, 162, 74, .08); border-radius: 0 6px 6px 0; font-size: 14.5px; color: var(--bone); }
.ferro__tec b { font: 600 11px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--brass); }

/* ---------- versione 3D (la attiva ferri.js) ---------- */
.ferri--3d .ferri__stage { display: grid; gap: 14px; min-width: 0; align-content: start; }
.ferri--3d .ferro__fig { display: none; }
.ferri--3d .ferri__pannello { display: block; }
.ferri--3d .ferro { display: none; padding: 26px; background: rgba(255, 255, 255, .045); gap: 12px; }
.ferri--3d .ferro.attivo { display: flex; animation: ferro-in .25s var(--ease); }
.ferri.senza-anim .ferro.attivo { animation: none; }
@keyframes ferro-in { from { opacity: 0; transform: translateY(10px); } }
.ferri--3d .punto:not(.aperto) p { display: none; }
.ferri--3d .punto { padding: 0; }
.ferri--3d .punto.aperto { background: rgba(200, 162, 74, .07); border-radius: 6px; }
.ferri--3d .punto.aperto + .punto { border-top-color: transparent; }
.punto__b { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 10px 13px 6px; border: 0; background: none; text-align: left; color: inherit; cursor: pointer; font: inherit; min-height: 48px; border-radius: 6px; }
.punto__b::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid var(--muted-d); border-bottom: 1.5px solid var(--muted-d); transform: rotate(45deg); transition: transform .3s var(--ease); flex: none; }
.punto.aperto .punto__b::after { transform: rotate(-135deg); border-color: var(--brass); }
.punto.aperto .punto__t b { background: var(--brass); color: var(--g); }
.punto__b:hover b { background: rgba(200, 162, 74, .25); }
.ferri--3d .punto p { margin: 0 14px 14px 50px; }

.ferri__vista { position: relative; height: clamp(320px, 88vw, 400px); border: 1px solid var(--line-d); border-radius: 10px; overflow: hidden; background: radial-gradient(58% 58% at 50% 46%, rgba(200, 162, 74, .2), transparent 74%), rgba(255, 255, 255, .025);
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.ferri__vista:active { cursor: grabbing; }
.ferri__vista canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s; }
.ferri--3d .ferri__vista canvas { opacity: 1; }
.ferri__hot { position: absolute; inset: 0; pointer-events: none; }
.ferri__hint { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font: 500 11px/1 ui-monospace, Consolas, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-d); pointer-events: none; transition: opacity .6s; }
.ferri__hint.via { opacity: 0; }
@media (min-width: 960px) {
  .ferri--3d .ferri__grid { grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: stretch; }
  .ferri__vista { height: 470px; }
}

.hot { position: absolute; left: 0; top: 0; width: 30px; height: 30px; margin: -15px 0 0 -15px; padding: 0; border-radius: 50%; border: 1.5px solid var(--brass); background: rgba(15, 42, 34, .86); color: var(--brass-2);
  font: 700 13px/1 var(--sans); display: grid; place-items: center; cursor: pointer; pointer-events: auto; will-change: transform, opacity; transition: background .25s, color .25s, box-shadow .25s; }
.hot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid rgba(200, 162, 74, .55); animation: eco 2.6s ease-out infinite; pointer-events: none; }
.hot:hover, .hot.on { background: var(--brass); color: var(--g); }
.hot.on { box-shadow: 0 0 0 4px rgba(200, 162, 74, .28); }
.hot.on::after { animation: none; opacity: 0; }
.hot__t { position: absolute; left: 50%; bottom: 38px; transform: translateX(-50%); white-space: nowrap; padding: 5px 10px; border-radius: 4px; background: rgba(15, 42, 34, .94); border: 1px solid rgba(200, 162, 74, .5); color: var(--bone); font: 600 12px/1 var(--sans); letter-spacing: .02em; opacity: 0; pointer-events: none; transition: opacity .25s; }
.hot.sotto .hot__t { bottom: auto; top: 38px; }
.hot.hl .hot__t { left: -8px; transform: none; }
.hot.hr .hot__t { left: auto; right: -8px; transform: none; }
.hot.on .hot__t, .hot:hover .hot__t { opacity: 1; }
@keyframes eco { 0% { transform: scale(.75); opacity: .9; } 100% { transform: scale(1.55); opacity: 0; } }
@media (pointer: coarse) { .hot { width: 38px; height: 38px; margin: -19px 0 0 -19px; font-size: 15px; } .hot__t { bottom: 46px; } .hot.sotto .hot__t { top: 46px; } }

.ferri__sel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 560px) { .ferri__sel { grid-template-columns: repeat(6, 1fr); } }
.ferri__b { min-height: 44px; padding: 0 6px; border: 1px solid var(--line-d); border-radius: 6px; background: rgba(255, 255, 255, .03); color: var(--bone); font: 600 13px/1 var(--sans); cursor: pointer; transition: background .25s, color .25s, border-color .25s; }
.ferri__b:hover { border-color: var(--brass); }
.ferri__b.on { background: var(--brass); border-color: var(--brass); color: var(--g); }

/* telefono: il visore e il pannello stanno insieme in una schermata; l'elenco dei punti viene prima della descrizione */
.ferri__cap { display: none; }
@media (max-width: 959px) {
  .ferri__vista { height: clamp(290px, 78vw, 400px); }
  .ferri--3d .ferri__cap { display: grid; gap: 6px; align-content: start; min-height: 120px; padding: 14px 16px; border-left: 2px solid var(--brass); background: rgba(200, 162, 74, .08); border-radius: 0 6px 6px 0; }
  .ferri__cap b { font: 600 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--brass); }
  .ferri__cap span { font-size: 14.5px; line-height: 1.5; color: var(--bone); }
  .ferri--3d .punto.aperto p { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* il testo sta già nella didascalia sotto il visore; ai lettori di schermo resta disponibile */
  .ferri--3d .ferro__n { display: none; }
  .ferri--3d .ferro__cosa { order: 9; font-size: 14.5px; }
  .ferri--3d .ferro { padding: 20px 16px; }
}
@media (max-width: 559px) {
  .ferri__sel { display: flex; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-snap-type: x proximity; }
  .ferri__sel::-webkit-scrollbar { display: none; }
  .ferri__b { flex: none; padding: 0 18px; scroll-snap-align: center; }
}

@media (prefers-reduced-motion: reduce) { .hot::after { animation: none; } .ferri--3d .ferro.attivo { animation: none; } }
