/* =============================================================
   BodyTop — dokumenty.css
   Wspólny arkusz trzech stron dokumentów prawnych:
   regulamin.html, polityka-prywatnosci.html, regulamin-studia.html.

   Układ: przyklejony spis treści + kolumna tekstu o ograniczonej
   szerokości (ok. 70 znaków w wierszu — długie akapity prawne
   czyta się źle na pełnej szerokości kontenera).
   Konwencja kolorów jak w reszcie serwisu: --accent na stany
   normalne, --accent-active (żółty) wyłącznie na :focus/:active.
   CACHE-BUSTING: po KAŻDEJ zmianie w tym pliku podbij ?v=N przy odwołaniach
   we wszystkich .html oraz w includes/layout.php — CDN trzyma CSS 7 dni
   i bez tego powracający odwiedzający zobaczą starą wersję.
   ============================================================= */

.doc-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

/* top: 100px — wysokość przyklejonego headera (76px) plus oddech. */
.doc-toc {
  position: sticky;
  top: 100px;
  border-left: 2px solid var(--line);
  padding-left: 1.1rem;
}

.doc-toc h2 {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.doc-toc li {
  margin-bottom: 0.55rem;
}

.doc-toc a {
  display: block;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.4;
  transition: color 0.15s ease;
}

.doc-toc a:hover {
  color: var(--accent);
}

.doc-toc a:focus-visible {
  outline: 2px solid var(--accent-active);
  outline-offset: 3px;
}

.doc {
  max-width: 70ch;
}

/* base.css ogranicza każdy <p> do 62ch — w dokumencie o szerokości
   pilnuje już .doc, więc akapity mają wypełniać kolumnę. */
.doc p {
  max-width: none;
}

.doc a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}

.doc a:hover {
  color: var(--accent);
}

.doc a:focus-visible {
  outline: 2px solid var(--accent-active);
  outline-offset: 2px;
}

.doc-meta {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  padding: 1.5rem 1.6rem;
  margin-bottom: clamp(2rem, 4vw, 2.8rem);
}

.doc-meta dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.5rem 1.4rem;
}

.doc-meta dt {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  padding-top: 0.3rem;
}

.doc-meta dd {
  color: var(--text);
}

/* scroll-margin-top — kotwica ze spisu treści nie może wjechać
   pod przyklejony header. */
.doc-section {
  margin-bottom: clamp(2.2rem, 4vw, 3.2rem);
  scroll-margin-top: 100px;
}

.doc-section > h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.2rem;
}

.doc-sec-num {
  color: var(--accent);
  margin-right: 0.45em;
}

.doc-section > p {
  margin-bottom: 0.9rem;
}

.doc-section > p:last-child {
  margin-bottom: 0;
}

.doc-clauses li {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr);
  margin-bottom: 0.85rem;
}

.doc-clauses li:last-child {
  margin-bottom: 0;
}

.doc-num {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
  padding-top: 0.1rem;
}

.doc-sublist {
  grid-column: 2;
  margin-top: 0.6rem;
}

.doc-sublist li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  margin-bottom: 0.5rem;
}

.doc-sublist li:last-child {
  margin-bottom: 0;
}

.doc-sublist .doc-num {
  font-size: 0.9rem;
}

.doc-bullets li {
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: 0.55rem;
}

.doc-bullets li:last-child {
  margin-bottom: 0;
}

.doc-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 0.6rem;
  height: 2px;
  background: var(--accent);
}

.doc-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  padding: clamp(1.5rem, 3vw, 2.1rem);
  margin-top: clamp(2rem, 4vw, 2.8rem);
  scroll-margin-top: 100px;
}

.doc-form > h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  margin-bottom: 0.5rem;
}

.doc-form-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.6rem;
}

.doc-form-addr {
  font-style: normal;
  line-height: 1.7;
  border-left: 2px solid var(--line);
  padding-left: 1rem;
  margin-bottom: 1.6rem;
}

.doc-form-label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.4rem;
}

.doc-form-fields li {
  margin-bottom: 1.1rem;
}

.doc-form-fields li:last-child {
  margin-bottom: 0;
}

.doc-fill {
  display: block;
  height: 1.7rem;
  border-bottom: 1px dashed #4d4d4d;
}

.doc-fill--tall {
  height: 3.4rem;
}

.doc-footnote {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1.4rem;
}

.doc-note {
  border-left: 3px solid var(--accent);
  background: rgba(255, 115, 0, 0.06);
  padding: 1rem 1.2rem;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.doc-note strong {
  color: var(--text);
}

.doc-updated {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }

  .doc-toc {
    position: static;
    border-left: 0;
    border-top: 2px solid var(--line);
    padding-left: 0;
    padding-top: 1.2rem;
  }

  .doc-toc ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.4rem;
  }

  .doc-toc li {
    margin-bottom: 0;
  }

  .doc {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .doc-meta dl {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .doc-meta dt {
    padding-top: 0.7rem;
  }

  .doc-meta dt:first-child {
    padding-top: 0;
  }

  .doc-clauses li {
    grid-template-columns: 2.7rem minmax(0, 1fr);
  }
}

@media print {
  .site-header,
  .site-footer,
  .doc-toc,
  .page-hero .stripe {
    display: none;
  }

  .doc-layout {
    display: block;
  }

  .doc {
    max-width: none;
  }

  .doc-meta,
  .doc-form,
  .doc-note {
    background: none;
  }

  .doc-section {
    break-inside: avoid;
  }
}
