/* ─────────────────────────────────────────────────
   TEDx TALKS
   Hero come Concerts + un pannello a tutta altezza per ogni talk, in scorrimento
   normale (nessuno stacking). Indicatore laterale a pallini e linee.
   Ogni talk: titolo, luogo, testo e video (in sovraimpressione su linee animate).
───────────────────────────────────────────────── */

/* Header nascosto, come sulla homepage/Concerts */
.site-header { display: none !important; }
.site-main   { margin-top: 0 !important; }

/* ── Hero (identica a Concerts) ─────────────────── */
.tedx-hero {
    height: 100vh;
    height: var(--screen-h, 100vh);
    background: var(--black);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vh, 5rem) clamp(2rem, 6vw, 6rem) clamp(2rem, 5vh, 4rem);
    box-sizing: border-box;
    position: relative;
}
.tedx-hero__title {
    font-size: clamp(4rem, 15vw, 19rem);
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1;
    color: var(--white);
    margin: 0;
}
.tedx-hero__bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: clamp(.5rem, 1.2vw, 1rem);
}
.tedx-hero__label {
    font-size: .75rem;
    color: var(--white);
    opacity: .45;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 0;
    letter-spacing: .02em;
}
.tedx-hero__desc {
    font-size: clamp(1.3rem, 2.8vw, 3rem);
    line-height: 1.22;
    color: var(--white);
    margin: 0;
    font-weight: 400;
}

/* ── Pannelli in scorrimento normale (uno sotto l'altro) ───────── */
.talks-stack { position: relative; }

.talk-panel {
    position: relative;
    min-height: 100vh;
    min-height: var(--screen-h, 100vh);
    display: flex;
    box-sizing: border-box;
}

/* Varianti colore (bg card + testo + colore linee) */
.talk-panel--dark {
    color: var(--white);
    --panel-bg: var(--black);
    --line-color: 255, 255, 255;
}
.talk-panel--light {
    color: var(--black);
    --panel-bg: var(--white);
    --line-color: 19, 13, 12;
}

/* Card: sfondo del pannello, a tutta larghezza e almeno a tutta altezza */
.talk-panel__card {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: var(--screen-h, 100vh);
    box-sizing: border-box;
    display: flex;
    align-items: stretch;
    background: var(--panel-bg);
    color: inherit;
    padding: clamp(4.5rem, 9vh, 7rem) clamp(1.5rem, 5vw, 6rem) clamp(2.5rem, 5vh, 4rem);
    overflow: hidden;
}

.talk-panel__inner {
    position: relative;
    z-index: 1;              /* sopra le linee full screen */
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;   /* ancora in alto: titolo sempre visibile */
    gap: clamp(1.4rem, 3.5vh, 2.6rem);
    padding-block: clamp(1rem, 3vh, 3rem);
    flex: 1;
    min-width: 0;
}

/* Linee animate: full screen, coprono l'intera card, dietro al contenuto */
.talk-panel__lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ── Testo (titolo → luogo → testo, sopra il video) ── */
.talk-panel__text { min-width: 0; flex-shrink: 0; }
.talk-panel__title {
    font-size: clamp(2.2rem, 4.4vw, 4.2rem);
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.02;
    margin: 0 0 1rem;
}
.talk-panel__location {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    opacity: .55;
    margin: 0 0 1.3rem;
}
.talk-panel__desc {
    font-size: clamp(.95rem, 1.15vw, 1.1rem);
    line-height: 1.5;
    max-width: 52rem;
    margin: 0;
    opacity: .8;
}

/* ── Media (contiene il video grande) ───────────── */
.talk-panel__media {
    position: relative;
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
}

/* Video: altezza limitata dal viewport così titolo + testo + video restano
   visibili insieme. */
.talk-panel__video {
    position: relative;
    z-index: 1;
    height: 52vh;
    width: auto;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 2px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.talk-panel__video video,
.talk-panel__video iframe,
.talk-panel__video .talk-panel__poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    display: block;
}
.talk-panel__poster { z-index: 1; }
.talk-panel__video.is-playing .talk-panel__poster { opacity: 0; transition: opacity .5s; pointer-events: none; }

/* ── Burger + wordmark adattivi (come Concerts) ── */
.hs-nav  { mix-blend-mode: difference !important; }
.hs-home { mix-blend-mode: difference !important; }
.hs-nav:has([aria-expanded="true"]) { mix-blend-mode: normal !important; }

/* ── Empty state ────────────────────────────────── */
.talks-empty {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--black);
    opacity: .5;
    padding: 2rem;
    text-align: center;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 860px) {
    .tedx-hero { padding-top: 5rem; }   /* titolo sotto il logo */
    .tedx-hero__title { font-size: clamp(3rem, 15vw, 6rem); }
    .talk-panel__card {
        padding: clamp(4.5rem, 10vh, 6rem) clamp(1.25rem, 5vw, 2.5rem) clamp(2rem, 5vh, 3rem);
    }
    .talk-panel__desc { max-width: none; }
    /* Su schermi stretti verticali l'altezza fissa non regge: torna a piena
       larghezza. */
    .talk-panel__video {
        height: auto;
        width: 100%;
    }
}

/* ── Indicatore laterale: pallino · linea · pallino · linea… (verticale) ──
   Un pallino per il visore e uno per ogni talk. Si riempiono man mano che si
   scende. mix-blend-mode: difference → nero su sfondo chiaro, bianco su scuro. */
.talks-progress {
    position: fixed;
    left: clamp(.9rem, 2vw, 1.8rem);
    top: 50%;
    transform: translateY(calc(-50% - var(--pin, 0px)));   /* --pin: spinta verso l'alto quando arriva il footer */
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
}
.talks-progress__dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    box-sizing: border-box;
    border: 1.5px solid rgba(255,255,255,.35);   /* vuoto: grigio come le linee */
    border-radius: 50%;
    background: transparent;
    transition: background-color .35s ease, border-color .35s ease;
}
.talks-progress__dot.is-filled { background: currentColor; border-color: currentColor; }
.talks-progress__line {
    position: relative;
    flex-shrink: 0;
    width: 1.5px;
    height: 34px;
    background: rgba(255,255,255,.35);
    overflow: hidden;
}
.talks-progress__line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: currentColor;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .45s ease;
}
.talks-progress__line.is-filled::after { transform: scaleY(1); }

/* Su mobile l'indicatore laterale non si mostra */
@media (max-width: 860px) {
    .talks-progress { display: none; }
}
