.kgs-films-section,
.kgs-vote-form-section {
  box-sizing: border-box;
  width: 100%;
}

.kgs-films-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.kgs-films-heading h2,
.kgs-form-intro h2 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
}

.kgs-films-heading p {
  max-width: 520px;
  margin: 0;
  opacity: .72;
}

.kgs-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
}

/* =========================
   SLIDER FILMÓW
   Desktop: 2 niezależne rzędy po 10 filmów, po 4 filmy widoczne jednocześnie.
   Tablet: 1 poziomy slider, 2 filmy widoczne jednocześnie.
   Mobile: 1 poziomy slider, 1 film na ekran.
========================= */

.kgs-slider-layout {
  display: grid;
  gap: 38px;
  width: 100%;
}

.kgs-slider {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  padding: 0 48px;
}

.kgs-slider-viewport {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}

.kgs-slider-viewport::-webkit-scrollbar {
  display: none;
}

.kgs-film-grid,
.kgs-slider-track {
  display: grid;
  width: 100%;
  min-width: 100%;
  grid-template-rows: auto;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 60px) / 4);
  gap: 28px 20px;
  align-items: stretch;
}

.kgs-film-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,.1);
  background: #fff;
  scroll-snap-align: start;
}

.kgs-film-card.is-visible {
  display: flex;
}

.kgs-slider-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(0,0,0,.16);
  border-radius: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  background: #fff;
  color: #111;
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
  transition: opacity .2s ease, transform .2s ease;
}

.kgs-slider-arrow:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.06);
}

.kgs-slider-arrow:disabled {
  opacity: .28;
  cursor: default;
}

.kgs-slider-prev {
  left: 0;
}

.kgs-slider-next {
  right: 0;
}

.kgs-film-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: #111;
}

.kgs-film-media > img,
.kgs-video-player,
.kgs-film-media > iframe,
.kgs-film-media > video {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  object-fit: cover;
}

.kgs-film-cover-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #eee;
  color: #777;
  letter-spacing: .16em;
  font-weight: 700;
}

.kgs-play-button {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #fff;
  background: rgba(0,0,0,.22);
  font: inherit;
  font-weight: 700;
}

.kgs-play-button span:first-child {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding-left: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: #111;
  font-size: 20px;
}

.kgs-film-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.kgs-film-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.kgs-film-description {
  margin-top: 10px;
  opacity: .75;
  font-size: 14px;
}

.kgs-vote-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.kgs-vote-count {
  min-width: 104px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border: 1px solid currentColor;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.kgs-vote-button,
.kgs-show-more {
  border: 0;
  padding: 12px 20px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.kgs-vote-button {
  flex: 1;
  background: #111;
  color: #000;
}

/* Pozostawione dla kompatybilności z wcześniejszym HTML/custom CSS. */
.kgs-show-more-wrap {
  display: none;
}

.kgs-vote-form-section {
  scroll-margin-top: 110px;
  margin-top: 72px;
  padding: clamp(24px, 5vw, 54px);
  background: #1a428a;
  color: #fff;
}

.kgs-form-intro {
  margin-bottom: 24px;
}

.kgs-form-placeholder {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border: 1px dashed rgb(255 255 255 / 28%);
}

.kgs-selected-film-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding: 14px;
  background: #fff;
}

.kgs-selected-film-card[hidden],
.kgs-cf7-wrap[hidden],
.kgs-form-placeholder[hidden] {
  display: none !important;
}

.kgs-selected-cover {
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 9 / 16;
  background: #e5e5e5;
  color: #777;
  font-weight: 700;
  letter-spacing: .1em;
}

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

.kgs-selected-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.kgs-selected-copy > span {
  font-size: 13px;
  opacity: .65;
}

.kgs-selected-copy > strong {
  font-size: 22px;
  color:#000;
}

.kgs-change-film {
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

.kgs-cf7-wrap .wpcf7-form label {
  display: block;
  margin-bottom: 16px;
}

.kgs-cf7-wrap input[type="text"],
.kgs-cf7-wrap input[type="email"],
.kgs-cf7-wrap input[type="tel"],
.kgs-cf7-wrap textarea,
.kgs-cf7-wrap input[type="file"] {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
}

.kgs-char-counter {
  margin-top: -10px;
  margin-bottom: 16px;
  text-align: right;
  font-size: 12px;
  opacity: .68;
}

.kgs-error {
  display: block;
  padding: 12px 14px;
  border: 1px solid #cc1818;
  color: #8a1111;
  background: #fff6f6;
}

@media (max-width: 900px) {
  .kgs-film-grid,
  .kgs-slider-track {
    grid-auto-columns: calc((100% - 20px) / 2);
  }

  .kgs-films-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 767px) {
  .kgs-slider {
    padding: 0 38px;
  }

  .kgs-film-grid,
  .kgs-slider-track {
    grid-template-rows: auto;
    grid-auto-columns: 100%;
    gap: 0;
  }

  .kgs-slider-arrow {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .kgs-film-title {
    font-size: 20px;
  }

  .kgs-vote-actions {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
  }

  .kgs-vote-count {
    min-width: 0;
  }

  .kgs-selected-film-card {
    grid-template-columns: 76px 1fr;
    gap: 14px;
  }

  .kgs-vote-form-section {
    margin-top: 48px;
    border-radius: 14px;
  }
}

/* ==========================================================
   v1.4.4 — DESKTOP ONLY
   iPad/tablet/mobile zachowują układ i mechanizm wersji 1.3.0.
   ========================================================== */
@media (min-width: 901px) {
  html:not(.kgs-ipad) .kgs-slider-layout {
    display: block;
    width: 100%;
  }

  html:not(.kgs-ipad) .kgs-slider {
    padding: 0;
  }

  html:not(.kgs-ipad) .kgs-slider-viewport {
    overflow: visible;
    scroll-snap-type: none;
  }

  html:not(.kgs-ipad) .kgs-film-grid,
  html:not(.kgs-ipad) .kgs-slider-track {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 18px;
    align-items: stretch;
  }

  html:not(.kgs-ipad) .kgs-slider-arrow {
    display: none !important;
  }

  html:not(.kgs-ipad) .kgs-film-card,
  html:not(.kgs-ipad) .kgs-film-card.is-visible {
    position: relative;
    display: block;
    min-width: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 0;
    background: #0a438c;
  }

  html:not(.kgs-ipad) .kgs-film-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #0a438c;
  }

  html:not(.kgs-ipad) .kgs-film-media > img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
  }

  html:not(.kgs-ipad) .kgs-film-media::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(3,34,84,.58) 0%, rgba(3,34,84,.05) 34%, rgba(3,34,84,.08) 60%, rgba(3,34,84,.76) 100%);
  }

  html:not(.kgs-ipad) .kgs-play-button {
    z-index: 2;
    background: transparent;
    padding-bottom: 40px;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
  }

  html:not(.kgs-ipad) .kgs-play-button span:first-child {
    width: 52px;
    height: 52px;
    padding-left: 3px;
    border: 2px solid rgba(255,255,255,.95);
    background: rgba(2,25,65,.38);
    color: #fff;
    font-size: 18px;
  }

  html:not(.kgs-ipad) .kgs-film-content {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 14px;
    pointer-events: none;
  }

  html:not(.kgs-ipad) .kgs-film-title {
    max-width: 58%;
    margin: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0,0,0,.32);
  }

  html:not(.kgs-ipad) .kgs-film-description {
    display: none;
  }

  html:not(.kgs-ipad) .kgs-vote-actions {
    display: block;
    margin-top: auto;
    padding: 0;
  }

  html:not(.kgs-ipad) .kgs-vote-count {
    position: absolute;
    top: 14px;
    right: 14px;
    min-width: 0;
    padding: 0;
    border: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0,0,0,.32);
  }

  html:not(.kgs-ipad) .kgs-vote-button {
    width: 100%;
    min-height: 42px;
    padding: 10px 16px;
    pointer-events: auto;
    border: 0;
    background: #ffcd00;
    color: #063d85;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
  }
}

/* Desktopowy podgląd pionowego filmu 9:16. Nie jest używany na iPadzie. */
.kgs-desktop-video-modal {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 18, 48, .90);
}

.kgs-desktop-video-modal[hidden] {
  display: none !important;
}

.kgs-desktop-video-dialog {
  position: relative;
  width: min(90vw, 450px);
  height: min(86vh, 800px);
  aspect-ratio: 9 / 16;
}

.kgs-desktop-video-holder {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}

.kgs-desktop-video-holder iframe,
.kgs-desktop-video-holder video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  background: #000;
}

.kgs-desktop-video-close {
  position: absolute;
  z-index: 2;
  top: -16px;
  right: -16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: #063d85;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

body.kgs-video-open {
  overflow: hidden;
}

/* ==========================================================
   v1.4.8 — Spotify + drugi tekst + SHARE
   ========================================================== */
.kgs-film-subtitle {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.2;
  opacity: .88;
}

.kgs-card-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.kgs-card-buttons > .kgs-vote-button:last-child:first-child,
.kgs-card-buttons > .kgs-spotify-button:last-child:first-child {
  grid-column: 1 / -1;
}

.kgs-spotify-button {
  border: 2px solid #063d85;
  padding: 12px 20px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  background: transparent;
  color: #063d85;
}

.kgs-film-card {
  position: relative;
}

.kgs-share-button {
  position: absolute;
  z-index: 8;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1.5px solid rgba(255,255,255,.95);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(5,47,106,.68);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.kgs-share-button:hover,
.kgs-share-button:focus-visible {
  background: #ffcd00;
  color: #063d85;
  border-color: #ffcd00;
}

.kgs-share-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.kgs-share-toast {
  position: fixed;
  z-index: 1000000;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(90vw, 420px);
  padding: 11px 16px;
  border-radius: 5px;
  background: #063d85;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(0,0,0,.24);
}

/* iPad / tablet / mobile: pozostaje slider z 1 filmem na ekran i pionowa karta 9:16. */
@media (max-width: 900px) {
  .kgs-film-grid,
  .kgs-slider-track {
    grid-auto-columns: 100%;
    gap: 0;
  }

  .kgs-film-card,
  .kgs-film-card.is-visible {
    position: relative;
    display: block;
    min-width: 0;
    width: 100%;
    overflow: hidden;
    border: 0;
    background: #0a438c;
  }

  .kgs-film-media {
    position: relative;
    aspect-ratio: 9 / 16;
    background: #0a438c;
  }

  .kgs-film-media::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(3,34,84,.58) 0%, rgba(3,34,84,.05) 34%, rgba(3,34,84,.08) 60%, rgba(3,34,84,.76) 100%);
  }

  .kgs-play-button {
    z-index: 2;
    background: transparent;
    padding-bottom: 64px;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
  }

  .kgs-play-button span:first-child {
    width: 58px;
    height: 58px;
    padding-left: 3px;
    border: 2px solid rgba(255,255,255,.95);
    background: rgba(2,25,65,.38);
    color: #fff;
    font-size: 20px;
  }

  .kgs-film-content {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 14px;
    pointer-events: none;
  }

  .kgs-film-title {
    max-width: 62%;
    margin: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0,0,0,.32);
  }

  .kgs-film-subtitle {
    max-width: 62%;
    margin-top: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0,0,0,.32);
  }

  .kgs-film-description {
    display: none;
  }

  .kgs-vote-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding: 0;
  }

  .kgs-vote-count {
    position: absolute;
    top: 54px;
    right: 14px;
    min-width: 0;
    padding: 0;
    border: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0,0,0,.32);
  }

  .kgs-card-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
  }

  .kgs-vote-button,
  .kgs-spotify-button {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    pointer-events: auto;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
  }

  .kgs-vote-button {
    border: 0;
    background: #ffcd00;
    color: #063d85;
  }

  .kgs-spotify-button {
    border: 2px solid #fff;
    background: transparent;
    color: #fff;
  }
}

/* Desktop: układ 4 × 4 pozostaje bez zmian, SHARE zajmuje prawy górny róg. */
@media (min-width: 901px) {
  html:not(.kgs-ipad) .kgs-film-subtitle {
    max-width: 58%;
    margin-top: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
    text-transform: uppercase;
    text-shadow: 0 1px 4px rgba(0,0,0,.32);
  }

  html:not(.kgs-ipad) .kgs-vote-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding: 0;
  }

  html:not(.kgs-ipad) .kgs-vote-count {
    top: 54px;
    right: 14px;
  }

  html:not(.kgs-ipad) .kgs-card-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: end;
  }

  html:not(.kgs-ipad) .kgs-vote-button,
  html:not(.kgs-ipad) .kgs-spotify-button {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    pointer-events: auto;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
  }

  html:not(.kgs-ipad) .kgs-vote-button {
    border: 0;
    background: #ffcd00;
    color: #063d85;
  }

  html:not(.kgs-ipad) .kgs-spotify-button {
    border: 2px solid #fff;
    background: transparent;
    color: #fff;
  }
}
