/*
 * Fundacja TV: style frontu (prefiks fdtv-). Tokeny motywu --fdt-* z bezpiecznymi wartościami zastępczymi,
 * więc wtyczka wygląda dobrze także z innym motywem. Progi: 480, 720, 960, 1200. Mobile najpierw.
 */
.fdtv {
  --fdtv-night: var(--fdt-night, #0a1620);
  --fdtv-deep: var(--fdt-deep, #102431);
  --fdtv-steel: var(--fdt-steel, #1b3446);
  --fdtv-paper: var(--fdt-paper, #f4f7f8);
  --fdtv-white: var(--fdt-white, #ffffff);
  --fdtv-ink: var(--fdt-ink, #0a1620);
  --fdtv-mute: var(--fdt-mute, #4f6370);
  --fdtv-brand: var(--fdt-brand, #2db4ea);
  --fdtv-brand-ink: var(--fdt-brand-ink, #086a92);
  --fdtv-warm: var(--fdt-warm, #ff9242);
  --fdtv-line: rgba(10, 22, 32, 0.12);
  --fdtv-radius: var(--fdt-radius, 6px);
  --fdtv-gap: var(--fdt-gap, clamp(14px, 2vw, 26px));
  --fdtv-font: var(--fdt-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  font-family: var(--fdtv-font);
  color: var(--fdtv-ink);
}

.fdtv *,
.fdtv *::before,
.fdtv *::after {
  box-sizing: border-box;
}

.fdtv-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.fdtv-wrap {
  width: var(--fdt-wrap, min(1240px, 100% - 32px));
  margin-inline: auto;
}

/* ---------- przyciski (niska swoistość: motyw może je nadpisać klasami fdt-btn) ---------- */
:where(.fdtv-btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border: 2px solid var(--fdtv-brand);
  border-radius: var(--fdtv-radius);
  background: var(--fdtv-brand);
  color: var(--fdtv-night);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}
:where(.fdtv-btn.fdt-btn--ghost) {
  background: transparent;
  color: var(--fdtv-brand-ink);
  border-color: var(--fdtv-brand-ink);
}
:where(.fdtv-btn.fdt-btn--donate) {
  background: var(--fdtv-warm);
  border-color: var(--fdtv-warm);
  color: var(--fdtv-night);
}
:where(.fdtv-btn):hover {
  filter: brightness(1.06);
}
.fdtv-btn:focus-visible,
.fdtv-chip:focus-visible,
.fdtv-card a:focus-visible,
.fdtv-share a:focus-visible,
.fdtv-copy:focus-visible,
.fdtv-strip__btn:focus-visible,
.fdtv-strip__track:focus-visible,
.fdtv-pager a:focus-visible {
  outline: 3px solid var(--fdtv-brand-ink);
  outline-offset: 2px;
}

/* ---------- plakietki ---------- */
.fdtv-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}
.fdtv-badge--live {
  background: var(--fdtv-warm);
  color: var(--fdtv-night);
}
.fdtv-badge--rec {
  background: rgba(10, 22, 32, 0.82);
  color: #ffffff;
}
.fdtv-live-dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.fdtv-live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: fdtv-pulse 1.6s ease-out infinite;
}
@keyframes fdtv-pulse {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* ---------- pasek "Na żywo" ---------- */
.fdtv-livebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  padding: 10px var(--fdt-pad, 16px);
  background: var(--fdtv-night);
  color: #ffffff;
  text-decoration: none;
  line-height: 1.3;
}
.fdtv-livebar__title {
  font-weight: 700;
}
.fdtv-livebar__cta {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fdtv-livebar:hover .fdtv-livebar__cta {
  color: var(--fdtv-brand);
}

/* ---------- listy ---------- */
.fdtv-list {
  margin-block: var(--fdtv-gap);
}
.fdtv-list__title {
  margin: 0 0 14px;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  line-height: 1.2;
  font-family: inherit;
}
.fdtv-empty {
  margin: 0;
  padding: 32px 20px;
  text-align: center;
  color: var(--fdtv-mute);
  background: var(--fdtv-paper);
  border-radius: var(--fdtv-radius);
}
.fdtv-more {
  margin: 22px 0 0;
  text-align: center;
}

.fdtv-grid {
  display: grid;
  gap: var(--fdtv-gap);
  grid-template-columns: 1fr;
}
.fdtv-grid--vertical {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 720px) {
  .fdtv-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .fdtv-grid--vertical {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--fdtv-gap);
  }
}
@media (min-width: 960px) {
  .fdtv-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .fdtv-grid--vertical {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1200px) {
  .fdtv-grid--four {
    grid-template-columns: repeat(4, 1fr);
  }
  .fdtv-shorts .fdtv-grid--vertical {
    grid-template-columns: repeat(6, 1fr);
  }
}

.fdtv-shorts {
  margin-top: calc(var(--fdtv-gap) * 1.6);
}

/* ---------- karta ---------- */
.fdtv-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--fdtv-white);
  border: 1px solid var(--fdtv-line);
  border-radius: var(--fdtv-radius);
  overflow: hidden;
}
.fdtv-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--fdtv-deep);
  overflow: hidden;
}
.fdtv-card--vertical .fdtv-card__media {
  aspect-ratio: 9 / 16;
}
.fdtv-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fdtv-card__ph {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--fdtv-steel), var(--fdtv-night));
}
.fdtv-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(10, 22, 32, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.85);
}
.fdtv-card__play::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 14px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent #ffffff;
}
.fdtv-card--vertical .fdtv-card__play {
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
}
.fdtv-card--vertical .fdtv-card__play::before {
  left: 16px;
  top: 11px;
  border-width: 8px 0 8px 13px;
}
.fdtv-card__badges {
  position: absolute;
  left: 10px;
  top: 10px;
}
.fdtv-card__time {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(10, 22, 32, 0.85);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.fdtv-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 14px 16px 16px;
}
.fdtv-card__title {
  margin: 0;
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 700;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.fdtv-card--vertical .fdtv-card__title {
  font-size: 0.95rem;
}
.fdtv-card__title a {
  color: inherit;
  text-decoration: none;
}
.fdtv-card__title a:hover {
  color: var(--fdtv-brand-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fdtv-card__meta {
  margin: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.86rem;
  color: var(--fdtv-mute);
}
.fdtv-card__series {
  color: var(--fdtv-brand-ink);
  font-weight: 600;
}
.fdtv-card.is-live {
  border-color: var(--fdtv-warm);
}

/* ---------- filtr cykli ---------- */
.fdtv-filters {
  margin-bottom: var(--fdtv-gap);
}
.fdtv-filters ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}
.fdtv-filters li {
  flex: none;
}
@media (min-width: 720px) {
  .fdtv-filters ul {
    flex-wrap: wrap;
    overflow: visible;
  }
}
.fdtv-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--fdtv-brand-ink);
  border-radius: 999px;
  color: var(--fdtv-brand-ink);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
}
.fdtv-chip:hover {
  background: rgba(8, 106, 146, 0.08);
}
.fdtv-chip.is-active {
  background: var(--fdtv-brand-ink);
  color: #ffffff;
}

/* ---------- strony ---------- */
.fdtv-pager {
  margin-top: calc(var(--fdtv-gap) * 1.2);
}
.fdtv-pager ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fdtv-pager .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--fdtv-line);
  border-radius: var(--fdtv-radius);
  color: var(--fdtv-ink);
  text-decoration: none;
  font-weight: 700;
}
.fdtv-pager a.page-numbers:hover {
  border-color: var(--fdtv-brand-ink);
  color: var(--fdtv-brand-ink);
}
.fdtv-pager .page-numbers.current {
  background: var(--fdtv-brand-ink);
  border-color: var(--fdtv-brand-ink);
  color: #ffffff;
}

/* ---------- pasek poziomy ---------- */
.fdtv-strip__nav {
  display: none;
}
@media (min-width: 720px) {
  .fdtv-strip__nav {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 10px;
  }
}
.fdtv-strip__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--fdtv-brand-ink);
  border-radius: 50%;
  background: transparent;
  color: var(--fdtv-brand-ink);
  cursor: pointer;
  padding: 0;
}
.fdtv-strip__btn:hover {
  background: var(--fdtv-brand-ink);
  color: #ffffff;
}
.fdtv-strip__btn[disabled] {
  opacity: 0.35;
  cursor: default;
}
.fdtv-strip__track {
  display: flex;
  gap: var(--fdtv-gap);
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.fdtv-strip__track > .fdtv-card {
  flex: 0 0 min(78vw, 300px);
  scroll-snap-align: start;
}
.fdtv-strip__track > .fdtv-card--vertical {
  flex-basis: min(42vw, 190px);
}
@media (min-width: 720px) {
  .fdtv-strip__track > .fdtv-card {
    flex-basis: 300px;
  }
  .fdtv-strip__track > .fdtv-card--vertical {
    flex-basis: 200px;
  }
}

/* ---------- układ wyróżniony: jeden duży i cztery małe ---------- */
.fdtv-featured {
  display: grid;
  gap: var(--fdtv-gap);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .fdtv-featured {
    grid-template-columns: repeat(2, 1fr);
  }
  .fdtv-featured .fdtv-card--lead {
    grid-column: 1 / -1;
  }
}
@media (min-width: 960px) {
  .fdtv-featured {
    grid-template-columns: 2fr 1fr 1fr;
  }
  .fdtv-featured .fdtv-card--lead {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .fdtv-featured .fdtv-card--lead .fdtv-card__media {
    flex: 1;
    aspect-ratio: auto;
    min-height: 260px;
  }
  .fdtv-featured .fdtv-card--lead .fdtv-card__title {
    font-size: 1.4rem;
  }
}

/* ---------- blok trwającej transmisji ---------- */
.fdtv-livebox {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: calc(var(--fdtv-gap) * 1.4);
  background: var(--fdtv-deep);
  color: #ffffff;
  border-radius: var(--fdtv-radius);
  overflow: hidden;
}
.fdtv-livebox__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--fdtv-night);
}
.fdtv-livebox__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fdtv-livebox__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}
.fdtv-livebox__body p {
  margin: 0;
}
.fdtv-livebox__title {
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  line-height: 1.2;
}
.fdtv-livebox__title a {
  color: inherit;
  text-decoration: none;
}
.fdtv-livebox__text {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.55;
}
@media (min-width: 720px) {
  .fdtv-livebox {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }
  .fdtv-livebox__media {
    aspect-ratio: auto;
    min-height: 260px;
  }
  .fdtv-livebox__body {
    padding: 28px;
  }
}

/* ---------- strona filmu ---------- */
.fdtv-stage {
  background: var(--fdtv-night);
  color: #ffffff;
  padding: 14px 0 22px;
}
.fdtv-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 0 0 12px;
  font-size: 0.9rem;
}
.fdtv-crumbs a {
  color: #bfe9fb;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fdtv-crumbs span {
  color: rgba(255, 255, 255, 0.6);
}
.fdtv-playerwrap {
  width: 100%;
  margin-inline: auto;
}
.fdtv-playerwrap--9x16 {
  max-width: min(400px, 100%);
}
.fdtv-playerwrap--1x1 {
  max-width: min(640px, 100%);
}
.fdtv-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: var(--fdtv-radius);
  overflow: hidden;
}
.fdtv-player--9x16 {
  aspect-ratio: 9 / 16;
}
.fdtv-player--1x1 {
  aspect-ratio: 1 / 1;
}
.fdtv-player__poster,
.fdtv-player__ph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fdtv-player__ph {
  background: linear-gradient(135deg, var(--fdtv-steel), var(--fdtv-night));
}
.fdtv-player__badges {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
}
.fdtv-player__play {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: linear-gradient(to top, rgba(10, 22, 32, 0.6), rgba(10, 22, 32, 0.05) 60%);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}
.fdtv-player__play svg {
  box-sizing: content-box;
  width: 30px;
  height: 30px;
  padding: 20px 18px 20px 22px;
  border-radius: 50%;
  background: var(--fdtv-brand);
  color: var(--fdtv-night);
}
.fdtv-player__play:hover svg {
  filter: brightness(1.1);
}
.fdtv-player__play:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: -6px;
}
.fdtv-player__label {
  font-weight: 800;
  font-size: 1.05rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.fdtv-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.fdtv-player__missing {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 20px;
  text-align: center;
  color: #ffffff;
}
.fdtv-playerinfo {
  max-width: 820px;
  margin: 12px auto 0;
  text-align: center;
}
.fdtv-notice {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}
.fdtv-ext {
  margin: 8px 0 0;
  font-size: 0.9rem;
}
.fdtv-ext a {
  color: #bfe9fb;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fdtv-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding-top: calc(var(--fdtv-gap) * 1.4);
}
.fdtv-title {
  margin: 0;
  font-family: inherit;
  font-size: clamp(1.6rem, 4.6vw, 2.5rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.fdtv-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  color: var(--fdtv-mute);
  font-size: 0.95rem;
}
.fdtv-meta__series a {
  color: var(--fdtv-brand-ink);
  font-weight: 700;
}
.fdtv-content {
  max-width: 72ch;
  margin-top: var(--fdtv-gap);
  font-size: 1.05rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.fdtv-content > :first-child {
  margin-top: 0;
}
.fdtv-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin: calc(var(--fdtv-gap) * 1.4) 0;
  padding: 18px 0;
  border-block: 1px solid var(--fdtv-line);
}
@media (min-width: 720px) {
  .fdtv-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.fdtv-share__title {
  margin: 0 0 8px;
  font-family: inherit;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fdtv-mute);
}
.fdtv-share ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fdtv-share a,
.fdtv-copy {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--fdtv-brand-ink);
  border-radius: var(--fdtv-radius);
  background: transparent;
  color: var(--fdtv-brand-ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.fdtv-share a:hover,
.fdtv-copy:hover {
  background: var(--fdtv-brand-ink);
  color: #ffffff;
}
.fdtv-donate {
  margin: 0;
}
.fdtv-related {
  padding: calc(var(--fdtv-gap) * 1.4) 0 calc(var(--fdtv-gap) * 2);
  background: var(--fdtv-paper);
}

@media (prefers-reduced-motion: reduce) {
  .fdtv-live-dot::after {
    animation: none;
    opacity: 0.5;
    transform: scale(1.8);
  }
  .fdtv-strip__track {
    scroll-behavior: auto;
  }
}

.fdtv-featured + .fdtv-grid--after {
  margin-top: var(--fdtv-gap);
}
.fdtv-card--lead .fdtv-card__body {
  flex: 0 0 auto;
}

.fdtv-playerwrap--9x16 {
  max-width: min(400px, 100%, calc(72vh * 9 / 16));
}
@supports (height: 1svh) {
  .fdtv-playerwrap--9x16 {
    max-width: min(400px, 100%, calc(72svh * 9 / 16));
  }
}
