/* badania.net — tokens taken from the live site's own CSS custom properties */
:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #6b6b6b;
  --border: #e7e7e7;
  --card-bg: #f8f9fa;
  --header-bg: #ffffff;
  --accent: #daf400;
  --accent-contrast: #000000;
}
html[data-theme="dark"] {
  --bg: #1c1c1c;
  --fg: #ffffff;
  --muted: #a3a3a3;
  --border: #333335;
  --card-bg: #242426;
  --header-bg: #1c1c1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  transition: background .15s, color .15s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* header */
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}
.site-header-top {
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 32px 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.site-header-tools { display: flex; align-items: center; gap: 18px; }
.icon-btn { display: flex; color: var(--fg); }
.theme-toggle {
  width: 38px; height: 22px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--card-bg);
  position: relative; cursor: pointer; padding: 0;
}
.theme-toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; color: #000;
  transition: left .15s;
}
html[data-theme="dark"] .theme-toggle-knob { left: 18px; }
.icon-sun { display: none; }
.icon-moon { display: block; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

.site-nav {
  max-width: 1120px; margin: 0 auto; padding: 16px 32px;
  display: flex; gap: 26px; font-size: 13.5px; font-weight: 600; flex-wrap: wrap;
}
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--fg); }

/* layout */
.site-main { max-width: 1120px; margin: 0 auto; padding: 36px 32px 60px 32px; }
.content-wrap { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 56px; align-items: start; }
.content-wrap--list, .content-wrap--page { display: block; max-width: 760px; }

/* category badge -- lime stays exclusive to Psychologia (the site's one
   real saturated accent color); every other category gets its own soft,
   complementary color instead of falling back to the same green. */
.category-badge {
  display: inline-block; background: var(--accent); color: var(--accent-contrast);
  font-size: 11px; font-weight: 700; letter-spacing: .05em;
  padding: 4px 10px; border-radius: 3px; margin-bottom: 16px;
}
.category-badge--neurobiologia { background: #ece4fb; color: #5b3aa6; }
.category-badge--biologia { background: #e0f5e4; color: #22733a; }
.category-badge--psychologia-ewolucyjna-tematyka-seks,
.category-badge--seks { background: #fbe4ee; color: #a23366; }
.category-badge--technologie { background: #e1edfc; color: #2058a8; }
.category-badge--srodowisko,
.category-badge--ochrona-srodowiska { background: #dff5f0; color: #0f7a63; }
.category-badge--zdrowie { background: #fdeaea; color: #b23b3b; }
.category-badge--ksiazki { background: #fbeee0; color: #a3611a; }
.category-badge--statystyczny-polak,
.category-badge--ciekawostki,
.category-badge--czy-wiesz-ze,
.category-badge--inne-teksty,
.category-badge--konkursy,
.category-badge--ogloszenia,
.category-badge--polecamy,
.category-badge--wyklady,
.category-badge--chemia { background: var(--card-bg); color: var(--muted); }

/* article */
.post-title { font-size: 36px; line-height: 1.18; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 20px 0; }
.post-byline { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #000; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0;
}
html[data-theme="dark"] .avatar { background: var(--accent); color: #000; }
.byline-name { font-weight: 600; font-size: 13.5px; }
.byline-date { color: var(--muted); font-size: 13.5px; }

/* flow-root contains any floated alignleft/alignright image inside --
   without it, a post ending on a floated image collapses the container's
   height around it, and everything after (footer included) can end up
   visually misplaced even though it's still correctly in the markup. */
.post-body { font-size: 16.5px; line-height: 1.75; display: flow-root; }
.post-body p { margin: 0 0 18px 0; }
.post-body figure { margin: 24px 0; }
.post-body figure img { border-radius: 6px; border: 1px solid var(--border); }
.post-body figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* WordPress's classic image-alignment classes -- meaningful in the old theme's
   own CSS, but that never carried over, so a bare alignleft/alignright image
   was just sitting unstyled in the document flow instead of floating with
   proper spacing. */
.post-body img { border-radius: 6px; }
.post-body img.alignleft { float: left; margin: 6px 24px 16px 0; max-width: 45%; }
.post-body img.alignright { float: right; margin: 6px 0 16px 24px; max-width: 45%; }
.post-body img.aligncenter { display: block; margin: 20px auto; float: none; }
.post-body img.alignnone { margin: 20px 0; }
/* block-level content (source boxes, polls, toggles) should always start
   on its own line, never sit squeezed beside a floated image */
.post-body .zrodlo, .post-body .alert, .post-body .archived-poll, .post-body details,
.post-body h2, .post-body h3, .post-body h4, .post-body h5 { clear: both; }
.post-body mark { padding: .05em .15em; border-radius: 2px; color: #000; }
.post-body .zrodlo, .post-body .alert {
  margin-top: 24px; padding: 16px 18px 18px 20px; background: var(--card-bg);
  border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 6px;
  font-size: 13.5px; color: var(--muted); line-height: 1.6;
}
.post-body .zrodlo strong:first-child, .post-body .alert strong:first-child,
.post-body .zrodlo h4:first-child, .post-body .alert h4:first-child,
.post-body .zrodlo h5:first-child, .post-body .alert h5:first-child,
.post-body .zrodlo h6:first-child, .post-body .alert h6:first-child {
  display: block; color: var(--fg); font-size: 15px; font-weight: 700; margin: 0 0 10px 0;
}
.post-body iframe { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 6px; }
.post-body .btn {
  display: inline-block; padding: 8px 16px; background: var(--accent); color: var(--accent-contrast);
  border-radius: 4px; font-weight: 600; font-size: 14px;
}
.archived-poll {
  margin: 24px 0; padding: 16px 18px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 6px;
}
.archived-poll ul { margin: 10px 0; padding-left: 20px; }
.archived-poll li { margin: 4px 0; }
.post-body details {
  margin: 14px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg);
}
.post-body details summary { font-weight: 600; cursor: pointer; }
.post-body details[open] summary { margin-bottom: 10px; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* comments */
.post-comments { margin-top: 52px; padding-top: 28px; border-top: 1px solid var(--border); }

/* sidebar */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.search-box {
  border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center;
  gap: 8px; padding: 10px 12px; background: var(--card-bg);
}
.search-box input { border: 0; background: transparent; outline: none; font-size: 13.5px; color: var(--fg); width: 100%; }
.sidebar-heading { font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--muted); margin-bottom: 14px; }
.related-posts { display: flex; flex-direction: column; gap: 12px; }
.related-post { font-size: 13.5px; font-weight: 600; line-height: 1.35; }

/* post list (home / category) */
.post-list { display: flex; flex-direction: column; gap: 32px; max-width: 760px; }
.list-title { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.author-profile { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 36px; }
.author-avatar { border-radius: 50%; flex-shrink: 0; border: 1px solid var(--border); }
.author-bio { color: var(--muted); font-size: 14.5px; line-height: 1.6; max-width: 560px; margin: 8px 0 0 0; }
.post-card h2 { font-size: 22px; margin: 0 0 6px 0; }
.post-card-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.post-card-summary { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0; }
.pagination { display: flex; justify-content: space-between; margin-top: 32px; font-size: 14px; font-weight: 600; }

.ad-slot { margin: 28px 0; }
.ad-slot-label {
  display: block; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 6px;
}

/* footer */
.site-footer { max-width: 1120px; margin: 0 auto; padding: 24px 32px; font-size: 13px; color: var(--muted); }

@media (max-width: 700px) {
  .content-wrap { grid-template-columns: 1fr; }
}
