/* =========================================================
   The Club - Home a sezioni (modulo tchome). Uguale al prototipo prototypes/home.html (v8.1).
   Usa le variabili del tema (custom.css): --black, --white, --photo-bg, --space-*, --spacing, --header-height, --icon-size,
   --fs-body, --fs-micro, --fw-bold. Niente angoli arrotondati, due pesi, 15px come minimo (11px solo per le scritte piccole).
   Ordine delle sezioni = ordine nel back office; qui solo come si vede ciascuna.
   ========================================================= */
.tch {
  --tch-ease: cubic-bezier(.16, 1, .3, 1);
  --tch-arc: clamp(15px, 1.25vw, 19px);
  position: relative;
  overflow-x: clip;
  background: var(--bg, #fff);
  color: var(--black, #000);
}
.tch a { color: inherit; text-decoration: none; }
.tch img { display: block; max-width: none; }
.tch-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tch-lnk { position: absolute; inset: 0; display: block; }

/* scritta in basso: nome (grassetto) + link di fianco, stessa grandezza */
.tch-cap { position: absolute; z-index: 2; left: var(--spacing, 1.25rem); right: var(--spacing, 1.25rem); bottom: var(--spacing, 1.25rem); display: flex; align-items: baseline; gap: 1rem; color: #fff; font-size: var(--fs-micro, 11px); letter-spacing: .04em; pointer-events: none; }
.tch-cap span { font-weight: var(--fw-bold, 700); }
.tch-cap a { pointer-events: auto; }
.tch-hero::after, .tch-full::after, .tch-zoom__stage::after { content: ''; position: absolute; inset: auto 0 0; height: 32%; background: linear-gradient(transparent, rgba(0, 0, 0, .4)); pointer-events: none; }

/* ---------- testo a semicerchio ---------- */
.tch-arc { position: relative; font-family: inherit; font-style: italic; font-weight: 400; font-size: var(--tch-arc); line-height: 1; }
.tch-arc > * { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
.tch-arc b, .tch-arc a { font-weight: var(--fw-bold, 700); }
.tch-arc a { font-style: normal; }

/* ---------- hero / full ---------- */
.tch-hero, .tch-full { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: #8c8f93; color: #fff; }
.tch-full { background: var(--black, #000); }
.tch-full .tch-media { transform: scale(var(--s, 1.15)); will-change: transform; }

/* ---------- testo curvo + una foto (ferma) ---------- */
.tch-split { position: relative; background: var(--bg, #fff); }
.tch-split__stage { position: relative; height: 100svh; min-height: 560px; display: grid; grid-template-columns: 50% 1fr; }
.tch-split__text { position: relative; padding: calc(var(--header-height, 72px) + 2rem) var(--spacing, 1.25rem) var(--spacing, 1.25rem) 6%; }
.tch-split__text .tch-arc { height: 100%; }
.tch-split__ph { position: relative; overflow: hidden; background: var(--photo-bg, #f6f6f6); }

/* slideshow: le foto stanno una sopra l'altra, ne e' visibile una (is-on); passano da sole, vedi tchome.js */
.tch-slide { z-index: 0; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s .5s; }
.tch-slide.is-on { z-index: 1; opacity: 1; visibility: visible; transition: opacity .5s ease, visibility 0s; }
/* miniature: nella colonna bianca, attaccate alla foto grande (a destra), sotto l'header cosi' si possono cliccare.
   Non stanno dentro la foto; la striscia si stringe se le foto sono tante. */
.tch-thumbs { position: absolute; z-index: 4; top: var(--header-height, 72px); left: 0; width: 50%; display: flex; justify-content: flex-end; pointer-events: none; }
.tch-th { position: relative; flex: 0 1 4.5rem; min-width: 0; aspect-ratio: 3 / 4; padding: 0; border: 0; border-radius: 0; background: var(--photo-bg, #f6f6f6); overflow: hidden; cursor: pointer; pointer-events: auto; }
.tch-th img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: opacity .25s; }
.tch-th.is-on img { opacity: 1; }
.tch-th i { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--black, #000); transform: scaleX(0); transform-origin: left; }   /* come la barra del colore scelto nelle schede prodotto: qui si riempie col tempo */
.tch-th.is-on i { transform: scaleX(var(--p, 1)); }
.tch-th:focus-visible { outline: 1px solid var(--black, #000); outline-offset: -1px; }

/* ---------- hero + testo curvo: il testo compare sopra la hero, resta fermo e arriva al suo posto ----------
   Il livello del testo copre hero e sezione sotto (due schermate). E' "sticky": resta in cima finche' la sezione
   sotto non e' al suo posto; li' coincide con il testo della sezione, quindi poi scorre via con lei. */
.tch-lead { --h: max(100svh, 560px); display: grid; grid-template-columns: minmax(0, 1fr); background: var(--bg, #fff); }
.tch-lead > .tch-hero { grid-row: 1; grid-column: 1; }
.tch-lead > .tch-split { grid-row: 2; grid-column: 1; }
.tch-lead__text { grid-row: 1 / 3; grid-column: 1; align-self: start; position: sticky; top: 0; z-index: 3; height: var(--h); display: grid; grid-template-columns: 50% 1fr; pointer-events: none; }
.tch-lead__in { position: relative; padding: calc(var(--header-height, 72px) + 2rem) var(--spacing, 1.25rem) var(--spacing, 1.25rem) 6%; }
.tch-lead__in .tch-arc { height: 100%; }
.tch-lead__in .tch-arc > * { color: #fff; }
.tch-lead__in .tch-arc > .is-dark { color: var(--black, #000); }   /* la riga e' gia' sul bianco della sezione */
.tch-lead .tch-arc a { pointer-events: auto; }
.tch-hero--lead .tch-cap { left: 50%; }   /* la scritta della hero sta a destra: non incrocia il testo curvo che scorre */
.tch-hero--lead::before { content: ''; position: absolute; z-index: 1; inset: 0 auto 0 0; width: 55%; background: linear-gradient(90deg, rgba(0, 0, 0, .28), transparent); pointer-events: none; }

/* ---------- liste prodotti: le card sono quelle del sito ---------- */
.tch-prod { background: var(--bg, #fff); padding: var(--space-8, 4rem) var(--spacing, 1.25rem); }
.tch-prod .module-products { margin-top: 0; }
.tch-prod__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; font-size: var(--fs-body, 15px); }
.tch-prod__title { margin: 0; font-family: inherit; font-size: inherit; font-weight: var(--fw-bold, 700); line-height: inherit; }

/* ---------- facce: 4 x 3 foto a filo a sinistra, alte quanto lo schermo: la colonna e' larga quanto serve per tenere il
   formato delle foto (--ar, calcolato dalla prima foto); a destra foto dell'occhiale + marchio e nome, centrati ---------- */
.tch-faces { --fh: max(100svh, 560px); --gw: calc(var(--fh) * 4 / 3 * var(--ar, .75)); background: var(--bg, #fff); height: var(--fh); display: grid; grid-template-columns: min(var(--gw), 76%) minmax(0, 1fr); }
.tch-faces__grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); height: 100%; min-height: 0; }
.tch-face { position: relative; overflow: hidden; background: var(--photo-bg, #f6f6f6); display: block; }
.tch-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.tch-face__nm { display: none; }
.tch-faces__side { display: grid; place-items: center; text-align: center; padding: 0 var(--spacing, 1.25rem); text-wrap: balance; }
.tch-faces__line { display: grid; justify-items: center; gap: var(--space-2, .5rem); transition: opacity .25s; }
/* la foto dell'occhiale e' ritagliata solo sopra e sotto (formato largo, larghezza intera: l'occhiale non si taglia ai lati) */
.tch-fp { position: relative; display: block; width: min(100%, clamp(200px, 22vw, 380px)); aspect-ratio: 4 / 3; background: var(--photo-bg, #f6f6f6); overflow: hidden; }
.tch-fp img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tch-faces__side.is-idle .tch-faces__line { opacity: 0; }
.tch-fn { font-weight: var(--fw-bold, 700); }

/* ---------- zoom: la sezione resta ferma, lo scroll muove lo zoom ---------- */
.tch-zoom { position: relative; height: 280svh; background: var(--black, #000); }
.tch-zoom__stage { position: sticky; top: 0; height: 100svh; min-height: 560px; overflow: hidden; color: #fff; }
.tch-zoom .tch-media { transform-origin: var(--fx, 50%) var(--fy, 55%); transform: scale(var(--z, 1)); will-change: transform; }

/* ---------- griglia finale: tutto schermo, 6 x 3 ---------- */
.tch-wall { display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(3, 1fr); height: 100svh; min-height: 560px; background: var(--bg, #fff); }
.tch-wt { position: relative; overflow: hidden; background: var(--photo-bg, #f6f6f6); display: block; }
.tch-wt .tch-media { object-position: 50% 30%; }

/* ---------- etichetta che segue il mouse: solo il nome in grassetto, senza riquadro ne' ombra.
   mix-blend-mode: difference = il testo si scurisce sui fondi chiari e si schiarisce su quelli scuri. ---------- */
.tch-tip { position: fixed; left: 0; top: 0; z-index: 80; display: none; align-items: baseline; gap: var(--btn-gap, 12px); white-space: nowrap; color: #fff; mix-blend-mode: difference; font-size: var(--fs-body, 15px); line-height: 1.3; pointer-events: none; opacity: 0; transition: opacity .3s; will-change: transform; }
.tch-tip.on { opacity: 1; }
/* pallino decorativo: lo stesso anello dei bottoni e dei link del sito */
.tch-tip::before, .tch-cap a::before, .tch-vp > span::before {
  content: ''; box-sizing: border-box; flex: none; align-self: center; display: inline-block;
  width: var(--btn-dot, 8px); height: var(--btn-dot, 8px); border: 2px solid currentColor; border-radius: 50%;
}
.tch-cap a::before { margin-right: var(--btn-gap, 12px); }
.tch-tip b { font-weight: var(--fw-bold, 700); }

@media (hover: hover) and (pointer: fine) {
  .tch-tip { display: flex; }
  .tch-arc a:hover, .tch-cap a:hover { opacity: .5; }
}

/* ---------- link in basso al centro delle foto a tutta pagina: solo dove non c'e' il mouse (telefono, tablet) ---------- */
.tch-vp { display: none; }
@media (hover: none), (max-width: 767px) {
  .tch-vp { position: absolute; z-index: 2; left: 50%; bottom: calc(var(--spacing, 1.25rem) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; justify-items: center; gap: .1rem; max-width: calc(100% - 2 * var(--spacing, 1.25rem)); text-align: center; color: #fff; font-size: var(--fs-body, 15px); line-height: 1.3; pointer-events: none; }
  .tch-vp b { font-weight: var(--fw-bold, 700); }
  .tch-vp > span { display: inline-flex; align-items: center; gap: var(--btn-gap, 12px); white-space: nowrap; }
  .tch-cap { bottom: calc(var(--spacing, 1.25rem) + 3.4rem); }   /* la scritta del back office sta sopra il link */
  /* zoom: il riquadro e' alto quanto lo schermo "grande" (barra del browser nascosta); il link resta nella parte sempre visibile */
  .tch-zoom { height: 280vh; height: 280lvh; }
  .tch-zoom__stage { height: 100vh; height: 100lvh; }
  .tch-zoom .tch-vp { bottom: auto; top: calc(100svh - var(--spacing, 1.25rem) - 2.8rem); }
  .tch-faces__go { display: none; }   /* il link dentro la griglia di facce serve solo sul telefono (vedi sotto) */
}

@media (max-width: 767px) {
  /* --tw: parte bianca col testo (alta abbastanza da contenere header, testo e miniature); --sh: altezza della sezione sotto la hero = parte bianca + foto 4:5 (mai meno di uno schermo) */
  .tch { --tw: max(calc(max(100svh, 560px) * .62), 25rem); --sh: max(calc(var(--tw) + 125vw), max(100svh, 560px)); }

  /* testo curvo + foto: la foto e' un rettangolo 4:5 (mai quadrato); se lo schermo e' molto alto cresce, non si vede mai un vuoto */
  .tch-split__stage { height: var(--sh); min-height: 0; grid-template-columns: 1fr; grid-template-rows: var(--tw) 1fr; }
  /* il testo e' centrato in verticale nello spazio libero della parte bianca: sotto l'header e sopra le miniature (che stanno in fondo) */
  .tch-split__text, .tch-lead__in { padding: var(--header-height, 72px) var(--spacing, 1.25rem) calc(4.4rem + .75rem); }
  /* hero + testo: il livello del testo percorre esattamente una schermata (hero), la sezione sotto puo' essere piu' alta */
  .tch-lead { grid-template-rows: var(--h) auto; }
  .tch-lead > .tch-split { grid-row: 2; }
  .tch-lead__text { margin-bottom: calc(var(--sh) - var(--h)); }   /* cosi' il testo resta fermo solo per la hero e poi scorre con la sezione bianca */
  .tch-lead__text { grid-template-columns: 1fr; grid-template-rows: var(--tw) 1fr; }
  .tch-thumbs { top: var(--tw); width: 100%; transform: translateY(-100%); }
  .tch-th { flex-basis: 3.25rem; }

  /* griglia di facce: 6 foto, il prodotto scelto in mezzo, altre 6 foto (come un panino).
     Toccando una foto si sceglie il prodotto: la foto scelta e' un po' sbiadita e ha un pallino dentro. */
  .tch-faces { height: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tch-faces__grid { display: contents; }
  .tch-face { order: 1; aspect-ratio: 4 / 5; }
  .tch-face:nth-child(n + 7) { order: 3; }
  .tch-face img { transition: opacity .3s; }
  .tch-face.is-sel img { opacity: .6; }
  .tch-face.is-sel::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; mix-blend-mode: difference; pointer-events: none; }
  .tch-face__nm { display: none; }
  .tch-faces__side { order: 2; grid-column: 1 / -1; padding: var(--space-6, 1.5rem) var(--spacing, 1.25rem); background: var(--bg, #fff); }
  .tch-faces__side.is-idle .tch-faces__line { opacity: 1; }
  .tch-fp { width: min(100%, 24rem); }
  .tch-faces__go { display: grid; position: static; transform: none; max-width: none; margin-top: var(--space-2, .5rem); color: inherit; pointer-events: auto; }

  .tch-wall { grid-template-columns: repeat(3, 1fr); grid-template-rows: none; height: auto; }
  .tch-wt { aspect-ratio: 4 / 5; }
}
