/* Chest of Books, arkusz stylów strony */

/* Czcionki osadzone lokalnie (licencja SIL OFL, pliki w assets/fonts) */
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/familjen-grotesk-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/familjen-grotesk-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/familjen-grotesk-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/familjen-grotesk-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/familjen-grotesk-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/familjen-grotesk-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/familjen-grotesk-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Familjen Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/familjen-grotesk-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/literata-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/literata-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/literata-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Literata"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/literata-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Tokeny */
:root {
  --papier: #F3F4F1;
  --atrament: #1E2A3A;
  --polka: #C9CDC6;
  --zakladka: #8E2C3E;
  --zakladka-ciemna: #6B1F2E;
  --szary: #4A5566;
  --bialy: #FFFFFF;
  --fokus: #27407A;

  --sans: "Familjen Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;

  --szerokosc: 1240px;
  --margines: clamp(20px, 5vw, 64px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--papier);
  color: var(--atrament);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--zakladka); text-underline-offset: 3px; }
a:hover { color: var(--zakladka-ciemna); }

:focus-visible { outline: 3px solid var(--fokus); outline-offset: 3px; }

.kontener { max-width: var(--szerokosc); margin: 0 auto; padding-inline: var(--margines); }

.pomin {
  position: absolute; left: 12px; top: -100px; z-index: 10;
  background: var(--atrament); color: var(--papier);
  padding: 12px 16px; border-radius: 2px; text-decoration: none; font-weight: 600;
}
.pomin:focus { top: 12px; color: var(--papier); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Pasek strony pokazowej: usuń razem z <p class="demo"> w plikach HTML */
.demo { margin: 0; padding: 8px var(--margines); background: var(--atrament); color: var(--papier); font-size: 14px; text-align: center; }

/* Nagłówek */
.naglowek { border-bottom: 1px solid var(--polka); }
.naglowek__wnetrze {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 40px; padding-block: 18px;
}
.logo {
  display: inline-flex; align-items: flex-end; gap: 10px; min-height: 44px;
  color: var(--atrament); text-decoration: none;
  font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2;
}
.logo:hover { color: var(--atrament); }
.logo svg { width: 26px; height: 28px; margin-bottom: 3px; flex: none; }
.logo span { padding-bottom: 4px; }

.menu { display: flex; flex-wrap: wrap; gap: 0 28px; margin: 0; padding: 0; list-style: none; font-size: 17px; font-weight: 500; }
.menu a { display: inline-block; padding: 11px 0; color: var(--atrament); text-decoration: none; }
.menu a:hover { color: var(--zakladka); text-decoration: underline; }

/* Nagłówki sekcji */
.sekcja__glowa {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 64px;
}
.tytul-strony {
  margin: 0; max-width: 12ch;
  font-size: clamp(40px, 6vw, 68px); line-height: 1.02; font-weight: 600; letter-spacing: -0.028em;
}
.tytul-sekcji {
  margin: 0;
  font-size: clamp(32px, 3.8vw, 46px); line-height: 1.06; font-weight: 600; letter-spacing: -0.02em;
}
.wstep { margin: 0; max-width: 42ch; font-size: 18px; line-height: 1.5; color: var(--szary); }

/* Półka miesiąca */
.polka-sekcja { padding-block: 72px 96px; }

.polka {
  display: flex; align-items: flex-end; gap: 3px;
  margin: 40px 0 0; padding: 48px 0 0; list-style: none;
  border-bottom: 14px solid var(--polka);
  box-shadow: 0 16px 18px -14px rgba(30, 42, 58, .45);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
}
.polka li { flex: 0 0 auto; display: flex; }

.grzbiet {
  --w: 76px; --h: 310px;
  width: calc(var(--w) * var(--skala, .93)); height: calc(var(--h) * var(--skala, .93));
  display: flex; align-items: center; justify-content: center;
  margin: 0; padding: 16px 0; border: 0; border-radius: 2px 2px 0 0;
  position: relative;
  background-color: var(--atrament); color: var(--papier);
  /* zaokrąglenie grzbietu: cień przy krawędziach, odblask bliżej lewej */
  background-image: linear-gradient(90deg, rgba(0,0,0,.24) 0, rgba(255,255,255,.16) 22%, rgba(255,255,255,0) 48%, rgba(0,0,0,.08) 82%, rgba(0,0,0,.26) 100%);
  box-shadow: 0 1px 0 rgba(0,0,0,.08), 2px 0 6px -3px rgba(30,42,58,.35);
  font: inherit; cursor: pointer;
  transition: transform .38s cubic-bezier(.2, .7, .2, 1), filter .2s;
}
/* prążki przy główce i stopce grzbietu */
.grzbiet::before, .grzbiet::after {
  content: ""; position: absolute; left: 10%; right: 10%; height: 2px;
  background: currentColor; opacity: .35; pointer-events: none;
}
.grzbiet::before { top: 18px; }
.grzbiet::after { bottom: 18px; }
.grzbiet:hover { filter: brightness(1.07); }
.grzbiet[aria-pressed="true"] { transform: translateY(-32px); }
.grzbiet:focus-visible { outline-offset: -6px; outline-color: var(--papier); }
.grzbiet--jasny:focus-visible { outline-color: var(--atrament); }
@media (prefers-reduced-motion: reduce) { .grzbiet { transition: none; } }

.grzbiet__napis {
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; gap: 14px; white-space: nowrap;
}
.grzbiet__tytul { font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.grzbiet__autor { font-size: 12px; font-weight: 500; }

/* Kolory okładek */
[data-kolor="zielen"]    { background-color: #2F5D50; color: #F3F4F1; }
[data-kolor="musztarda"] { background-color: #D9A72B; color: #1E2A3A; }
[data-kolor="roz"]       { background-color: #E3B5AE; color: #1E2A3A; }
[data-kolor="granat"]    { background-color: #27407A; color: #F3F4F1; }
[data-kolor="wisnia"]    { background-color: #8E2C3E; color: #F3F4F1; }
[data-kolor="szalwia"]   { background-color: #A9B8A4; color: #1E2A3A; }
[data-kolor="grafit"]    { background-color: #3B3F45; color: #F3F4F1; }
[data-kolor="ochra"]     { background-color: #EBD9A6; color: #1E2A3A; }

.ksiazka {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  gap: 28px 72px; padding-top: 48px;
}
.ksiazka__naglowek { flex: 1 1 320px; min-width: 0; }
.ksiazka__tytul {
  margin: 0; font-family: var(--serif);
  font-size: clamp(32px, 3.6vw, 46px); line-height: 1.12; font-weight: 500;
}
.ksiazka__autor { margin: 14px 0 0; font-size: 19px; font-weight: 500; }
.ksiazka__tresc { flex: 1.5 1 420px; min-width: 0; max-width: 640px; }
.ksiazka__opis { margin: 0; font-family: var(--serif); font-size: 21px; line-height: 1.62; }
.ksiazka__poleca { margin: 16px 0 0; font-size: 15px; color: var(--szary); }

.przycisk {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; margin-top: 28px;
  border: 0; border-radius: 2px;
  background: var(--zakladka); color: var(--bialy);
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.przycisk:hover { background: var(--zakladka-ciemna); color: var(--bialy); }

/* Księgarnie */
.ksiegarnie { background: var(--bialy); border-block: 1px solid var(--polka); padding-block: 88px; }
.ksiegarnie__lista {
  display: flex; flex-wrap: wrap; gap: 40px 32px;
  margin: 48px 0 0; padding: 0; list-style: none;
}
.ksiegarnia { flex: 1 1 220px; min-width: 0; border-top: 3px solid var(--atrament); padding-top: 20px; }
.ksiegarnia h3 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -0.01em; }
.ksiegarnia address { margin: 14px 0 0; font-style: normal; line-height: 1.6; }
.ksiegarnia address a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; }
.ksiegarnia__godziny { margin: 12px 0 0; line-height: 1.6; color: var(--szary); }
.ksiegarnia__link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; font-weight: 600; }

/* Spotkania */
.spotkania { padding-block: 88px; }
.spotkania__lista { margin: 40px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--polka); }
.spotkanie {
  display: flex; flex-wrap: wrap; align-items: baseline;
  gap: 8px 40px; padding-block: 28px; border-bottom: 1px solid var(--polka);
}
.spotkanie__kiedy { flex: 0 0 180px; margin: 0; font-size: 18px; font-weight: 600; }
.spotkanie__tresc { flex: 1 1 360px; min-width: 0; }
.spotkanie h3 { margin: 0; font-size: 22px; font-weight: 600; }
.spotkanie__opis { margin: 8px 0 0; font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--szary); }
.spotkanie__link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }

/* Newsletter */
.newsletter { background: var(--atrament); color: var(--papier); }
.newsletter__wnetrze {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 32px 64px; padding-block: 72px;
}
.newsletter__tekst { flex: 1 1 360px; min-width: 0; }
.newsletter h2 { margin: 0; font-size: clamp(30px, 3.2vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; }
.newsletter__wstep { margin: 14px 0 0; max-width: 44ch; font-size: 18px; color: var(--polka); }
.newsletter a { color: var(--papier); }
.formularz { flex: 1 1 400px; min-width: 0; max-width: 540px; }
.formularz label[for="email"] { display: block; margin-bottom: 8px; font-size: 15px; font-weight: 500; }
.formularz__wiersz { display: flex; flex-wrap: wrap; gap: 8px; }
.formularz input[type="email"] {
  flex: 1 1 240px; min-width: 0; min-height: 48px; padding: 0 16px;
  border: 1.5px solid var(--papier); border-radius: 2px;
  background: transparent; color: var(--papier); font: inherit; font-size: 16px;
}
.formularz input[type="email"]:focus-visible { outline-color: var(--papier); }
.formularz .przycisk { margin-top: 0; background: var(--papier); color: var(--atrament); }
.formularz .przycisk:hover { background: var(--bialy); color: var(--atrament); }
.formularz .przycisk:focus-visible { outline-color: var(--papier); }
.zgoda { display: flex; gap: 12px; cursor: pointer; align-items: flex-start; margin-top: 16px; font-size: 14px; line-height: 1.5; color: var(--polka); }
.zgoda input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--papier); }
.zgoda input:focus-visible { outline-color: var(--papier); }
.pulapka { display: none; }

/* Stopka */
.stopka__wnetrze {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 40px; padding-block: 40px 56px; font-size: 15px; color: var(--szary);
}
.stopka p { margin: 0; }
.stopka ul { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 0; padding: 0; list-style: none; }
.stopka a { display: inline-block; padding: 12px 0; color: var(--atrament); }

/* Podstrony tekstowe (polityka prywatności, podziękowanie, 404) */
.podstrona { padding-block: 72px 96px; }
.podstrona .tytul-strony { max-width: 16ch; }
.proza { max-width: 68ch; margin-top: 32px; font-family: var(--serif); font-size: 18px; line-height: 1.7; }
.proza h2 { margin: 40px 0 8px; font-family: var(--sans); font-size: 24px; line-height: 1.25; font-weight: 600; }
.proza p, .proza ul { margin: 0 0 16px; }
.proza li { margin-bottom: 6px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .polka-sekcja { padding-block: 48px 72px; }
  .ksiegarnie, .spotkania { padding-block: 64px; }
  .ksiazka__opis { font-size: 19px; }
  .spotkanie__kiedy { flex-basis: 100%; }
  .grzbiet { --skala: .7; }
  .grzbiet[aria-pressed="true"] { transform: translateY(-24px); }
  .polka { padding-top: 36px; }
}

/* ---------- Rozszerzenia: 3D, mapa, formularz, drobne reguły ---------- */

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a, button, input, label { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (pointer: fine) { html { overscroll-behavior: none; } }
.spotkanie__kiedy { font-variant-numeric: tabular-nums; }

/* Scena z książką 3D (widoczna tylko, gdy przeglądarka obsłużyła WebGL) */
.scena { margin-top: 8px; }
.scena__ksiazka { display: none; }
.ma-3d .scena {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 24px 64px; align-items: center; margin-top: 16px;
}
.ma-3d .scena__ksiazka { display: block; position: relative; height: clamp(430px, 48vw, 640px); padding-bottom: 56px; }
.scena__plotno {
  position: absolute; inset: 0 0 56px 0; width: 100%; height: calc(100% - 56px); display: block;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.scena--ciagniecie .scena__plotno { cursor: grabbing; }
.scena__sterowanie {
  position: absolute; left: 0; bottom: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px;
}
.scena__podpowiedz { margin: 0; font-size: 14px; color: var(--szary); }
@media (pointer: coarse) { .scena__podpowiedz { display: none; } }
.scena__tyl {
  min-height: 44px; padding: 0 16px; border: 1.5px solid var(--atrament); border-radius: 2px;
  background: transparent; color: var(--atrament); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.scena__tyl:hover, .scena__tyl[aria-pressed="true"] { background: var(--atrament); color: var(--papier); }
.ma-3d .ksiazka { display: block; padding-top: 0; }
.ma-3d .ksiazka__tresc { margin-top: 24px; }
.ma-3d .polka { margin-top: 56px; }

/* Mapa księgarń 3D */
.ksiegarnie__uklad { margin-top: 48px; }
.ksiegarnie__uklad .ksiegarnie__lista { margin-top: 0; }
.mapa { display: none; }
.ma-3d .ksiegarnie__uklad {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 56px; align-items: center;
}
.ma-3d .mapa { display: block; position: relative; aspect-ratio: 1 / .92; min-height: 300px; overflow: hidden; }
.ma-3d .ksiegarnie__lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 32px; }
.mapa__etykieta {
  position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap;
  padding: 4px 10px; border-radius: 2px; background: var(--atrament); color: var(--papier);
  font-size: 14px; font-weight: 600; transition: background-color .2s;
}
.mapa__etykieta--aktywna { background: var(--zakladka); }
.ksiegarnia { transition: border-color .2s; }
.ksiegarnia:hover, .ksiegarnia:focus-within { border-top-color: var(--zakladka); }

/* Błędy formularza */
.formularz__blad { margin: 10px 0 0; font-size: 15px; font-weight: 500; color: #F6C7CE; }
.formularz input[aria-invalid="true"] { border-color: #F6C7CE; }

@media (max-width: 860px) {
  .ma-3d .scena { grid-template-columns: minmax(0, 1fr); }
  .ma-3d .scena__ksiazka { height: clamp(400px, 105vw, 520px); }
  .ma-3d .ksiegarnie__uklad { grid-template-columns: minmax(0, 1fr); }
  .ma-3d .mapa { aspect-ratio: auto; min-height: 0; height: clamp(260px, 72vw, 420px); }
}
@media (max-width: 560px) {
  .ma-3d .ksiegarnie__lista { grid-template-columns: minmax(0, 1fr); }
}
