@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Styl stron artykułów (/artykuly/), generowanych przez panel */

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

:root {
  --bg: #0c0c13;
  --surface: #12121a;
  --border: #1e1e2e;
  --text: #e4e4ef;
  --body: #c4c4d4;
  --muted: #8b8ba0;
  --accent: #6366f1;
  --link: #a5a8ff;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --grid-line: rgba(139, 142, 255, 0.07);
}

/* Jasny motyw (przełącznik w nagłówku, zapamiętany w przeglądarce) */
:root[data-theme="light"] {
  --bg: #f6f6fb;
  --surface: #ffffff;
  --border: #e2e2ee;
  --text: #16161f;
  --body: #34344a;
  --muted: #5c5c70;
  --link: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.10);
  --grid-line: rgba(99, 102, 241, 0.08);
}

.zmiana-motywu, .zmiana-motywu *, .zmiana-motywu *::before, .zmiana-motywu *::after {
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease !important;
}

::-webkit-scrollbar { width: 14px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 7px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #818cf8; }
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-color: var(--accent) var(--bg); }
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.tlo {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 50% at 50% 0%, black 20%, transparent 100%);
}

.podglad {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  background: #854d0e;
  color: #fef3c7;
}

.gora {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  font-size: 1.05rem;
}

.logo span { color: var(--accent); }

.gora nav { display: flex; gap: 1.5rem; }
.gora nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.gora nav a:hover { color: var(--text); }

.gora .motyw {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.gora .motyw:hover { color: var(--text); border-color: var(--accent); }
.gora .motyw svg { width: 18px; height: 18px; }
.motyw .ikona-ksiezyc { display: none; }
:root[data-theme="light"] .motyw .ikona-slonce { display: none; }
:root[data-theme="light"] .motyw .ikona-ksiezyc { display: block; }
.gora .prawa { display: flex; align-items: center; }

.porady {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.25rem 0;
  flex: 1;
}

/* Lista porad */

.naglowek-listy { text-align: center; margin-bottom: 3rem; }

.naglowek-listy h1, .artykul h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.wstep {
  max-width: 640px;
  margin: 1rem auto 0;
  color: var(--muted);
  font-weight: 300;
}

.kategorie-skroty {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.kategorie-skroty a {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  color: var(--body);
  text-decoration: none;
  font-size: 0.85rem;
}

.kategorie-skroty a:hover { border-color: var(--accent); color: var(--text); }

.pusto { text-align: center; color: var(--muted); }

[hidden] { display: none !important; }

.ukryte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Wyszukiwarka */

.szukaj {
  position: relative;
  max-width: 520px;
  margin: 1.75rem auto 0;
}

.szukaj svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.szukaj input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.szukaj input::placeholder { color: var(--muted); }
.szukaj input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.wyniki { margin-bottom: 3.5rem; }
.wyniki h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); letter-spacing: -0.02em; margin-bottom: 0.4rem; }

/* Lista z chmurą tagów z boku */

.uklad-listy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 2.5rem;
  align-items: start;
}

.uklad-listy.bez-bocznej { grid-template-columns: minmax(0, 1fr); }
.uklad-listy .karty { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.boczna {
  position: sticky;
  top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.boczna h2 { font-size: 1rem; margin-bottom: 0.9rem; }

.chmura { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.75rem; }

.chmura a { display: inline-block; color: var(--body); text-decoration: none; line-height: 1.3; transition: color 0.2s; }
.chmura a:hover, .chmura a.aktywny { color: var(--link); }
.chmura a.aktywny { font-weight: 600; }
.chmura .r1 { font-size: 0.82rem; color: var(--muted); }
.chmura .r2 { font-size: 0.92rem; }
.chmura .r3 { font-size: 1.05rem; }
.chmura .r4 { font-size: 1.2rem; font-weight: 600; color: var(--text); }

.tagi { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }

.tagi a {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  color: var(--link);
  font-size: 0.8rem;
  text-decoration: none;
}

.tagi a:hover { border-color: var(--accent); }

.okruszki-listy { justify-content: center; }
.wszystkie-link { margin-top: 2rem; }
.wszystkie-link a { color: var(--link); text-decoration: none; }

.kategoria { margin-bottom: 3.5rem; scroll-margin-top: 1.5rem; }

.kategoria h2, .inne h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.kategoria-opis { color: var(--muted); font-weight: 300; margin-bottom: 1.25rem; }

.karty {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.karta {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s;
}

.karta:hover { border-color: rgba(99, 102, 241, 0.6); transform: translateY(-2px); }

.karta-tekst { padding: 1.25rem 1.35rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.karta h3 { font-size: 1.05rem; line-height: 1.35; margin-bottom: 0.5rem; }
.karta p { color: var(--muted); font-size: 0.92rem; font-weight: 300; line-height: 1.6; flex: 1; }
.karta-data { margin-top: 1rem; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--muted); }

/* Artykuł */

.okruszki {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.okruszki a { color: var(--link); text-decoration: none; }
.okruszki a:hover { text-decoration: underline; }

.artykul { max-width: 720px; margin: 0 auto; }

.artykul header { margin-bottom: 2rem; }

.meta {
  margin-top: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

.okladka { margin-bottom: 2rem; }
.okladka img { width: 100%; height: auto; border-radius: 12px; display: block; border: 1px solid var(--border); }

.tresc { color: var(--body); font-size: 1.05rem; font-weight: 300; }
.tresc > * + * { margin-top: 1.1rem; }
.tresc h2 { color: var(--text); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin-top: 2.5rem; }
.tresc h3 { color: var(--text); font-size: 1.2rem; font-weight: 600; line-height: 1.35; margin-top: 2rem; }
.tresc strong { color: var(--text); font-weight: 600; }
.tresc a { color: var(--link); }
.tresc ul, .tresc ol { padding-left: 1.5rem; }
.tresc li + li { margin-top: 0.4rem; }
.tresc li > ul, .tresc li > ol { margin-top: 0.4rem; }
.tresc li::marker { color: var(--accent); }
.tresc blockquote {
  padding: 0.9rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  border-radius: 0 8px 8px 0;
  color: var(--text);
}
.tresc blockquote > * + * { margin-top: 0.6rem; }
.tresc code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.tresc pre {
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  line-height: 1.55;
}
.tresc pre code { padding: 0; border: 0; background: none; font-size: 0.88rem; }
.tresc hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.tresc img { max-width: 100%; height: auto; border-radius: 10px; vertical-align: middle; }
.tresc figure { margin-top: 1.75rem; margin-bottom: 1.75rem; text-align: center; }
.tresc figure img { display: block; margin: 0 auto; border: 1px solid var(--border); }
.tresc figcaption { margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }
.tresc table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.tresc th, .tresc td { padding: 0.55rem 0.9rem; border: 1px solid var(--border); text-align: left; }
.tresc th { color: var(--text); font-weight: 600; background: var(--surface); }
.tresc .w-center { text-align: center; }
.tresc .w-right { text-align: right; }

.cta {
  max-width: 720px;
  margin: 3.5rem auto 0;
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(167, 139, 250, 0.06)), var(--surface);
  text-align: center;
}

.cta h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.cta p { color: var(--muted); font-weight: 300; max-width: 540px; margin: 0 auto 1.25rem; }

.przycisk,
.tresc .przycisk {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35);
  transition: background 0.2s, box-shadow 0.2s;
}

.przycisk:hover { background: #818cf8; box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5); }

.inne { max-width: 1040px; margin: 3.5rem auto 0; }

footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

footer a { color: var(--link); }

@media (max-width: 640px) {
  .gora { padding: 1.1rem 1rem; }
  .gora nav { gap: 1rem; }
  .porady { padding: 1rem 1rem 0; }
  .tresc { font-size: 1rem; }
  .karty, .uklad-listy .karty { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .uklad-listy { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .boczna { position: static; order: -1; margin-bottom: 2rem; padding: 1rem 0 0.25rem; border: 0; background: none; }
  .boczna h2 { margin-bottom: 0.5rem; }
  .chmura { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.6rem; scrollbar-width: thin; }
  .chmura a { white-space: nowrap; }
}
