/* Filmowa Kronika Fyrtli — individual episode */
.page-episode {
  background: radial-gradient(circle at 50% 38%, rgba(59, 140, 235, 0.055), transparent 36rem), var(--bg);
}

.fkf-episode-page {
  min-height: 100vh;
}

.episode-hook {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 112px clamp(18px, 4vw, 56px) 56px;
  overflow: hidden;
  isolation: isolate;
}

.episode-hook::before {
  content: '';
  position: absolute;
  z-index: -2;
  width: min(88vw, 1500px);
  aspect-ratio: 16 / 9;
  border-radius: 50%;
  background: rgba(59, 140, 235, 0.16);
  filter: blur(110px);
  opacity: 0.55;
  transform: scale(0.72);
}

.episode-hook::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 24%;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.episode-player {
  position: relative;
  width: min(92vw, 1500px, calc((100svh - 168px) * 1.7778));
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: clamp(12px, 1.4vw, 22px);
  background: #000;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.76), 0 0 56px rgba(59, 140, 235, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.episode-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.episode-content {
  position: relative;
  width: min(calc(100% - 40px), var(--container-text));
  margin: 0 auto;
  padding: clamp(70px, 9vw, 128px) 0 clamp(72px, 9vw, 120px);
}

.episode-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 84px;
  height: 1px;
  background: linear-gradient(90deg, var(--brand), transparent);
  box-shadow: 0 0 16px rgba(59, 140, 235, 0.55);
}

.episode-kicker {
  margin: 0 0 15px;
  color: var(--brand);
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 1.2vw, 0.86rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.episode-title {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2.55rem, 7vw, 5.8rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.episode-logline {
  max-width: 900px;
  margin: clamp(32px, 4.8vw, 54px) 0 0;
  color: var(--text-soft);
  font-size: clamp(1.08rem, 2vw, 1.42rem);
  font-weight: 400;
  line-height: 1.72;
  text-wrap: pretty;
  transition: color 150ms linear, opacity 150ms linear, filter 170ms linear, transform 170ms linear;
}

.episode-logline strong {
  color: inherit;
  font-weight: 700;
}

/* A stronger scroll transition for detail-page headings, using the same
   cinematic-focus engine as the home-page modules. */
.page-episode .episode-title[data-cinematic-focus],
.page-episode .episode-logline[data-cinematic-focus] {
  --cinema-max-blur: 6px;
  opacity: calc(0.52 + (var(--cinema-focus) * 0.48));
  transform: translate3d(0, calc((1 - var(--cinema-focus)) * 12px), 0) scale(calc(0.989 + (var(--cinema-focus) * 0.011)));
}

/* Focused content is fully sharp; interactive cards retain their own hover
   transforms because only opacity and filtering are normalised here. */
.page-episode [data-cinematic-focus].is-cinema-focused {
  opacity: 1;
  filter: none;
}

.page-episode .episode-title[data-cinematic-focus].is-cinema-focused,
.page-episode .episode-logline[data-cinematic-focus].is-cinema-focused {
  transform: none;
}

.page-episode .episode-logline[data-cinematic-focus].is-cinema-focused {
  color: var(--text);
}

.episode-description {
  max-width: 800px;
  margin: clamp(10px, 1.2vw, 14px) 0 0;
  padding-top: clamp(10px, 1.2vw, 14px);
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: clamp(0.98rem, 1.5vw, 1.08rem);
  font-weight: 400;
}

.episode-description p {
  margin: 0;
  color: var(--cinema-text, var(--text-muted));
  text-wrap: pretty;
  transition: color 150ms linear, opacity 150ms linear, filter 170ms linear, transform 170ms linear;
}

.episode-description p + p {
  margin-top: 1em;
}

.episode-description p.is-cinema-focused {
  color: var(--text);
  opacity: 1;
  filter: none;
  transform: none;
}

.episode-partner {
  position: relative;
  width: min(100%, 360px);
  margin: clamp(42px, 6vw, 66px) auto 0;
  padding-top: 28px;
  text-align: center;
}

.episode-partner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 72px;
  height: 1px;
  background: var(--line);
  transform: translateX(-50%);
}

.episode-partner-label {
  margin: 0 0 18px;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.episode-partner-card {
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

a.episode-partner-card {
  border-radius: 12px;
  cursor: pointer;
}

a.episode-partner-card .episode-partner-logo {
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

a.episode-partner-card:hover .episode-partner-logo,
a.episode-partner-card:focus-visible .episode-partner-logo {
  opacity: 1;
  transform: translateY(-2px);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.34));
}

a.episode-partner-card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 8px;
}

.episode-partner-logo {
  width: min(100%, 240px);
  height: auto;
  opacity: 0.92;
}

.episode-actions-label {
  margin: clamp(42px, 5vw, 58px) 0 12px;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.episode-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.episode-action {
  position: relative;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: center;
  padding: 16px 48px 16px 20px;
  overflow: hidden;
  border: 1px solid rgba(59, 140, 235, 0.46);
  border-radius: var(--radius-md);
  background: radial-gradient(circle at 88% 14%, rgba(59, 140, 235, 0.16), transparent 42%), rgba(255, 255, 255, 0.035);
  color: #edf5ff;
  font-family: var(--font-display);
  font-size: clamp(0.72rem, 1.2vw, 0.84rem);
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: 0.055em;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.episode-action::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 18%, rgba(255, 255, 255, 0.075) 50%, transparent 82%);
  opacity: 0;
  transform: translateX(-70%);
  transition: opacity 220ms ease, transform 520ms ease;
  pointer-events: none;
}

.episode-action span,
.episode-action svg {
  position: relative;
  z-index: 1;
}

.episode-action svg {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 18px;
  height: 18px;
  color: var(--brand);
  transform: translateY(-50%);
  transition: color 220ms ease, transform 220ms ease;
}

.episode-action:hover,
.episode-action:focus-visible {
  border-color: rgba(116, 182, 255, 0.88);
  background-color: rgba(59, 140, 235, 0.11);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38), 0 0 28px rgba(59, 140, 235, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  outline: none;
  transform: translateY(-2px);
}

.episode-action:hover::before,
.episode-action:focus-visible::before {
  opacity: 1;
  transform: translateX(70%);
}

.episode-action:hover svg,
.episode-action:focus-visible svg {
  color: #fff;
  transform: translate(3px, -50%);
}

.episode-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 4vw, 54px);
  margin-top: clamp(48px, 6vw, 74px);
  padding-top: clamp(26px, 3vw, 36px);
  border-top: 1px solid var(--line);
}

.episode-nav-item {
  display: inline-flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0;
  color: var(--brand);
  font-size: clamp(0.72rem, 1.05vw, 0.88rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.episode-nav-label {
  position: relative;
  display: inline-block;
  padding-bottom: 7px;
}

.episode-nav-label::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.42;
  transform-origin: left;
  transition: opacity 180ms ease, transform 220ms ease;
}

.episode-nav-arrow {
  flex: 0 0 auto;
  color: currentColor;
  font-size: 1.55em;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 0;
  transition: transform 220ms ease;
}

.episode-nav-item[href] {
  cursor: pointer;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.episode-nav-item[href]:hover,
.episode-nav-item[href]:focus-visible {
  color: #78b8ff;
  text-shadow: 0 0 18px rgba(59, 140, 235, 0.22);
  outline: none;
}

.episode-nav-item[href]:hover .episode-nav-label::after,
.episode-nav-item[href]:focus-visible .episode-nav-label::after {
  opacity: 0.9;
  transform: scaleX(1.08);
}

.episode-nav-item--previous[href]:hover .episode-nav-arrow,
.episode-nav-item--previous[href]:focus-visible .episode-nav-arrow {
  transform: translateX(-4px);
}

.episode-nav-item--all[href]:hover .episode-nav-arrow,
.episode-nav-item--all[href]:focus-visible .episode-nav-arrow,
.episode-nav-item--next[href]:hover .episode-nav-arrow,
.episode-nav-item--next[href]:focus-visible .episode-nav-arrow {
  transform: translateX(4px);
}

.episode-nav-item[aria-disabled='true'] {
  cursor: default;
  color: var(--text-faint);
  opacity: 0.34;
}

.episode-nav-item[aria-disabled='true'] .episode-nav-label::after {
  opacity: 0.18;
}

@media (max-width: 768px) {
  .page-episode .episode-title[data-cinematic-focus],
  .page-episode .episode-logline[data-cinematic-focus] {
    --cinema-max-blur: 4.2px;
    opacity: calc(0.64 + (var(--cinema-focus) * 0.36));
    transform: translate3d(0, calc((1 - var(--cinema-focus)) * 8px), 0) scale(calc(0.992 + (var(--cinema-focus) * 0.008)));
  }

  .episode-hook {
    min-height: 0;
    padding: calc(92px + env(safe-area-inset-top, 0px)) 14px 36px;
  }

  .episode-hook::before {
    width: 120vw;
    filter: blur(72px);
    opacity: 0.42;
  }

  .episode-player {
    width: 100%;
    margin-inline: auto;
    border-radius: 12px;
    box-shadow: 0 22px 64px rgba(0, 0, 0, 0.72), 0 0 32px rgba(59, 140, 235, 0.11);
  }

  .episode-content {
    width: min(calc(100% - 32px), var(--container-text));
    padding-top: 64px;
  }

  .episode-partner {
    width: min(100%, 280px);
    margin-top: 44px;
    padding-top: 24px;
  }

  .episode-partner-label {
    margin-bottom: 15px;
    font-size: 0.6rem;
  }

  .episode-partner-logo {
    width: min(100%, 195px);
  }

  .episode-actions {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .episode-action {
    min-height: 58px;
    padding: 13px 42px 13px 16px;
    font-size: 0.69rem;
  }
}

@media (max-width: 760px) {
  .episode-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
    margin-top: 42px;
  }

  .episode-nav-item {
    justify-content: flex-start;
    font-size: 0.68rem;
    text-align: left;
  }

  .episode-nav-item--all {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    justify-content: center;
  }

  .episode-nav-item--previous {
    grid-column: 1;
    grid-row: 2;
  }

  .episode-nav-item--next {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-end;
    text-align: right;
  }
}


/* 2026-08-04: larger Mueller partner mark in episode 5 */
.episode-partner-logo--muller {
  width: min(100%, 300px);
}

@media (max-width: 680px) {
  .episode-partner-logo--muller {
    width: min(100%, 235px);
  }
}

/* Tutorial watch pages — one PL/EN rhythm and related-card layout. */
.page-episode .episode-content {
  padding-bottom: clamp(34px, 3.8vw, 52px);
}

.page-episode .episode-navigation {
  margin-top: clamp(40px, 4.8vw, 58px);
  padding-top: clamp(22px, 2.5vw, 30px);
}

.page-episode .tutorial-related {
  padding-top: clamp(24px, 2.6vw, 38px);
  padding-bottom: clamp(70px, 7vw, 104px);
}

.page-episode .tutorial-related-title {
  width: min(100%, 920px);
  margin: 0 auto 20px;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-size: var(--type-label);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}

.page-episode .tutorial-related .tutorial-related-cards {
  max-width: 920px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.page-episode .brief-prompt-modal {
  width: min(760px, 100%);
}

.page-episode .brief-prompt-modal .modal-title {
  margin-bottom: 26px;
}

.page-episode .brief-prompt-copy {
  max-width: 620px;
}

.page-episode .brief-prompt-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.page-episode .brief-prompt-download {
  min-width: min(100%, 280px);
  text-decoration: none;
}

@media (max-width: 980px) {
  .page-episode .tutorial-related-title {
    width: min(100%, 620px);
  }

  .page-episode .tutorial-related .tutorial-related-cards {
    max-width: 620px;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .page-episode .episode-content {
    padding-bottom: 32px;
  }

  .page-episode .episode-navigation {
    margin-top: 36px;
    padding-top: 22px;
  }
}

@media (max-width: 640px) {
  .page-episode .tutorial-related {
    padding-top: 22px;
    padding-bottom: 72px;
  }

  .page-episode .tutorial-related-title {
    margin-bottom: 18px;
    font-size: 0.7rem;
  }

  .page-episode .brief-prompt-actions,
  .page-episode .brief-prompt-download {
    width: 100%;
  }
}

/* Firefox deliberately uses luminance instead of live text blur to avoid
   rasterisation artefacts, consistent with the site-wide fallback. */
@supports (-moz-appearance: none) {
  .page-episode .episode-title[data-cinematic-focus],
  .page-episode .episode-logline[data-cinematic-focus] {
    opacity: calc(0.8 + (var(--cinema-focus) * 0.2));
  }
}
