/* Franchises — thème secours */

.franchises-section {
  padding: 0 clamp(1rem, 4vw, 3rem) 2rem;
  margin-top: 0.25rem;
}

.franchises-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.franchises-head h2 {
  margin: 0;
  font-family: var(--font-display, 'Instrument Serif', serif);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.02em;
}

.franchises-head h2 span {
  color: #9b8cf8;
  font-style: italic;
}

.franchises-head p {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
}

.studio-carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.studio-bar {
  display: flex;
  gap: 1.35rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 0.65rem 0.35rem 1rem;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.studio-bar::-webkit-scrollbar {
  display: none;
}

.studio-bar.is-expanded {
  flex-wrap: wrap;
  overflow: visible;
}

/* ── Carte franchise ── */

.studio-card {
  --studio-accent: #9b8cf8;
  --studio-glow: rgba(155, 140, 248, 0.25);
  position: relative;
  flex: 0 0 280px;
  height: 158px;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.studio-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--studio-bg, linear-gradient(135deg, #12121c, #0a0a12));
  z-index: 0;
}

.studio-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, var(--studio-glow), transparent 65%);
  opacity: 0.85;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.studio-card:hover,
.studio-card:focus-visible {
  border-color: rgba(155, 140, 248, 0.35);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .studio-card:hover,
  .studio-card:focus-visible {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(155, 140, 248, 0.12);
  }

  .studio-card:hover .studio-logo,
  .studio-card.is-active .studio-logo {
    transform: scale(1.04);
  }
}

.studio-card.is-active {
  transform: translateY(-2px);
  border-color: var(--studio-accent);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 24px var(--studio-glow);
}

.studio-card.is-active::after {
  opacity: 1;
}

.studio-logo {
  position: relative;
  z-index: 2;
  max-width: 78%;
  max-height: 58%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55));
  transition: transform 0.28s ease;
  transform: translateZ(0);
}

.studio-text {
  position: relative;
  z-index: 2;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Thèmes par franchise */

.studio-card--disney {
  --studio-accent: #0063e5;
  --studio-glow: rgba(0, 99, 229, 0.35);
  --studio-bg: linear-gradient(135deg, #001a3a 0%, #002d6b 100%);
}

.studio-card--warner {
  --studio-accent: #f5a623;
  --studio-glow: rgba(245, 166, 35, 0.3);
  --studio-bg: linear-gradient(135deg, #1a0e00 0%, #3d2200 100%);
}

.studio-card--marvel {
  --studio-accent: #e62429;
  --studio-glow: rgba(230, 36, 41, 0.35);
  --studio-bg: linear-gradient(135deg, #1a0000 0%, #4a0000 100%);
}

.studio-card--starwars {
  --studio-accent: #ffd600;
  --studio-glow: rgba(255, 214, 0, 0.25);
  --studio-bg: linear-gradient(135deg, #0d0800 0%, #2a1f00 100%);
}
.studio-card--starwars .studio-logo {
  max-width: 78%;
  max-height: 52%;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55));
}

.studio-card--dc {
  --studio-accent: #0078f0;
  --studio-glow: rgba(0, 120, 240, 0.3);
  --studio-bg: linear-gradient(135deg, #00001a 0%, #000a52 100%);
}

.studio-card--primevideo {
  --studio-accent: #00a8e1;
  --studio-glow: rgba(0, 168, 225, 0.3);
  --studio-bg: linear-gradient(135deg, #00050f 0%, #001a3d 100%);
}

.studio-card--primevideo .studio-logo {
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55)) brightness(1.08);
}

.studio-card--paramount {
  --studio-accent: #0064ff;
  --studio-glow: rgba(0, 100, 255, 0.2);
  --studio-bg: linear-gradient(135deg, #f8f8f8 0%, #e8e8e8 100%);
  border-color: rgba(255, 255, 255, 0.25);
}

.studio-card--paramount:hover {
  border-color: rgba(0, 100, 255, 0.4);
}

.studio-card--fr {
  --studio-accent: #64b5f6;
  --studio-glow: rgba(100, 181, 246, 0.25);
  --studio-bg: linear-gradient(135deg, #00101a 0%, #003255 100%);
}

.studio-bar-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.studio-bar-actions .see-all {
  background: none;
  border: none;
  color: rgba(155, 140, 248, 0.85);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.studio-bar-actions .see-all:hover {
  color: #b8aaf9;
  background: rgba(155, 140, 248, 0.08);
}

.studio-arrow {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 20, 0.9);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.studio-arrow:hover {
  border-color: rgba(155, 140, 248, 0.35);
  color: #9b8cf8;
  background: rgba(155, 140, 248, 0.08);
}

/* ── Vue franchise ── */

#studioView {
  position: relative;
  min-height: 100vh;
  padding: 5.5rem clamp(1rem, 4vw, 3rem) 3rem;
}

.studio-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0.18;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.studio-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0a0a12 0%, rgba(10, 10, 18, 0.82) 35%, #0a0a12 100%);
}

.studio-view-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.studio-view-head h2 {
  margin: 0;
  font-family: var(--font-display, 'Instrument Serif', serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 400;
  color: #fff;
  letter-spacing: -0.02em;
}

.studio-chips {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.35rem;
}

.studio-chip {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  padding: 0.38rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.studio-chip.is-active,
.studio-chip:hover {
  border-color: rgba(155, 140, 248, 0.4);
  background: rgba(155, 140, 248, 0.1);
  color: #fff;
}

.studio-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 228px));
  gap: 14px;
  padding: 0.35rem 0 0.5rem;
  justify-content: start;
}

#studioGrid .card {
  flex: unset;
  width: 228px;
  max-width: 228px;
}

#studioGrid .card--poster {
  width: 228px;
  max-width: 228px;
  margin: 0;
}

#studioGrid .card--poster:hover {
  transform: translateY(-6px) scale(1.03);
  z-index: 2;
}

#studioGrid .card--poster .card-clip {
  border-radius: var(--radius-sm, 12px);
}

#studioGrid .card--poster .card-img {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center top;
}

.studio-saga-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 2rem 0 0.85rem;
}

.studio-saga-header:first-child {
  margin-top: 0;
}

.studio-saga-header__bar {
  width: 3px;
  height: 20px;
  border-radius: 2px;
  background: linear-gradient(180deg, #9b8cf8, #6b5ce7);
  box-shadow: 0 0 10px rgba(155, 140, 248, 0.4);
}

.studio-saga-header__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.studio-saga-header__count {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 0.18rem 0.5rem;
}

.studio-skeleton {
  aspect-ratio: 2/3;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  background-size: 200% 100%;
  animation: studio-shimmer 1.2s infinite;
}

@keyframes studio-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.studio-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 3rem 1rem;
  font-size: 0.9rem;
}

.studio-load-more {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

@media (max-width: 640px) {
  .studio-card {
    flex-basis: 210px;
    height: 122px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    contain: layout style;
  }

  .studio-card:active {
    transform: scale(0.98);
  }

  .studio-bar {
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }

  .studio-card {
    scroll-snap-align: start;
  }

  #studioView {
    padding-top: calc(var(--header-h, 72px) + 1rem);
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .studio-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .studio-chips::-webkit-scrollbar {
    display: none;
  }

  .studio-chip {
    flex: 0 0 auto;
  }

  #studioGrid .card--poster:hover {
    transform: none;
  }

  .studio-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 168px));
    gap: 12px;
  }

  #studioGrid .card,
  #studioGrid .card--poster {
    width: 168px;
    max-width: 168px;
  }

  .studio-arrow {
    display: none;
  }

  .franchises-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
