/* Nilip i Fiko — shared page shell
 * Header (logo + nilipifiko.pl), main wrap, h1/subtitle/h2, site-footer,
 * copyright-bar, back-home button. Used by: regulamin, zasady,
 * polityka-prywatnosci, ranking, and any future legal/info page.
 *
 * Requires tokens.css to be loaded first.
 */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Sticky header ──────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: var(--sp-3) var(--sp-5);
  background: var(--bg-header);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  width: min(1000px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-6);
}
.site-header .hdr-logo { height: 64px; width: auto; opacity: 0.9; }
.site-header .hdr-url {
  font-family: var(--ff-brand);
  font-size: var(--fs-xl);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-widest);
  color: var(--accent);
  text-transform: lowercase;
  text-shadow: var(--glow-accent-sm);
}
.site-header .hdr-url a { color: inherit; text-decoration: none; }
.site-header .hdr-url .dot { color: var(--text-subtle); text-shadow: none; }

/* ─── Main content wrap ──────────────────────────────────────────── */
main {
  flex: 1;
  margin: 0 auto;
  padding: var(--sp-11) var(--sp-8) var(--sp-8);
  width: 100%;
}
main.narrow { max-width: 780px; }
main.wide   { max-width: 900px; }

main h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-tight);
  margin-bottom: var(--sp-3);
  color: var(--accent);
  text-shadow: var(--glow-accent-md);
}
main .subtitle {
  color: var(--text-subtle);
  font-size: var(--fs-base);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  margin-bottom: var(--sp-10);
}
main h2 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-tight);
  margin: var(--sp-9) 0 var(--sp-5);
  color: var(--text-strong);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--sp-2);
}
main p {
  font-family: var(--ff-body);
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  margin-bottom: var(--sp-5);
}
main ol li, main ul.cyber li {
  font-family: var(--ff-body);
}
main strong { color: var(--text); font-weight: var(--fw-medium); }
main a.inline { color: var(--accent); }

/* ─── Bullet / ordered lists ─────────────────────────────────────── */
main ol { padding-left: 22px; margin-bottom: var(--sp-5); }
main ol li {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}
main ul.cyber {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-5);
}
main ul.cyber li {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  padding-left: var(--sp-7);
  position: relative;
  margin-bottom: var(--sp-2);
}
main ul.cyber li::before {
  content: '›';
  position: absolute;
  left: var(--sp-1);
  color: var(--accent);
  font-weight: var(--fw-semibold);
}

/* ─── Inline keycap ──────────────────────────────────────────────── */
.key {
  display: inline-block;
  color: var(--text);
  background: var(--bg-code);
  padding: 2px var(--sp-3);
  border-radius: var(--radius);
  font-family: var(--ff-mono);
  font-size: var(--fs-base);
  border: 1px solid var(--border-strong);
  margin: 0 2px;
}

/* ─── Back home button ───────────────────────────────────────────── */
.back-home {
  display: inline-block;
  margin-top: var(--sp-9);
  font-size: var(--fs-base);
  color: var(--accent);
  text-decoration: none;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  border: 1px solid var(--accent);
  padding: var(--sp-3) var(--sp-7);
  border-radius: var(--radius);
  box-shadow: var(--glow-accent);
  transition: all var(--t-base);
}
.back-home:hover {
  background: var(--accent-bg);
  box-shadow: var(--glow-accent-lg);
}

/* ─── Site footer ────────────────────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: center;
  gap: var(--sp-7);
  flex-wrap: wrap;
  padding: var(--sp-6);
  border-top: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-subtle);
  letter-spacing: var(--ls-normal);
  background: var(--bg-elev);
}
.site-footer a { color: var(--text-subtle); text-decoration: none; }
.site-footer a:hover { color: var(--text-muted); text-decoration: underline; }

.copyright-bar {
  text-align: center;
  padding: var(--sp-4) var(--sp-6);
  font-size: var(--fs-xs);
  letter-spacing: var(--ls-wide);
  color: var(--text-faint);
  background: var(--bg-elev);
  border-top: 1px solid var(--border-subtle);
}

/* ─── Sticky table of contents (long legal pages) ────────────────── */
.toc {
  position: sticky;
  top: calc(80px + var(--sp-5));
  font-size: var(--fs-sm);
  line-height: var(--lh-loose);
  padding: var(--sp-5);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.toc-title {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--text-subtle);
  margin-bottom: var(--sp-3);
  font-family: var(--ff-brand);
  font-weight: var(--fw-medium);
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: var(--sp-2); }
.toc a {
  color: var(--text-muted);
  text-decoration: none;
  display: block;
  padding: 2px var(--sp-2);
  border-left: 2px solid transparent;
  transition: all var(--t-fast);
}
.toc a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-bg-subtle);
}
main.with-toc {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--sp-9);
  max-width: 1100px;
  align-items: start;
}
@media (max-width: 900px) {
  main.with-toc { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; margin-bottom: var(--sp-7); }
}
main.with-toc h1, main.with-toc .subtitle, main.with-toc h2,
main.with-toc p, main.with-toc ul, main.with-toc ol,
main.with-toc .back-home { grid-column: 2; }
@media (max-width: 900px) {
  main.with-toc > * { grid-column: 1; }
}

/* ─── Generic ghost button (cookie settings, etc.) ───────────────── */
.btn-ghost {
  display: inline-block;
  padding: var(--sp-2) var(--sp-6);
  font-family: inherit;
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-normal);
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  text-transform: uppercase;
}
.btn-ghost:hover { background: var(--accent-bg); }
