/* Transport controls belong to the single video controller, not the card link. */
html body .tbp-video-preview {
  position: absolute; z-index: 8; top: 0; right: 6px; left: auto; transform: none;
  display: flex; gap: 0; align-items: center; flex-wrap: nowrap;
  width: 44px; height: 44px; max-width: calc(100% - 12px); border-radius: 22px;
  background: rgb(0 0 0 / 62%); color: #fff;
  opacity: 0; pointer-events: none;
}
html body .tbp-video-preview[hidden] { display: none !important; }
html body .tbp-video-preview button {
  --tbp-focus-color: #6B7280;
  box-sizing: border-box !important;
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important;
  flex: 0 0 44px; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 22px !important;
  background: transparent !important; color: #fff !important;
  box-shadow: none !important; cursor: pointer; touch-action: manipulation; pointer-events: inherit;
}
html body .tbp-video-preview button:hover { background: #ffffff1f !important; }
html body .tbp-video-preview button:active { background: #ffffff38 !important; }
html body .tbp-video-preview button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
html body .tbp-video-preview button svg { display: block; width: 20px !important; height: 20px !important; pointer-events: none; }
html body .tbp-video-preview button[hidden] { display: none !important; }
html body .tbp-video-preview__message {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  white-space: nowrap; clip-path: inset(50%); pointer-events: none;
}
html body .tbp-video-preview__message:empty { display: none; }
html body .tbp-video-preview-poster {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border-radius: inherit; overflow: hidden;
}
html body .tbp-video-preview-poster[hidden] { display: none !important; }
html body .tbp-video-preview-poster > img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
}
/* Real playback position, not a timer or a fake loading animation. */
/* L'anello: la posizione gira attorno alla scheda invece di tagliarla con una
   riga (Elind, 13/9). Parte da meta' del lato sinistro, sale, fa il giro in
   senso orario e chiude dov'e' partito. Il percorso lo disegna il JS sulla
   misura vera della scheda, perche' con un viewBox stirato gli angoli e lo
   spessore verrebbero deformati.

   Sta SUL bordo, non dentro (Elind, 13/9: «come se fosse lui il bordo»).
   Prima era rientrato di mezzo tratto ma con il raggio della scheda: un
   rettangolo rientrato di k vuole un raggio ridotto di k per restare
   parallelo, e agli angoli si staccava — era quello che si vedeva male.

   Il tratto e' 10 e non 5 perche' la scheda ha overflow:hidden
   (tbp-discovery-cards.css, file di Codex che non si tocca): la meta' esterna
   viene tagliata, quindi si vedono 5px netti appoggiati al bordo, che sono
   quelli che l'altra sessione aveva misurato come i piu' leggibili. */
html body .tbp-video-progress {
  position: absolute; z-index: 8; inset: 0;
  width: auto; height: auto; border-radius: inherit;
  overflow: visible; background: none; pointer-events: none;
}
html body .tbp-video-progress[hidden] { display: none !important; }
html body .tbp-video-progress > svg {
  position: absolute; inset: 0; display: block;
  width: 100%; height: 100%; overflow: visible; pointer-events: none;
}
/* La pista: dove l'oro non e' ancora arrivato. Appena accennata. */
html body .tbp-video-progress__pista {
  fill: none; stroke: rgb(255 255 255 / 26%); stroke-width: 10;
}
/* L'oro: piu' spesso di prima (3px non si vedeva) e con un alone, cosi' si
   stacca sia dalle foto chiare sia da quelle scure. */
html body .tbp-video-progress__oro {
  fill: none; stroke-width: 10; stroke-linecap: butt;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  filter: drop-shadow(0 0 3px rgb(231 183 64 / 55%));
}
/* Long location labels need photo room for 44px transport below the price. */
@media (max-width: 479px) {
  html body #tbp-results-container .grid-risultati:has(.tbp-exp-card video):has([data-tbp-card-reviews]) {
    grid-auto-rows: 384px !important;
  }
}
@media (hover: hover) and (pointer: fine) {
  html body :is(.tbp-exp-card, .tbp-card-thumb, .esperienze-video-copertina, .tbp-map-card__media):hover .tbp-video-preview { opacity: 1; pointer-events: auto; }
}
@media (hover: none), (pointer: coarse) {
  html body .tbp-video-preview[data-present="1"] { opacity: 1; pointer-events: auto; }
}
html body .tbp-video-preview:is([data-state="blocked"], [data-state="error"], [data-manual-only="1"], [data-user-paused="1"]) { opacity: 1; pointer-events: auto; }
html body .tbp-video-preview:focus-within { opacity: 1; pointer-events: auto; }

/* Con il puntatore l'anteprima parte in hover: comando piccolo e discreto,
   solo l'audio, non un pulsante Play che fa credere serva un clic. */
@media (hover: hover) and (pointer: fine) {
  html body .tbp-video-preview {
    height: 36px; border-radius: 18px; right: 8px;
    background: rgb(0 0 0 / 52%);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    transition: opacity 160ms ease;
  }
  html body .tbp-video-preview button {
    width: 36px !important; height: 36px !important;
    min-width: 36px !important; min-height: 36px !important;
    flex: 0 0 36px; border-radius: 18px !important;
  }
  html body .tbp-video-preview button svg { width: 18px !important; height: 18px !important; }
  html body .tbp-video-preview[data-hover-driven="1"] .tbp-video-preview__toggle { display: none !important; }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  html body .tbp-video-preview { transition: none; }
}
