/*
 * BC Legal Pages — regulaminy, polityka prywatności
 * Scope: .bc-legal-page (body class on IDs 41149, 41151, 41158, 3)
 * Note: #brx-content IS the article — style directly on it, not on article.hentry
 */

/* ── Override Bricks content area for legal pages ── */
.bc-legal-page #brx-content.page {
  max-width: 860px !important;
  /* Keep Bricks' 131px header offset, override only side/bottom */
  padding-top: 131px !important;
  padding-right: clamp(24px, 5vw, 64px) !important;
  padding-bottom: 80px !important;
  padding-left: clamp(24px, 5vw, 64px) !important;
  box-sizing: border-box;
}

/* ── Unhide h1 (bricks-overrides hides it globally on .page) ── */
.bc-legal-page #brx-content.page > h1:first-child,
.bc-legal-page article.page > h1:first-child {
  display: block !important;
  font-family: var(--font-h, 'NTVanilla', serif);
  font-size: clamp(22px, 5.5vw, 40px);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bc-dark, #393029);
  margin: 40px 0 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--bc-cream-dark, #E8E2DA);
  line-height: 1.2;
}

/* ── Section headings h2 (polityka prywatności) ── */
.bc-legal-page #brx-content h2 {
  font-family: var(--font-h, 'NTVanilla', serif);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bc-brown, #B0947E);
  margin: 2.4em 0 0.8em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bc-cream-dark, #E8E2DA);
}

/* ── Sub-headings h3 ── */
.bc-legal-page #brx-content h3 {
  font-family: var(--font-b, 'Clarity City', sans-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bc-dark-light, #6E5B4C);
  margin: 2em 0 0.6em;
}

/* ── Body text ── */
.bc-legal-page #brx-content p {
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 1em;
  color: var(--bc-dark, #393029);
}

/* ── Root-level ol (regulamin kliniki: numbered sections) ── */
.bc-legal-page #brx-content > ol {
  padding-left: 0;
  margin: 0 0 1.4em;
  list-style: none;
  counter-reset: bc-ol-counter;
}

.bc-legal-page #brx-content > ol > li {
  counter-increment: bc-ol-counter;
  position: relative;
  padding: 14px 0 14px 48px;
  border-bottom: 1px solid var(--bc-cream-dark, #E8E2DA);
  font-size: 15px;
  line-height: 1.75;
}

.bc-legal-page #brx-content > ol > li:last-child {
  border-bottom: none;
}

.bc-legal-page #brx-content > ol > li::before {
  content: counter(bc-ol-counter);
  position: absolute;
  left: 0;
  top: 15px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bc-cream-dark, #E8E2DA);
  color: var(--bc-dark-light, #6E5B4C);
  font-family: var(--font-b, 'Clarity City', sans-serif);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Root-level ul (regulaminy bonu/karnetu) ── */
.bc-legal-page #brx-content > ul {
  padding-left: 0;
  margin: 0 0 1.4em;
  list-style: none;
}

.bc-legal-page #brx-content > ul > li {
  position: relative;
  padding: 12px 0 12px 24px;
  border-bottom: 1px solid var(--bc-cream-dark, #E8E2DA);
  font-size: 15px;
  line-height: 1.75;
}

.bc-legal-page #brx-content > ul > li:last-child {
  border-bottom: none;
}

.bc-legal-page #brx-content > ul > li::before {
  content: '–';
  position: absolute;
  left: 0;
  top: 13px;
  color: var(--bc-brown, #B0947E);
  font-weight: 600;
  font-size: 15px;
}

/* ── Nested ul inside ol > li ── */
.bc-legal-page #brx-content li > ul {
  margin: 10px 0 4px;
  padding-left: 0;
  list-style: none;
}

.bc-legal-page #brx-content li > ul > li {
  position: relative;
  padding: 4px 0 4px 18px;
  font-size: 14px;
  line-height: 1.65;
  border-bottom: none;
}

.bc-legal-page #brx-content li > ul > li::before {
  content: '–';
  position: absolute;
  left: 0;
  top: 5px;
  color: var(--bc-brown, #B0947E);
  font-size: 13px;
  background: none;
  width: auto;
  height: auto;
  border-radius: 0;
}

/* ── Nested ol inside ol > li (polityka: sub-numbered lists) ── */
.bc-legal-page #brx-content li > ol {
  margin: 10px 0 4px;
  padding-left: 0;
  list-style: decimal;
  padding-left: 20px;
}

.bc-legal-page #brx-content li > ol > li {
  font-size: 14px;
  line-height: 1.65;
  padding: 3px 0;
  border-bottom: none;
}

.bc-legal-page #brx-content li > ol > li::before {
  display: none;
}

/* ── strong in content ── */
.bc-legal-page #brx-content li strong,
.bc-legal-page #brx-content p strong {
  font-weight: 600;
  color: var(--bc-dark, #393029);
}

/* ── Table of Contents (JS-injected, regulamin kliniki only) ── */
.bc-legal-toc {
  margin: 28px 0 40px;
  padding: 22px 28px;
  background: var(--bc-cream, #F7F4EF);
  border-left: 3px solid var(--bc-brown, #B0947E);
  border-radius: 0 8px 8px 0;
}

.bc-legal-toc-title {
  font-family: var(--font-b, 'Clarity City', sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bc-dark-light, #6E5B4C);
  margin-bottom: 14px;
}

.bc-legal-toc-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: grid;
  gap: 8px;
  counter-reset: none;
}

.bc-legal-toc-list > li {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 0 !important;
  border: none !important;
  font-size: 14px;
  line-height: 1.5;
  counter-increment: none;
}

/* Override global ol > li::before for toc items */
.bc-legal-toc-list > li::before {
  display: none !important;
}

.bc-toc-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bc-brown, #B0947E);
  color: #fff;
  font-family: var(--font-b, 'Clarity City', sans-serif);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.bc-legal-toc-list a {
  color: var(--bc-dark, #393029);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.5;
  transition: color 0.2s;
}

.bc-legal-toc-list a:hover {
  color: var(--bc-brown, #B0947E);
}

/* ── bc-section-num spans (JS-injected) — hidden, CSS counter handles it ── */
.bc-section-num {
  display: none;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .bc-legal-page #brx-content.page {
    padding-top: 131px !important;
    padding-right: 20px !important;
    padding-bottom: 64px !important;
    padding-left: 20px !important;
  }

  .bc-legal-toc {
    padding: 16px 16px;
  }

  .bc-legal-page #brx-content > ol > li {
    padding-left: 40px;
  }

  .bc-legal-page #brx-content > ol > li::before {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
}

/* ── Callout box (procedury sanitarne: MIŁO NAM BĘDZIE...) ── */
.bc-legal-page .bc-legal-callout {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--bc-cream, #F7F4EF);
  border-left: 3px solid var(--bc-brown, #B0947E);
  border-radius: 0 8px 8px 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--bc-dark, #393029);
}

/* ── Indent paragraphs (wywiad epidemiologiczny: pytania pomocnicze) ── */
.bc-legal-page .bc-legal-indent {
  padding-left: 28px;
  font-size: 14px;
  color: var(--bc-dark-light, #6E5B4C);
  margin: 4px 0 4px;
}
