/* ══════════════════════════════════════════════════════════════════
   ArchitettiAI Pro — Video guide
   Card dei tour + lettore a schermo intero.

   Questo foglio era dentro a video.html: è stato portato fuori
   perché ora le guide compaiono anche in home. Un solo posto da
   toccare, due pagine che restano identiche.
   ══════════════════════════════════════════════════════════════════ */
/* ══ HERO ══════════════════════════════════════════════════ */
.vh { padding: 150px 0 40px; text-align: center; position: relative; }
.vh h1 {
  font-family: var(--fh);
  font-size: clamp(36px, 5.4vw, 62px);
  font-weight: 800; line-height: 1.08; letter-spacing: -1.6px;
  margin: 22px 0 18px;
}
.vh p.lead {
  font-size: 18px; color: var(--muted); max-width: 660px;
  margin: 0 auto 32px; line-height: 1.7;
}
.vh-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ══ FEATURED ══════════════════════════════════════════════ */
.feat {
  position: relative; margin: 56px auto 0; max-width: 1000px;
  border-radius: 2px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--navy2);
  box-shadow: 0 40px 100px rgba(28,28,26,0.165);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), border-color .3s;
}
.feat:hover { transform: translateY(-6px); border-color: rgba(27,77,107,0.45); }
.feat img { display: block; width: 100%; opacity: .62; transition: opacity .45s, transform .8s; }
.feat:hover img { opacity: .78; transform: scale(1.03); }
.feat::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(24,23,21,0.96) 0%, rgba(24,23,21,0.35) 45%, transparent 100%);
}
.feat-body {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  padding: 30px 34px; text-align: left;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.feat-body h3 { font-family: var(--fh); font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.feat-body p { color: var(--muted); font-size: 14.5px; max-width: 520px; }
.bigplay {
  position: absolute; inset: 0; z-index: 2; margin: auto;
  width: 88px; height: 88px; border-radius: 50%;
  background: rgba(27,77,107,0.92);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 0 rgba(27,77,107,0.55), 0 20px 50px rgba(27,77,107,0.4);
  animation: bp 2.6s infinite;
}
.bigplay svg { margin-left: 5px; }
@keyframes bp {
  0%   { box-shadow: 0 0 0 0 rgba(27,77,107,0.5), 0 20px 50px rgba(27,77,107,0.35); }
  70%  { box-shadow: 0 0 0 26px rgba(27,77,107,0.0), 0 20px 50px rgba(27,77,107,0.35); }
  100% { box-shadow: 0 0 0 0 rgba(27,77,107,0.0), 0 20px 50px rgba(27,77,107,0.35); }
}

/* ══ GRIGLIA TOUR ══════════════════════════════════════════ */
.catrow {
  display: flex; align-items: center; gap: 14px;
  margin: 64px 0 22px;
}
.catrow h2 {
  font-family: var(--fh); font-size: 22px; font-weight: 700; white-space: nowrap;
}
.catrow .line { flex: 1; height: 1px; background: var(--border); }
.catrow .cnt { font-size: 12px; color: var(--dim); white-space: nowrap; }

.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.tcard {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 2px; overflow: hidden; cursor: pointer;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .3s, background .3s;
  text-align: left;
  display: flex; flex-direction: column;
}
.tcard:hover {
  transform: translateY(-5px);
  border-color: rgba(27,77,107,0.45);
  background: rgba(27,77,107,0.05);
}
.tcard-thumb { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--navy2); }
.tcard-thumb img {
  width: 100%; height: 100%; object-fit: cover; object-position: top left;
  opacity: .72; transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .35s;
}
.tcard:hover .tcard-thumb img { transform: scale(1.07); opacity: 1; }
.tcard-thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(24,23,21,0.85), transparent 55%);
}
.tcard-play {
  position: absolute; left: 14px; bottom: 12px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(27,77,107,0.95);
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s;
}
.tcard:hover .tcard-play { transform: scale(1.14); }
.tcard-time {
  position: absolute; right: 12px; bottom: 14px; z-index: 2;
  font-size: 11.5px; font-weight: 700; letter-spacing: .4px;
  background: rgba(28,28,26,0.195); padding: 3px 9px; border-radius: 6px;
  backdrop-filter: blur(4px);
}
.tcard-body { padding: 16px 18px 18px; flex: 1; }
.tcard-body h3 {
  font-family: var(--fb); font-weight: 600; font-size: 16px; font-weight: 700;
  line-height: 1.35; margin-bottom: 7px;
}
.tcard-body p { font-size: 13.4px; color: var(--muted); line-height: 1.55; }
.tcard-meta { margin-top: 12px; font-size: 11.5px; color: var(--dim); }

/* ══ COME FUNZIONA ═════════════════════════════════════════ */
.hints {
  display: grid; gap: 16px; margin-top: 70px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.hint {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 2px; padding: 20px;
}
.hint b { display: block; font-size: 14.5px; margin-bottom: 6px; }
.hint span { font-size: 13.2px; color: var(--muted); line-height: 1.6; }
.hint .em { font-size: 22px; display: block; margin-bottom: 10px; }

/* ══════════════════════════════════════════════════════════
   PLAYER
   ══════════════════════════════════════════════════════════ */
.kb-root {
  position: fixed; inset: 0; z-index: 9800;   /* sopra il banner cookie */
  display: none; align-items: center; justify-content: center;
  padding: 26px;
}
.kb-root.open { display: flex; }
.kb-backdrop {
  position: absolute; inset: 0;
  background: rgba(24,23,21,0.93);
  backdrop-filter: blur(14px);
}
/* L'elenco dei tour sta SOTTO al video, non di fianco: così il
   filmato si prende tutta la larghezza disponibile invece di
   cederne 310px a una colonna. */
.kb-shell {
  position: relative; z-index: 2;
  width: min(1600px, 100%); max-height: 100%;
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
}
.kb-main {
  background: #201F1C;
  color: #EDE9E2;
  border: 1px solid rgba(245,243,239,0.12);
  border-radius: 2px; overflow: hidden;
  display: flex; flex-direction: column; min-width: 0;
  box-shadow: 0 50px 120px rgba(28,28,26,0.21);
}

.kb-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid rgba(245,243,239,0.12);
}
.kb-chapter {
  font-size: 11px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  color: #7FB3D0; margin-bottom: 7px;
}
.kb-title { font-family: var(--fh); font-size: 19px; font-weight: 700; line-height: 1.3; }
.kb-sub { font-size: 13.2px; color: #A8A399; margin-top: 4px; }
.kb-close {
  background: rgba(28,28,26,0.027); border: 1px solid rgba(245,243,239,0.12);
  color: #EDE9E2; width: 34px; height: 34px; border-radius: 9px;
  font-size: 15px; cursor: pointer; flex-shrink: 0;
  transition: background .25s, transform .25s;
}
.kb-close:hover { background: rgba(150,58,48,0.25); transform: rotate(90deg); }

/* Il palco cede il passo ai comandi: se lo spazio non basta si
   stringe lui, invece di spingerli fuori dal riquadro. */
.kb-stage {
  position: relative; width: 100%; aspect-ratio: 16/10;
  overflow: hidden; background: #15140F;
  flex: 0 1 auto; min-height: 0;
  margin-inline: auto;
}
.kb-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform-origin: 0 0;
  opacity: 0; transition: opacity .55s ease;
  will-change: transform, opacity;
}
.kb-img.on { opacity: 1; }
.kb-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 82% 74% at 50% 42%, transparent 55%, rgba(24,23,21,0.55) 100%),
    linear-gradient(to top, rgba(24,23,21,0.97) 0%, rgba(24,23,21,0.9) 14%, rgba(24,23,21,0.35) 30%, transparent 48%);
}
.kb-cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 30px 30px 26px;
  pointer-events: none;
  /* velatura propria: il sottotitolo resta leggibile anche quando
     sotto c'è una schermata chiarissima */
  background: linear-gradient(to top,
    rgba(21,20,15,0.96) 0%, rgba(21,20,15,0.92) 55%,
    rgba(21,20,15,0.72) 82%, rgba(21,20,15,0) 100%);
}
.kb-cap.in { animation: capIn .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes capIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.kb-cap-title {
  display: block;
  font-family: var(--fb); font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 700; letter-spacing: -.2px; margin-bottom: 7px;
  color: #FFFFFF;
  text-shadow: 0 2px 22px rgba(28,28,26,0.27);
}
.kb-cap-text {
  display: block; max-width: 780px;
  font-size: clamp(13.5px, 1.15vw, 16px); line-height: 1.6; color: #dbe3f0;
  text-shadow: 0 2px 16px rgba(28,28,26,0.285);
}
.kb-tap {
  position: absolute; top: 0; bottom: 92px; width: 22%;
  background: transparent; border: 0; cursor: pointer; z-index: 4;
}
.kb-tap-l { left: 0; }
.kb-tap-r { right: 0; }

.kb-end {
  position: absolute; inset: 0; z-index: 6;
  background: rgba(6,10,20,0.9); backdrop-filter: blur(6px);
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
.kb-end.show { display: flex; }
.kb-end p { font-family: var(--fh); font-size: 20px; font-weight: 700; }
.kb-end div { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.kb-bar { display: flex; gap: 4px; padding: 12px 22px 0; }
.kb-seg {
  height: 3px; border-radius: 3px; overflow: hidden;
  background: rgba(28,28,26,0.059); flex-basis: 0;
}
.kb-seg i { display: block; height: 100%; width: 0; background: var(--indigo2); border-radius: 3px; }
.kb-seg.done i { width: 100% !important; background: rgba(42,110,150,0.55); }

.kb-ctrl {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px 18px;
  flex-shrink: 0;          /* i comandi restano sempre visibili */
  flex-wrap: wrap;
}
.kb-bar { flex-shrink: 0; }
.kb-ico {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(28,28,26,0.027); border: 1px solid rgba(245,243,239,0.12);
  color: #EDE9E2; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .25s, border-color .25s, transform .2s;
}
.kb-ico:hover { background: rgba(27,77,107,0.22); border-color: rgba(27,77,107,0.5); }
.kb-ico:active { transform: scale(.93); }
.kb-playbtn {
  width: 46px; height: 46px; border-radius: 2px;
  background: var(--indigo); border-color: transparent;
}
.kb-playbtn:hover { background: var(--indigo2); }
.kb-count { font-size: 12.5px; color: #A8A399; margin-left: 6px; font-variant-numeric: tabular-nums; }
.kb-count b { color: #EDE9E2; }
.kb-spacer { flex: 1; }
.kb-chip {
  font-size: 12.2px; font-weight: 600;
  padding: 8px 13px; border-radius: 9px;
  background: rgba(28,28,26,0.027); border: 1px solid rgba(245,243,239,0.12);
  color: #EDE9E2; cursor: pointer; white-space: nowrap;
  transition: background .25s, border-color .25s, color .25s;
}
.kb-chip:hover { background: rgba(27,77,107,0.2); border-color: rgba(27,77,107,0.5); }
.kb-chip.off { color: #857F74; }

/* Volume */
.kb-vol { display: flex; align-items: center; gap: 8px; }
.kb-vol input[type="range"] {
  width: 84px; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: rgba(245,243,239,0.22);
  border-radius: 2px; cursor: pointer; outline: none;
}
.kb-vol input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 13px; height: 13px; border-radius: 50%;
  background: #EDE9E2; cursor: pointer; border: 0;
}
.kb-vol input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #EDE9E2; cursor: pointer; border: 0;
}
.kb-vol.muto input[type="range"] { opacity: .4; }
.kb-btn {
  font-size: 13.5px; font-weight: 600; padding: 11px 20px; border-radius: 10px;
  background: rgba(28,28,26,0.032); border: 1px solid rgba(245,243,239,0.12);
  color: #EDE9E2; cursor: pointer; transition: background .25s;
}
.kb-btn:hover { background: rgba(28,28,26,0.063); }
.kb-btn.kb-primary { background: var(--indigo); border-color: transparent; }
.kb-btn.kb-primary:hover { background: var(--indigo2); }

/* playlist */
.kb-side {
  background: #201F1C;
  color: #EDE9E2; border: 1px solid rgba(245,243,239,0.12);
  border-radius: 2px; overflow: hidden;
  display: flex; flex-direction: column; min-height: 0;
  box-shadow: 0 50px 120px rgba(28,28,26,0.21);
}
.kb-sidehead {
  padding: 14px 18px; border-bottom: 1px solid rgba(245,243,239,0.12);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.kb-sidehead b { font-family: var(--fh); font-size: 14.5px; }
/* position:relative serve perché offsetTop delle voci sia relativo alla lista */
.kb-list {
  overflow-y: auto; padding: 10px; flex: 1; position: relative;
  display: grid; gap: 4px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  align-content: start;
  max-height: 320px;
}
/* L'intestazione di categoria prende tutta la riga della griglia:
   altrimenti si incastra fra due tour e l'elenco diventa illeggibile. */
.kb-listcat {
  grid-column: 1 / -1;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: #7FB3D0;
  padding: 16px 10px 8px;
  margin-top: 6px;
  border-bottom: 1px solid rgba(245,243,239,0.12);
}
.kb-listcat:first-child { margin-top: 0; padding-top: 4px; }
.kb-listitem {
  width: 100%; display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 10px;
  background: transparent; border: 1px solid transparent;
  color: #EDE9E2; cursor: pointer; text-align: left;
  transition: background .22s, border-color .22s;
}
.kb-listitem:hover { background: rgba(28,28,26,0.023); }
.kb-listitem.active { background: rgba(27,77,107,0.16); border-color: rgba(27,77,107,0.45); }
.kb-listicon {
  font-family: var(--fb); font-size: 11px; font-weight: 600;
  letter-spacing: 1px; color: #7FB3D0;
  flex-shrink: 0; width: 24px; text-align: left; padding-top: 2px;
}
.kb-listtxt { min-width: 0; }
.kb-listtxt b { display: block; font-family: var(--fb); font-size: 13.2px; font-weight: 600; line-height: 1.35; }
.kb-listtxt i { display: block; font-style: normal; font-size: 11.2px; color: #857F74; margin-top: 2px; }

/* Dimensione del video su desktop.
   La prima versione legava la larghezza solo all'altezza della
   finestra: su uno schermo largo ma basso il video si riduceva a
   una finestrella in mezzo al vuoto. Ora c'è una larghezza minima
   garantita, e se proprio non ci sta in altezza è il pannello a
   scorrere — meglio scorrere che guardare un francobollo. */
/* Il palco si prende tutta la larghezza; è l'altezza a limitarlo,
   così l'immagine resta in proporzione senza deformarsi. */
@media (min-width: 1081px) {
  .kb-stage {
    width: min(100%, (100vh - 300px) * 1.6);
    margin-inline: auto;
  }
}

/* ══ RESPONSIVE ════════════════════════════════════════════ */
/* ── SCHERMO INTERO SENZA API (iPhone) ─────────────────────
   Stesso risultato visivo della modalità nativa, ottenuto solo
   con il CSS: il riquadro del video riempie lo schermo e
   l'elenco dei tour sparisce. */
.kb-root.espanso .kb-shell { width: 100%; max-height: 100%; height: 100%; gap: 0; }
.kb-root.espanso .kb-side { display: none; }
.kb-root.espanso { padding: 0; }
.kb-root.espanso .kb-main {
  height: 100%; max-width: none; border: 0; border-radius: 0;
  justify-content: center;
}
.kb-root.espanso .kb-stage {
  width: min(100%, (100vh - 170px) * 1.6);
  margin-inline: auto;
}
.kb-root.espanso .kb-sub { display: none; }

/* ── SCHERMO INTERO ────────────────────────────────────────
   Il palco resta 16:10 anche a tutto schermo: l'immagine riempie
   il riquadro senza object-fit, quindi cambiare proporzioni la
   deformerebbe. Si dimensiona sull'altezza e si centra. */
.kb-main:fullscreen {
  max-width: none; width: 100vw; height: 100vh;
  border: 0; border-radius: 0;
  justify-content: center;
}
.kb-main:fullscreen .kb-stage {
  aspect-ratio: 16 / 10;
  width: min(100vw, (100vh - 170px) * 1.6);
  margin-inline: auto;
}
.kb-main:fullscreen .kb-head { padding: 14px 26px 12px; }
.kb-main:fullscreen .kb-sub { display: none; }

@media (max-width: 1080px) {
  .kb-list { grid-template-columns: 1fr; max-height: 260px; }
}
@media (max-width: 768px) {
  .kb-root { padding: 0; }
  .kb-shell { border-radius: 0; gap: 0; height: 100%; }
  .kb-main { border-radius: 0; border: 0; }
  .kb-side { border-radius: 0; border: 0; border-top: 1px solid var(--border); }
  .kb-head { padding: 14px 16px 12px; }
  .kb-title { font-size: 16px; }
  .kb-sub { display: none; }
  .kb-cap { padding: 14px 18px 18px; }
  .kb-ctrl { padding: 12px 14px 16px; gap: 8px; flex-wrap: wrap; }
  .kb-count { display: none; }
  .kb-spacer { flex: 1 1 0; }
  .kb-bar { padding: 10px 14px 0; }
  .vh { padding: 120px 0 30px; }
  .bigplay { width: 66px; height: 66px; }
  /* Sul telefono il titolo del video in evidenza scende SOTTO
     l'immagine: sopra finiva su una schermata chiara e non si leggeva. */
  .feat::after { display: none; }
  .feat img { opacity: 1; }
  .feat-body {
    position: static;
    padding: 18px 18px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    gap: 12px;
  }
  .feat-body h3 { font-size: 19px; }
}
