/* Vetrina digitale /tv/<codice>: Smart TV 16:9 in negozio. Tema scuro, misure in vw/vh (leggibile da lontano). */
@font-face { font-family: "Lumina Serif"; src: url("fonts/serif-regular.woff2") format("woff2"), url("fonts/serif-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lumina Sans"; src: url("fonts/sans-regular.woff2") format("woff2"), url("fonts/sans-regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lumina Sans"; src: url("fonts/sans-medium.woff2") format("woff2"), url("fonts/sans-medium.otf") format("opentype"); font-weight: 500; font-display: swap; }

:root {
  --tv-bg: #1C1917;        /* antracite (stone-900) */
  --tv-bg-2: #24211F;
  --tv-ink: #F5F5F4;       /* alabastro (stone-100) */
  --tv-muted: #A8A29E;     /* stone-400 */
  --tv-gold: #C4AB84;      /* sabbia dorata, come il layout notturno */
  --tv-line: #3B3733;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--tv-bg); color: var(--tv-ink); cursor: none; }
body { display: grid; place-items: center; }
body { font-family: "Lumina Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
::-webkit-scrollbar { display: none; }

/* 16:9 sempre: riempie lo schermo e si centra se il rapporto è diverso */
.tv { position: relative; width: min(100vw, 177.78vh); height: min(56.25vw, 100vh); overflow: hidden;
      background: radial-gradient(ellipse at 30% 40%, var(--tv-bg-2), var(--tv-bg) 70%); --u: min(1vw, 1.7778vh); }

.tv-slide { position: absolute; inset: 0 0 calc(8 * var(--u)) 0; display: grid; grid-template-columns: 60% 40%; opacity: 0; transition: opacity 1.6s ease-in-out; }
.tv-slide.is-active { opacity: 1; }

.tv-left { display: flex; align-items: center; gap: calc(4 * var(--u)); padding: calc(5 * var(--u)) calc(3 * var(--u)) calc(3 * var(--u)) calc(6 * var(--u)); min-width: 0; }
.tv-portrait { flex: none; width: calc(21 * var(--u)); padding: calc(.5 * var(--u)); border: 1px solid var(--tv-gold); border-radius: 999px 999px 6px 6px; }
.tv-portrait img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 999px 999px 4px 4px; filter: saturate(.85) contrast(1.05); background: var(--tv-bg-2); }
.tv-text { min-width: 0; }
.tv-eyebrow, .tv-label { font-size: calc(1.3 * var(--u)); letter-spacing: .22em; text-transform: uppercase; color: var(--tv-gold); }
.tv-name { margin-top: calc(1 * var(--u)); font: 400 calc(5.2 * var(--u))/1.05 "Lumina Serif", Georgia, serif; color: var(--tv-ink); overflow-wrap: anywhere; }
.tv-dates { margin-top: calc(1.4 * var(--u)); font-size: calc(1.9 * var(--u)); color: var(--tv-muted); }
.tv-funeral { margin-top: calc(3.2 * var(--u)); padding-top: calc(2.4 * var(--u)); border-top: 1px solid var(--tv-line); }
.tv-when { margin-top: calc(.8 * var(--u)); font: 400 calc(2.8 * var(--u))/1.2 "Lumina Serif", Georgia, serif; color: var(--tv-ink); }
.tv-where { margin-top: calc(.6 * var(--u)); font-size: calc(1.9 * var(--u)); color: var(--tv-ink); opacity: .85; }

.tv-right { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(4 * var(--u)) calc(5 * var(--u)) calc(3 * var(--u)) calc(2 * var(--u)); border-left: 1px solid var(--tv-line); text-align: center; }
.tv-qr { width: calc(22 * var(--u)); padding: calc(1.4 * var(--u)); background: #fff; border-radius: calc(1 * var(--u)); }
.tv-qr svg { display: block; width: 100%; height: auto; }
.tv-cta { margin-top: calc(2.6 * var(--u)); max-width: calc(30 * var(--u)); font: 400 calc(2.3 * var(--u))/1.3 "Lumina Serif", Georgia, serif; color: var(--tv-ink); }
.tv-url { margin-top: calc(1.2 * var(--u)); font-size: calc(1.2 * var(--u)); letter-spacing: .04em; color: var(--tv-muted); }

.tv-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(2 * var(--u)); text-align: center; }
.tv-empty .ornament { color: var(--tv-gold); }
.tv-agency-name { font: 400 calc(4.5 * var(--u))/1.1 "Lumina Serif", Georgia, serif; }
/* Logo dell'agenzia su una targhetta alabastro: i loghi sono quasi sempre scuri, su fondo antracite sparirebbero.
   I loghi monocromi invece si schiariscono e restano sul fondo scuro, senza targhetta. */
.tv-plate { display: inline-flex; align-items: center; justify-content: center; height: calc(5.4 * var(--u)); padding: calc(.7 * var(--u)) calc(1.4 * var(--u));
            background: #F5F2EC; border-radius: calc(.6 * var(--u)); box-shadow: 0 0 0 1px rgba(196, 171, 132, .35); }
.tv-plate img { display: block; height: 100%; width: auto; max-width: calc(22 * var(--u)); object-fit: contain; }
.tv-plate.is-mono { background: none; box-shadow: none; padding: 0; }
.tv-plate.is-mono img { filter: brightness(0) invert(.92); }
.tv-plate-big { height: calc(16 * var(--u)); padding: calc(2 * var(--u)) calc(3 * var(--u)); border-radius: calc(1 * var(--u)); }
.tv-plate-big img { max-width: calc(40 * var(--u)); }

.tv-hint { position: absolute; left: 50%; bottom: calc(9 * var(--u)); transform: translateX(-50%); padding: calc(.8 * var(--u)) calc(1.8 * var(--u));
           border: 1px solid var(--tv-line); border-radius: 999px; background: rgba(28, 25, 23, .92); color: var(--tv-muted);
           font-size: calc(1.2 * var(--u)); letter-spacing: .04em; white-space: nowrap; transition: opacity 1s; }
.tv-hint.is-quiet { opacity: .35; }
.tv-hint[hidden] { display: none; }

.tv-foot { position: absolute; left: 0; right: 0; bottom: 0; height: calc(8 * var(--u)); display: flex; align-items: center; gap: calc(1.6 * var(--u)); padding: 0 calc(6 * var(--u)); border-top: 1px solid var(--tv-line); }
.tv-foot-name { font-size: calc(1.5 * var(--u)); letter-spacing: .08em; color: var(--tv-ink); opacity: .8; }
.tv-dots { margin-left: auto; display: flex; gap: calc(.8 * var(--u)); }
.tv-dot { width: calc(.8 * var(--u)); height: calc(.8 * var(--u)); border-radius: 50%; background: var(--tv-line); transition: background .6s; }
.tv-dot.is-active { background: var(--tv-gold); }

@media (prefers-reduced-motion: reduce) { .tv-slide { transition: none; } }
/* vetrina dell'agenzia di esempio (area dimostrativa) */
.tv-demo { position: absolute; top: calc(1.2 * var(--u)); right: calc(1.6 * var(--u)); margin: 0; padding: calc(.5 * var(--u)) calc(1.2 * var(--u)); border-radius: 999px; background: rgba(255, 255, 255, .12); color: #F4F0E8; font-size: calc(1.3 * var(--u)); letter-spacing: .04em; }
