/* =========================================================
   PORTFOLIO ROW (Netflix-style) — Version dark fixed
   ========================================================= */

/* -------- 1. Section principale -------- */

.jk-portfolio {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px 0 36px;
  background: var(--bg-alt);
  color: var(--text-main);
  overflow: hidden;
}

/* Fond flouté ultra soft contrôlé par JS via --jk-portfolio-bg */
.jk-portfolio::before {
  content: "";
  position: absolute;
  inset: -12%;
  background: var(--bg-alt);
  background-image: var(--jk-portfolio-bg);
  background-size: cover;
  background-position: center;
  filter: grayscale(1) blur(38px);
  opacity: 0.18;
  mix-blend-mode: screen;
  z-index: 0;
}

.jk-portfolio-head {
  position: relative;
  z-index: 1;
  padding: 0 6vw 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.jk-portfolio-title {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 28px);
  color: inherit;
  opacity: 1;
}

/* -------- 2. Pills = boutons filtres portfolio -------- */

.jk-portfolio-filters {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.jk-filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 13px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid currentColor;
  background: transparent;
  color: currentColor;
  opacity: 0.8;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.jk-filter-pill:hover {
  transform: translateY(-1px);
  opacity: 1;
}

/* Pill active : même logique que les boutons primary */
.jk-filter-pill.is-active {
  background: var(--btn-bg);
  border-color: var(--btn-border);
  color: var(--btn-text);
  opacity: 1;
}

/* -------- 3. Row de cartes (scroll horizontal + snap) -------- */

.jk-tvrow {
  position: relative;
  height: clamp(42vh, 60vh, 68vh);
  max-height: clamp(42vh, 60vh, 68vh);

  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 10px 6vw 10px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 6vw;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: none;
  -ms-overflow-style: none;

  background: transparent;
  box-shadow: none;
  z-index: 1;
}

.jk-tvrow::-webkit-scrollbar {
  height: 0;
}

/* pas d’infos visibles tant qu’aucun projet n’est actif */
.jk-tvrow:not(.has-active) + .jk-tvinfo {
  opacity: 0;
  pointer-events: none;
  height: 0;
  margin-top: 0;
  transform: translateY(8px);
}

/* -------- 4. Carte projet (poster + layer active 16/9 + carrousel interne) -------- */

.jk-tvcard {
  position: relative;
  flex: 0 0 clamp(140px, 11vw, 190px);
  height: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: visible;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  scroll-snap-align: start;

  opacity: 0.7;
  --push-x: 0px;

  transform: translateX(var(--push-x));
  transition:
    opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    filter 0.55s ease;
  will-change: opacity, transform, filter;
}

.jk-tvcard__poster {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: opacity 0.2s ease;
}

.jk-tvcard__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* couche active (16/9) */
.jk-tvcard__active {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  aspect-ratio: 16 / 9;
  width: auto;

  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  border: 2px solid transparent;
  box-shadow: 0 20px 70px rgba(0,0,0,0.8);
  transform: scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.jk-tvcard__active::before {
  content: "";
  position: absolute;
  inset: -8%;
  background-image: var(--active-bg); /* défini en JS externe */
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.55) saturate(1.1);
  transform: scale(1.1);
  z-index: 0;
  opacity: 0.9;
}

/* Carrousel interne */
.jk-tvcarousel {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.jk-tvcarousel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.55s ease;
}

.jk-tvcarousel img.is-active {
  opacity: 1;
}

/* bouton close */
.jk-tvclose {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid currentColor;
  background: transparent;
  color: currentColor;
  font-size: 18px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.jk-tvclose:hover {
  transform: scale(1.06);
  opacity: 1;
}

/* état actif */
.jk-tvcard.is-active {
  opacity: 1;
  z-index: 50;
}

.jk-tvcard.is-active .jk-tvcard__poster {
  opacity: 0;
}

.jk-tvcard.is-active .jk-tvcard__active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
  border-color: var(--text-main);
  background: transparent;

  /* largeur du modal conforme, responsive et non agressive */
  width: min(70vw, calc(68vh * 16 / 9));
  max-width: 980px;
}

/* dim les autres cartes quand une est active */
.jk-tvrow.has-active .jk-tvcard:not(.is-active) {
  opacity: 0.45;
  filter: saturate(0.85) brightness(0.75);
}

/* -------- 5. Panel infos (fiche projet) -------- */

.jk-tvinfo {
  width: 100%;
  padding: 24px 6vw 40px;
  background: var(--bg-main);
  color: var(--text-main);
  position: relative;
  z-index: 2;
}

.jk-tvinfo__title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: inherit;
}

.jk-tvinfo__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 16px;
}

.jk-tvinfo__tags .pill {
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  color: currentColor;
  font-size: 13px;
  padding: 6px 14px;
  opacity: 0.9;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.jk-tvinfo__tags .pill:hover {
  transform: translateY(-1px);
  opacity: 1;
}

/* Logo(s) et croix décorative */

.jk-tvinfo__logos {
  display: flex;
  align-items: center;
  gap: 30px;
  min-height: 90px;
}

.jk-logo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.jk-logo-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  opacity: 0.78;
  text-align: center;
  color: inherit;
}

.jk-logo-img {
  height: 90px;
  width: auto;
  opacity: 0.96;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7));
  transition: opacity 0.2s ease;
}

.jk-logo-x {
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  opacity: 0.8;
  color: inherit;
}

/* Meta année / rôle */

.jk-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: inherit;
  opacity: 0.78;
}

.jk-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  transition: opacity 0.2s ease;
}

/* -------- Responsive fiche projet -------- */

@media (max-width: 900px) {
  .jk-tvinfo__grid {
    flex-direction: column;
    max-width: none;
  }

  .jk-tvinfo__right {
    flex: 1 1 auto;
    max-width: none;
    max-height: none;
    overflow: visible;
  }
}

/* ===== ANIMATIONS PREMIUM FILTRAGE ===== */

.jk-tvcard.is-filtered-out {
  opacity: 0;
  transform: translateX(90px) scale(0.88);
  filter: blur(2px);
  pointer-events: none;
}

.jk-tvcard.is-filter-entering {
  opacity: 0;
  transform: translateX(-40px) scale(0.96);
  filter: blur(3px);
}

/* (Fade-in / scroll assist restent gérés par le JS + style.css) */