/* =========================================================
   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;
  mix-blend-mode: normal;
  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: 1;
  --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: #ffffff;
  box-shadow: 0 8px 24px rgba(32,35,38,.08);
  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: brightness(0) drop-shadow(0 1px 2px rgba(0,0,0,.08));
  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) */
/* =========================================================
   V6.2 — PORTFOLIO EDITORIAL POLISH
   ========================================================= */
.jk-portfolio {
  justify-content: center;
  padding: clamp(72px, 9vh, 112px) 0 clamp(52px, 7vh, 88px);
  background: #f2f3f3;
}

.jk-portfolio::before { display: none; }

.jk-portfolio-head {
  padding: 0 6vw 24px;
  align-items: flex-end;
}

.jk-portfolio-title {
  max-width: 620px;
  font-size: clamp(34px, 4.2vw, 64px);
  line-height: .96;
  letter-spacing: -.045em;
  font-weight: 650;
  color: #202326;
}

.jk-portfolio-title span {
  background: linear-gradient(100deg, #08a8c2 0%, #16c8b4 52%, #a8df35 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.jk-portfolio-filters { padding-bottom: 3px; }
.jk-filter-pill {
  border-color: rgba(32,35,38,.25);
  color: #363a3d;
  background: rgba(255,255,255,.36);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 1;
}
.jk-filter-pill:hover { background: rgba(255,255,255,.78); }
.jk-filter-pill.is-active { background:#202326; border-color:#202326; color:#fff; }

.jk-tvrow {
  height: clamp(430px, 58vh, 660px);
  max-height: none;
  gap: clamp(12px, 1vw, 18px);
  padding: 8px 6vw 18px;
  scroll-behavior: smooth;
}

.jk-tvcard {
  flex-basis: clamp(180px, 20vw, 330px);
  border-radius: 26px;
  transition: opacity .42s ease, transform .55s cubic-bezier(.22,.61,.36,1), filter .42s ease;
}
.jk-tvcard:nth-child(3n+2) { flex-basis: clamp(190px, 22vw, 360px); }
.jk-tvcard:nth-child(4n) { flex-basis: clamp(170px, 18.5vw, 300px); }

.jk-tvcard__poster {
  border-radius: 26px;
  box-shadow: 0 1px 0 rgba(20,24,28,.06), 0 14px 34px rgba(20,24,28,.055);
  transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease, opacity .2s ease;
}
.jk-tvcard:hover .jk-tvcard__poster {
  transform: translateY(-4px);
  box-shadow: 0 1px 0 rgba(20,24,28,.07), 0 22px 50px rgba(20,24,28,.09);
}

.jk-tvcard__active {
  border-radius: 28px;
  border: 1px solid rgba(32,35,38,.07);
  background: rgba(255,255,255,.58);
  box-shadow: 0 28px 80px rgba(20,24,28,.14), 0 2px 8px rgba(20,24,28,.06);
}
.jk-tvcard__active::before {
  filter: blur(34px) brightness(.88) saturate(.85);
  opacity: .28;
}
.jk-tvcard.is-active .jk-tvcard__active {
  border-color: rgba(32,35,38,.07);
  width: min(72vw, calc(66vh * 16 / 9));
}

.jk-tvclose {
  top: 14px; left: 14px;
  width: 34px; height: 34px;
  border: 0;
  background: rgba(247,248,248,.82);
  color: #2c3033;
  font-size: 22px;
  font-weight: 300;
  box-shadow: 0 3px 14px rgba(20,24,28,.10);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.jk-tvclose:hover { background:#fff; transform:scale(1.05); }

.jk-tvrow.has-active .jk-tvcard:not(.is-active) {
  opacity: .68;
  filter: saturate(.76) brightness(1.04);
}

.jk-tvnav {
  position: relative;
  z-index: 3;
  padding: 2px 6vw 8px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.jk-tvnav__hint {
  margin-right: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: rgba(32,35,38,.48);
}
.jk-tvnav__btn {
  width: 42px; height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(32,35,38,.16);
  background: rgba(255,255,255,.62);
  color: #202326;
  font: 400 20px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.jk-tvnav__btn:hover { transform: translateY(-2px); background:#fff; border-color:rgba(32,35,38,.3); }

.jk-tvinfo {
  margin-top: 10px;
  padding: 34px 6vw 64px;
  background: transparent;
  border-top: 1px solid rgba(32,35,38,.08);
}
.jk-tvinfo__title {
  max-width: 760px;
  font-size: clamp(25px, 2.2vw, 36px);
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 650;
}
.jk-tvinfo__tags { margin: 14px 0 26px; }
.jk-tvinfo__tags .pill { border-color:rgba(32,35,38,.22); font-size:11px; padding:5px 11px; }
.jk-tvinfo__grid {
  display: grid;
  grid-template-columns: minmax(260px, .75fr) minmax(340px, 1.35fr);
  gap: clamp(44px, 7vw, 120px);
  align-items: start;
  max-width: 1180px;
}
.jk-tvinfo__left { min-width:0; }
.jk-tvinfo__right { max-width: 720px; }
.jk-tvinfo__intro {
  margin: 8px 0 0;
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.62;
  color: rgba(32,35,38,.76);
}
.jk-tvinfo__logos { gap:22px; min-height:74px; justify-content:flex-start; }
.jk-logo-col { align-items:flex-start; }
.jk-logo-img {
  height: 66px;
  max-width: 150px;
  object-fit: contain;
  object-position: left center;
  opacity: .62;
  filter: brightness(0);
}
.jk-logo-label { opacity:.46; text-align:left; }
.jk-logo-x { opacity:.28; font-size:18px; }
.jk-tvinfo__meta-lines { display:flex; gap:18px; margin-top:12px; }

@media (max-width: 900px) {
  .jk-portfolio-head { align-items:flex-start; flex-direction:column; }
  .jk-portfolio-title { font-size:clamp(34px,9vw,52px); }
  .jk-tvrow { height: min(58vh, 560px); }
  .jk-tvcard { flex-basis: min(64vw, 280px) !important; border-radius:20px; }
  .jk-tvcard__poster { border-radius:20px; }
  .jk-tvnav__hint { display:none; }
  .jk-tvinfo__grid { display:flex; flex-direction:column; gap:26px; }
}

/* V6.3 — filter reflow + flatter cards */
.jk-tvcard__poster { box-shadow:none !important; }
.jk-tvcard:hover .jk-tvcard__poster { box-shadow:none !important; transform:none; }
.jk-tvcard.is-filtered-out { display:none !important; }
.jk-tvnav.is-not-needed { display:none; }

/* V6.4 — hiérarchie typographique commune aux sections */
.jk-portfolio-title{
  max-width:760px;
  font-size:clamp(42px,4.7vw,72px);
  line-height:.96;
  letter-spacing:-.045em;
  font-weight:600;
}
