/* ==========================================================================
   FOTORYGO — Kampanijne (Campaign) page
   Two layouts switched by an interactive toggle:
     • default  → horizontal scrolling rail (tanyatimal-style)
     • toggled  → masonry-style 4-column grid
   Standalone, light-themed stylesheet.
   ========================================================================== */

@font-face {
  font-family: 'Gloock';
  src: url('Fonty/Gloock/Gloock-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Jost';
  src: url('Fonty/Jost/Jost-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --orange: #ff5b00;
  --orange-deep: #d94300;
  --black: #0a0a0a;
  --ink: #0d0d0d;
  --white: #ffffff;
  --line: #c9c9c9;
  --muted: #8a8a8a;
  --maxw: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', sans-serif;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.shell {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 40px;
}

/* Reusable button ------------------------------------------------------- */
.btn {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 16px 38px;
  border: 1px solid var(--black);
  color: var(--white);
  background: var(--black);
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}
.btn--small { padding: 13px 30px; font-size: 11px; letter-spacing: 0.3em; }

/* ==========================================================================
   HEADER / NAV  (light theme)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  transition: box-shadow 0.3s ease;
}
.site-header.is-scrolled { box-shadow: 0 8px 30px rgba(0,0,0,0.10); }
.site-header .shell { max-width: 1600px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 104px;
}

.nav-logo { display: inline-flex; align-items: center; }
.nav-logo img {
  width: 325px;
  height: 85px;
  object-fit: contain;
  object-position: left center;
  filter: brightness(0);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}
.nav-menu a {
  font-family: 'Jost', sans-serif;
  font-size: 14.29px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.82);
  white-space: nowrap;
  position: relative;
  padding: 4px 0;
  transition: color 0.25s ease;
}
.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--black);
  transition: width 0.3s ease;
}
.nav-menu a:hover,
.nav-menu a.is-active { color: var(--black); }
.nav-menu a:hover::after,
.nav-menu a.is-active::after { width: 100%; }
.nav-cons-m { display: none; }   /* link Konsultacja: tylko w menu mobilnym (na desktopie jest przycisk CTA) */

.nav-right { display: flex; align-items: center; gap: 12px; }

.nav-cta {
  width: 349px;
  height: 60px;
  padding: 0;
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
  border-radius: 0;
  font-family: 'Jost', sans-serif;
  font-size: 14.29px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--orange); border-color: var(--orange); color: var(--white); transform: translateY(-1px); }

.nav-social { display: flex; align-items: center; gap: 8px; }
.nav-social a {
  width: 60px; height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--white);
  transition: transform 0.25s ease, background 0.25s ease;
}
.nav-social a:hover { transform: translateY(-1px); background: var(--orange); }
.nav-social svg { width: 24px; height: 24px; }

.nav-toggle {
  display: none;
  width: 40px; height: 28px;
  background: transparent; border: 0; cursor: pointer;
  position: relative;
}
.nav-toggle span {
  position: absolute; left: 0; width: 100%; height: 2px;
  background: var(--black); transition: 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 4px; }
.nav-toggle span:nth-child(2) { top: 13px; }
.nav-toggle span:nth-child(3) { top: 22px; }
.nav-toggle.is-open span:nth-child(1) { top: 13px; transform: rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { top: 13px; transform: rotate(-45deg); }

/* ---- Sub-row: back + view toggle (left) / sister categories (right) ---- */
.subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  margin-top: -8px;
}
.subnav-left { display: flex; align-items: center; gap: 22px; }
.subnav-right { display: flex; align-items: center; gap: 44px; }
.subnav-right a {
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.62);
  transition: color 0.25s ease;
}
.subnav-right a:hover { color: var(--black); }

/* Back link */
.back-link { display: inline-flex; align-items: center; }
.back-icon {
  width: 70px; height: 44px;
  border-radius: 999px;
  border: 1.5px solid rgba(0,0,0,0.55);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.back-icon svg { width: 26px; height: auto; }
.back-link:hover .back-icon { background: var(--black); color: var(--white); border-color: var(--black); }

/* View toggle (pill switch) */
.view-toggle {
  width: 76px; height: 44px;
  border-radius: 999px;
  border: 1.5px solid rgba(0,0,0,0.55);
  background: transparent;
  position: relative;
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.view-toggle-knob {
  position: absolute;
  top: 50%;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--black);
  transform: translateY(-50%);
  right: 6px; left: auto;
  transition: left 0.3s ease, right 0.3s ease, background 0.3s ease;
}
/* default (horizontal view) → knob on the right; grid view → knob on the left */
.view-toggle[aria-checked="true"] .view-toggle-knob { left: 6px; right: auto; }
.view-toggle:hover { border-color: var(--black); }

/* ==========================================================================
   MAIN
   ========================================================================== */
.kampanijne {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
}

/* ---------- HORIZONTAL RAIL (default) ------------------------------------ */
.kam-rail {
  position: relative;
  flex: 1 1 auto;
  height: calc(100vh - 170px);   /* definite height so figure % sizes resolve correctly */
  min-height: 0;
  margin-left: 210px;            /* leave the title its own column; photos clip here */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.35) transparent;
}
.kam-rail::-webkit-scrollbar { height: 6px; }
.kam-rail::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.3); border-radius: 6px; }
.kam-rail::-webkit-scrollbar-track { background: transparent; }

/* fixed against the non-scrolling <main>, so it never moves with the rail */
.kam-title {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}
body.is-grid .kam-title { display: none; }
.kam-title span {
  font-family: 'Gloock', serif;
  font-weight: 400;
  font-size: clamp(54px, 7vw, 116px);
  line-height: 1;
  color: var(--black);
  white-space: nowrap;
  text-transform: uppercase;
  transform: rotate(-90deg);
}
/* „SOCIAL MEDIOWE" w DWÓCH liniach (SOCIAL / MEDIOWE) — krótsze linie pozwalają na
   znacznie większy font bez ucinania. Szerszy kontener mieści dwie obrócone linie;
   rozmiar ograniczony wysokością okna, by zawsze był widoczny w całości. */
.gallery-social .kam-title { width: 320px; }
.gallery-social .kam-title span {
  font-size: min(140px, calc((100vh - 100px) / 5.2));
  line-height: 1.08;
  text-align: center;
}
/* Napis (2 kolumny) jest szerszy, więc szyna ze zdjęciami zaczyna się za nim —
   inaczej przewijane zdjęcia nachodziłyby na kolumnę „MEDIOWE". */
.gallery-social .kam-rail { margin-left: 320px; }

/* Napis wyrównany do DOŁU kolumny (dół zdjęć), zamiast do środka.
   writing-mode daje realny pionowy box, więc flex czysto dosuwa go do dołu;
   rotate(180deg) zachowuje ten sam kierunek/wygląd liter co domyślny rotate(-90deg). */
.title-bottom .kam-title { align-items: flex-end; padding-bottom: 3vh; }
.title-bottom .kam-title span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.kam-track {
  height: 100%;
  display: flex;
  align-items: center;            /* all photos centred on one middle axis */
  gap: 0;                         /* photos sit edge-to-edge (connected) */
  width: max-content;
  min-width: 100%;
  /* left/right padding is set by JS so the first photo starts from the right
     with the next one peeking in — see layout() in kampanijne.js */
  padding: 0 90px 0 24px;
}
.kam-track figure {
  position: relative;
  flex: 0 0 auto;
  height: 94%;                    /* uniform height — every photo is the same size */
  aspect-ratio: 4 / 5;            /* portrait, showing the full photo like the lightbox */
  overflow: hidden;
  transform-origin: center center;
  will-change: transform;         /* JS sets transform (translateX + scale) per frame */
}
.kam-track figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- GRID (toggled) ----------------------------------------------- */
.kam-grid { display: none; }
.kam-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.kam-grid figure { overflow: hidden; position: relative; }
.kam-grid figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.kam-grid figure:hover img { transform: scale(1.05); }

/* ---------- View switching ---------------------------------------------- */
body.is-grid .kam-rail { display: none; }
body.is-grid .kampanijne { flex: 1 0 auto; display: block; }
body.is-grid .kam-grid { display: grid; }
body.is-grid .site-footer { display: block; }

/* footer hidden in the immersive horizontal view */
.site-footer { display: none; }

/* ==========================================================================
   LIGHTBOX — clicked photo full-height, pinned right, page dimmed white
   ========================================================================== */
.kam-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.94);  /* 94% white veil over the page */
  display: flex;
  align-items: center;
  justify-content: center;                /* photo centred on screen */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  cursor: zoom-out;
}
.kam-lightbox.is-open { opacity: 1; visibility: visible; }
.kam-lightbox img {
  height: 100vh;            /* full page height */
  width: auto;
  max-width: 100vw;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.22);
}

/* Prev / next arrows — transparent pill outline */
.kam-lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 88px;
  height: 52px;
  border-radius: 999px;
  border: 1.5px solid rgba(0, 0, 0, 0.55);
  background: transparent;     /* przezroczyste tło */
  color: #0a0a0a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.kam-lb-arrow svg { width: 30px; height: auto; }
.kam-lb-prev { left: 36px; }
.kam-lb-next { right: 36px; }
.kam-lb-arrow:hover {
  background: #0a0a0a;
  color: #fff;
  border-color: #0a0a0a;
}
@media (max-width: 640px) {
  .kam-lb-arrow { width: 62px; height: 42px; }
  .kam-lb-prev { left: 14px; }
  .kam-lb-next { right: 14px; }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  flex-shrink: 0;
  background: var(--black);
  color: var(--white);
  padding: 56px 0 30px;
  font-family: 'Jost', sans-serif;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  column-gap: 70px;
  align-items: start;
  margin-bottom: 40px;
}
.footer-logo { height: 46px; width: auto; filter: brightness(0) invert(1); }

.footer-col { list-style: none; }
.footer-menu li { margin-bottom: 12px; }
.footer-col a, .footer-col p {
  font-size: 17px;
  color: var(--white);
  font-weight: 300;
  letter-spacing: 0.01em;
  transition: color 0.25s ease;
}
.footer-col a:hover { color: var(--orange); }
.footer-data p { margin-bottom: 12px; }

.footer-contact h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-contact p { margin-bottom: 9px; }

.footer-social { display: flex; gap: 10px; margin-top: 22px; }
.footer-social a {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.88);
  color: #141414;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}
.footer-social a:hover { background: var(--white); transform: translateY(-2px); }
.footer-social svg { width: 17px; height: 17px; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.16);
  padding-top: 22px;
  font-size: 17px;
  color: var(--white);
  font-weight: 300;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .kam-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; row-gap: 40px; }
}

@media (max-width: 860px) {
  .shell { padding: 0 22px; }
  .nav-menu, .nav-social { display: none; }
  .nav-toggle { display: block; }
  .nav-cons-m { display: block; }   /* Konsultacja widoczna w menu mobilnym */
  .nav-cta { display: none; }   /* mobile: górny pasek bez "Bezpłatna konsultacja", jak na pozostałych podstronach */
  .nav-logo img { width: auto; max-width: 56vw; height: 54px; }   /* logo jak na pozostałych podstronach */
  .nav-menu.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 104px; left: 0; right: 0;
    background: var(--white);
    padding: 26px 22px;
    gap: 18px;
    border-bottom: 1px solid rgba(0,0,0,0.12);
    box-shadow: 0 12px 30px rgba(0,0,0,0.10);
  }
  .subnav-right { gap: 24px; }
  .subnav-right a { font-size: 12px; letter-spacing: 0.14em; }
  /* lightbox na mobile: całe zdjęcie wyśrodkowane (bez ucięcia) + biała zasłona 90% */
  .kam-lightbox { background: rgba(255, 255, 255, 0.90); }
  .kam-lb-arrow { display: none; }            /* bez strzałek - zmiana zdjęć swipem palcem */
  .kam-lightbox img {
    height: auto;
    width: auto;
    max-height: 100vh;
    max-height: 100dvh;
    max-width: 100vw;
    object-fit: contain;
  }
  /* mobile: bez pionowego napisu; pierwsze zdjęcie dosunięte do lewej krawędzi
     (efekt szyny z JS wyłączony dla ≤860px - patrz kampanijne.js) */
  .kam-title { display: none; }
  /* mobile: każde zdjęcie = szerokość ekranu telefonu, całe widoczne od razu (bez przewijania
     w bok wewnątrz zdjęcia), responsywnie; kolejne odsłaniasz przesunięciem (scroll-snap) */
  .kam-rail, .gallery-social .kam-rail { margin-left: 0; height: auto; scroll-snap-type: x mandatory; }
  .kam-track { padding-left: 0; height: auto; align-items: center; transform: none !important; }
  .kam-track figure {
    flex: 0 0 100vw !important;
    width: 100vw !important;
    height: auto !important;
    aspect-ratio: auto !important;
    transform: none !important;
    transition: none !important;
    scroll-snap-align: start;
  }
  .kam-track figure img { width: 100% !important; height: auto !important; object-fit: contain; }
  /* iOS Safari: delegowany click odpala się na stuknięcie tylko gdy element ma cursor:pointer */
  .kam-track figure, .kam-track img,
  .kam-grid figure, .kam-grid img { cursor: pointer; }
  .kam-grid { grid-template-columns: repeat(2, 1fr); }
  /* stopka widoczna na mobile (na desktopie w widoku szyny pozostaje ukryta) i wyśrodkowana jak na pozostałych podstronach */
  .site-footer { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; row-gap: 40px; text-align: center; }
  .footer-logo { margin-left: auto; margin-right: auto; }
  .footer-social { justify-content: center; }
  .footer-bottom { text-align: center; }
}

@media (max-width: 520px) {
  /* linki Social Mediowa / Biznesowa zostają widoczne obok przełącznika (nad zdjęciami) - kompaktowo */
  .subnav { gap: 8px; flex-wrap: wrap; align-items: center; }
  .subnav-left { gap: 12px; align-items: center; }
  /* napisy wyśrodkowane w pionie względem toggla/strzałki */
  .subnav-right { display: flex; gap: 10px; align-items: center; }
  .subnav-right a { font-size: 12px; letter-spacing: 0.04em; line-height: 1; }   /* +20% */
  /* przełącznik i strzałka +15% */
  .back-icon { width: 56px; height: 36px; }
  .back-icon svg { width: 21px; }
  .view-toggle { width: 61px; height: 36px; }
  .view-toggle-knob { width: 25px; height: 25px; right: 6px; }
  .view-toggle[aria-checked="true"] .view-toggle-knob { left: 6px; right: auto; }
  .footer-grid { grid-template-columns: 1fr; row-gap: 32px; }
}
