/* ============================================================
   AIBoost – Videós vélemények (rail + lightbox)
   Újrahasználható: szabadúszó/céges képzés oldal, klub.
   Függ: main.css design tokenek (--void, --cyan, --purple, --glass…)
   ============================================================ */

/* ---------- Szekció ---------- */

.vtst {
  /* a rail kifut a viewport jobb széléig – a kilógást itt vágjuk le,
     hogy ne keletkezzen vízszintes görgetés az oldalon */
  overflow-x: clip;
}

.vtst__header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-9);
}

.vtst__intro {
  font-size: 17px;
  color: var(--white-dim);
  line-height: 1.7;
  margin-top: 16px;
}

/* ---------- Rail ---------- */

/* A nyilak ehhez igazodnak: pontosan a container tartalom-szélessége.
   (A railwrap kilóg a viewportig, ezért ahhoz képest a % kiszámíthatatlan
   lenne – a nyilakat ezért NEM ahhoz kötjük.) */
.vtst__rails {
  position: relative;
}

.vtst__railwrap {
  /* full-bleed jobbra: a bal szél a containerhez igazodik, a jobb kifut.
     A félbevágott kártya A JELZÉS, hogy van még – ezért nincs jobb padding
     a viewport széléig. */
  margin-right: calc(50% - 50vw);
}

.vrail {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  /* KÖTELEZŐ. Az `overflow-x: auto` miatt a másik tengely `visible`-ről
     automatikusan `auto`-ra vált (CSS spec), így a rail FÜGGŐLEGESEN IS
     scroll-dobozzá válik. Ha a tartalom akár pár pixellel magasabb nála,
     mobilon az ujj a railt mozgatja fel-le az oldal helyett – ami elveszi a
     gesztust az oldal görgetésétől. Explicit `hidden`-nel a doboz nem
     user-scrollable y-ban, így a függőleges húzás az oldalra öröklődik. */
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;   /* iOS: ne váltson vissza-lapozásra */
  scrollbar-width: none;            /* saját progress-sávot adunk */
  -ms-overflow-style: none;
  /* felül a hover-emelés (-4px), alul a kártya árnyékának hagyunk helyet */
  padding: 8px 24px 10px 0;
  /* a szélső kártya beleolvad a háttérbe → „folytatódik" érzés */
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 90px), transparent 100%);
          mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 90px), transparent 100%);
}

.vrail::-webkit-scrollbar { display: none; }

.vcard {
  flex: 0 0 clamp(196px, 21vw, 232px);
  scroll-snap-align: start;
  position: relative;
  margin: 0;
}

/* A GLOBÁLIS .reveal 32px-cel lejjebb tolja az elemet, amíg be nem úszik a
   képbe. A railben ez hibás: a jobbra kilógó kártyák SOHA nem érik el a
   viewportot, így az IntersectionObserver nem ad rájuk .visible-t, és
   véglegesen eltolva maradnak → 28px függőleges túlcsordulás a scroll-
   dobozban (mérve: scrollHeight 634 vs clientHeight 606).
   Az áttűnést megtartjuk, az eltolást nem. */
.vrail .vcard.reveal {
  transform: none;
}

.vcard__btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, var(--navy), var(--surface));
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  transition: transform .3s cubic-bezier(.2,.7,.3,1), border-color .3s ease, box-shadow .3s ease;
}

.vcard__btn:hover,
.vcard__btn:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(124,58,237,.5);
  box-shadow: 0 18px 44px rgba(4,7,26,.6);
}

.vcard__btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.vcard__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* egységes tónus: 22 különböző fényviszonyú kocka így lesz egy rendszer */
  filter: saturate(.86) contrast(1.05) brightness(.9);
  transition: transform .5s cubic-bezier(.2,.7,.3,1);
}

.vcard__btn:hover .vcard__img { transform: scale(1.045); }

/* Sötét gradiens + halvány purple duotone: a háttér textúrává válik
   a szöveg mögött, nem hibává. Az idézet ezen ül. */
.vcard__scrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(124,58,237,.14) 0%,
      rgba(4,7,26,0) 26%,
      rgba(4,7,26,.5) 52%,
      rgba(4,7,26,.88) 76%,
      rgba(4,7,26,.97) 100%);
}

.vcard__time {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--white);
  background: rgba(4,7,26,.6);
  border: 1px solid var(--glass-border);
  padding: 4px 8px;
  border-radius: var(--r-pill);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.vcard__play {
  position: absolute;
  /* az áll (~52%) és az idézet-blokk (~68%) közti sávban – a keretezés
     a szemvonalat 33%-ra teszi, így a gomb SOHA nem takarja az arcot */
  top: 56%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124,58,237,.82);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 8px 30px rgba(124,58,237,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform .25s ease, background .25s ease;
}

.vcard__play svg { width: 20px; height: 20px; fill: var(--white); margin-left: 2px; }

.vcard__btn:hover .vcard__play,
.vcard__btn:focus-visible .vcard__play {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--purple);
}

.vcard__meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 15px 17px;
  display: block;
}

/* A szekció legfontosabb eleme: a többség ezt olvassa el és soha nem nyom play-t. */
.vcard__quote {
  display: block;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--white);
  margin-bottom: 9px;
  /* max 4 sor – utána levágjuk, hogy a kártyák egyforma ritmusúak legyenek */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vcard__name {
  display: block;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--white);
  letter-spacing: -.01em;
}

.vcard__role {
  display: block;
  font-size: 11px;
  color: var(--purple-glow);
  margin-top: 2px;
}

/* ---------- Nyilak (desktop) ---------- */

.vrail__nav {
  position: absolute;
  top: calc(50% - 18px);
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14,21,56,.82);
  border: 1px solid var(--glass-border);
  color: var(--white);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity .25s ease, background .25s ease, transform .2s ease;
}

.vrail__nav:hover { background: var(--purple); transform: translateY(-50%) scale(1.06); }
.vrail__nav:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.vrail__nav svg { width: 18px; height: 18px; fill: currentColor; }
.vrail__nav--prev { left: -14px; }
.vrail__nav--next { right: -14px; }

.vrail__nav[disabled] {
  opacity: 0;
  pointer-events: none;
}

/* ---------- Progress ---------- */

.vrail__progress {
  position: relative;
  height: 3px;
  border-radius: 3px;
  background: rgba(124,58,237,.16);
  margin: 26px auto 0;
  overflow: hidden;
}

.vrail__progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 20%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  transition: transform .12s linear;
  transform-origin: left;
}

/* ---------- Lightbox ---------- */

.vlb[hidden] { display: none; }

.vlb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.vlb__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4,7,26,.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: vlbFade .25s ease;
}

.vlb__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  animation: vlbIn .3s cubic-bezier(.2,.7,.3,1);
}

.vlb__stage {
  position: relative;
  aspect-ratio: 9 / 16;
  height: min(78vh, 780px);
  max-width: calc(100vw - 48px);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

.vlb__stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.vlb__info { text-align: center; }
.vlb__name { font-weight: 700; font-size: 16px; color: var(--white); }
.vlb__role { font-size: 13px; color: var(--purple-glow); margin-top: 2px; }
.vlb__count { font-family: var(--font-mono); font-size: 11px; color: var(--white-muted); margin-top: 6px; }

.vlb__close,
.vlb__nav {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(14,21,56,.85);
  border: 1px solid var(--glass-border);
  color: var(--white);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .25s ease, transform .2s ease;
}

.vlb__close:hover,
.vlb__nav:hover { background: var(--purple); transform: scale(1.07); }
.vlb__close:focus-visible,
.vlb__nav:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.vlb__close { top: -14px; right: -14px; width: 40px; height: 40px; }
.vlb__close svg { width: 16px; height: 16px; fill: currentColor; }

.vlb__nav { top: calc(50% - 40px); width: 46px; height: 46px; }
.vlb__nav svg { width: 18px; height: 18px; fill: currentColor; }
.vlb__nav--prev { left: -62px; }
.vlb__nav--next { right: -62px; }
.vlb__nav[disabled] { opacity: .3; pointer-events: none; }

@keyframes vlbFade { from { opacity: 0; } }
@keyframes vlbIn { from { opacity: 0; transform: scale(.97); } }

/* ---------- Reszponzív ---------- */

@media (max-width: 960px) {
  .vrail__nav { display: none; }          /* mobilon a swipe a natív gesztus */
  .vlb__nav--prev { left: 50%; transform: translateX(-64px); top: auto; bottom: -58px; }
  .vlb__nav--next { right: 50%; transform: translateX(64px); top: auto; bottom: -58px; }
  .vlb__nav:hover { transform: translateX(-64px) scale(1.07); }
  .vlb__nav--next:hover { transform: translateX(64px) scale(1.07); }
  .vlb__dialog { padding-bottom: 58px; }
}

@media (max-width: 768px) {
  .vcard { flex-basis: 64vw; scroll-snap-align: center; }
  .vrail {
    scroll-padding-inline: 24px;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%);
            mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 40px), transparent 100%);
  }
  .vcard__quote { font-size: 13px; -webkit-line-clamp: 3; }
  .vlb { padding: 16px; }
  .vlb__stage { height: min(70vh, 640px); }
  .vlb__close { top: -10px; right: -6px; }
}

@media (prefers-reduced-motion: reduce) {
  .vrail { scroll-behavior: auto; }
  .vcard__btn,
  .vcard__img,
  .vcard__play,
  .vrail__nav,
  .vlb__close,
  .vlb__nav { transition: none; }
  .vcard__btn:hover { transform: none; }
  .vcard__btn:hover .vcard__img { transform: none; }
  .vlb__backdrop,
  .vlb__dialog { animation: none; }
}
