/* ═══════════════════════════════════════════════════════════
   Kępińscy — Huta Głodowska
   Styl serwisu. Paleta i typografia przeniesione z pierwotnej
   jednoplikowej wersji strony.
   ═══════════════════════════════════════════════════════════ */

:root {
  --cream: #F8F2E4;
  --cream-dark: #EDE3CB;
  --parchment: #D9C9A3;
  --ink: #2A1A0E;
  --ink-mid: #4A3020;
  --sepia: #7A4F2E;
  --amber: #C47C2B;
  --gold: #D4A844;
  --forest: #2D4A35;
  --forest-light: #3D6449;
  --rust: #8B3A2A;
  --shadow: rgba(42, 26, 14, 0.18);

  --nav-h: 60px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 18px;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'EB Garamond', Georgia, serif;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > main { flex: 1; }

/* Ziarnista tekstura na całej stronie */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.5;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--sepia); }

::selection { background: rgba(212, 168, 68, 0.35); }

/* ——— Animacje pojawiania ——— */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1); }
.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1); }
.reveal-left.visible, .reveal-right.visible { opacity: 1; transform: translateX(0); }
.delay-1 { transition-delay: .12s; }
.delay-2 { transition-delay: .24s; }
.delay-3 { transition-delay: .38s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-left, .reveal-right { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══ NAWIGACJA ═══ */
nav.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  background: rgba(42, 26, 14, .96);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 0 1.6rem;
  height: var(--nav-h);
  border-bottom: 1px solid rgba(212, 168, 68, .3);
}

.nav-brand {
  font-family: 'Great Vibes', cursive;
  color: var(--gold);
  font-size: 1.7rem;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.nav-links { display: flex; gap: 1.4rem; list-style: none; align-items: center; }

.nav-links a {
  color: var(--parchment);
  text-decoration: none;
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: color .2s;
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); }

.nav-right { display: flex; align-items: center; gap: 1rem; }

/* Przełącznik języka */
.lang-switch { display: flex; align-items: center; gap: .35rem; }
.lang-switch a {
  color: rgba(248, 242, 228, .5);
  text-decoration: none;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .2rem .4rem;
  border: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.lang-switch a:hover { color: var(--gold); }
.lang-switch a.active { color: var(--gold); border-color: rgba(212, 168, 68, .4); }
.lang-switch span { color: rgba(248, 242, 228, .25); font-size: .7rem; }

/* ——— Menu drugiego poziomu (Multimedia, Moje konto) ———
   Na desktopie rozwija je hover, ale hover nie istnieje na dotyku i nie ma go
   klawiatura — dlatego rodzic jest <button>, a JS przełącza klasę .open.
   Oba mechanizmy prowadzą do tego samego selektora. */
.nav-has-sub { position: relative; }

.nav-sub-toggle {
  display: inline-flex; align-items: center; gap: .4rem;
  background: none; border: none; cursor: pointer;
  color: var(--parchment);
  font-family: 'EB Garamond', serif;
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 0;
  transition: color .2s;
  white-space: nowrap;
}
.nav-sub-toggle:hover, .nav-sub-toggle.active { color: var(--gold); }

.nav-caret { width: 9px; height: 6px; transition: transform .25s; }
.nav-has-sub:hover .nav-caret,
.nav-has-sub.open .nav-caret { transform: rotate(180deg); }

.nav-sub {
  position: absolute; top: 100%; left: -1rem;
  min-width: 13rem;
  list-style: none;
  background: rgba(26, 13, 6, .99);
  border: 1px solid rgba(212, 168, 68, .3);
  border-top: 2px solid var(--gold);
  padding: .4rem 0;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .4);
  /* Domknięte menu ma zniknąć także dla czytników ekranu i tabulatora,
     dlatego visibility, nie samo opacity. */
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
  z-index: 10;
}
.nav-sub-right { left: auto; right: 0; }

.nav-has-sub:hover .nav-sub,
.nav-has-sub:focus-within .nav-sub,
.nav-has-sub.open .nav-sub {
  opacity: 1; visibility: visible; transform: translateY(0);
}

/* Odstęp między przyciskiem a listą zjadłby hover w połowie drogi. */
.nav-has-sub::after {
  content: ''; position: absolute; top: 100%; left: 0; right: 0; height: .8rem;
}

.nav-sub a, .nav-logout {
  display: block; width: 100%;
  padding: .6rem 1.2rem;
  color: var(--parchment); text-decoration: none;
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  text-align: left;
  background: none; border: none; cursor: pointer;
  font-family: 'EB Garamond', serif;
  transition: background .2s, color .2s;
}
.nav-sub a:hover, .nav-sub a.active, .nav-logout:hover {
  background: rgba(212, 168, 68, .12);
  color: var(--gold);
}

.nav-sub-sep { border-top: 1px solid rgba(248, 242, 228, .08); margin-top: .4rem; padding-top: .4rem; }

/* Menu użytkownika */
.nav-user {
  display: flex; align-items: center; gap: .6rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(212, 168, 68, .25);
}
.nav-user-badge {
  font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(212, 168, 68, .4);
  padding: .18em .6em;
  white-space: nowrap;
}
.nav-user-toggle { gap: .5rem; }
.nav-user-name { font-size: .74rem; }

.nav-login {
  background: var(--amber);
  color: var(--ink) !important;
  padding: .45em 1.1em;
  font-size: .72rem !important;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s;
  white-space: nowrap;
}
.nav-login:hover { background: var(--gold); }

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--parchment);
  padding: .4rem;
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    gap: 0;
    background: rgba(26, 13, 6, .99);
    border-bottom: 1px solid rgba(212, 168, 68, .3);
    padding: .5rem 0 1rem;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    transform: translateY(-120%);
    transition: transform .3s cubic-bezier(.22,1,.36,1);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a {
    display: block;
    padding: .9rem 1.6rem;
    font-size: .84rem;
    border-bottom: 1px solid rgba(248, 242, 228, .06);
  }

  /* Podmenu wewnątrz rozwijanego menu (Multimedia) nie ma dokąd „wypłynąć” —
     rozwija się w miejscu, wcięte, jako część listy. Hover na dotyku nie
     istnieje, więc otwiera je wyłącznie klasa .open ustawiana kliknięciem. */
  .nav-links .nav-has-sub { position: static; }
  .nav-links .nav-has-sub::after { content: none; }

  .nav-links .nav-sub-toggle {
    display: flex; justify-content: space-between; width: 100%;
    padding: .9rem 1.6rem;
    font-size: .84rem;
    border-bottom: 1px solid rgba(248, 242, 228, .06);
  }

  .nav-links .nav-sub {
    position: static;
    min-width: 0;
    border: none;
    box-shadow: none;
    background: rgba(0, 0, 0, .28);
    padding: 0;
    transform: none;
    display: none;
    opacity: 1; visibility: visible;
  }
  .nav-links .nav-has-sub:hover .nav-sub { display: none; }
  .nav-links .nav-has-sub.open .nav-sub { display: block; }

  .nav-links .nav-sub a { padding-left: 2.8rem; }

  /* Menu konta zostaje w pasku (poza .nav-links), więc nadal opada z góry —
     tylko nazwa ustępuje miejsca, bo pasek jest wąski. */
  .nav-user { padding-left: .6rem; }
  .nav-user-name { display: none; }
}

/* ═══ HERO ═══ */
.hero {
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  padding: calc(var(--nav-h) + 2rem) 2rem 4rem;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #3D2B1F 0%, #1A0D06 100%);
  text-align: center;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(196,124,43,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(45,74,53,.2) 0%, transparent 50%),
    radial-gradient(circle at 60% 10%, rgba(139,58,42,.1) 0%, transparent 40%);
  animation: shimmer 8s ease-in-out infinite alternate;
}
@keyframes shimmer { 0% { opacity: .8; } 100% { opacity: 1; } }

.hero-content { position: relative; z-index: 2; max-width: 860px; }

.hero-kicker {
  display: inline-block;
  color: var(--gold);
  font-size: .75rem; letter-spacing: .25em; text-transform: uppercase;
  border-top: 1px solid rgba(212,168,68,.5);
  border-bottom: 1px solid rgba(212,168,68,.5);
  padding: .35em 2em;
  margin-bottom: 1.8rem;
  animation: fadeDown 1.2s ease forwards;
  opacity: 0;
}
.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  font-weight: 700; line-height: 1.05;
  color: var(--cream);
  letter-spacing: -.01em;
  animation: fadeUp 1.2s .2s ease forwards;
  opacity: 0;
}
.hero-title em { font-style: italic; color: var(--gold); display: block; font-size: .72em; }

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--parchment);
  margin: 1.6rem auto 2.2rem;
  font-style: italic; line-height: 1.6;
  max-width: 40ch;
  opacity: 0;
  animation: fadeUp 1.2s .5s ease forwards;
}
.hero-divider {
  display: flex; align-items: center; gap: 1rem; justify-content: center;
  margin: 0 0 2rem;
  opacity: 0; animation: fadeIn 1.2s .8s ease forwards;
}
.hero-divider span { color: var(--gold); font-size: 1.2rem; }
.hero-divider::before, .hero-divider::after {
  content: ''; flex: 1; max-width: 120px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.hero-divider::after { background: linear-gradient(270deg, transparent, var(--gold)); }

.hero-dedication {
  font-size: 1rem;
  color: rgba(248,242,228,.65);
  font-style: italic;
  max-width: 560px; margin: 0 auto;
  line-height: 1.75;
  opacity: 0; animation: fadeUp 1.2s 1s ease forwards;
}
.hero-dedication strong { color: var(--gold); font-style: normal; font-weight: 500; }

.hero-actions {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin-top: 2.5rem;
  opacity: 0; animation: fadeUp 1.2s 1.2s ease forwards;
}

.hero-scroll {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  opacity: 0; animation: fadeIn 1.5s 1.5s ease forwards;
  color: rgba(212,168,68,.6);
  font-size: .68rem; letter-spacing: .15em; text-transform: uppercase;
}
.hero-scroll::after {
  content: ''; display: block; width: 1px; height: 40px;
  background: linear-gradient(to bottom, rgba(212,168,68,.6), transparent);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes fadeDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounce { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.3) translateY(6px); } }

/* ═══ STRUKTURA SEKCJI ═══ */
section { position: relative; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 2rem; }

.page-head {
  padding: calc(var(--nav-h) + 4rem) 0 3rem;
  background: linear-gradient(180deg, #2A1A0E 0%, #3D2B1F 100%);
  color: var(--cream);
  text-align: center;
  position: relative; overflow: hidden;
}
.page-head::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(196,124,43,.12) 0%, transparent 55%);
}
.page-head > * { position: relative; z-index: 1; }
.page-head .section-kicker { color: var(--gold); }
.page-head h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 700; line-height: 1.15;
  color: var(--cream);
}
.page-head h1 em { font-style: italic; color: var(--gold); }
.page-head p {
  color: rgba(248,242,228,.7);
  font-style: italic;
  margin-top: .9rem;
  font-size: 1.05rem;
}
.page-head .ornament-line::before, .page-head .ornament-line::after { background: rgba(248,242,228,.2); }

.section-header { text-align: center; margin-bottom: 4rem; }

.chapter-number {
  font-family: 'Great Vibes', cursive;
  font-size: 5rem; color: var(--parchment);
  opacity: .35; line-height: 1;
  display: block; margin-bottom: -1.5rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 700; color: var(--ink);
  letter-spacing: -.01em; line-height: 1.15;
}
.section-title em { font-style: italic; color: var(--sepia); }

.section-kicker {
  font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--amber);
  margin-bottom: .8rem; display: block;
}

.ornament-line {
  display: flex; align-items: center; gap: 1rem; justify-content: center;
  margin: 1.2rem 0 0;
}
.ornament-line::before, .ornament-line::after {
  content: ''; flex: 1; max-width: 80px; height: 1px; background: var(--parchment);
}
.ornament-line span { color: var(--amber); font-size: 1rem; }

.folk-divider { text-align: center; padding: 2rem 0; }
.folk-divider svg { width: 280px; height: 24px; max-width: 80%; margin: 0 auto; }

/* ——— Przyciski ——— */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, #3D2B1F 0%, #2A1A0E 100%);
  color: var(--cream);
  border: none; cursor: pointer;
  padding: .95em 2em;
  font-family: 'EB Garamond', serif;
  font-size: .8rem; letter-spacing: .2em; text-transform: uppercase;
  text-decoration: none;
  transition: background .25s, transform .15s, box-shadow .25s;
  text-align: center;
}
.btn:hover {
  background: linear-gradient(135deg, #5A3D2B 0%, #3D2B1F 100%);
  box-shadow: 0 6px 20px rgba(26,13,6,.3);
  transform: translateY(-1px);
  color: var(--cream);
}
.btn:active { transform: translateY(0); }

.btn-gold { background: linear-gradient(135deg, var(--gold) 0%, var(--amber) 100%); color: var(--ink); }
.btn-gold:hover { background: linear-gradient(135deg, #E0B655 0%, #D4882F 100%); color: var(--ink); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--parchment);
  color: var(--ink);
}
.btn-outline:hover { background: var(--cream-dark); color: var(--ink); box-shadow: none; }

.btn-outline-light {
  background: transparent;
  border: 1px solid rgba(212,168,68,.5);
  color: var(--gold);
}
.btn-outline-light:hover { background: rgba(212,168,68,.1); color: var(--gold); }

.btn-sm { padding: .55em 1.2em; font-size: .7rem; letter-spacing: .12em; }
.btn-danger { background: var(--rust); }
.btn-danger:hover { background: #A34434; }
.btn-block { display: block; width: 100%; }

/* Przycisk nagrywania — ten sam kształt co reszta przycisków, tylko w kolorze
   rdzy: nagrywanie to jedyna akcja na stronie, która zaczyna coś zapisywać
   w tle, więc ma prawo wyglądać inaczej niż „Zapisz”. */
.btn-record {
  display: inline-flex; align-items: center; gap: .7rem;
  background: var(--rust);
}
.btn-record:hover { background: #A34434; }

/* Pola wyboru pliku.
   Natywnego <input type=file> nie da się ostylować, więc chowamy go wewnątrz
   <label class="btn">: klik w etykietę otwiera okno wyboru, a etykieta wygląda
   jak każdy inny przycisk. Input zostaje w drzewie (formularz musi mieć co
   wysłać) i pozostaje osiągalny z klawiatury — dlatego nie display:none. */
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input[type=file] {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

.file-picker { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }

/* Nazwa wybranego pliku — przeglądarka rysowała ją obok natywnej kontrolki,
   więc po jej schowaniu musimy ją dopisać sami (robi to JS). */
.file-name {
  font-size: .84rem;
  color: var(--sepia);
  font-style: italic;
  word-break: break-all;
}

/* ——— Komunikaty ——— */
.flash-stack {
  position: fixed; top: calc(var(--nav-h) + 1rem); right: 1.5rem; z-index: 600;
  display: flex; flex-direction: column; gap: .6rem;
  max-width: min(420px, calc(100vw - 3rem));
}
.flash {
  padding: .9rem 1.2rem;
  border-left: 4px solid var(--forest);
  background: #fff;
  box-shadow: 0 10px 30px rgba(42,26,14,.18);
  font-size: .92rem;
  animation: flashIn .4s cubic-bezier(.22,1,.36,1);
  display: flex; align-items: flex-start; gap: .8rem;
}
.flash-success { border-left-color: var(--forest); }
.flash-error { border-left-color: var(--rust); color: var(--rust); }
.flash-info { border-left-color: var(--amber); }
.flash button {
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: .5; font-size: 1.1rem; line-height: 1;
  margin-left: auto; padding: 0;
}
.flash button:hover { opacity: 1; }
@keyframes flashIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ——— Cytat blokowy ——— */
.pullquote {
  position: relative;
  margin: 3rem 0;
  padding: 2.5rem 2rem 2.5rem 4rem;
  border-left: 4px solid var(--amber);
  background: linear-gradient(135deg, var(--cream-dark) 0%, var(--cream) 100%);
}
.pullquote::before {
  content: '"';
  position: absolute; top: -.5rem; left: 1rem;
  font-family: 'Playfair Display', serif;
  font-size: 6rem; line-height: 1;
  color: var(--amber); opacity: .35;
}
.pullquote p {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-style: italic; line-height: 1.65;
  color: var(--ink-mid);
}
.pullquote cite {
  display: block; margin-top: 1rem;
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sepia); font-style: normal;
}

/* ═══ SEKCJA: WIOSKA ═══ */
.section-cream { padding: 6rem 0 5rem; background: var(--cream); }
.section-cream-grad { padding: 6rem 0 5rem; background: linear-gradient(180deg, var(--cream) 0%, var(--cream-dark) 100%); }
.section-cream-grad-rev { padding: 6rem 0 5rem; background: linear-gradient(180deg, var(--cream-dark) 0%, var(--cream) 100%); }
.section-dark {
  padding: 6rem 0 5rem;
  background: linear-gradient(180deg, #1F1208 0%, #2A1A0E 100%);
  color: var(--cream);
  overflow: hidden;
}
.section-dark .section-title { color: var(--cream); }
.section-dark .section-kicker { color: rgba(212,168,68,.75); }
.section-dark .chapter-number { color: rgba(212,168,68,.18); }
.section-dark .ornament-line::before, .section-dark .ornament-line::after { background: rgba(248,242,228,.2); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; margin-top: 3rem; }
.two-col-wide { display: grid; grid-template-columns: 5fr 4fr; gap: 4rem; align-items: start; margin-top: 3rem; }

.prose p { font-size: 1.04rem; line-height: 1.85; color: var(--ink-mid); margin-bottom: 1.2rem; }
.prose p:last-child { margin-bottom: 0; }
.prose h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem; color: var(--ink);
  margin: 2rem 0 .9rem;
}
.prose ul, .prose ol { margin: 0 0 1.2rem 1.4rem; color: var(--ink-mid); line-height: 1.8; }
.prose blockquote {
  border-left: 3px solid var(--amber);
  padding-left: 1.4rem; margin: 1.6rem 0;
  font-style: italic; color: var(--sepia);
}
.prose img { margin: 1.6rem 0; border: 8px solid var(--cream-dark); }
.prose strong { color: var(--sepia); }

.section-dark .prose p { color: rgba(248,242,228,.82); }
.section-dark .prose strong { color: var(--gold); font-weight: 500; }

.map-card {
  background: var(--ink);
  overflow: hidden; position: relative;
  aspect-ratio: 4/3;
  display: flex; align-items: center; justify-content: center;
  border: 8px solid var(--cream-dark);
  box-shadow: 12px 12px 0 var(--parchment), 14px 14px 0 var(--ink-mid);
}
.map-card svg { width: 100%; height: 100%; padding: 1.2rem; }

.farm-doc {
  margin-top: 1.5rem;
  background: #F5EDD8;
  border: 1px solid var(--parchment);
  padding: 1.6rem 1.8rem;
  font-size: .9rem; color: var(--ink); line-height: 1.7;
}
.farm-doc-label {
  display: block;
  font-size: .68rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--sepia); margin-bottom: .7rem;
  border-bottom: 1px dashed var(--parchment);
  padding-bottom: .5rem;
}
.farm-doc strong { color: var(--sepia); }

.fact-strip {
  margin-top: 3rem;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--parchment);
  border: 1px solid var(--parchment);
}
.fact { background: var(--cream); padding: 1.6rem 1rem; text-align: center; }
.fact-num {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700;
  color: var(--sepia); display: block; line-height: 1;
}
.fact-label {
  font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-mid); margin-top: .5rem;
  display: block; opacity: .85; line-height: 1.4;
}

/* ——— Portret ——— */
.portrait-card {
  background: var(--ink);
  padding: 1.2rem;
  border: 1px solid var(--sepia);
  box-shadow: 8px 8px 0 rgba(42,26,14,.2);
}
.portrait-inner {
  width: 100%; aspect-ratio: 3/4;
  background: linear-gradient(145deg, #3D2B1F 0%, #1A0D06 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.portrait-inner img { width: 100%; height: 100%; object-fit: cover; }
.portrait-caption {
  display: block; text-align: center;
  font-size: .76rem; letter-spacing: .06em;
  color: var(--parchment); opacity: .75;
  font-style: italic; margin-top: .8rem;
}

/* ═══ SEKCJA: WOJNA ═══ */
.date-badge {
  display: inline-block;
  background: var(--rust); color: var(--cream);
  padding: .3em .9em;
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.tragedy-card {
  background: rgba(248,242,228,.04);
  border: 1px solid rgba(212,168,68,.2);
  padding: 2rem;
  position: relative;
}
.tragedy-card + .tragedy-card { margin-top: 1.5rem; }
.tragedy-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 3px; height: 100%; background: var(--rust);
}
.tragedy-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; color: var(--cream);
  margin-bottom: 1.2rem; font-weight: 600;
}
.tragedy-note { font-size: .78rem; color: rgba(248,242,228,.5); margin-bottom: 1.2rem; }

.loss-item {
  display: flex; gap: 1rem;
  padding: .9rem 0;
  border-bottom: 1px solid rgba(248,242,228,.08);
  align-items: flex-start;
}
.loss-item:last-child { border-bottom: none; }
.loss-icon { color: var(--rust); font-size: 1.05rem; flex-shrink: 0; margin-top: .1rem; }
.loss-icon-gold { color: var(--gold); }
.loss-text { font-size: .88rem; line-height: 1.6; color: rgba(248,242,228,.75); }
.loss-text strong { color: var(--parchment); display: block; font-size: .94rem; margin-bottom: .15rem; }

.war-pullquote {
  margin-top: 2.5rem;
  padding: 2rem;
  border: 1px solid rgba(212,168,68,.25);
  background: rgba(212,168,68,.04);
  text-align: center;
}
.war-pullquote p {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-style: italic;
  color: rgba(248,242,228,.85); line-height: 1.7;
}

/* ═══ SEKCJA: ŻYCIE ═══ */
.life-mosaic {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  margin: 3rem 0;
  background: var(--parchment);
}
.life-card {
  background: var(--cream);
  padding: 2.2rem 1.7rem;
  position: relative;
  transition: background .3s;
}
.life-card:hover { background: #F0E8D5; }
.life-card::before {
  content: attr(data-num);
  position: absolute; top: 1rem; right: 1.3rem;
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem; font-weight: 700;
  color: var(--parchment); line-height: 1;
}
.life-icon { font-size: 2.1rem; display: block; margin-bottom: 1rem; line-height: 1; }
.life-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; font-weight: 600;
  color: var(--ink); margin-bottom: .8rem; line-height: 1.25;
}
.life-card p { font-size: .9rem; line-height: 1.72; color: var(--ink-mid); }

.electricity-banner {
  margin: 3.5rem 0 0;
  display: grid; grid-template-columns: 1fr 2fr;
  background: var(--forest);
  color: var(--cream);
  overflow: hidden;
}
.electricity-year {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--forest-light);
  padding: 2.5rem 2rem; text-align: center;
}
.electricity-year span:first-child {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 6vw, 5rem); font-weight: 900;
  color: var(--gold); line-height: 1; display: block;
}
.electricity-year span:last-child {
  font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(248,242,228,.6); margin-top: .5rem;
}
.electricity-text { padding: 2.2rem 2.5rem; display: flex; align-items: center; }
.electricity-text p {
  font-size: 1.02rem; line-height: 1.8;
  color: rgba(248,242,228,.85);
  font-style: italic;
  font-family: 'Playfair Display', serif;
}

/* ═══ SEKCJA: SPOŁECZNOŚĆ ═══ */
.event-list { list-style: none; margin: 1.5rem 0; }
.event-list li {
  display: flex; gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--cream-dark);
  font-size: .94rem; color: var(--ink-mid);
  align-items: flex-start;
}
.event-list li::before {
  content: '✦'; color: var(--amber);
  flex-shrink: 0; margin-top: .1rem; font-size: .8rem;
}

.seasons-card { border: 1px solid var(--parchment); overflow: hidden; }
.season {
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid var(--parchment);
  display: grid; grid-template-columns: 100px 1fr; gap: 1.2rem; align-items: start;
}
.season:last-child { border-bottom: none; }
.season-name { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600; color: var(--sepia); }
.season-months { color: var(--amber); font-size: .72rem; display: block; }
.season-desc { font-size: .9rem; line-height: 1.65; color: var(--ink-mid); }

/* ═══ OŚ CZASU ═══ */
.section-timeline {
  padding: 6rem 0 5rem;
  background: var(--ink);
  color: var(--cream);
  overflow: hidden;
}
.section-timeline .section-title { color: var(--cream); }
.section-timeline .section-kicker { color: var(--gold); opacity: .85; }
.section-timeline .chapter-number { color: rgba(212,168,68,.15); }
.section-timeline .ornament-line::before, .section-timeline .ornament-line::after { background: rgba(248,242,228,.15); }

.timeline { position: relative; margin-top: 3.5rem; padding-bottom: 2rem; }
.timeline::before {
  content: '';
  position: absolute; top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(212,168,68,.4), rgba(212,168,68,.4), transparent);
}
.timeline-item {
  display: grid; grid-template-columns: 1fr 60px 1fr;
  margin-bottom: 2.5rem; position: relative;
}
.tl-side { padding-top: .4rem; }
.tl-left { padding-right: 2rem; text-align: right; }
.tl-right { padding-left: 2rem; text-align: left; }
.tl-center { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 4px rgba(196,124,43,.3);
  margin-top: .6rem; flex-shrink: 0;
  transition: transform .3s, box-shadow .3s;
}
.timeline-item:hover .tl-dot { transform: scale(1.4); box-shadow: 0 0 0 6px rgba(196,124,43,.4); }
.tl-dot-gold { background: var(--gold); }
.tl-dot-gold-strong { background: var(--gold); box-shadow: 0 0 0 6px rgba(212,168,68,.4); }
.tl-dot-rust { background: var(--rust); }
.tl-year {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem; font-weight: 700;
  color: var(--gold); line-height: 1; margin-bottom: .3rem;
}
.tl-year-rust { color: #E06B5A; }
.tl-text { font-size: .9rem; line-height: 1.65; color: rgba(248,242,228,.75); }
.tl-text strong { color: var(--cream); }
.tl-text em { color: rgba(212,168,68,.9); }

/* ═══ RODZINA ═══ */
.family-intro { text-align: center; max-width: 720px; margin: 0 auto 3.5rem; }
.family-intro p { font-size: 1.08rem; line-height: 1.85; color: var(--ink-mid); font-style: italic; }

.family-tree { display: flex; flex-direction: column; align-items: center; max-width: 940px; margin: 0 auto; }
.family-gen { width: 100%; padding: 2.2rem 0; position: relative; }
.family-gen + .family-gen::before {
  content: '';
  position: absolute; top: -2.2rem; left: 50%;
  transform: translateX(-50%);
  width: 1px; height: 2.2rem; background: var(--parchment);
}
.gen-label {
  text-align: center;
  font-size: .66rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 1.4rem;
}
.gen-members { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; }

.person-card {
  background: #fff;
  border: 1px solid var(--parchment);
  padding: 1.3rem 1.4rem;
  text-align: center;
  min-width: 130px; max-width: 190px;
  position: relative;
  transition: transform .25s, box-shadow .25s;
}
.person-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(42,26,14,.15); }
.person-card.highlight {
  border-color: var(--amber);
  background: linear-gradient(135deg, #FFF8EE 0%, #fff 100%);
}
.person-card.highlight::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--amber);
}
.person-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  margin: 0 auto .7rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
}
.person-avatar.male { background: rgba(45,74,53,.1); }
.person-avatar.female { background: rgba(139,58,42,.08); }
.person-name {
  font-family: 'Playfair Display', serif;
  font-size: .92rem; font-weight: 600; color: var(--ink);
  line-height: 1.2; margin-bottom: .25rem;
}
.person-years { font-size: .7rem; color: var(--sepia); font-style: italic; }

.grandchildren-section { margin-top: 4rem; text-align: center; }
.grandchildren-title {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2rem, 5vw, 3rem); color: var(--sepia);
  margin-bottom: 1.8rem;
}
.grandchildren-grid { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.grandchild {
  background: linear-gradient(135deg, var(--cream-dark) 0%, var(--cream) 100%);
  border: 1px solid var(--parchment);
  border-top: 3px solid var(--gold);
  padding: 1.1rem 1.4rem;
  text-align: center; min-width: 110px;
  transition: transform .2s;
}
.grandchild:hover { transform: translateY(-3px); }
.grandchild-emoji { font-size: 1.7rem; display: block; }
.grandchild-name {
  font-family: 'Playfair Display', serif;
  font-size: .95rem; font-weight: 600; color: var(--ink);
  display: block; margin-top: .4rem;
}
.grandchild-born { color: var(--sepia); font-size: .74rem; }

/* ═══ WSPOMNIENIA ═══ */
.memories-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  background: var(--parchment); margin-top: 3rem;
}
.memory-card {
  background: var(--cream);
  padding: 2.2rem 1.9rem;
  position: relative; overflow: hidden;
  transition: background .3s;
}
.memory-card:hover { background: var(--cream-dark); }
.memory-tag {
  display: inline-block;
  background: var(--forest); color: var(--cream);
  font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  padding: .25em .8em; margin-bottom: 1rem;
}
.memory-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 600; color: var(--ink);
  margin-bottom: .8rem; line-height: 1.3;
}
.memory-card p { font-size: .93rem; line-height: 1.78; color: var(--ink-mid); }

/* ═══ TREŚĆ ZABLOKOWANA ═══ */
.locked-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem; margin-top: 2rem;
}
.locked-card {
  background: linear-gradient(135deg, #EFE6D2 0%, var(--cream) 100%);
  border: 1px dashed var(--parchment);
  padding: 2rem 1.8rem;
  position: relative;
  text-align: center;
}
.locked-card .lock-icon {
  width: 40px; height: 40px;
  margin: 0 auto 1rem;
  color: var(--amber); opacity: .7;
}
.locked-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; color: var(--ink-mid);
  margin-bottom: .5rem;
}
.locked-card p { font-size: .86rem; color: var(--sepia); line-height: 1.6; margin-bottom: 1.2rem; }

.level-badge {
  display: inline-block;
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .25em .8em;
  border: 1px solid var(--amber);
  color: var(--amber);
  margin-bottom: 1rem;
}
.level-badge-close { border-color: var(--rust); color: var(--rust); }

.locked-banner {
  background: linear-gradient(135deg, #2A1A0E 0%, #3D2B1F 100%);
  color: var(--cream);
  padding: 3rem 2rem;
  text-align: center;
  border-top: 3px solid var(--gold);
  margin: 3rem 0;
}
.locked-banner .lock-icon { width: 44px; height: 44px; margin: 0 auto 1.2rem; color: var(--gold); }
.locked-banner h3 { font-family: 'Playfair Display', serif; font-size: 1.5rem; margin-bottom: .8rem; }
.locked-banner p { color: rgba(248,242,228,.7); max-width: 46ch; margin: 0 auto 1.6rem; line-height: 1.7; }

/* ═══ KARTY (blog, galeria, książka) ═══ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
.card {
  background: #fff;
  border: 1px solid var(--parchment);
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s;
  overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(42,26,14,.14); }
.card-media {
  aspect-ratio: 4/3;
  background: linear-gradient(145deg, #3D2B1F 0%, #1A0D06 100%);
  overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .card-media img { transform: scale(1.04); }
.card-media-empty { color: rgba(212,168,68,.35); font-size: 2.4rem; }
.card-count {
  position: absolute; bottom: .8rem; right: .8rem;
  background: rgba(26,13,6,.8);
  color: var(--gold);
  font-size: .7rem; letter-spacing: .1em;
  padding: .3em .8em;
}
.card-body { padding: 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card-date { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); margin-bottom: .6rem; }
.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 600; color: var(--ink);
  line-height: 1.3; margin-bottom: .7rem;
}
.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: var(--sepia); }
.card-text { font-size: .92rem; line-height: 1.7; color: var(--ink-mid); flex: 1; }
.card-foot {
  margin-top: 1.2rem; padding-top: 1rem;
  border-top: 1px solid var(--cream-dark);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.card-link {
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sepia); text-decoration: none;
}
.card-link:hover { color: var(--amber); }
.card-author { font-size: .78rem; color: var(--sepia); font-style: italic; }

/* ═══ ARTYKUŁ (wpis blogu, rozdział) ═══ */
.article { padding: 4rem 0 5rem; background: var(--cream); }
.article-meta {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sepia);
  padding-bottom: 1.5rem; margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--parchment);
}
.article-lead {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem; line-height: 1.7;
  color: var(--sepia); font-style: italic;
  margin-bottom: 2.5rem;
}
.article-nav {
  display: flex; justify-content: space-between; gap: 1.5rem;
  margin-top: 4rem; padding-top: 2rem;
  border-top: 1px solid var(--parchment);
  flex-wrap: wrap;
}
.article-nav a {
  text-decoration: none; color: var(--sepia);
  font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  max-width: 45%;
}
.article-nav a:hover { color: var(--amber); }
.article-nav .nav-label { display: block; font-size: .68rem; opacity: .6; margin-bottom: .3rem; }
.article-nav .nav-title { font-family: 'Playfair Display', serif; text-transform: none; font-size: .95rem; letter-spacing: 0; }

/* ═══ OKNO MODALNE (POPUP) ═══ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal[hidden] { display: none; }
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(42, 26, 14, 0.62);
  backdrop-filter: blur(2px);
  animation: modal-fade .25s ease;
}
.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--cream);
  border: 1px solid var(--parchment);
  box-shadow: 0 24px 60px rgba(42, 26, 14, 0.4);
  padding: 2.4rem 2.4rem 2rem;
  animation: modal-rise .3s ease;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

.modal-close {
  position: absolute;
  top: .8rem; right: 1rem;
  background: none; border: none;
  font-size: 1.8rem; line-height: 1;
  color: var(--sepia); cursor: pointer;
  transition: color .2s;
}
.modal-close:hover { color: var(--rust); }

.modal-head { text-align: center; margin-bottom: 1.6rem; }
.modal-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; color: var(--ink);
  margin: .5rem 0 .6rem;
}
.modal-head p { font-size: .92rem; color: var(--ink-mid); line-height: 1.65; }

.modal-form .form-actions { margin-top: 1.8rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.modal-form .form-actions .btn { flex: 1; min-width: 140px; }

@media (max-width: 560px) {
  .modal-dialog { padding: 2rem 1.4rem 1.6rem; }
  .modal-form .form-actions .btn { flex: 1 1 100%; }
}

/* ═══ FORMULARZE ═══ */
.form-card {
  background: #fff;
  border: 1px solid var(--parchment);
  padding: 2.5rem;
}
.form-card + .form-card { margin-top: 2rem; }
.form-card h2, .form-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem; color: var(--ink);
  margin-bottom: 1.5rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--cream-dark);
}

.field { margin-bottom: 1.4rem; }
.field:last-child { margin-bottom: 0; }

.field label, .field-label {
  display: block;
  font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--sepia); margin-bottom: .5rem;
}
.field-hint { font-size: .78rem; color: var(--sepia); opacity: .75; margin-top: .4rem; font-style: italic; }
.field-optional { text-transform: none; letter-spacing: 0; opacity: .6; font-style: italic; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], input[type=search], select, textarea {
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--parchment);
  border-bottom: 2px solid var(--parchment);
  padding: .8rem 1rem;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--amber);
  border-bottom-color: var(--gold);
  background: #fff;
  box-shadow: 0 4px 12px rgba(196,124,43,.08);
}
input::placeholder, textarea::placeholder { color: #B8A88A; font-style: italic; }
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
select { cursor: pointer; }

input.error, textarea.error, select.error { border-color: var(--rust); border-bottom-color: var(--rust); }
.field-error { color: var(--rust); font-size: .82rem; margin-top: .4rem; font-style: italic; }

.field-check { display: flex; align-items: flex-start; gap: .7rem; }
.field-check input[type=checkbox] { width: auto; margin-top: .25rem; accent-color: var(--amber); }
.field-check label {
  margin: 0; text-transform: none; letter-spacing: 0;
  font-size: .95rem; color: var(--ink-mid);
  cursor: pointer;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

/* Pole dwujęzyczne */
.bilingual { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.bilingual-part { position: relative; }
.bilingual-flag {
  position: absolute; top: -.5rem; right: .6rem;
  background: var(--amber); color: #fff;
  font-size: .58rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .12em .5em;
  z-index: 1;
}

.honeypot { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.form-actions {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid var(--cream-dark);
}

/* ═══ LOGOWANIE ═══ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--nav-h) + 2rem) 1.5rem 3rem;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #3D2B1F 0%, #1A0D06 100%);
  position: relative;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(196,124,43,.12) 0%, transparent 50%);
}
.gate-card {
  background: var(--cream);
  border: 1px solid var(--parchment);
  max-width: 460px; width: 100%;
  padding: 2.8rem 2.6rem;
  position: relative;
  box-shadow: 0 0 0 1px rgba(212,168,68,.15), 0 30px 80px rgba(26,13,6,.5);
  animation: gateAppear .7s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes gateAppear {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.gate-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.gate-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, transparent, var(--amber), transparent);
}
.gate-emblem { text-align: center; margin-bottom: 1.4rem; }
.gate-emblem svg { width: 52px; height: 52px; margin: 0 auto; }
.gate-title {
  font-family: 'Great Vibes', cursive;
  font-size: 2.5rem; color: var(--ink);
  text-align: center; line-height: 1; margin-bottom: .3rem;
}
.gate-sub {
  text-align: center;
  font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--amber);
}
.gate-ornament {
  display: flex; align-items: center; gap: .8rem; justify-content: center;
  margin: 1rem 0 1.6rem;
}
.gate-ornament::before, .gate-ornament::after {
  content: ''; flex: 1; max-width: 60px; height: 1px; background: var(--parchment);
}
.gate-ornament span { color: var(--amber); font-size: .85rem; }
.gate-message {
  font-size: .95rem; line-height: 1.7;
  color: var(--ink-mid); text-align: center;
  margin-bottom: 1.8rem; font-style: italic;
}
.gate-footer {
  margin-top: 1.8rem; padding-top: 1.3rem;
  border-top: 1px solid #E8DEC8;
  text-align: center;
  font-size: .82rem; color: var(--sepia);
}
.gate-footer a { color: var(--amber); text-decoration: none; }
.gate-footer a:hover { text-decoration: underline; }

.pwd-wrap { position: relative; }
.pwd-toggle {
  position: absolute; right: .7rem; bottom: .7rem;
  background: none; border: none; cursor: pointer;
  color: #B8A88A; padding: .2rem; line-height: 1;
  transition: color .2s;
}
.pwd-toggle:hover { color: var(--sepia); }

/* ═══ POZIOMY DOSTĘPU (legenda) ═══ */
.levels-legend {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--parchment);
  border: 1px solid var(--parchment);
  margin: 2rem 0;
}
.level-item { background: var(--cream); padding: 1.4rem 1.2rem; text-align: center; }
.level-item .lvl-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; color: var(--ink); margin-bottom: .4rem;
}
.level-item .lvl-desc { font-size: .82rem; color: var(--ink-mid); line-height: 1.55; }
.level-item.current { background: linear-gradient(135deg, #FFF8EE 0%, var(--cream) 100%); border-top: 3px solid var(--amber); }

/* ═══ KSIĄŻKA — warianty ═══ */
.variants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.variant {
  background: #fff;
  border: 1px solid var(--parchment);
  padding: 2rem 1.7rem;
  display: flex; flex-direction: column;
  position: relative;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.variant:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(42,26,14,.14); }
.variant.featured { border-color: var(--gold); }
.variant.featured::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--amber), var(--gold));
}
.variant-icon { font-size: 2.2rem; margin-bottom: 1rem; }
.variant h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; color: var(--ink);
  margin-bottom: .7rem; line-height: 1.3;
}
.variant p { font-size: .9rem; line-height: 1.7; color: var(--ink-mid); flex: 1; }
.variant-price {
  font-family: 'Playfair Display', serif;
  font-size: 2rem; font-weight: 700; color: var(--sepia);
  margin: 1.2rem 0;
}
.variant-price small { font-size: .9rem; font-weight: 400; }
.variant-price.free { color: var(--forest); font-size: 1.3rem; }

/* ═══ ODTWARZACZ AUDIO ═══ */
.player {
  position: sticky; top: calc(var(--nav-h) + 1rem);
  background: linear-gradient(135deg, #2A1A0E 0%, #3D2B1F 100%);
  border: 1px solid rgba(212,168,68,.3);
  color: var(--cream);
  padding: 1.8rem;
  z-index: 50;
  box-shadow: 0 20px 50px rgba(26,13,6,.3);
}
.player-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.4rem; }
.player-art {
  width: 60px; height: 60px; flex-shrink: 0;
  background: rgba(212,168,68,.12);
  border: 1px solid rgba(212,168,68,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.player-meta { min-width: 0; flex: 1; }
.player-label {
  font-size: .62rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(212,168,68,.7); margin-bottom: .25rem;
}
.player-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; color: var(--cream);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player-subtitle { font-size: .8rem; color: rgba(248,242,228,.55); font-style: italic; }

.player-progress {
  display: flex; align-items: center; gap: .9rem;
  margin-bottom: 1.2rem;
}
.player-time {
  font-size: .75rem; color: rgba(248,242,228,.6);
  font-variant-numeric: tabular-nums;
  min-width: 44px; text-align: center;
}
.player-seek {
  flex: 1; height: 6px;
  background: rgba(248,242,228,.12);
  cursor: pointer; position: relative;
  border-radius: 3px;
}
.player-seek-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, var(--amber), var(--gold));
  border-radius: 3px;
  width: 0;
}
.player-seek-fill::after {
  content: '';
  position: absolute; right: -5px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,68,.25);
  opacity: 0; transition: opacity .2s;
}
.player-seek:hover .player-seek-fill::after { opacity: 1; }

.player-controls { display: flex; align-items: center; justify-content: center; gap: .8rem; }
.player-btn {
  background: none; border: 1px solid rgba(212,168,68,.3);
  color: var(--parchment);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.player-btn:hover { background: rgba(212,168,68,.12); color: var(--gold); border-color: var(--gold); }
.player-btn:disabled { opacity: .3; cursor: not-allowed; }
.player-btn svg { width: 18px; height: 18px; }
.player-btn-main {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  border-color: transparent;
  color: var(--ink);
}
.player-btn-main:hover { background: linear-gradient(135deg, #E0B655, #D4882F); color: var(--ink); }
.player-btn-main svg { width: 22px; height: 22px; }

.player-extra {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-top: 1.3rem; padding-top: 1.1rem;
  border-top: 1px solid rgba(248,242,228,.1);
  flex-wrap: wrap;
}
.player-speed { display: flex; align-items: center; gap: .5rem; }
.player-speed span { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(248,242,228,.5); }
.speed-btn {
  background: none; border: 1px solid rgba(248,242,228,.15);
  color: rgba(248,242,228,.6);
  font-family: inherit; font-size: .74rem;
  padding: .25em .6em; cursor: pointer;
  transition: all .2s;
}
.speed-btn:hover { border-color: var(--gold); color: var(--gold); }
.speed-btn.active { background: rgba(212,168,68,.15); border-color: var(--gold); color: var(--gold); }

.player-volume { display: flex; align-items: center; gap: .6rem; flex: 1; max-width: 160px; }
.player-volume svg { width: 16px; height: 16px; color: rgba(248,242,228,.5); flex-shrink: 0; }
.player-volume input[type=range] {
  flex: 1; height: 4px; padding: 0;
  background: rgba(248,242,228,.12);
  border: none; border-radius: 2px;
  appearance: none; cursor: pointer;
}
.player-volume input[type=range]::-webkit-slider-thumb {
  appearance: none;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold); cursor: pointer;
}
.player-volume input[type=range]::-moz-range-thumb {
  width: 12px; height: 12px; border: none; border-radius: 50%;
  background: var(--gold); cursor: pointer;
}

/* Lista ścieżek */
.tracklist { border: 1px solid var(--parchment); background: #fff; }
.tracklist h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; color: var(--ink);
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--cream-dark);
  background: var(--cream-dark);
}
.track {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--cream-dark);
  cursor: pointer;
  transition: background .2s;
  width: 100%; text-align: left;
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: inherit;
}
.track:last-child { border-bottom: none; }
.track:hover { background: var(--cream); }
.track.playing { background: linear-gradient(90deg, #FFF8EE, #fff); }
.track.playing .track-num { background: var(--amber); color: #fff; border-color: var(--amber); }
.track.locked { cursor: not-allowed; opacity: .55; }
.track.locked:hover { background: none; }

.track-num {
  width: 34px; height: 34px; flex-shrink: 0;
  border: 1px solid var(--parchment);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; color: var(--sepia);
  font-variant-numeric: tabular-nums;
  transition: all .2s;
}
.track-info { flex: 1; min-width: 0; }
.track-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; color: var(--ink);
  line-height: 1.3;
}
.track-sub { font-size: .78rem; color: var(--sepia); margin-top: .15rem; }
.track-meta {
  font-size: .74rem; color: var(--sepia);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: .8rem;
  flex-shrink: 0;
}
.track-lock { width: 15px; height: 15px; color: var(--amber); }

.audio-grid { display: grid; grid-template-columns: 380px 1fr; gap: 2.5rem; align-items: start; margin-top: 3rem; }

/* ═══ GALERIA ═══ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.photo {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--ink);
  cursor: pointer;
  border: 1px solid var(--parchment);
  padding: 0;
  display: block; width: 100%;
}
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s, opacity .3s; }
.photo:hover img { transform: scale(1.06); }
.photo-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(26,13,6,.92), transparent);
  color: var(--cream);
  padding: 2rem .9rem .8rem;
  font-size: .8rem; line-height: 1.4;
  text-align: left;
  opacity: 0; transform: translateY(8px);
  transition: opacity .3s, transform .3s;
}
.photo:hover .photo-caption { opacity: 1; transform: translateY(0); }
.photo-year { color: var(--gold); font-size: .72rem; display: block; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(15, 8, 3, .96);
  display: none;
  align-items: center; justify-content: center;
  padding: 4rem 5rem;
}
.lightbox.open { display: flex; }
.lightbox-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: lbIn .35s cubic-bezier(.22,1,.36,1);
}
@keyframes lbIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.lightbox-caption {
  position: absolute; bottom: 1.2rem; left: 50%;
  transform: translateX(-50%);
  color: var(--cream);
  text-align: center;
  max-width: 60ch;
  font-size: .9rem; line-height: 1.5;
  background: rgba(26,13,6,.7);
  padding: .8rem 1.4rem;
}
.lightbox-caption .photo-year { color: var(--gold); }
.lightbox-count {
  position: absolute; top: 1.2rem; left: 50%;
  transform: translateX(-50%);
  color: rgba(248,242,228,.6);
  font-size: .78rem; letter-spacing: .14em;
}
.lb-btn {
  position: absolute;
  background: rgba(248,242,228,.06);
  border: 1px solid rgba(212,168,68,.3);
  color: var(--parchment);
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.lb-btn:hover { background: rgba(212,168,68,.18); color: var(--gold); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 1.2rem; right: 1.2rem; }
.lb-prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.2rem; top: 50%; transform: translateY(-50%); }

/* Galeria w sekcji */
.section-gallery { margin-top: 3.5rem; }
.section-gallery-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap;
}
.section-gallery-head h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem; color: var(--ink);
}
.section-dark .section-gallery-head h3 { color: var(--cream); }
.section-gallery-head a {
  font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--amber); text-decoration: none;
}
.section-gallery .photo-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  margin-top: 0;
}

/* ═══ STOPKA ═══ */
footer.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 4rem 2rem 2.5rem;
  text-align: center;
  position: relative;
}
footer.site-footer::before {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 1px; background: var(--gold);
}
.footer-signature {
  font-family: 'Great Vibes', cursive;
  font-size: 3.4rem; color: var(--gold);
  margin-bottom: .3rem; line-height: 1;
}
.footer-subtitle {
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(248,242,228,.45); margin-bottom: 2rem;
}
.footer-text {
  font-size: .92rem; line-height: 1.8;
  color: rgba(248,242,228,.6);
  max-width: 480px; margin: 0 auto 1.5rem;
  font-style: italic;
}
.footer-links {
  display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap;
  margin: 2rem 0;
}
.footer-links a {
  color: rgba(248,242,228,.55); text-decoration: none;
  font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
}
.footer-links a:hover { color: var(--gold); }
.footer-date {
  font-size: .74rem; letter-spacing: .08em;
  color: rgba(248,242,228,.3);
  border-top: 1px solid rgba(248,242,228,.1);
  padding-top: 1.4rem; margin-top: 1.5rem;
}
.footer-text strong { color: var(--gold); }

/* ═══ STRONA BŁĘDU ═══ */
.error-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 3rem) 2rem 4rem;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, #3D2B1F 0%, #1A0D06 100%);
  color: var(--cream);
}
.error-code {
  font-family: 'Playfair Display', serif;
  font-size: clamp(5rem, 18vw, 10rem);
  font-weight: 900; line-height: 1;
  color: rgba(212,168,68,.25);
}
.error-page h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--cream); margin: -1rem 0 1rem;
}
.error-page p {
  color: rgba(248,242,228,.65);
  max-width: 46ch; margin: 0 auto 2rem;
  line-height: 1.8; font-style: italic;
}
.error-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ═══ TABELE ═══ */
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th {
  text-align: left;
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sepia);
  padding: 1rem;
  background: var(--cream-dark);
  border-bottom: 1px solid var(--parchment);
  white-space: nowrap;
}
.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--cream-dark);
  font-size: .92rem;
  color: var(--ink-mid);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--cream); }
.table a { color: var(--sepia); }

.status-pill {
  display: inline-block;
  font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .3em .8em;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.status-new { color: var(--amber); }
.status-confirmed { color: var(--forest); }
.status-paid { color: var(--forest); background: rgba(45,74,53,.08); }
.status-sent { color: var(--sepia); }
.status-cancelled { color: var(--rust); opacity: .7; }

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--sepia);
  font-style: italic;
  background: var(--cream);
  border: 1px dashed var(--parchment);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: .5; }

/* ═══ RESPONSYWNOŚĆ ═══ */
@media (max-width: 980px) {
  .audio-grid { grid-template-columns: 1fr; }
  .player { position: static; }
  .variants { grid-template-columns: 1fr; }
  .two-col, .two-col-wide { grid-template-columns: 1fr; gap: 2.5rem; }
  .memories-grid { grid-template-columns: 1fr; }
  .life-mosaic { grid-template-columns: 1fr 1fr; }
  .electricity-banner { grid-template-columns: 1fr; }
  .levels-legend { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   TREŚĆ DODAWANA PRZEZ RODZINĘ
   ═══════════════════════════════════════════════════════════ */

/* Pasek z przyciskiem „dodaj” nad listami (blog, galeria, filmy, audio) */
.contrib-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.contrib-intro {
  max-width: 44rem;
  margin: 0 auto 2.5rem;
  text-align: center;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--ink-mid);
  font-style: italic;
}

/* Cztery drogi na stronie „Moje wpisy”.
   Czytelne przyciski, nie kafelki z emoji: nazwa akcji stoi na pierwszym
   planie, ikona jest ozdobą z boku, a strzałka mówi, że to prowadzi dalej.
   Wcześniej trzeba było zgadywać z obrazka, co się kliknie. */
.contrib-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.contrib-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: linear-gradient(135deg, #3D2B1F 0%, #2A1A0E 100%);
  border: 1px solid transparent;
  color: var(--cream);
  text-decoration: none;
  transition: background .25s, transform .15s, box-shadow .25s, border-color .25s;
}

.contrib-action:hover {
  background: linear-gradient(135deg, #5A3D2B 0%, #3D2B1F 100%);
  border-color: rgba(212, 168, 68, .5);
  box-shadow: 0 10px 26px rgba(26, 13, 6, .3);
  transform: translateY(-2px);
  color: var(--cream);
}

.contrib-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.contrib-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1; }

.contrib-name {
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cream);
}

.contrib-hint {
  font-size: .8rem;
  font-style: italic;
  color: rgba(248, 242, 228, .6);
  line-height: 1.4;
}

.contrib-arrow {
  color: var(--gold);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform .25s;
}
.contrib-action:hover .contrib-arrow { transform: translateX(4px); }

/* Listy „moich” materiałów */
.mine-block { margin-bottom: 3rem; }

.mine-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: var(--sepia);
  margin-bottom: 1.2rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--cream-dark);
}

.mine-list { list-style: none; }

.mine-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding: 1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--cream-dark);
  margin-bottom: .6rem;
}

.mine-info { display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 1; }

.mine-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}

.mine-name:hover { color: var(--amber); }

.mine-meta { font-size: .8rem; color: var(--sepia); opacity: .8; }

.mine-info audio { width: 100%; max-width: 22rem; margin-top: .5rem; height: 34px; }

.mine-actions { display: flex; gap: .5rem; align-items: center; }

/* Przyciski właściciela pod treścią (edytuj / usuń) */
.owner-actions {
  display: flex;
  gap: .6rem;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--cream-dark);
}

/* Pole dwujęzyczne — angielski zwinięty pod znacznikiem */
.bilingual-field .req { color: var(--rust); margin-left: .2rem; }

.bilingual-en { margin-top: .6rem; }

.bilingual-en summary {
  cursor: pointer;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sepia);
  opacity: .7;
  padding: .3rem 0;
}

.bilingual-en summary:hover { opacity: 1; }
.bilingual-en[open] summary { margin-bottom: .5rem; }

.source-picker {
  border: 1px solid var(--cream-dark);
  padding: 1.4rem;
  margin-bottom: 1.6rem;
}

.source-picker legend {
  font-family: 'Playfair Display', serif;
  font-size: .95rem;
  color: var(--sepia);
  padding: 0 .6rem;
}

.form-actions {
  display: flex;
  gap: .8rem;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cream-dark);
}

/* Edytor zdjęć w galerii użytkownika */
.photo-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
}

.photo-editor-item {
  border: 1px solid var(--cream-dark);
  padding: .7rem;
  background: var(--cream);
}

.photo-editor-item.is-cover { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,168,68,.25); }

.photo-editor-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: .6rem;
}

.photo-editor-form { display: flex; flex-direction: column; gap: .4rem; }
.photo-editor-form input { font-size: .82rem; padding: .4em .6em; }

.photo-editor-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-top: .6rem;
  padding-top: .5rem;
  border-top: 1px dashed var(--cream-dark);
}

.photo-cover-badge {
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--sepia);
  text-decoration: underline;
}

.link-btn:hover { color: var(--amber); }
.link-btn-danger { color: var(--rust); }
.link-btn-danger:hover { color: #A34434; }

/* ═══════════════════════════════════════════════════════════
   NAGRYWARKA GŁOSU
   ═══════════════════════════════════════════════════════════ */

.recorder {
  border: 1px solid var(--cream-dark);
  background: var(--cream);
  padding: 1.4rem;
  margin-bottom: 1.6rem;
}

.recorder-main { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Przycisk nagrywania nosi teraz .btn.btn-record — kształt bierze stamtąd,
   a tutaj zostaje tylko to, czego reszta przycisków nie potrzebuje: kropka. */
.recorder-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cream);
}

/* Kropka pulsuje tylko w trakcie nagrywania — to jedyny sygnał, że mikrofon
   naprawdę słucha. */
.recorder.is-recording .recorder-dot { animation: recorder-pulse 1.1s ease-in-out infinite; }

@keyframes recorder-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(1.35); }
}

.recorder-time {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--sepia);
  font-variant-numeric: tabular-nums;
}

.recorder-preview { width: 100%; margin-top: 1rem; }

.recorder-status {
  margin-top: .8rem;
  font-size: .84rem;
  color: var(--sepia);
  font-style: italic;
  min-height: 1.2em;
}

.recorder-upload {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--cream-dark);
}

/* Uwaga: etykieta wyboru pliku jest tu przyciskiem (.btn.file-button), więc
   nagłówek sekcji to <span class="field-label"> — gdyby stylować „label”,
   przycisk dostałby wygląd nagłówka. */
.recorder-upload .field-label { margin-bottom: .6rem; }

.recorder-hint {
  margin-top: .8rem;
  font-size: .78rem;
  color: var(--sepia);
  opacity: .75;
  font-style: italic;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   KOMENTARZE
   ═══════════════════════════════════════════════════════════ */

.comments {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--cream-dark);
}

.comments-head { text-align: center; margin-bottom: 2rem; }

.comments-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--sepia);
}

.comments-empty,
.comments-cta {
  text-align: center;
  color: var(--ink-mid);
  font-style: italic;
  padding: 1.5rem 0;
}

.comment-list { list-style: none; margin-bottom: 2.5rem; }

.comment {
  display: flex;
  gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px dashed var(--cream-dark);
}

.comment:last-child { border-bottom: none; }

.comment-avatar {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--parchment);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
}

.comment-body { flex: 1; min-width: 0; }

.comment-meta {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .5rem;
  font-size: .78rem;
  color: var(--sepia);
}

.comment-author { font-family: 'Playfair Display', serif; font-size: .95rem; color: var(--ink); }

.comment-delete { margin-left: auto; }

.comment-delete button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sepia);
  font-size: 1.2rem;
  line-height: 1;
  opacity: .5;
  padding: 0 .3rem;
}

.comment-delete button:hover { opacity: 1; color: var(--rust); }

.comment-text { line-height: 1.75; color: var(--ink-mid); }

.comment-audio { display: flex; align-items: center; gap: .7rem; margin-bottom: .5rem; }
.comment-audio-icon { font-size: 1.1rem; }
.comment-audio audio { flex: 1; height: 36px; max-width: 28rem; }

.comment-form {
  background: #fff;
  border: 1px solid var(--cream-dark);
  padding: 1.6rem;
}

.comment-form h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--sepia);
  margin-bottom: 1rem;
}

.comment-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* Zakładki noszą .btn.btn-sm, więc kształt i typografię biorą stamtąd.
   Tu zostaje tylko różnica między wybraną a niewybraną: nieaktywna wygląda
   jak przycisk obrysowany, aktywna — jak pełny. Bez tego obie byłyby ciemne
   i nie dałoby się poznać, która droga jest wybrana. */
.comment-tab:not(.active) {
  background: transparent;
  border: 1px solid var(--parchment);
  color: var(--ink);
}
.comment-tab:not(.active):hover {
  background: var(--cream-dark);
  border-color: var(--gold);
  color: var(--ink);
  box-shadow: none;
}

.comment-pane { margin-bottom: 1rem; }

.comment-pane textarea {
  width: 100%;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 1rem;
  padding: .8em;
  border: 1px solid var(--cream-dark);
  background: var(--cream);
  color: var(--ink);
  resize: vertical;
}

.comment-pane textarea:focus { outline: none; border-color: var(--gold); }

/* Komentarze pod nagraniem — zwinięte, żeby lista ścieżek pozostała listą */
.track-comments {
  border: 1px solid var(--cream-dark);
  border-top: none;
  background: var(--cream);
}

.track-comments summary {
  cursor: pointer;
  padding: .6rem 1.2rem;
  font-size: .78rem;
  color: var(--sepia);
  letter-spacing: .05em;
}

.track-comments summary:hover { background: var(--cream-dark); }
.track-comments .comments { margin-top: 0; padding: 0 1.2rem 1.2rem; border-top: none; }
.track-comments .comments-head h2 { font-size: 1.1rem; }

/* ═══════════════════════════════════════════════════════════
   FILMY
   ═══════════════════════════════════════════════════════════ */

.card-media-video { position: relative; }

.video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.video-play svg {
  width: 56px;
  height: 56px;
  color: var(--cream);
  background: rgba(42, 26, 14, .55);
  border-radius: 50%;
  padding: .8rem;
  transition: transform .3s, background .3s;
}

.card:hover .video-play svg { transform: scale(1.1); background: rgba(196, 124, 43, .9); }

/* Ramka filmu utrzymuje proporcje 16:9 niezależnie od źródła. */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--ink);
  margin-bottom: 2rem;
  border: 8px solid var(--cream-dark);
  box-shadow: 0 16px 40px rgba(42,26,14,.18);
}

.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (max-width: 720px) {
  html { font-size: 16px; }
  .container, .container-narrow { padding: 0 1.2rem; }
  .fact-strip { grid-template-columns: 1fr 1fr; }
  .life-mosaic { grid-template-columns: 1fr; }
  .field-row, .bilingual { grid-template-columns: 1fr; }
  .form-card { padding: 1.6rem 1.3rem; }

  .contrib-actions { grid-template-columns: 1fr 1fr; }
  .mine-item { flex-direction: column; align-items: stretch; }
  .mine-actions { justify-content: flex-end; }
  .photo-editor { grid-template-columns: 1fr 1fr; }
  .comment-audio audio { max-width: 100%; }
  .video-frame { border-width: 4px; }
  .gate-card { padding: 2rem 1.5rem; }
  .flash-stack { right: .8rem; left: .8rem; max-width: none; }

  .timeline::before { left: 18px; }
  .timeline-item { grid-template-columns: 1fr; padding-left: 46px; }
  .tl-center { position: absolute; left: 11px; top: 0; }
  .tl-left, .tl-right { text-align: left; padding: 0; }
  .tl-left:empty, .tl-right:empty { display: none; }

  .season { grid-template-columns: 1fr; gap: .4rem; }
  .article-nav a { max-width: 100%; }
  .lightbox { padding: 3.5rem 1rem; }
  .lb-prev { left: .4rem; }
  .lb-next { right: .4rem; }
  .pullquote { padding: 2rem 1.2rem 2rem 2.6rem; }
  .pullquote::before { font-size: 4rem; left: .4rem; }
}

/* ═══════════════════════════════════════════════════════════
   PROFIL, RODZINA, PRZODKOWIE, OGŁOSZENIA, NAGRANIA
   ═══════════════════════════════════════════════════════════ */

/* ——— Skróty na „Moim koncie” ———
   To, co zniknęło z menu głównego (Dodaj wpis, Panel), musi być widoczne od
   razu po wejściu na konto — inaczej przeniesienie byłoby po prostu ukryciem. */
.account-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.account-shortcut {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  background: #fff;
  border: 1px solid var(--cream-dark);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .25s, box-shadow .25s, transform .15s;
}

.account-shortcut:hover {
  border-color: var(--gold);
  box-shadow: 0 10px 26px rgba(42, 26, 14, .1);
  transform: translateY(-2px);
  color: var(--ink);
}

.account-shortcut-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }

.account-shortcut-text { display: flex; flex-direction: column; gap: .15rem; }

.account-shortcut-text strong {
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sepia);
}

.account-shortcut-text small { font-size: .82rem; color: var(--ink-mid); font-style: italic; }

/* ——— Zdjęcie profilowe w formularzu ——— */
.avatar-edit {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.8rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px dashed var(--cream-dark);
  flex-wrap: wrap;
}

.avatar-preview {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cream-dark);
  border: 2px solid var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-initial,
.family-initial,
.profile-initial {
  font-family: 'Playfair Display', serif;
  color: var(--sepia);
  line-height: 1;
}

.avatar-initial { font-size: 2.6rem; }

.avatar-controls {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-items: flex-start;
}

.avatar-delete { margin-top: .2rem; }
.avatar-delete span { font-size: .84rem; color: var(--ink-mid); }

.form-subhead {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--sepia);
  margin: 2.2rem 0 1.2rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--cream-dark);
}

/* Lista dzieci — checkboxy w siatce, żeby przy dwudziestu osobach nie powstała
   kolumna na pół ekranu. */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .5rem .9rem;
}
.checkbox-grid .field-check { margin: 0; }
.checkbox-grid span { font-size: .92rem; color: var(--ink-mid); }

/* ——— Sekcja „Rodzina” ——— */
.family-group { margin-bottom: 3.5rem; }

.family-group-title {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--sepia);
  margin-bottom: 1.5rem;
  padding-bottom: .7rem;
  border-bottom: 1px solid var(--cream-dark);
}

.family-count {
  font-family: 'EB Garamond', serif;
  font-size: .7rem;
  letter-spacing: .1em;
  color: var(--cream);
  background: var(--sepia);
  padding: .15em .6em;
  border-radius: 999px;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.2rem;
  list-style: none;
}

.family-card a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  padding: 1.4rem .9rem;
  background: #fff;
  border: 1px solid var(--cream-dark);
  text-decoration: none;
  text-align: center;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}

.family-card a:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 12px 28px rgba(42, 26, 14, .12);
}

.family-card.is-me a { border-color: var(--amber); }

.family-photo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cream-dark);
  border: 2px solid var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
}

.family-photo img { width: 100%; height: 100%; object-fit: cover; }
.family-initial { font-size: 1.8rem; }

.family-name {
  font-family: 'Playfair Display', serif;
  font-size: .98rem;
  color: var(--ink);
  line-height: 1.35;
}

.family-relation { font-size: .78rem; color: var(--sepia); font-style: italic; }

.family-me {
  font-size: .62rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
}

/* ——— Profil pojedynczej osoby ——— */
.profile-head {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.profile-photo {
  width: 180px;
  height: 180px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cream-dark);
  border: 3px solid var(--parchment);
  box-shadow: 0 10px 30px rgba(42, 26, 14, .15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-initial { font-size: 4rem; }

.profile-intro { flex: 1; min-width: 240px; }

.profile-bio {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-mid);
  margin-bottom: 1.2rem;
}

.profile-bio-empty { font-style: italic; opacity: .7; }

/* Dane kontaktowe */
.contact-list { list-style: none; display: flex; flex-direction: column; gap: .9rem; }

.contact-list li { display: flex; gap: .9rem; align-items: flex-start; }

.contact-icon {
  color: var(--amber);
  font-size: 1.1rem;
  width: 1.4rem;
  flex-shrink: 0;
  text-align: center;
}

.contact-list a { color: var(--sepia); text-decoration: none; border-bottom: 1px solid transparent; }
.contact-list a:hover { color: var(--amber); border-bottom-color: var(--amber); }

/* Więzy rodzinne */
.relation-block { margin-bottom: 1.6rem; }
.relation-block:last-child { margin-bottom: 0; }

.relation-list { list-style: none; display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .6rem; }

.relation-person {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .45rem .9rem .45rem .45rem;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-size: .92rem;
  transition: border-color .2s, background .2s;
}

.relation-person:hover { border-color: var(--gold); background: #fff; color: var(--ink); }

.relation-photo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.relation-photo img { width: 100%; height: 100%; object-fit: cover; }
.relation-photo .family-initial { font-size: .95rem; }

/* ——— Przodkowie ——— */
.ancestors-intro { margin-bottom: 3rem; text-align: center; }
.ancestors-closing { margin-top: 3rem; font-style: italic; color: var(--ink-mid); }

.ancestors-grid { display: flex; flex-direction: column; gap: 3rem; }

.ancestor {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
  background: #fff;
  border: 1px solid var(--cream-dark);
  padding: 2rem;
}

.ancestor-portrait {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(160deg, #3D2B1F 0%, #1A0D06 100%);
  border: 1px solid var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ancestor-portrait img { width: 100%; height: 100%; object-fit: cover; }

/* Brak fotografii: ozdobnik zamiast pustej ramy. Nieobecność zdjęcia jest
   częścią tej historii, a nie błędem do ukrycia. */
.ancestor-nophoto { font-size: 3rem; color: rgba(212, 168, 68, .45); }

.ancestor-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--ink);
  margin-bottom: .3rem;
}

.ancestor-role {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: .3rem;
}

.ancestor-years {
  font-family: 'Playfair Display', serif;
  color: var(--sepia);
  font-style: italic;
  margin-bottom: 1rem;
}

/* ——— Ogłoszenia ——— */
.announce-flag {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber);
  margin-top: .5rem;
}

.announce-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }

.announce-item {
  display: flex;
  gap: 1.5rem;
  padding: 1.6rem;
  background: #fff;
  border: 1px solid var(--cream-dark);
  border-left: 3px solid var(--amber);
  transition: box-shadow .25s, border-left-color .25s;
}

.announce-item:hover {
  box-shadow: 0 12px 28px rgba(42, 26, 14, .1);
  border-left-color: var(--gold);
}

/* Data jako kartka z kalendarza — ogłoszenie żyje terminem, więc data ma być
   pierwszą rzeczą, którą widać. */
.announce-date {
  flex-shrink: 0;
  width: 62px;
  text-align: center;
  border-right: 1px solid var(--cream-dark);
  padding-right: 1rem;
}

.announce-day {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem;
  color: var(--sepia);
  line-height: 1;
}

.announce-month {
  display: block;
  font-size: .72rem;
  color: var(--sepia);
  opacity: .7;
  margin-top: .25rem;
}

.announce-body { flex: 1; min-width: 0; }

.announce-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; margin-bottom: .4rem; }
.announce-title a { color: var(--ink); text-decoration: none; }
.announce-title a:hover { color: var(--amber); }

.announce-lead { color: var(--ink-mid); line-height: 1.7; margin-bottom: .8rem; }

.announce-foot {
  display: flex;
  align-items: center;
  gap: .9rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--sepia);
}

.announce-level { color: var(--amber); }
.announce-foot .card-link { margin-left: auto; }

/* ——— Nagrania ——— */
.record-list { list-style: none; display: flex; flex-direction: column; gap: 1.2rem; }

.record {
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--cream-dark);
}

.record-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }

.record-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }

.record-meta { flex: 1; min-width: 0; }

.record-title { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--ink); }

.record-sub { color: var(--ink-mid); font-style: italic; margin-top: .2rem; }

.record-line { font-size: .8rem; color: var(--sepia); margin-top: .4rem; }

.record-player { width: 100%; height: 40px; }

.record-foot { display: flex; gap: .6rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }

@media (max-width: 720px) {
  .ancestor { grid-template-columns: 1fr; }
  .ancestor-portrait { max-width: 220px; margin: 0 auto; }

  .announce-item { flex-direction: column; gap: .8rem; }
  .announce-date {
    display: flex;
    align-items: baseline;
    gap: .5rem;
    width: auto;
    text-align: left;
    border-right: none;
    border-bottom: 1px solid var(--cream-dark);
    padding: 0 0 .6rem;
  }
  .announce-day { font-size: 1.4rem; }
  .announce-foot .card-link { margin-left: 0; }

  .profile-photo { margin: 0 auto; }
  .family-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ═══════════════════════════════════════════════════════════
   STRONA GŁÓWNA — RODZINNA SPOŁECZNOŚĆ
   Kafelki „Co znajdziesz w archiwum” + sekcja „Dołącz”.
   Korzysta z istniejących tokenów i klas (.section-*, .btn-*).
   ═══════════════════════════════════════════════════════════ */

/* Wprowadzenie pod nagłówkiem sekcji */
.section-lead {
  max-width: 54ch;
  margin: 1.6rem auto 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-mid);
}
.section-dark .section-lead { color: rgba(248, 242, 228, .78); }

/* ——— Kafelki „Więcej niż książka” ——— */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.4rem;
}

.feature-tile {
  position: relative;
  display: block;
  padding: 2rem 1.8rem 2.6rem;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 2px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .2s, box-shadow .25s, border-color .25s;
}
.feature-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(42, 26, 14, .12);
  border-color: rgba(212, 168, 68, .55);
  color: var(--ink);
}

.feature-icon { font-size: 2rem; line-height: 1; display: block; margin-bottom: 1rem; }

.feature-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--sepia);
  margin-bottom: .5rem;
}

.feature-text { font-size: .95rem; line-height: 1.6; color: var(--ink-mid); }

.feature-arrow {
  position: absolute;
  right: 1.6rem; bottom: 1.4rem;
  color: var(--gold);
  font-size: 1.15rem;
  transition: transform .25s;
}
.feature-tile:hover .feature-arrow { transform: translateX(5px); }

/* ——— Sekcja „Dołącz do archiwum” ——— */
.join-section { text-align: center; }
.join-lead { color: rgba(248, 242, 228, .78); }

.join-grid {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  flex-wrap: wrap;
}

.join-card {
  flex: 1 1 340px;
  max-width: 520px;
  padding: 2.4rem 2rem;
  background: linear-gradient(135deg, #3D2B1F 0%, #2A1A0E 100%);
  border: 1px solid rgba(212, 168, 68, .25);
  border-radius: 2px;
  text-align: center;
}

.join-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--cream);
  margin-bottom: .8rem;
}

.join-card p {
  color: rgba(248, 242, 228, .72);
  max-width: 44ch;
  margin: 0 auto 1.7rem;
  line-height: 1.7;
}

.join-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .feature-grid { grid-template-columns: 1fr; }
  .join-card { padding: 2rem 1.4rem; }
  .join-actions { flex-direction: column; }
  .join-actions .btn { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   TAGI — przy wpisach, galeriach i jako pasek filtrów
   ═══════════════════════════════════════════════════════════ */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 1rem 0 0;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 2.4rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--cream-dark);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  font-size: .78rem;
  letter-spacing: .02em;
  color: var(--sepia);
  background: var(--cream);
  border: 1px solid var(--parchment);
  border-radius: 999px;
  text-decoration: none;
  transition: background .18s, color .18s, border-color .18s;
}

.tag-chip:hover {
  background: var(--cream-dark);
  border-color: var(--amber);
  color: var(--ink);
}

.tag-chip.is-active {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
}

.tag-count {
  font-size: .68rem;
  opacity: .65;
}

.tag-chip.is-active .tag-count { opacity: .85; }

/* Kafelek galerii/wpisu: tagi pod treścią, w obrysie karty. */
.card .tag-list {
  padding: 0 1.5rem 1.2rem;
  margin-top: -.4rem;
}

.card-body .tag-list { padding: 0; margin: .8rem 0 0; }

/* ═══════════════════════════════════════════════════════════
   CZYTNIK KSIĄŻKI
   ═══════════════════════════════════════════════════════════ */

.reader {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 80px);
  background: var(--ink);
}

.reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .9rem 1.4rem;
  background: rgba(42, 26, 14, .96);
  border-bottom: 1px solid rgba(212, 168, 68, .25);
  position: sticky;
  top: 0;
  z-index: 20;
}

.reader-bar-left,
.reader-bar-right {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.reader-title {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: .02em;
}

.reader-bar .btn-outline {
  color: var(--parchment);
  border-color: rgba(217, 201, 163, .35);
}

.reader-bar .btn-outline:hover:not(:disabled) {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold);
}

.reader-bar .btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.reader-counter {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--parchment);
  font-size: .85rem;
}

.reader-counter input {
  width: 4.5rem;
  padding: .3rem .5rem;
  text-align: center;
  font-size: .85rem;
  color: var(--cream);
  background: rgba(248, 242, 228, .08);
  border: 1px solid rgba(217, 201, 163, .3);
}

.reader-stage {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.6rem 1rem;
  overflow: auto;
  position: relative;
}

.reader-page {
  max-width: min(900px, 100%);
  width: 100%;
  height: auto;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
  /* Zniechęca do przeciągania obrazka na pulpit i zaznaczania go.
     To utrudnienie, nie zabezpieczenie — patrz komentarz w BookPdf.php. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.reader-stage.is-zoomed { align-items: flex-start; }
.reader-stage.is-zoomed .reader-page { max-width: none; width: 1400px; }

.reader-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--parchment);
  font-size: .9rem;
  letter-spacing: .06em;
  z-index: 5;
}

.reader-foot {
  padding: 1rem 1.4rem 2rem;
  text-align: center;
}

.reader-noscript {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--parchment);
  margin-bottom: 1rem;
}

.reader-note {
  color: rgba(217, 201, 163, .55);
  font-size: .8rem;
  font-style: italic;
  margin: 0;
}

.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;
}

@media (max-width: 720px) {
  .reader-bar { padding: .7rem .9rem; }
  .reader-title { display: none; }
  .reader-stage { padding: .8rem .4rem; }
  .reader-bar-right { width: 100%; justify-content: space-between; }
}

/* ═══════════════════════════════════════════════════════════
   WIADOMOŚĆ DLA AUTORA
   ═══════════════════════════════════════════════════════════ */

/* Wariant PDF bez przycisku — gdy książka nie została jeszcze wgrana. */
.variant-pending {
  display: block;
  text-align: center;
  font-size: .86rem;
  font-style: italic;
  color: var(--sepia);
  padding: .8rem 0;
}
