/* 3ks-gallery 1.6.0 (Task 156) — widok „Archiwum” (makieta B). Wszystkie reguły w zakresie #g3ks (Enfold ma
   własne style h1/button/img/[hidden] — G-147), plus przyciski wtyczki w podglądzie PhotoSwipe (.pswp). */

#g3ks {
  --g3-brand: #741099;
  --g3-ink: #4d1e66;
  --g3-text: #2b2730;
  --g3-muted: #6c6472;
  --g3-line: #e6e1ea;
  --g3-head: 'Montserrat', Helvetica, Arial, sans-serif;
  --g3-row: 210px;
  --g3-gap: 6px;
  color: var(--g3-text);
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 0 24px;
}
#g3ks *, #g3ks *::before, #g3ks *::after { box-sizing: border-box; }
#g3ks [hidden] { display: none !important; }
#g3ks :focus-visible { outline: 3px solid var(--g3-brand); outline-offset: 2px; }

#g3ks .g3ks-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 40px; flex-wrap: wrap; padding: 8px 0 22px; }
#g3ks .g3ks-kicker { font: 700 12px/1 var(--g3-head); letter-spacing: .16em; text-transform: uppercase; color: var(--g3-brand); margin: 0 0 12px; }
#g3ks .g3ks-title { font: 300 clamp(22px, 3vw, 34px)/1.2 var(--g3-head); letter-spacing: .04em; text-transform: uppercase; margin: 0; padding: 0; color: var(--g3-text); text-wrap: balance; }
#g3ks .g3ks-meta { margin: 8px 0 0; padding: 0; color: var(--g3-muted); font-variant-numeric: tabular-nums; }


#g3ks .g3ks-bar { display: flex; align-items: center; justify-content: space-between; gap: 4px 24px; flex-wrap: wrap; border-top: 1px solid var(--g3-line); border-bottom: 1px solid var(--g3-line); }
#g3ks .g3ks-tabs { display: flex; gap: 2px 22px; overflow-x: auto; scrollbar-width: none; min-width: 0; max-width: 100%; }
#g3ks .g3ks-tabs::-webkit-scrollbar { display: none; }
#g3ks .g3ks-tabs button { flex: none; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; margin: 0; padding: 15px 0 13px; cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 400; line-height: 1; color: var(--g3-text); white-space: nowrap; }
#g3ks .g3ks-tabs button .d { color: var(--g3-muted); margin-left: 6px; font-size: 13px; }
#g3ks .g3ks-tabs button .n { font: 700 11px/1 var(--g3-head); color: var(--g3-muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
#g3ks .g3ks-tabs button[aria-pressed="true"] { border-bottom-color: var(--g3-brand); font-weight: 700; }
#g3ks .g3ks-tabs button:focus-visible { outline-offset: -3px; }

#g3ks .g3ks-status { font-size: 14px; color: var(--g3-muted); padding: 8px 0; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Kolaż — wariant D (1.5.0): nagłówek jak nagłówki dni (tytuł, podpisane przełączniki, przyciski bez ramek),
   linia pod nagłówkiem = pasek czasu. Te same przyciski w każdej wersji. */
#g3ks .g3ks-collage { padding-top: 18px; }
#g3ks .g3ks-collage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
#g3ks .g3ks-collage-title { font: 400 15px/1.3 var(--g3-head); letter-spacing: .06em; text-transform: uppercase; margin: 0; padding: 0; color: var(--g3-text); }
#g3ks .g3ks-collage-options { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
#g3ks .g3ks-versions, #g3ks .g3ks-order { display: flex; align-items: center; gap: 8px; }
#g3ks .g3ks-collage-label { color: var(--g3-muted); font-size: 13px; line-height: 1.3; }
#g3ks .g3ks-seg { display: inline-flex; border: 1px solid var(--g3-ink); }
/* Kontrast (audyt 389 W05/W-05): nieaktywny #6c6472 na bieli 5,7:1 bez opacity; fokus NA ZEWNĄTRZ przycisku
   (#741099 na bieli 9,2:1) — wewnętrzny obrys na aktywnym tle #4d1e66 miał 1,3:1. */
#g3ks .g3ks-seg button { background: transparent; color: var(--g3-muted); border: 0; border-radius: 0; margin: 0; padding: 6px 10px; min-width: 44px; min-height: 36px; cursor: pointer; font: 700 12px/1 var(--g3-head); letter-spacing: .08em; }
#g3ks .g3ks-seg button[aria-pressed="true"] { background: var(--g3-ink); color: #fff; opacity: 1; }
#g3ks .g3ks-seg button:focus-visible { outline-offset: 2px; position: relative; z-index: 1; }
#g3ks .g3ks-collage-controls { display: flex; align-items: center; gap: 4px; margin-left: auto; }
#g3ks .g3ks-collage-status { color: var(--g3-muted); font-size: 13px; line-height: 1.3; margin-right: 8px; white-space: nowrap; }
#g3ks .g3ks-collage-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 0 10px; margin: 0; background: transparent; color: #290038; border: 1px solid transparent; border-radius: 0; cursor: pointer; font: inherit; font-size: 13px; line-height: 1; white-space: nowrap; }
#g3ks .g3ks-collage-btn:hover { border-color: var(--g3-line); }
#g3ks .g3ks-collage-btn[aria-disabled="true"], #g3ks .g3ks-collage-btn[aria-disabled="true"]:hover { opacity: .4; cursor: default; border-color: transparent; }
#g3ks .g3ks-collage-btn svg, #g3ks .g3ks-collage-full-close svg, #g3ks .g3ks-collage-hint svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; }
#g3ks .g3ks-collage-pause .g3ks-i-play, #g3ks .g3ks-collage-pause[data-paused] .g3ks-i-pause { display: none; }
#g3ks .g3ks-collage-pause[data-paused] .g3ks-i-play { display: block; }
#g3ks .g3ks-collage-full-close { display: none; }
#g3ks .g3ks-collage-rule { position: relative; height: 1px; margin: 10px 0 12px; background: var(--g3-line); } /* odstęp: linia czasu nie może wyglądać jak podkreślenie przycisku nad nią */
#g3ks .g3ks-collage-track { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; overflow: hidden; }
#g3ks .g3ks-collage-bar { display: block; width: 100%; height: 100%; background: var(--g3-brand); transform: scaleX(0); transform-origin: left; }
/* Podpowiedź gestu zawsze widoczna (decyzja Ownera); od 1.5.2 gest działa palcem i myszą, więc tekst mówi o obu. */
#g3ks .g3ks-collage-hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 0; padding: 0; color: var(--g3-muted); font-size: 12px; line-height: 1.3; }

/* Kolaż: jeden duży kadr i cztery mniejsze, z przesuniętą linią podziału po prawej. */
/* LLM intent (Task 156 — gest w bok): pan-y oddaje pion przeglądarce (przewijanie strony nietknięte), skrypt dostaje
   tylko ruch poziomy. Bez tej reguły palec na kolażu albo przewijałby stronę zamiast zmienić zestaw, albo odwrotnie. */
#g3ks .g3ks-collage-tiles { display: grid; grid-template-columns: 1.65fr 1fr 1.15fr; grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 6px; height: clamp(320px, 52vh, 620px); height: clamp(320px, 52svh, 620px); touch-action: pan-y; }
/* Gest (1.5.2): bez zaznaczania i „duszka” przeciąganego obrazka; podczas przesuwu scena przycina zestaw. */
#g3ks .g3ks-collage-tiles, #g3ks .g3ks-collage-tile, #g3ks .g3ks-collage-tile img { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
#g3ks .g3ks-collage-tiles[data-drag], #g3ks .g3ks-collage-tiles[data-sliding] { overflow: hidden; }
#g3ks .g3ks-collage-tiles[data-drag] { cursor: grabbing; }
#g3ks .g3ks-collage-tile { position: relative; display: block; min-width: 0; min-height: 0; overflow: hidden; background: #f2f0f4; border: 0; border-radius: 0; padding: 0; margin: 0; }
#g3ks .g3ks-collage-tiles[data-drag] .g3ks-collage-tile { transform: translateX(var(--g3-drag, 0px)); }
/* Puls (1.6.0): w trakcie zmiany stare zdjęcie ma przezroczystość w kształcie serca z logo (warstwa pełna minus kanał
   alfa heart.svg); rozmiar i położenie serca — jedno na cały kolaż — nadaje collage-pulse.js, nowe zdjęcie leży pod
   starym. Tylko maska bez prefiksu: przeglądarka bez niej dostaje samo gaśnięcie (collage-pulse.js, CSS.supports). */
#g3ks .g3ks-collage-tiles[data-heart] .g3ks-collage-tile > [aria-hidden] { mask-image: linear-gradient(#000, #000), url(heart.svg); mask-repeat: no-repeat; mask-composite: exclude; }
#g3ks .g3ks-collage-tile:nth-child(1) { grid-area: 1 / 1 / 7 / 2; }
#g3ks .g3ks-collage-tile:nth-child(2) { grid-area: 1 / 2 / 4 / 3; }
#g3ks .g3ks-collage-tile:nth-child(3) { grid-area: 1 / 3 / 3 / 4; }
#g3ks .g3ks-collage-tile:nth-child(4) { grid-area: 4 / 2 / 7 / 3; }
#g3ks .g3ks-collage-tile:nth-child(5) { grid-area: 3 / 3 / 7 / 4; }
#g3ks .g3ks-collage-tile img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; margin: 0; padding: 0; border: 0; }
/* LLM intent (Task 156 — fokus na dowolnym zdjęciu): biały pierścień oddziela fioletowy obrys od kadru.
   Kontrast #741099/biel = 9,2:1, niezależnie od jasności obrazu. */
#g3ks .g3ks-collage-tile:focus-visible { outline: 3px solid #741099; outline-offset: 0; box-shadow: 0 0 0 6px #fff; z-index: 1; }
#g3ks .g3ks-collage-tiles[data-count="1"] { grid-template-columns: 1fr; }
#g3ks .g3ks-collage-tiles[data-count="2"], #g3ks .g3ks-collage-tiles[data-count="3"] { grid-template-columns: 1.45fr 1fr; }
#g3ks .g3ks-collage-tiles[data-count="2"] .g3ks-collage-tile:nth-child(2) { grid-area: 1 / 2 / 7 / 3; }
#g3ks .g3ks-collage-tiles[data-count="3"] .g3ks-collage-tile:nth-child(3) { grid-area: 4 / 2 / 7 / 3; }
#g3ks .g3ks-collage-tiles[data-count="4"] .g3ks-collage-tile:nth-child(3) { grid-row-end: 7; }

/* Lot: kafel = odbitka (.g3ks-flight-card) z cieniem widocznym tylko w locie; ruch nadaje collage-flight.js. */
#g3ks .g3ks-collage[data-version="flight"] .g3ks-collage-tiles { position: relative; } /* punkt odniesienia torów lotu */
#g3ks .g3ks-collage[data-version="flight"] .g3ks-collage-tile { overflow: visible; }
/* LLM intent (Task 156 — przycięcie tylko w locie): poza sceną kafel dałby poziome przewijanie strony;
   w spoczynku scena nie przycina, żeby obrys fokusu skrajnych kafli był cały. */
#g3ks .g3ks-collage[data-version="flight"] .g3ks-collage-tiles[data-flying] { overflow: hidden; }
#g3ks .g3ks-flight-card { position: absolute; inset: 0; display: block; }
#g3ks .g3ks-flight-shade { position: absolute; inset: 0; opacity: 0; box-shadow: 0 30px 46px -22px rgba(41, 0, 56, .6), 0 10px 18px -12px rgba(41, 0, 56, .35); }

#g3ks .g3ks-grid { padding-top: 26px; }
#g3ks .g3ks-day { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--g3-line); }
#g3ks .g3ks-day:first-child { margin-top: 0; }
#g3ks .g3ks-day h2 { font: 400 15px/1.3 var(--g3-head); letter-spacing: .06em; text-transform: uppercase; margin: 0; padding: 0; color: var(--g3-text); }
#g3ks .g3ks-day span { color: var(--g3-muted); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Siatka justowana bez kadrowania: szerokość kafla ∝ proporcjom zdjęcia, ostatni rząd nie jest rozciągany. */
#g3ks .g3ks-jg { display: flex; flex-wrap: wrap; gap: var(--g3-gap); }
#g3ks .g3ks-jg::after { content: ""; flex: 1000000 1 0; }
#g3ks .g3ks-item { position: relative; display: block; overflow: hidden; flex: calc(var(--r) * 1000) 1 calc(var(--r) * var(--g3-row)); aspect-ratio: var(--r); background: var(--c, #ddd); }
#g3ks .g3ks-item img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; margin: 0; padding: 0; border: 0; transition: filter .2s; }
#g3ks .g3ks-item:hover img { filter: brightness(1.06); }
#g3ks .g3ks-item:focus-visible { outline-offset: 3px; z-index: 1; }
#g3ks .g3ks-no { position: absolute; left: 0; bottom: 0; background: rgba(13, 11, 15, .72); color: #fff; font: 700 11px/1 var(--g3-head); letter-spacing: .06em; padding: 5px 7px; opacity: 0; transition: opacity .15s; }
#g3ks .g3ks-item:hover .g3ks-no, #g3ks .g3ks-item:focus-visible .g3ks-no { opacity: 1; }

#g3ks .g3ks-foot { display: flex; justify-content: center; margin: 34px 0 0; }
#g3ks .g3ks-more { display: inline-flex; align-items: center; cursor: pointer; background: transparent; border: 1px solid var(--g3-line); border-radius: 0; margin: 0; padding: 12px 18px; font: 700 13px/1 var(--g3-head); letter-spacing: .06em; text-transform: uppercase; color: var(--g3-ink); }
#g3ks .g3ks-more:hover { border-color: var(--g3-brand); }
#g3ks .g3ks-note { max-width: 46em; margin: 40px auto 0; padding: 0; text-align: center; color: var(--g3-muted); font-size: 14px; }

@media (max-width: 900px) { #g3ks { --g3-row: 160px; } }
@media (max-width: 600px) {
  #g3ks { --g3-row: 104px; --g3-gap: 4px; }
  #g3ks .g3ks-bar { gap: 0 16px; }
  #g3ks .g3ks-tabs { gap: 2px 18px; width: 100%; }
  #g3ks .g3ks-tabs button .d { display: none; }
  #g3ks .g3ks-no { display: none; }
  #g3ks .g3ks-collage { padding-top: 16px; }
  #g3ks .g3ks-collage-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; }
  #g3ks .g3ks-collage-title { grid-column: 1; grid-row: 1; font-size: 14px; }
  #g3ks .g3ks-collage-controls { grid-column: 2; grid-row: 1; gap: 0; margin: 0; }
  #g3ks .g3ks-collage-options { grid-column: 1 / -1; grid-row: 2; display: grid; gap: 6px; }
  #g3ks .g3ks-versions, #g3ks .g3ks-order { display: grid; grid-template-columns: 84px minmax(0, 1fr); }
  #g3ks .g3ks-seg button { flex: 1 1 auto; padding: 6px 4px; }
  #g3ks .g3ks-collage-btn { padding: 0; }
  #g3ks .g3ks-collage-status, #g3ks .g3ks-collage-btn-text { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #g3ks .g3ks-collage-tiles { height: clamp(200px, 36vh, 300px); height: clamp(200px, 36svh, 300px); gap: 4px; }
}
/* 360 px: przy 104 px dwa poziome kadry nie mieszczą się w rzędzie (po jednym na rząd). */
@media (max-width: 400px) { #g3ks { --g3-row: 90px; } }

/* Pełny ekran (1.5.0): kolaż przeniesiony do <dialog> (showModal) — ciemne tło jak podgląd zdjęcia, biały przycisk
   wyjścia w prawym górnym rogu, sterowanie i linia czasu na dole. Strona pod spodem nie przewija się. */
html.g3ks-full-open, html.g3ks-full-open body { overflow: hidden; }
#g3ks .g3ks-collage-full { box-sizing: border-box; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0d0b0f; color: #fff; overflow: hidden; }
#g3ks .g3ks-collage-full::backdrop { background: #0d0b0f; }
#g3ks .g3ks-collage[data-full] { height: 100%; padding: 10px 16px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto auto auto; grid-template-areas: "title close" "tiles tiles" "rule rule" "ctl ctl" "hint hint"; column-gap: 16px; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-head { display: contents; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-title { grid-area: title; align-self: center; font-size: 12px; font-weight: 700; letter-spacing: .16em; color: #d9cfe0; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-options, #g3ks .g3ks-collage[data-full] .g3ks-collage-full-open { display: none; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-full-close { grid-area: close; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 0 16px 0 12px; background: #fff; color: #290038; border: 0; border-radius: 0; cursor: pointer; font: 700 13px/1 var(--g3-head); letter-spacing: .04em; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-full-close:hover { background: #efe6f4; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-tiles { grid-area: tiles; height: auto; min-height: 0; margin-top: 10px; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-rule { grid-area: rule; margin: 12px 0 0; background: rgba(255, 255, 255, .22); }
#g3ks .g3ks-collage[data-full] .g3ks-collage-bar { background: #fff; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-controls { grid-area: ctl; justify-content: center; margin: 8px 0 0; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-btn { color: #fff; border-color: rgba(255, 255, 255, .42); }
#g3ks .g3ks-collage[data-full] .g3ks-collage-btn:hover { border-color: #fff; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-status, #g3ks .g3ks-collage[data-full] .g3ks-collage-hint { color: #d9cfe0; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-hint { grid-area: hint; }
#g3ks .g3ks-collage[data-full] :focus-visible { outline-color: #fff; }
#g3ks .g3ks-collage[data-full] .g3ks-collage-tile:focus-visible { box-shadow: 0 0 0 6px #0d0b0f; }
/* Telefon w pionie: duży kafel u góry, dwa pod nim (w pionie wysoka kolumna kafli dawałaby wąskie paski). */
@media (orientation: portrait) {
  #g3ks .g3ks-collage[data-full] .g3ks-collage-tiles[data-count="3"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1.2fr 1fr; }
  #g3ks .g3ks-collage[data-full] .g3ks-collage-tiles[data-count="3"] .g3ks-collage-tile:nth-child(1) { grid-area: 1 / 1 / 2 / 3; }
  #g3ks .g3ks-collage[data-full] .g3ks-collage-tiles[data-count="3"] .g3ks-collage-tile:nth-child(2) { grid-area: 2 / 1 / 3 / 2; }
  #g3ks .g3ks-collage[data-full] .g3ks-collage-tiles[data-count="3"] .g3ks-collage-tile:nth-child(3) { grid-area: 2 / 2 / 3 / 3; }
}

/* Przycisk „Pobierz” w podglądzie. */
.pswp { --pswp-bg: #0d0b0f; --pswp-placeholder-bg: #222; }
.pswp .g3ks-pswp-btn { width: auto; min-width: 44px; padding: 0 12px; color: #fff; font: 700 12px/60px Helvetica, Arial, sans-serif; letter-spacing: .03em; opacity: .85; text-decoration: none; display: inline-flex; align-items: center; }
.pswp .g3ks-pswp-btn:hover, .pswp .g3ks-pswp-btn:focus-visible { opacity: 1; color: #fff; }
.pswp .g3ks-pswp-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pswp .g3ks-pswp-btn .lbl { margin-left: 6px; }
@media (max-width: 600px) { .pswp .g3ks-pswp-btn .lbl { display: none; } }

@media (prefers-reduced-motion: reduce) {
  #g3ks *, #g3ks *::before, #g3ks *::after { transition-duration: .001ms !important; }
}
