/* 17/11: l'ingresso con le luci, l'albero dei servizi della home e la scheda di ogni servizio */

/* ------------------------------------------------------------------ l'ingresso (js/ingresso.js) */
html.ingresso :is(.testata .marchio, .menu a, [data-luce], main .bottone):not(.luce-ok) { opacity: 0; animation: luce-salva 0.01s 3.3s forwards; }
@keyframes luce-salva { to { opacity: 1; } }
html.ingresso .luce-ok { animation: luce-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
html.ingresso .luce-ok.luce-subito { animation: none; }
@keyframes luce-in {
  0% { opacity: 0; filter: brightness(3.4) blur(5px); }
  50% { opacity: 1; filter: brightness(1.9) blur(0.6px); }
  100% { opacity: 1; filter: none; }
}
.ingresso-tela { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }

/* ------------------------------------------------------------------ l'albero */
.albero { position: relative; z-index: 1; height: calc(100vh - var(--testata, 72px)); height: calc(100svh - var(--testata, 72px));
          min-height: 640px; max-height: 1000px; overflow: hidden; border-bottom: 1px solid var(--linea);
          background: radial-gradient(80% 70% at 50% 55%, rgba(10, 10, 10, 0.05), rgba(10, 10, 10, 0.32) 85%); }   /* 18/11: più trasparente, le scene di sfondo si vedono intere */
.albero-tela, .albero-nodi { position: absolute; inset: 0; width: 100%; height: 100%; }
.nodo { position: absolute; left: 0; top: 0; margin: 0; padding: 0; border: 0; background: none; color: var(--bianco); font: inherit;
        text-align: center; cursor: pointer; transform-origin: 50% 100%; will-change: transform, opacity; -webkit-tap-highlight-color: transparent;
        width: max-content; }
.nodo[data-ramo="consulenza"] { --tinta: 236, 112, 86; }
.nodo[data-ramo="digitale"] { --tinta: 138, 170, 255; }
.nodo[data-ramo="architettura"] { --tinta: 130, 206, 168; }
.nodo[data-ramo="perizie"] { --tinta: 130, 206, 168; }
.nodo:focus-visible { outline: none; }
.nodo:focus-visible .nodo-luce { outline: 2px solid var(--oro-chiaro); outline-offset: 4px; }
.nodo-luce { display: block; }

/* i due rami: titoli con grazie, la parte in corsivo d'oro */
.nodo-ramo .nodo-luce { font-family: var(--tecnico); font-weight: 600; font-size: clamp(26px, 2.35vw, 36px); line-height: 1.05; letter-spacing: 0.07em; text-transform: uppercase;
                        padding: 8px 16px 6px;   /* 24/11 (Mirco): blocchi un po' più grandi */ text-shadow: 0 2px 22px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 0.9); }
.nodo-ramo em { display: block; font-style: normal; font-weight: inherit; color: inherit; }   /* 23/11: le due parole del ramo dello stesso colore */
/* 18/11: niente filetto sotto: il contorno lo disegna la luce-vespa (js/albero.js, disegnaContorni) */

/* i macroblocchi: targhette scure con il filo d'oro */
.nodo-blocco .nodo-luce, .foglia-alta .nodo-luce {
  font-family: var(--tecnico); font-weight: 600; font-size: 20px; line-height: 1.15; letter-spacing: 0.1em; text-transform: uppercase; padding: 12px 20px 12px;
  background: none; border: 0;   /* 19/11: niente velo: dietro si vede lo sfondo come fuori */
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.85); transition: color 0.25s; }
.nodo-blocco:hover .nodo-luce, .nodo-blocco.aperto .nodo-luce, .foglia-alta:hover .nodo-luce, .foglia-alta.acceso .nodo-luce {
  color: var(--oro-chiaro); }
.nodo-blocco.aperto .nodo-luce { color: var(--oro-chiaro); }

/* le foglie: i servizi */
.nodo-foglia .nodo-luce { font-family: var(--tecnico); font-weight: 500; font-size: 17px; line-height: 1.25; letter-spacing: 0.08em; text-transform: uppercase; color: var(--testo);
                          padding: 8px 13px 9px; background: none; border: 0;
                          text-shadow: 0 0 3px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 0, 0, 0.85); transition: color 0.25s; }
.foglia-alta .nodo-luce { font-family: var(--tecnico); font-weight: 600; font-size: 20px; line-height: 1.15; color: var(--bianco); }
/* 18/11: niente rombo davanti: la scritta sta dentro la sua forma di luce, centrata */
.nodo-foglia:hover .nodo-luce, .nodo-foglia.acceso .nodo-luce { color: var(--bianco); }

/* con un blocco aperto gli altri restano, attenuati: l'occhio va al blocco scelto */
.albero.blocco-aperto .nodo-blocco:not(.aperto) .nodo-luce, .albero.blocco-aperto .foglia-alta .nodo-luce { opacity: 0.5; transition: opacity 0.3s; }
.albero.blocco-aperto .nodo-blocco:not(.aperto):hover .nodo-luce { opacity: 1; }
/* la pagina Servizi: i passi senza numeri */
.passi-servizio li::before { content: none !important; }
.albero-aiuto { position: absolute; left: 0; right: 0; top: 50%; margin: 0; text-align: center; pointer-events: none;
                font-size: 12px; font-weight: 600; letter-spacing: 0.32em; text-transform: uppercase; color: var(--oro); transition: opacity 0.3s; }
.albero.aperto .albero-aiuto { opacity: 0 !important; }

html.js .albero-dati, html.js .schede-servizi { display: none; }

@media (max-width: 719px) {
  .albero { min-height: 700px; max-height: 900px; }
  .nodo-ramo .nodo-luce { font-size: 16px; letter-spacing: 0.06em; padding: 4px 4px 2px; }
  .nodo-blocco .nodo-luce, .foglia-alta .nodo-luce { font-size: 14.5px; letter-spacing: 0.07em; padding: 8px 7px 9px; }
  .nodo-foglia .nodo-luce { font-size: 13.5px; letter-spacing: 0.06em; padding: 7px 9px 8px; }
  .albero-aiuto { top: 44%; font-size: 11px; }
}

/* senza programmi (anteprime, file fissi): l'albero diventa un indice e le schede si leggono in fila */
html:not(.js) .albero { height: auto; min-height: 0; max-height: none; overflow: visible; padding: 40px 16px 20px; background: none; }
html:not(.js) .albero-tela, html:not(.js) .albero-nodi, html:not(.js) .albero-aiuto { display: none; }
html:not(.js) .albero-dati { max-width: 900px; margin: 0 auto 30px; }
html:not(.js) .albero-dati ul { list-style: none; margin: 0; padding: 0 0 0 18px; }
html:not(.js) .albero-dati > ul { padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
html:not(.js) .albero-dati > ul > li > .nome { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--bianco); }
html:not(.js) .albero-dati li li > .nome { font-family: var(--serif); font-size: 19px; color: var(--oro-chiaro); }
html:not(.js) .albero-dati li li li > .nome { font-family: var(--sans); font-size: 14.5px; color: var(--testo); }
html:not(.js) .scheda-servizio { max-width: 900px; margin: 0 auto 24px; border: 1px solid var(--linea); background: rgba(10, 10, 10, 0.9); }
html:not(.js) .scheda-servizio .scheda-foto { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }

/* ------------------------------------------------------------------ la scheda del servizio, sopra l'albero */
.scheda-velo { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 28px;
               background: rgba(4, 4, 4, 0.74); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.scheda-velo[hidden] { display: none; }
.scheda-finestra { position: relative; width: min(1060px, 100%); max-height: calc(100vh - 56px); overflow: auto; overscroll-behavior: contain; outline: none;
                   background: linear-gradient(180deg, #12110e, #0a0a09); border: 1px solid rgba(201, 165, 76, 0.45); border-radius: 3px;
                   box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75), 0 0 70px rgba(201, 165, 76, 0.12); }
.scheda-corpo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
.scheda-corpo[data-ramo="consulenza"] { --tinta: 236, 112, 86; }
.scheda-corpo[data-ramo="digitale"] { --tinta: 138, 170, 255; }
.scheda-corpo[data-ramo="architettura"] { --tinta: 130, 206, 168; }
.scheda-corpo[data-ramo="perizie"] { --tinta: 130, 206, 168; }
.scheda-foto { width: 100%; height: 100%; min-height: 380px; object-fit: cover; border-right: 1px solid var(--linea); background: #0b0c0e; }
.scheda-testo { padding: 42px 46px 38px; min-width: 0; }
.scheda-testo .occhiello { margin: 0 0 14px; letter-spacing: 0.24em; color: rgb(var(--tinta, 201, 165, 76)); }
.scheda-testo h2 { font-size: clamp(30px, 3vw, 42px); margin: 0 0 16px; }
.scheda-dettagli { margin: 0 0 8px; font-size: 16.5px; line-height: 1.6; color: var(--testo); }
.scheda-testo h3 { margin: 24px 0 8px; font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--oro); }
.scheda-testo h3 + p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--testo-2); }
.scheda-passi { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.scheda-passi li { border-top: 1px solid var(--linea); padding-top: 8px; font-size: 14.5px; line-height: 1.4; color: var(--testo); }
.scheda-passi b { display: block; font-weight: 600; }
.scheda-passi small { display: block; margin-top: 2px; font-size: 13px; color: var(--testo-2); }
.scheda-caso { margin: 10px 0 0; font-size: 15px; }
/* 18/11: i servizi accorpati tengono i loro dettagli in un elenco compatto */
.scheda-moduli { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 7px; }
.scheda-moduli li { position: relative; padding-left: 16px; font-size: 15px; line-height: 1.45; color: var(--testo); }
.scheda-moduli li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 6px; height: 6px; transform: rotate(45deg); background: rgb(var(--tinta, 201, 165, 76)); }
.scheda-moduli b { font-weight: 600; color: var(--bianco); }
.scheda-caso a { border-bottom: 1px solid var(--oro); padding-bottom: 1px; }
.scheda-contatto { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.scheda-contatto .bottone { padding: 12px 22px; }
.scheda-chiudi { position: absolute; top: 12px; right: 12px; z-index: 3; width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
                 border: 1px solid rgba(201, 165, 76, 0.55); background: rgba(10, 10, 10, 0.82); color: var(--bianco); font: 300 26px/1 var(--sans); }
.scheda-chiudi:hover { background: var(--oro); color: var(--nero); }
body.scheda-aperta { overflow: hidden; }
@media (max-width: 760px) {
  .scheda-velo { padding: 0; align-items: stretch; }
  .scheda-finestra { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .scheda-corpo { grid-template-columns: 1fr; }
  .scheda-foto { height: auto; min-height: 0; aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid var(--linea); }
  .scheda-testo { padding: 24px 18px 34px; }
  .scheda-testo h2 { font-size: 31px; }
  .scheda-chiudi { position: fixed; top: 10px; right: 10px; }
}

/* ------------------------------------------------------------------ la pagina Servizi */
.rimando-albero { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; font-size: 15.5px; }

/* 19/11: piccola galleria dentro una scheda */
.scheda-galleria { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 18px 0 0; }
.scheda-galleria figure { margin: 0; }
.scheda-galleria img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--linea); border-radius: 3px; display: block; }
.scheda-galleria figcaption { font-size: 13px; line-height: 1.35; color: var(--testo-2); margin-top: 6px; }
.scheda-galleria video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--linea); border-radius: 3px; display: block; background: #0b0c0e; }
.scheda-galleria.fem img { object-fit: contain; background: #0b0c0e; }

/* 19/11: immagini che scorrono nel riquadro grande della scheda */
.scheda-scorre { position: relative; overflow: hidden; }
.scheda-scorre > img, .scheda-scorre > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .scheda-scorre > * { animation: none !important; } .scheda-scorre > :first-child { opacity: 1; } }
.scheda-scorre > video { object-fit: contain; background: #080808; }
.scheda-scorre > img[src*="sim_telaio"] { object-fit: contain; background: #121214; }   /* 20/11: il capannone intero, non un ritaglio */
.scheda-scorre > img[src*="disegno_"] { object-fit: contain; background: #ffffff; }
.scheda-scorre > img[src*="verifica_"] { object-fit: contain; background: #ffffff; }   /* la tavola di verifica intera */
.scheda-scorre > img[src*="sim_telaio_lamiera"] { object-fit: contain; background: #121214; }   /* 20/11: i disegni tecnici interi, su fondo bianco */
.scheda-scorre > img[src*="dim_"] { object-fit: contain; background: #ffffff; }
