/* Strona: lumen.html (dawniej styles-4.css) — style unikalne (wspólne: tokens + motyw + components). */
/* =========================
   Reset & Global
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  color: var(--text); /* biały tekst globalnie */
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg); /* prawie czarne tło */
  position: relative;
  transition: background 0.5s ease;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url('/background.png') no-repeat center center;
  background-size: cover;
  opacity: 0.05; /* bardzo subtelny obraz */
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

header {
  position: relative;
  width: 100%;
  height: 300px;
  text-align: center;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
}

header::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: url('/header.png') no-repeat center center;
  background-size: cover;
  opacity: 0.1;
  z-index: -1;
}

header h1,
header p {
  position: relative;
  z-index: 1;
}

#main-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  width: 100%;
  height: 100%;
  padding: 0 20px;
}

/* Link „Ruch Uniesienia" w nagłówku — dziedziczy szeryf nagłówka, nie wygląda jak odnośnik */
.header-button {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s ease;
}
.header-button:hover { color: var(--accent-bright); }

/* =========================
   Sidebar
   ========================= */
aside {
  flex: 0 0 25%;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 10px;
  padding: 20px;
  color: var(--text);
  min-width: 200px;
  height: auto;
}

/* =========================
   Search Box
   ========================= */
.search-box {
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: none;
  outline: none;
  font-size: 1rem;
  background: var(--text);
  color: var(--surface);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.search-box input::placeholder {
  color: var(--muted);
  font-style: italic;
}

aside nav ul {
  list-style: none;
}

aside nav ul li {
  margin-bottom: 10px;
}

/* =========================
   Accordion / Submenu
   ========================= */
.accordion {
  background: var(--bg-2);
  color: var(--text);
  cursor: pointer;
  padding: 12px 14px;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.3s, color 0.3s;
}

.accordion:hover {
  background: var(--accent);
  color: var(--bg-2);
}

.accordion.active {
  background: var(--accent);
  color: var(--bg-2);
  font-weight: bold;
}

.accordion::after {
  content: "▶";
  float: right;
  transition: transform 0.3s, color 0.3s;
  color: var(--text);
}

.accordion.active::after {
  transform: rotate(90deg);
  content: "▼";
  color: var(--bg-2);
}

.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.3s;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--accent);
  margin: 8px 0 12px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  padding: 0;
}

.submenu li {
  margin: 5px 0;
}

.submenu li a.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  word-wrap: break-word;
  padding: 5px 0 5px 10px;
  text-decoration: none;
  color: var(--text);
  transition: color 0.3s, background 0.3s;
}

.submenu li a.sidebar-item:hover {
  color: var(--bg-2);
  background: var(--accent);
  border-radius: 4px;
}

.sidebar-item span {
  flex: 1;
  min-width: 0;
  padding-right: 10px;
}

.sidebar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--accent);
}

/* =========================
   Aktualności (main)
   ========================= */
main {
  flex: 1;
  min-width: 0;            /* bez tego flexbox nie pozwala kolumnie zwężyć się poniżej treści */
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 20px 30px;
  display: flex;
  flex-direction: column;
  min-height: 420px;       /* było 700px — na telefonie to była zadarta do góry strona */
}

.news-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  /* Pasek musi być widoczny: przy przypiętej kolumnie treść bez paska wygląda
     na uciętą, a na telefonie pasek systemowy bywa niewidoczny do pierwszego ruchu. */
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255,255,255,0.08);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.news-list::-webkit-scrollbar { width: 10px; }
.news-list::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 6px; }
.news-list::-webkit-scrollbar-thumb {
  background: var(--accent); border-radius: 6px; border: 2px solid transparent;
  background-clip: content-box;
}
.lumen-aktualnosci {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;      /* bez tego flexbox nie pozwala dziecku się przewijać */
  overflow: hidden;
}
.lumen-aktualnosci h2 { flex: 0 0 auto; }
.news-list small {
  display: block; font: 600 0.72rem/1 var(--font-sans); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); opacity: 0.85; margin: -2px 0 8px;
}

.news-list article {
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 0.3, transparent); /* subtelny złoty podział */
}

.news-list h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--text);
}

.news-list p {
  color: var(--text-body);
}

main h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
  color: var(--text);
}

/* =========================
   Pasek HOME
   ========================= */
.home-bar {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 20px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
  font-size: clamp(1.2rem, 4vw, 2rem);
  padding: 0 20px;
  line-height: 20px;
  text-align: center;
  transition: background 0.3s, color 0.3s;
}

.home-bar:hover {
  background: var(--accent);
  color: var(--bg-2);
}

.home-bar span {
  display: inline-block;
}

/* =========================
   Responsywność
   ========================= */
@media (max-width: 900px) {
  #main-container {
    flex-direction: column;
    gap: 20px;
  }

  aside {
    order: -1;
    width: 100%;
    background: rgba(0,0,0,0.9);
    border-radius: 0;
    padding: 15px;
  }

  aside nav ul li {
    margin-bottom: 5px;
  }

  main {
    order: 1;
    max-height: 60vh;
    overflow: hidden;
  }

  .news-list {
    overflow-y: auto;
    flex: 1;
  }

  .accordion {
    font-size: 1rem;
    padding: 10px 12px;
  }

  .sidebar-img {
    width: 30px;
    height: 30px;
  }
}

/* ==========================================================================
   SIDEBAR: przycisk + (dodaj) na całą szerokość
   (JS dokleja go jako osobne <li> na końcu listy)
   ========================================================================== */
#sidebar-list {
  display: flex;
  flex-wrap: wrap;
}
#sidebar-list > li {
  flex: 1 1 100%;
}
#sidebar-list > li:has(> #add-entry-btn) {
  flex: 1 1 100%;
  display: flex;
  margin-bottom: 0;
  margin-top: 0 !important; /* nadpisuje inline marginTop z JS */
}
#add-entry-btn {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#add-entry-btn {
  background: var(--accent) !important; /* zamiast inline #d4af37 */
  color: var(--bg) !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 1.4rem !important;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}
#add-entry-btn:hover {
  background: var(--accent-bright) !important;
  transform: translateY(-1px);
}

/* ==========================================================================
   UKŁAD DWUKOLUMNOWY KATALOGU
   `.lumen-uklad` to opakowanie: katalog z bocznego panelu + treść.
   Wcześniej katalog siedział w #main-container i wysokość była przypięta
   do okna — na telefonie ucinało listę i nie dało się jej przewinąć.
   ========================================================================== */
.lumen-uklad {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex: 1;
  min-height: 0;
  padding: 20px;
  width: 100%;
}

.lumen-uklad > aside {
  flex: 0 0 320px;
  max-width: 320px;
  min-width: 220px;
  align-self: flex-start;   /* panel kończy się tam, gdzie kończy się lista —
                               bez position:sticky, które ucinało go na wysokości okna */
}

.lumen-uklad > main {
  flex: 1;
  min-width: 0;
  /* Kafel ma stałą wysokość (reszta ekranu), a przewija się w nim tylko lista
     aktualności — tak jak w wersji, którą Pan wgrał. Reszta kafla stoi. */
  height: calc(100vh - 40px);
  min-height: 460px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

/* ==========================================================================
   AKTUALNOŚCI (dział „news", który wcześniej znikał)
   ========================================================================== */
.lumen-liczby {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 18px;
  padding: 0;
  font: 400 0.92rem/1.4 var(--font-sans);
  color: var(--muted);
}
.lumen-liczby strong { color: var(--accent-bright); font-weight: 600; }

/* ==========================================================================
   PRZYCISK „+" — prowadzi do /lumen/zglos/ (wcześniej otwierał wyskakujące okno)
   ========================================================================== */
.lumen-dodaj {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font: 700 1rem/1 var(--font-sans);
  text-decoration: none;
  transition: background 0.25s ease, transform 0.2s ease;
}
.lumen-dodaj > span[aria-hidden="true"] { font-size: 1.5rem; line-height: 1; }
.lumen-dodaj-opis {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lumen-dodaj:hover { background: var(--accent-bright); transform: translateY(-1px); }

.lumen-liczba {
  float: right;
  margin-left: 8px;
  font: 600 0.8rem/1 var(--font-sans);
  opacity: 0.75;
}

/* ==========================================================================
   STRONA ZGŁOSZEŃ (/lumen/zglos/)
   Formularz używa klas .am-*, które w components.css są przywiązane do
   #add-modal. Tutaj mają działać samodzielnie — i być responsywne.
   ========================================================================== */
.lumen-zglos {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(18px, 5vw, 44px) clamp(14px, 4vw, 28px) 64px;
  display: block;
  background: none;
  border-radius: 0;
  /* Było: overflow:hidden i max-height z układu katalogu → formularz ucinał się
     na wysokości pierwszego ekranu i nie dawał się przewinąć. */
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.lumen-zglos h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 14px;
  color: var(--text);
}

.lumen-zglos .lumen-wstep {
  color: var(--muted);
  font-size: clamp(0.95rem, 2.6vw, 1.05rem);
  line-height: 1.65;
  margin: 0 0 26px;
}

/* karta formularza */
.lumen-zglos .am-card {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: clamp(16px, 5vw, 32px);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.lumen-zglos fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;               /* bez tego fieldset nie pozwala polom zwężyć się na telefonie */
}

.lumen-zglos legend {
  padding: 0 0 18px;
  font: 600 0.78rem/1.3 var(--font-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.lumen-zglos .am-field { margin-bottom: 20px; }

.lumen-zglos label {
  display: block;
  margin-bottom: 7px;
  font: 600 0.75rem/1.3 var(--font-sans);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

/* wspólne dla wszystkich pól: NIGDY szersze niż karta */
.lumen-zglos input[type="text"],
.lumen-zglos input[type="email"],
.lumen-zglos input[type="url"],
.lumen-zglos textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text);
  font: 400 1rem/1.5 var(--font-sans);   /* 1rem = brak auto-powiększenia na iPhonie */
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.lumen-zglos input:focus,
.lumen-zglos textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 190, 119, 0.18);
}
.lumen-zglos textarea { resize: vertical; min-height: 120px; }
.lumen-zglos input::placeholder,
.lumen-zglos textarea::placeholder { color: var(--muted-2); opacity: 0.8; }

.lumen-zglos small {
  display: block;
  margin-top: 6px;
  font: 400 0.8rem/1.45 var(--font-sans);
  color: var(--muted);
}

/* zgoda: checkbox i tekst w jednej linii, tekst się zawija */
.lumen-zglos .am-zgoda label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font: 400 0.88rem/1.5 var(--font-sans);
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-body, var(--text));
  cursor: pointer;
}
.lumen-zglos .am-zgoda input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

/* przyciski: obok siebie na desktopie, pod sobą na telefonie */
.lumen-zglos .am-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.lumen-zglos .am-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 140px;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  font: 600 0.85rem/1 var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
}
.lumen-zglos .am-btn-primary { background: var(--accent); color: var(--bg); }
.lumen-zglos .am-btn-primary:hover { background: var(--accent-bright); }
.lumen-zglos .am-btn-ghost { background: transparent; color: var(--accent); }
.lumen-zglos .am-btn-ghost:hover { border-color: var(--accent-bright); color: var(--accent-bright); }

.lumen-drobne {
  margin: 22px 0 0;
  font: 400 0.83rem/1.6 var(--font-sans);
  color: var(--muted);
}

/* ścieżka nawigacyjna nad tytułem */
.lumen-sciezka {
  font: 600 0.72rem/1 var(--font-sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 16px;
}
.lumen-sciezka a { color: var(--accent); text-decoration: none; }
.lumen-sciezka a:hover { text-decoration: underline; }

/* ==========================================================================
   PROFILE I LISTY OSÓB (adresy /lumen/osoby/<slug>/)
   ========================================================================== */
.lumen-lista, .lumen-wpisy { list-style: none; margin: 0; padding: 0; }
.lumen-wpisy { display: grid; gap: 14px; grid-template-columns: 1fr; }
.lumen-wpisy a {
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); text-decoration: none; transition: border-color 0.2s ease;
}
.lumen-wpisy a:hover { border-color: var(--accent); }
.lumen-pusto { color: var(--muted); font-style: italic; padding: 8px 0; }
.lumen-pusto a { color: var(--accent); }

.lumen-profil {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(18px, 5vw, 44px) clamp(14px, 4vw, 28px) 64px;
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
  background: none;
  border-radius: 0;
}
.lumen-profil h1 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(1.7rem, 6vw, 2.6rem); line-height: 1.2; margin: 0 0 8px;
}
.lumen-rola {
  font: 600 0.78rem/1.4 var(--font-sans); letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 22px;
}
.lumen-tagi { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 22px 0; }
.lumen-tagi li {
  padding: 5px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill, 999px);
  font: 600 0.74rem/1 var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.lumen-linki { list-style: none; padding: 0; margin: 0 0 26px; }
.lumen-linki li { margin-bottom: 8px; }
.lumen-linki a { color: var(--accent); text-decoration: none; }
.lumen-linki a:hover { text-decoration: underline; }
.lumen-powrot { margin: 30px 0 0; font: 600 0.78rem/1 var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase; }
.lumen-powrot a { color: var(--accent); text-decoration: none; }

/* ==========================================================================
   PRZEŁĄCZNIK JĘZYKA (klasa była używana, ale nigdzie nie zdefiniowana)
   ========================================================================== */
.site-lang {
  position: fixed;
  z-index: 900;
  top: 12px;
  right: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 7px 12px;
  border: 1px solid rgba(160, 150, 120, 0.45);
  border-radius: 9px;
  background: rgba(10, 12, 14, 0.92);
  color: #efe9dc;
  font: 600 12px/1.1 var(--font-sans);
  backdrop-filter: blur(6px);
}
.site-lang a { color: inherit; text-decoration: none; }
.site-lang a[aria-current="page"] {
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   TELEFON I TABLET — tu było najwięcej do naprawy
   ========================================================================== */
@media (max-width: 900px) {
  .lumen-uklad {
    flex-direction: column;
    padding: 14px;
    gap: 16px;
  }

  /* katalog przestaje być przypięty: rośnie z treścią i przewija się razem ze stroną */
  .lumen-uklad > aside {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    position: static;
    max-height: none;
    overflow: visible;
    order: -1;
  }

  .lumen-uklad > main {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
  }

  /* na telefonie aktualności płyną razem ze stroną — jedno przewijanie zamiast dwóch */
  .news-list {
    max-height: none;
    overflow: visible;
  }

  .lumen-uklad main { padding: 16px; }

  .lumen-dodaj { margin-top: 12px; }
}

@media (max-width: 560px) {
  header { height: 200px; }
  .lumen-zglos, .lumen-profil { padding-left: 14px; padding-right: 14px; }
  .lumen-zglos .am-actions { flex-direction: column; }
  .lumen-zglos .am-btn { width: 100%; flex: 0 0 auto; }
  .site-lang { top: 8px; right: 8px; padding: 6px 10px; }
}

/* ==========================================================================
   AKORDEON KATALOGU — reguły dla stanu otwartego
   (stary arkusz używał klasy `.active` na przycisku, a HTML ustawia
   `aria-expanded` i klasę `.lumen-otwarty` na <li> — stąd braki)
   ========================================================================== */
.lumen-akordeon > .accordion[aria-expanded="true"] {
  background: var(--accent);
  color: var(--bg-2);
  font-weight: 700;
}
.lumen-akordeon > .accordion[aria-expanded="true"]::after {
  content: "▼";
  transform: none;
  color: var(--bg-2);
}

/* rozwinięta sekcja: pokaż listę (stary arkusz trzymał `.submenu` na max-height:0) */
.lumen-otwarty > .submenu {
  max-height: 2000px;
  overflow: visible;
  padding: 6px 8px;
}

.lumen-nazwa { display: block; font-weight: 600; }
.lumen-rola-lista {
  display: block;
  font: 400 0.74rem/1.35 var(--font-sans);
  color: var(--muted);
  margin-top: 2px;
}
.submenu li a.sidebar-item { padding: 8px 10px; gap: 10px; }
.submenu li a.sidebar-item:hover .lumen-rola-lista { color: rgba(10, 10, 10, 0.75); }
