:root {
  --bg: #ffffff;
  --header-bg: #e0f2fe;
  --card-bg: #ffffff;
  --text: #0f172a;
  --muted: #4b5563;
  --accent: #2563eb;
  --radius: 12px;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.10);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               sans-serif;
}

/* RESET */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}

/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0.9rem 4vw;
  background: var(--header-bg);
  border-bottom: 1px solid #bfdbfe;
}

.logo {
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.logo-main {
  background: linear-gradient(120deg, #1d4ed8, #4f46e5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-sub {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.16em;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(129, 140, 248, 0.7);
}

.logo-dot {
  font-weight: 500;
  font-size: 14px;
  color: #64748b;
}

.logo:hover .logo-sub {
  background: rgba(79, 70, 229, 0.18);
  border-color: rgba(79, 70, 229, 1);
  transition: background 0.2s ease, border-color 0.2s ease;
}

/* NAV */

.main-nav a {
  margin-left: 1.4rem;
  font-size: 0.95rem;
  color: #111827;
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--accent);
}

/* SEARCH */

.search-container {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

#searchbar {
  width: 100%;
  padding: 10px 40px 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
  font-size: 14px;
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

#searchbar::placeholder {
  color: #9ca3af;
}

#searchbar:focus {
  border-color: #4f46e5;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.2);
  background: #ffffff;
}

/* THEME TOGGLE */

.theme-toggle {
  margin-left: 1.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #cbd5f5;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.9rem;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* LAYOUT – TYLKO ARTYKUŁ, SZEROKA RAMKA */

.layout {
  max-width: 1200px;          /* prawie cała szerokość na dużych ekranach */
  margin: 0 auto;
  padding: 2.5rem 4vw 3rem;
}

/* nagłówek sekcji */

.articles h1 {
  margin: 0 0 0.6rem;
  font-size: 1.9rem;
  background: linear-gradient(120deg, #0f172a, #111827);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 46rem;
}

/* KARTA ARTYKUŁU – SZEROKA */

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  box-shadow: var(--shadow);
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.5rem;
  max-width: 100%;            /* karta na całą szerokość layoutu */
}

/* TREŚĆ ZE STACKEDIT */

.stackedit__html {
  line-height: 1.6;
  color: var(--muted);
}

.stackedit__html h2,
.stackedit__html h3,
.stackedit__html h4 {
  margin-top: 1.8rem;
  margin-bottom: 0.6rem;
  color: var(--text);
}

.stackedit__html p,
.stackedit__html ul,
.stackedit__html ol,
.stackedit__html blockquote {
  margin-bottom: 0.9rem;
}

.stackedit__html ul,
.stackedit__html ol {
  padding-left: 1.4rem;
}

.stackedit__html a {
  color: var(--accent);
}

.stackedit__html blockquote {
  margin: 1rem 0;
  padding-left: 0.9rem;
  border-left: 3px solid #bfdbfe;
}

.stackedit__html img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.75rem auto;
}

.task-list-item {
  list-style: none;
}

/* FOOTER */

.site-footer {
  padding: 16px 4vw;
  font-size: 12px;
  color: #9ca3af;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
}

.site-footer small {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-links a {
  margin-left: 1rem;
  font-size: 0.85rem;
  color: #6b7280;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .layout {
    padding-inline: 5vw;
  }

  .site-header {
    padding-inline: 5vw;
    flex-wrap: wrap;
  }

  .search-container {
    order: 3;
    width: 100%;
    margin-top: 0.75rem;
  }
}

/* DARK THEME */

body.dark {
  --bg: #020617;
  --card-bg: #0b1120;
  --text: #e5e7eb;
  --muted: #cbd5f5;
}

body.dark .site-header {
  background: #020617;
  border-bottom-color: rgba(148, 163, 184, 0.5);
}

body.dark .logo-main {
  background: linear-gradient(120deg, #38bdf8, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.dark .logo-sub {
  background: rgba(15,23,42,0.8);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.7);
}

body.dark .logo-dot {
  color: #9ca3af;
}

body.dark .main-nav a {
  color: #e5e7eb;
}

body.dark .main-nav a:hover {
  color: #38bdf8;
}

body.dark .theme-toggle {
  background: transparent;
  border-color: rgba(148,163,184,0.7);
  color: #e5e7eb;
}

body.dark .theme-toggle:hover {
  border-color: #38bdf8;
  color: #38bdf8;
}

body.dark #searchbar {
  background: #020617;
  border-color: rgba(148,163,184,0.5);
  box-shadow: 0 8px 30px rgba(15,23,42,0.9);
  color: #e5e7eb;
}

body.dark #searchbar::placeholder {
  color: #64748b;
}

body.dark .card {
  border-color: rgba(148, 163, 184, 0.6);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.9);
}

body.dark .site-footer {
  background: #020617;
  color: #9ca3af;
}
