/* ============================================================
   Legal page styles (Regulamin / Privacy)
   ============================================================ */

.legal-hero {
  position: relative;
  padding: 160px 0 60px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.legal-hero .bg-photo {
  right: -10%;
  top: 0;
  width: 45%;
  height: 100%;
}
.legal-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.legal-hero h1 {
  font-size: clamp(36px, 4.5vw, 64px);
  margin-top: 20px;
  margin-bottom: 14px;
}
.legal-hero p {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 56ch;
}
.legal-meta {
  display: grid;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.legal-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.legal-meta-row b {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.legal-meta-row .badge {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(197,240,44,0.2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* Reading progress bar */
.legal-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--accent);
  width: 0%;
  z-index: 100;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 80ms linear;
}

/* Layout — sticky TOC + content */
.legal-section {
  padding: 80px 0 120px;
}
/* `overflow-x: hidden` on body (set by main stylesheet) creates a scroll
   container that breaks position: sticky on descendants in some browsers.
   `overflow-x: clip` does the same visual job without spawning a scroll
   context, so sticky works. */
html, body { overflow-x: clip; }

.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 60px;
  align-items: start;
}
.legal-layout > aside {
  position: sticky;
  top: 90px;
  align-self: start;
}
@media (max-width: 760px) {
  .legal-layout { grid-template-columns: 1fr; gap: 32px; }
  .legal-layout > aside { position: static; }
}

/* TOC */
.legal-toc {
  display: grid;
  gap: 14px;
}
.legal-toc h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.legal-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
  counter-reset: toc;
  border-left: 1px solid var(--border);
}
.legal-toc li {
  position: relative;
  counter-increment: toc;
}
.legal-toc a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px;
  padding: 8px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}
.legal-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  padding-top: 1px;
}
.legal-toc a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.02);
}
.legal-toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}
.legal-toc a.active::before { color: var(--accent); }

@media (max-width: 980px) {
  .legal-toc { position: static; }
}

/* Article */
.legal-article {
  max-width: 780px;
}
.legal-article > section {
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 64px;
}
.legal-article > section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Section heading — badge above title for breathing room */
.legal-article h2 {
  font-size: clamp(26px, 2.6vw, 34px);
  margin: 0 0 32px;
  letter-spacing: -0.015em;
  line-height: 1.15;
  scroll-margin-top: 100px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.legal-article h2 .sec-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(197,240,44,0.25);
  padding: 5px 12px;
  border-radius: 6px;
  letter-spacing: 0.06em;
  line-height: 1;
}

/* Numbered clauses — hanging indent via position, not grid */
.legal-article ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: clause;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.legal-article ol > li {
  counter-increment: clause;
  position: relative;
  padding-left: 44px;
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.7;
}
.legal-article ol > li::before {
  content: counter(clause, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  background: rgba(197,240,44,0.06);
  border: 1px solid rgba(197,240,44,0.18);
  padding: 3px 7px;
  border-radius: 4px;
  line-height: 1;
}

/* Nested bullet lists inside a clause */
.legal-article ol > li ul {
  list-style: none;
  margin: 14px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legal-article ol > li ul li {
  position: relative;
  padding-left: 18px;
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
}
.legal-article ol > li ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}

/* Paragraphs and inline styles */
.legal-article p {
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.7;
}
.legal-article p + p { margin-top: 14px; }
.legal-article strong { color: var(--text); font-weight: 600; }
.legal-article a {
  color: var(--accent);
  border-bottom: 1px dashed rgba(197,240,44,0.4);
  padding-bottom: 1px;
  transition: color 180ms ease, border-color 180ms ease;
}
.legal-article a:hover { color: var(--accent-hot); border-color: var(--accent); }
.legal-article em {
  font-style: normal;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.94em;
  border: 1px solid var(--border-2);
}

@media (max-width: 560px) {
  .legal-article ol > li { padding-left: 36px; font-size: 15px; }
  .legal-article ol > li::before { font-size: 10px; padding: 2px 6px; }
  .legal-article h2 { margin-bottom: 24px; }
}

/* Print button */
.legal-actions {
  margin-top: 24px;
  display: flex;
  gap: 8px;
}
.legal-actions .btn {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

/* Print styles */
@media print {
  body { background: white; color: black; }
  .nav, .footer, .legal-progress, .legal-toc, .legal-actions, .bg-photo { display: none !important; }
  .legal-section { padding: 0; }
  .legal-layout { display: block; }
  .legal-article { max-width: none; color: black; }
  .legal-article h2, .legal-article ol > li, .legal-article p { color: black; }
  .legal-article a { color: black; }
}