/* Galeria rolek i odtwarzacz filmow (views/partials/reels-gallery.twig, skrypt assets/js/reels.js). Kolory z --ck-*, gdy strona je ma. */
/* Rolki: na telefonie przewijany pasek ze scroll-snap, od 900 px siatka (do 6 kolumn). */
.cx-reels { display: grid; grid-auto-flow: column; grid-auto-columns: min(62%, 240px); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: 8px; scrollbar-width: thin; }
.cx-reels > * { scroll-snap-align: start; }
@media (min-width: 900px) { .cx-reels { grid-auto-flow: row; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); overflow: visible; } }
.cx-reel { min-width: 0; margin: 0; }
.cx-reel-media { position: relative; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: #2C2723; }
.cx-reel-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cx-reel figcaption { display: flex; flex-direction: column; gap: 3px; padding-top: 12px; min-width: 0; overflow-wrap: anywhere; }
.cx-reel-label { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ck-gold-light, #D9BF94); }
.cx-reel strong { font-size: 15px; font-weight: 600; line-height: 1.35; }
.cx-reel small { font-size: 13px; color: rgba(255,255,255,.7); }

.cx-reels-bento .cx-reel { position: relative; }
.cx-reels-bento figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 14px 12px; border-radius: 0 0 18px 18px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.62)); pointer-events: none; }
.cx-reels-bento .cx-reel-label { color: #fff; }
@media (min-width: 900px) {
    /* 2fr 1fr 1fr: duza rolka ma szerokosc dwoch malych, wiec przy wysokosci dwoch malych tez wychodzi 9:16. */
    .cx-reels.cx-reels-bento { grid-auto-flow: row; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
    .cx-reels-bento .cx-reel:first-child { grid-row: span 2; }
    .cx-reels-bento .cx-reel:first-child .cx-reel-media { height: 100%; aspect-ratio: auto; }
    .cx-reels-bento .cx-reel:not(:first-child) small { display: none; }
}

.cx-play { position: absolute; inset: 0; z-index: 2; margin: auto; display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ck-ink, #1B1815); line-height: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.cx-play svg { display: block; width: 22px; height: 22px; fill: currentColor; }
.cx-play .is-pause, .is-playing .cx-play .is-play { display: none; }
.is-playing .cx-play .is-pause { display: block; }
/* W trakcie odtwarzania przycisk pauzy tylko po najechaniu (albo fokusie z klawiatury); na dotyk pauza stuknieciem w film. */
.is-playing > .cx-play { opacity: 0; pointer-events: none; transition: opacity .2s; }
@media (hover: hover) { .is-playing:hover > .cx-play { opacity: 1; pointer-events: auto; } }
.is-playing > .cx-play:focus-visible { opacity: 1; pointer-events: auto; }
.cx-play:focus-visible { outline: 3px solid var(--ck-gold-light, #D9BF94); outline-offset: 3px; }

/* Ladowanie: pulsujacy kafelek, az kadr podgladu sie wczyta, potem film plynnie sie pokazuje (klase is-loading dodaje skrypt). */
.cx-reel-media video, .cx-author-video video { transition: opacity .35s ease; }
.is-loading > video { opacity: 0; }
.is-loading { animation: cx-pulse 1.4s ease-in-out infinite; }
@keyframes cx-pulse { 0%, 100% { background-color: #2C2723; } 50% { background-color: #3D3631; } }
@media (prefers-reduced-motion: reduce) { .is-loading { animation: none; } }

/* Dzwiek: wycisz/wlacz w prawym gornym rogu po pierwszym starcie. Suwak glosnosci tylko przy myszy (na telefonie glosnosc
   ustawia system), wysuwa sie w lewo po najechaniu, wiec przycisk dzwieku zostaje w rogu. */
.cx-vbar { position: absolute; top: 10px; right: 10px; z-index: 2; display: none; flex-direction: row-reverse; align-items: center; padding: 2px; border-radius: 999px; background: rgba(20,18,16,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.is-started > .cx-vbar { display: flex; }
/* Z mysza: tylko po najechaniu na film. Na dotyk: tylko w trakcie odtwarzania. */
@media (hover: hover) {
    .cx-vbar { opacity: 0; pointer-events: none; transition: opacity .2s; }
    .is-started:hover > .cx-vbar, .cx-vbar:focus-within { opacity: 1; pointer-events: auto; }
}
@media (hover: none) { .is-started:not(.is-playing) > .cx-vbar { display: none; } }
.cx-mute { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.cx-mute svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-mute .is-off, .is-muted .cx-mute .is-on { display: none; }
.is-muted .cx-mute .is-off { display: block; }
.cx-mute:focus-visible, .cx-vol:focus-visible { outline: 2px solid var(--ck-gold-light, #D9BF94); outline-offset: 2px; }
/* Safari daje suwakowi wlasna minimalna szerokosc, wiec chowa go owijka o zerowej szerokosci, a nie sam suwak. */
.cx-volwrap { display: none; width: 0; overflow: hidden; opacity: 0; transition: width .2s, opacity .2s; }
.cx-vol { display: block; width: 64px; min-width: 0; height: 12px; margin: 0 4px 0 12px; padding: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.cx-vol::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); }
.cx-vol::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4px; border: 0; border-radius: 50%; background: #fff; -webkit-appearance: none; appearance: none; }
.cx-vol::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.cx-vol::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.35); }
@media (hover: hover) and (pointer: fine) {
    .cx-volwrap { display: flex; align-items: center; height: 36px; }
    .cx-vbar:hover .cx-volwrap, .cx-volwrap:focus-within { width: 80px; opacity: 1; }
}
.cx-play.cx-play--lg { width: 84px; height: 84px; background: var(--ck-gold-light, #D9BF94); }
.cx-play.cx-play--lg svg { width: 30px; height: 30px; }
/* Systemowy przycisk Safari na filmie: ukryty, sa wlasne przyciski. */
[data-cx-video]::-webkit-media-controls, [data-cx-video]::-webkit-media-controls-start-playback-button, [data-cx-video]::-webkit-media-controls-overlay-play-button { display: none !important; -webkit-appearance: none; }
/* Schodki (przewodnik ZAWOD): piec rownych w rzedzie, co druga nizej; na telefonie przewijany pasek. */
@media (min-width: 900px) {
    .cx-reels.cx-reels-stagger { gap: 16px; padding-bottom: 48px; }
    .cx-reels-stagger .cx-reel:nth-child(even) { transform: translateY(48px); }
}
/* Rzad (mentoring): rolki na styk, bez odstepow i zaokraglen, na cala szerokosc; podpis na filmie. Na telefonie przewijany pasek. */
.cx-reels.cx-reels-row { gap: 0; padding-bottom: 0; }
.cx-reels-row .cx-reel { position: relative; }
.cx-reels-row .cx-reel-media { border-radius: 0; }
.cx-reels-row figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 48px 14px 12px; background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.62)); pointer-events: none; }
.cx-reels-row .cx-reel-label { color: #fff; }
.cx-shield { position: absolute; inset: 0; z-index: 1; }
/* !important: ramki filmow (np. .cx-author-video w szablonie ZAWOD) maja wlasne tlo zapisane pozniej, ktore inaczej kasuje kadr podgladu. */
.cx-has-poster { background-image: var(--cx-poster) !important; background-size: cover !important; background-position: center !important; }
.cx-has-poster.is-loading { background-image: none !important; }
.cx-has-poster > video { opacity: 0; transition: opacity .35s ease; }
.cx-has-poster > video.is-on { opacity: 1; }
