/* ============================================================
   VIDEO NEWS — feed a schermo intero, stile TikTok/Reels
   ============================================================ */

.tnv-app {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 999999;
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   BANNER "CORRIERE DI GENOVA" — pagina video pulita e indipendente:
   nessun elemento del tema (menu, breadcrumb, sidebar) viene mostrato,
   solo questa intestazione essenziale con il marchio del giornale.
   ============================================================ */
.tnv-brand-banner {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    margin: 0 auto;
    padding: 12px 0 10px;
    background: #000;
}
.tnv-brand-rule {
    width: 100%;
    height: 1px;
    margin: 6px 0;
    background: linear-gradient(90deg, transparent 0%, #c9a24a 12%, #f0d080 50%, #c9a24a 88%, transparent 100%);
}
.tnv-brand-name {
    margin: 2px 0;
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: #fff;
    font-size: 1.6rem;
    font-size: clamp(1.25rem, 5.5vw, 2.2rem);
    letter-spacing: 6px;
    letter-spacing: clamp(4px, 1.5vw, 10px);
    text-transform: uppercase;
    font-weight: 400;
    white-space: nowrap;
    text-shadow: 0 1px 8px rgba(201,162,74,.35);
}

.tnv-feed {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
}
.tnv-feed::-webkit-scrollbar { display: none; }

.tnv-slide {
    position: relative;
    height: 100%;
    width: 100%;
    -webkit-scroll-snap-align: start;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    background: #000;
}

.tnv-video {
    max-height: 100%;
    max-width: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.tnv-slide--empty { align-items: center; justify-content: center; }
.tnv-empty-msg { text-align: center; color: #fff; opacity: .9; padding: 0 24px; }
.tnv-empty-msg i { font-size: 2.4rem; margin-bottom: 10px; display: block; }

.tnv-loading {
    height: 100%;
    width: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
}

.tnv-overlay {
    position: absolute;
    left: 16px;
    right: 76px;
    bottom: 100px;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.tnv-author { font-weight: 700; margin: 0 0 6px; font-size: .95rem; }
.tnv-caption { margin: 0; font-size: .9rem; line-height: 1.35; }

/* ============================================================
   AVVISO REAZIONE OBBLIGATORIA
   Resta visibile finché l'utente non tocca una reazione: solo allora
   scompare e si passa automaticamente al video successivo.
   ============================================================ */
.tnv-reaction-gate {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    /* Ultimo nel DOM = sopra tutto: nessun z-index necessario su Android */
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0,0,0,.72);
    text-align: center;
    /* Nascosto di default. Usiamo visibility+opacity invece del solo opacity:
       pointer-events:none non è supportato sugli elementi HTML in alcuni
       browser Android (funziona solo su SVG): con visibility:hidden l'elemento
       non intercetta mai i tocchi, nemmeno su quei browser. */
    opacity: 0;
    visibility: hidden;
    -webkit-transition: opacity .2s ease, visibility .2s ease;
    transition: opacity .2s ease, visibility .2s ease;
}
.tnv-reaction-gate.is-shown {
    opacity: 1;
    visibility: visible;
}
.tnv-reaction-gate.is-done {
    opacity: 0 !important;
    visibility: hidden !important;
}

.tnv-reaction-msg {
    margin: 0;
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1.3;
    text-shadow: 0 2px 10px rgba(0,0,0,.8);
    background: rgba(0,0,0,.35);
    padding: 10px 18px;
    border-radius: 14px;
    max-width: 90%;
}

.tnv-reaction-row {
    /* grid non supportato su Android browser classico: usiamo flex wrap */
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
}
.tnv-reaction-btn {
    width: 60px;
    height: 60px;
    margin: 7px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.75);
    background: rgba(0,0,0,.5);
    /* Centratura senza flex: text-align + line-height coprono tutti i browser */
    text-align: center;
    line-height: 60px;
    vertical-align: middle;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
    -webkit-transition: -webkit-transform .15s ease, border-color .15s ease;
    transition: transform .15s ease, border-color .15s ease;
}
.tnv-reaction-btn:active { -webkit-transform: scale(.88); transform: scale(.88); }

@keyframes tnv-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-7px); }
    80% { transform: translateX(7px); }
}
.tnv-reaction-gate.tnv-shake { animation: tnv-shake .4s ease; }

/* Piccolo indicatore permanente, discreto, che ricorda la reazione già
   data senza più occupare il centro dello schermo. */
.tnv-reaction-indicator {
    position: absolute;
    left: 16px;
    top: 16px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0,0,0,.68);
    border: 1.5px solid rgba(255,255,255,.6);
    text-align: center;
    line-height: 34px;
    display: none;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}
.tnv-slide.tnv-reacted .tnv-reaction-indicator {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
}

.tnv-mute-btn {
    position: absolute;
    right: 16px;
    bottom: 160px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.7);
    background: rgba(0,0,0,.68);
    color: #fff;
    cursor: pointer;
    text-align: center;
    line-height: 46px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}
.tnv-mute-btn svg { pointer-events: none; vertical-align: middle; }

.tnv-delete-btn {
    position: absolute;
    right: 16px;
    bottom: 214px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.7);
    background: rgba(0,0,0,.68);
    color: #fff;
    cursor: pointer;
    text-align: center;
    line-height: 46px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-transition: opacity .15s ease;
    transition: opacity .15s ease;
}
.tnv-delete-btn svg { pointer-events: none; vertical-align: middle; }
.tnv-delete-btn:disabled { opacity: .5; cursor: default; }
.tnv-delete-btn:hover { background: rgba(200,30,30,.65); }

/* Pannello condivisione: colonna di tasti verticale sul lato destro.
   Ordine DOM: WA prima (in basso), FB dopo (in alto) — column-reverse */
.tnv-share-panel {
    position: absolute;
    right: 16px;
    bottom: 272px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: reverse;
    -webkit-flex-direction: column-reverse;
    flex-direction: column-reverse;
}
/* gap non supportato su Android classico: margin-bottom sul primo figlio */
.tnv-share-panel .tnv-share-btn + .tnv-share-btn { margin-bottom: 8px; }
.tnv-share-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.7);
    background: rgba(0,0,0,.68);
    color: #fff;
    cursor: pointer;
    text-align: center;
    line-height: 46px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-transition: background .15s ease;
    transition: background .15s ease;
    text-decoration: none;
}
.tnv-share-btn svg { pointer-events: none; vertical-align: middle; }
.tnv-share-wa:hover { background: rgba(37,211,102,.8); }
.tnv-share-fb:hover { background: rgba(24,119,242,.8); }

.tnv-play-toggle {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    /* Primo nel DOM = sotto tutti gli altri pulsanti: nessun z-index serve */
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}
.tnv-play-toggle svg {
    background: rgba(0,0,0,.45);
    border-radius: 50%;
    padding: 18px;
    width: 34px;
    height: 34px;
    opacity: 0;
    transition: opacity .15s ease;
}
.tnv-play-toggle.tnv-flash svg { opacity: 1; }

.tnv-nav-btns {
    position: fixed;
    left: 16px;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    z-index: 1000001;
}
.tnv-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.7);
    background: rgba(0,0,0,.68);
    color: #fff;
    text-align: center;
    line-height: 40px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 10px;
}
.tnv-nav-btn:last-child { margin-bottom: 0; }
.tnv-nav-btn svg { vertical-align: middle; }
.tnv-nav-btn:disabled { opacity: .3; cursor: default; }

.tnv-upload-fab-wrap {
    position: fixed;
    left: 50%;
    bottom: 20px;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);
    z-index: 1000001;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
}
.tnv-upload-label {
    margin-top: 6px;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.9), 0 0 12px rgba(0,0,0,.7);
    white-space: nowrap;
    pointer-events: none;
}
.tnv-upload-fab {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #c9a24a;
    color: #111;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
    text-align: center;
    line-height: 52px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.tnv-upload-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1000000;
    background: rgba(0,0,0,.7);
    display: none;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 16px;
}
.tnv-upload-overlay.visible {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
}

.tnv-upload-box {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    box-sizing: border-box;
    max-height: 90vh;
    overflow-y: auto;
}

.tnv-upload-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.tnv-upload-head h3 { margin: 0; font-size: 1.1rem; }
.tnv-upload-close {
    border: none;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
}

.tnv-upload-picker {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 24px 12px;
    text-align: center;
    position: relative;
    color: #666;
    margin-bottom: 12px;
}
.tnv-upload-picker i { font-size: 1.8rem; margin-bottom: 8px; display: block; }
.tnv-upload-picker input[type="file"] {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    opacity: 0;
    cursor: pointer;
}

#tnv-upload-preview {
    width: 100%;
    max-height: 260px;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #000;
}

#tnv-caption {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 12px;
    font: inherit;
}

.tnv-upload-msg {
    font-size: .85rem;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 12px;
}
.tnv-upload-msg.error   { background: #fdecea; color: #b3261e; }
.tnv-upload-msg.success { background: #e6f4ea; color: #1e7e34; }

.tnv-upload-submit {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 12px;
    background: #1a2b4c;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}
.tnv-upload-submit:disabled { opacity: .5; cursor: not-allowed; }

.tnv-upload-locked {
    text-align: center;
    padding: 8px 0 4px;
    color: #444;
}
.tnv-upload-locked i { font-size: 1.8rem; margin-bottom: 10px; display: block; color: #999; }
.tnv-upload-locked p { margin: 0 0 16px; line-height: 1.4; }
.tnv-upload-locked-actions { display: flex; flex-direction: column; gap: 10px; }
.tnv-upload-locked-secondary {
    display: block;
    text-align: center;
    color: #666;
    text-decoration: underline;
    font-size: .85rem;
}

.tnv-upload-tabs {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    margin-bottom: 12px;
    background: #f2f2f2;
    border-radius: 10px;
    padding: 4px;
}
.tnv-upload-tab + .tnv-upload-tab { margin-left: 6px; }
.tnv-upload-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 6px;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
}
.tnv-upload-tab.active { background: #fff; color: #111; box-shadow: 0 1px 3px rgba(0,0,0,.15); }

.tnv-record-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 12;
    max-height: 280px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}
#tnv-record-live { width: 100%; height: 100%; object-fit: cover; }
#tnv-record-live.tnv-mirrored { transform: scaleX(-1); }
.tnv-record-timer {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: .8rem;
    padding: 4px 10px;
    border-radius: 12px;
}
.tnv-record-flip {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,.7);
    background: rgba(0,0,0,.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tnv-record-flip svg { pointer-events: none; }
.tnv-record-flip:hover { background: rgba(0,0,0,.75); }

.tnv-record-controls { display: flex; justify-content: center; margin-bottom: 12px; }
.tnv-record-btn {
    border: none;
    border-radius: 24px;
    padding: 10px 22px;
    font-weight: 600;
    cursor: pointer;
    font-size: .9rem;
}
.tnv-record-btn--start { background: #d64545; color: #fff; }
.tnv-record-btn--stop  { background: #333; color: #fff; }

.tnv-upload-retry {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    color: #555;
    font-size: .85rem;
}
