/* Kolory i czcionki przychodzą z ustawień strony (panel → Ustawienia → Wygląd) jako zmienne :root.
   Poniżej wartości domyślne na wypadek braku ustawień. */
:root {
  --accent: #1f6fb2;
  --accent-dark: #163f68;
  --accent-soft: #dceaf6;
  --bg: #f4f8fc;
  --line: #c7dbec;
  --fg: #142233;
  --muted: #5b6b7d;
  --card: #fff;
  --film: #17191c;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --fs: 18px;
  --fs-menu: 16px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1320px;      /* szerokość strony — rośnie na dużych ekranach (na dole pliku) */
  --strip: 210px;      /* szerokość kliszy */
  --card-min: 240px;   /* minimalna szerokość karty wpisu */
  --zoom: 1;           /* mnożnik tekstu na dużych ekranach */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--sans); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* tło z aparatem: duży, ledwie widoczny rysunek przypięty do okna */
body.camera-bg::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url("../img/aparat.svg") no-repeat right -80px bottom -60px / min(70vw, 900px) auto;
  opacity: .07;
}

/* ---------------------------------------------------------------- nagłówek */
.site-header { max-width: var(--maxw); margin: 0 auto; padding: 18px 16px 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 28px; align-items: center; }
.brand img { width: clamp(200px, 26vw, 320px); height: auto; }
.header-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.tagline { margin: 0; color: var(--muted); font: italic 15px/1.3 var(--font-body); text-align: right; }
.search { position: relative; width: min(100%, 360px); }
.search input { width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: 15px var(--sans); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgb(0 0 0 / .12); }
.suggest a { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--fg); }
.suggest a:hover, .suggest a.on { background: var(--accent-soft); }
.suggest small { color: var(--muted); }
.menu-toggle { display: none; }
.tabs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--accent); margin-top: 6px; }
.tabs a { padding: 8px 16px; border-radius: 8px 8px 0 0; text-decoration: none; color: var(--accent-dark); font: 600 var(--fs-menu)/1.3 var(--sans); }
.tabs a:hover { background: var(--accent-soft); }
.tabs a[aria-current] { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- układ + klisza */
.layout { max-width: var(--maxw); margin: 0 auto; padding: 24px 16px 48px; display: grid; grid-template-columns: var(--strip) minmax(0, 1fr); gap: 32px; align-items: start; }
main { min-width: 0; }

.filmstrip {
  position: sticky; top: 16px;
  background: var(--film);
  /* perforacja: dwa rzędy jasnych okienek po bokach paska */
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 10px, #e9edf1 10px 22px, transparent 22px 32px),
    repeating-linear-gradient(to bottom, transparent 0 10px, #e9edf1 10px 22px, transparent 22px 32px);
  background-size: 12px 100%, 12px 100%;
  background-position: 7px 0, calc(100% - 7px) 0;
  background-repeat: repeat-y;
  border-radius: 6px; padding: 14px 28px; box-shadow: 0 6px 18px rgb(0 0 0 / .18);
}
.filmstrip-title { margin: 0 0 8px; color: #f3c64a; font: 700 11px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; text-align: center; }
.filmstrip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
/* klatka = zdjęcie z najnowszego wpisu kategorii + podpis na nim */
.frame {
  position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden;
  border-radius: 2px; text-decoration: none; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 45%, #26303a), #1c2128);
  outline: 1px solid rgb(255 255 255 / .06);
}
.frame img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.85) brightness(.85); transition: transform .35s ease, filter .25s ease;
}
.frame::after { /* przyciemnienie od dołu pod podpisem */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgb(5 12 22 / .82) 0%, rgb(5 12 22 / .15) 55%, transparent 100%);
}
.frame-label {
  position: absolute; z-index: 1; left: 8px; right: 8px; bottom: 6px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  font: 700 var(--fs-menu)/1.15 var(--sans); letter-spacing: .01em; text-shadow: 0 1px 3px rgb(0 0 0 / .6);
}
.frame-label small { font-weight: 600; font-size: 11px; padding: 1px 6px; border-radius: 999px;
  background: rgb(255 255 255 / .2); font-variant-numeric: tabular-nums; text-shadow: none; }
.frame:hover img { transform: scale(1.06); filter: saturate(1) brightness(1); }
.frame:focus-visible { outline: 3px solid #f3c64a; outline-offset: 1px; }
.frame.active::after { box-shadow: inset 0 0 0 3px #f3c64a; }
.frame.active img { filter: none; }
.frame.active .frame-label small { background: #f3c64a; color: #1b2430; }

/* ---------------------------------------------------------------- listy */
.intro h1, .post-header h1 { font: 600 clamp(28px, 3.6vw, 42px)/1.15 var(--font-head); margin: 4px 0 8px; text-wrap: balance; color: var(--accent-dark); }
.intro p { color: var(--muted); margin: 4px 0; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0; }
.meta { color: var(--muted); font-size: 14px; margin: 4px 0; font-variant-numeric: tabular-nums; }
.sort { font-size: 14px; color: var(--muted); }
.sort a[aria-current] { font-weight: 700; text-decoration: none; color: var(--fg); }

.cards { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 28px 22px; grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr)); }
.card { background: var(--card); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgb(0 0 0 / .06), 0 4px 14px rgb(31 111 178 / .08); transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgb(0 0 0 / .08), 0 10px 26px rgb(31 111 178 / .16); }
.card a { text-decoration: none; color: inherit; display: block; }
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: var(--line); }
.card h2 { font: 600 19px/1.25 var(--font-head); margin: 12px 14px 2px; text-wrap: balance; }
.card .meta { margin: 0 14px 14px; }
.card a:hover h2 { color: var(--accent); }
.pager { display: flex; gap: 20px; justify-content: center; align-items: center; color: var(--muted); }

.tags { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags a { display: inline-block; font-size: 13px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--accent-dark); background: #fff; }
.tags a:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------------------------------------------------------------- wpis */
.post { max-width: 1100px; }
.post.narrow { max-width: 720px; }
.lead { font: 20px/1.6 var(--font-body); }
.post-body { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; gap: 12px; margin-top: 18px; }
.post-body .text, .post-body h2, .post-body .video { grid-column: 1 / -1; max-width: 760px; margin: 12px 0; width: 100%; }
.post-body > :first-child { margin-top: 0; }
.post-body .text > :first-child { margin-top: 0; }
.post-body .text > :last-child { margin-bottom: 0; }
.post-body .text { font: var(--fs)/1.75 var(--font-body); }
.post-body h2 { font: 600 26px/1.25 var(--font-head); color: var(--accent-dark); }
.video iframe, .video video { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 6px; background: #000; }
.photo { margin: 0; }
.photo.landscape { grid-column: 1 / -1; }
.photo img { width: 100%; border-radius: 3px; background: var(--line); cursor: zoom-in; }
.photo figcaption { font-size: 14px; color: var(--muted); padding: 6px 2px 0; }

.share { display: flex; gap: 12px; align-items: center; margin: 32px 0 0; font-size: 15px; color: var(--muted); }
.share a { padding: 6px 14px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; }
.share a:hover { background: var(--accent-dark); color: #fff; }
.prevnext { display: flex; justify-content: space-between; gap: 16px; margin: 28px 0; border-top: 1px solid var(--line); padding-top: 16px; }
.prevnext a { max-width: 48%; }
.prevnext a[rel=next] { margin-left: auto; text-align: right; }
.related h2, .comments h2 { font: 600 24px/1.2 var(--font-head); color: var(--accent-dark); }

/* ---------------------------------------------------------------- formularze, komentarze */
.comments { max-width: 760px; margin-top: 32px; }
.comment { background: #fff; border-left: 3px solid var(--accent); border-radius: 4px; padding: 8px 14px; margin: 10px 0; }
.comment p { margin: 4px 0; }
.form { display: grid; gap: 10px; max-width: 640px; margin-top: 12px; }
.form label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.form input, .form textarea { font: 16px var(--sans); padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--fg); }
.form button, .subscribe button { justify-self: start; padding: 9px 20px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 600 15px var(--sans); cursor: pointer; }
.form button:hover, .subscribe button:hover { background: var(--accent-dark); }
.err { color: #b3261e; font-size: 13px; }
.flash { list-style: none; padding: 0; margin: 0 0 16px; }
.flash li, .flash-ok { padding: 10px 14px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); }
.flash li.error { background: #fde7e7; color: #8a1c1c; }

.news-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.news-item h2 { margin: 2px 0; font: 600 22px/1.3 var(--font-head); }

/* ---------------------------------------------------------------- stopka */
.site-footer { background: var(--accent-dark); color: #e6eef6; margin-top: 24px; }
.site-footer { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; padding: 28px max(16px, calc(50% - var(--maxw) / 2 + 16px)); }
.site-footer a { color: #fff; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col img { width: 64px; height: 64px; }
.footer-h { margin: 0; font-weight: 700; }
.subscribe { display: flex; flex-wrap: wrap; gap: 8px; }
.subscribe input[type=email] { padding: 9px 14px; border: 0; border-radius: 999px; min-width: 240px; font: 15px var(--sans); }
.subscribe button { background: #f3c64a; color: #1b2430; }
.subscribe button:hover { background: #fff; color: #1b2430; }

/* ---------------------------------------------------------------- przeglądarka zdjęć */
.lb { position: fixed; inset: 0; z-index: 100; background: rgb(8 14 22 / .94); display: grid; grid-template-columns: 64px 1fr 64px; grid-template-rows: 1fr auto; align-items: center; }
.lb[hidden] { display: none; }
.lb img { grid-column: 2; grid-row: 1; max-width: 100%; max-height: calc(100vh - 80px); margin: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.lb button { background: rgb(255 255 255 / .08); border: 0; color: #fff; font-size: 34px; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; margin: auto; }
.lb button:hover { background: var(--accent); }
.lb .lb-prev { grid-column: 1; grid-row: 1; }
.lb .lb-next { grid-column: 3; grid-row: 1; }
.lb .lb-close { position: absolute; top: 12px; right: 12px; font-size: 26px; width: 44px; height: 44px; }
.lb .lb-info { grid-column: 1 / -1; grid-row: 2; color: #cfd8e3; text-align: center; padding: 10px 16px 16px; font-size: 14px; }

/* ---------------------------------------------------------------- duże ekrany: szerzej i proporcjonalnie większe */
@media (min-width: 1700px) {
  :root { --maxw: 1520px; --card-min: 270px; }
  body { zoom: 1.1; }
}
@media (min-width: 2200px) {
  :root { --maxw: 1640px; --card-min: 290px; }
  body { zoom: 1.3; }
}
@media (min-width: 3000px) {
  body { zoom: 1.6; }
}

/* ---------------------------------------------------------------- niskie ekrany: klisza mieści się w oknie */
@media (min-width: 861px) {
  .filmstrip ul { gap: 6px; }
  .frame { aspect-ratio: auto; height: clamp(52px, calc((100vh - 96px) / 7 - 6px), 140px); }
  @supports (zoom: 1) {
    @media (min-width: 1700px) { .frame { height: clamp(52px, calc((100vh / 1.1 - 96px) / 7 - 6px), 140px); } }
    @media (min-width: 2200px) { .frame { height: clamp(52px, calc((100vh / 1.3 - 96px) / 7 - 6px), 140px); } }
    @media (min-width: 3000px) { .frame { height: clamp(52px, calc((100vh / 1.6 - 96px) / 7 - 6px), 140px); } }
  }
}

/* ---------------------------------------------------------------- telefon */
@media (max-width: 860px) {
  /* nagłówek zwarty: logo + wyszukiwarka w jednym pasie, zakładki przewijane */
  .site-header { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding-top: 12px; }
  .brand img { width: 132px; }
  .tagline { display: none; }
  .header-side { align-items: stretch; }
  .search { width: 100%; }
  .search input { padding: 8px 12px; font-size: 16px; }
  /* menu pod przyciskiem ☰ */
  .site-header { grid-template-columns: auto minmax(0, 1fr) auto; position: relative; }
  .menu-toggle { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px;
    background: var(--accent); color: #fff; cursor: pointer; }
  .menu-toggle:focus-visible { outline: 3px solid #f3c64a; outline-offset: 2px; }
  .burger, .burger::before, .burger::after { display: block; width: 20px; height: 2px; border-radius: 2px;
    background: currentColor; transition: transform .2s ease, opacity .2s ease; }
  .burger { position: relative; }
  .burger::before, .burger::after { content: ""; position: absolute; left: 0; }
  .burger::before { top: -6px; }
  .burger::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .burger { background: transparent; }
  .menu-toggle[aria-expanded="true"] .burger::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .burger::after { transform: translateY(-6px) rotate(-45deg); }

  .tabs { display: none; grid-column: 1 / -1; flex-direction: column; gap: 0; border: 0; margin: 4px -16px 0;
    background: #fff; box-shadow: 0 10px 24px rgb(15 30 50 / .15); border-top: 3px solid var(--accent); }
  .tabs.open { display: flex; animation: menu-in .18s ease-out; }
  .tabs a { padding: 14px 20px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 17px; }
  .tabs a:last-child { border-bottom: 0; }
  .tabs a[aria-current] { background: var(--accent-soft); color: var(--accent-dark); box-shadow: inset 4px 0 0 var(--accent); }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }

  .layout { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-top: 14px; }

  /* klisza poziomo, od krawędzi do krawędzi, przewijana palcem bez paska */
  .filmstrip { position: static; margin-inline: -16px; border-radius: 0; padding: 22px 0;
    overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
    background-image:
      repeating-linear-gradient(to right, transparent 0 10px, #e9edf1 10px 22px, transparent 22px 32px),
      repeating-linear-gradient(to right, transparent 0 10px, #e9edf1 10px 22px, transparent 22px 32px);
    background-size: 100% 9px, 100% 9px; background-position: 0 6px, 0 calc(100% - 6px); background-repeat: repeat-x;
    background-attachment: local; }
  .filmstrip::-webkit-scrollbar { display: none; }
  .filmstrip-title { display: none; }
  .filmstrip ul { flex-direction: row; gap: 6px; padding-inline: 16px; width: max-content; }
  .filmstrip li { scroll-snap-align: start; }
  .frame { width: 132px; aspect-ratio: 4 / 3; }

  /* wygaszenie przy krawędzi = „przewiń, jest więcej” (klasy ustawia site.js) */
  .fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
  .fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent);
            mask-image: linear-gradient(to left, #000 calc(100% - 48px), transparent); }
  .fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent);
                   mask-image: linear-gradient(to right, transparent, #000 48px, #000 calc(100% - 48px), transparent); }

  .intro h1, .post-header h1 { font-size: 30px; }
  .post-body { grid-template-columns: 1fr; }
  .lb { grid-template-columns: 44px 1fr 44px; }
  .lb button { width: 40px; height: 40px; font-size: 26px; }
}
