/* ============================================================================
   legal.css — /legal (the register) and /legal/{slug} (one document).
   Built from the kit (page-header, section-header, card (+ --lift, --pad,
   --sheen), spotlight, chip, notice, icon-tile, empty-state, horizon,
   callout, toc (Shared/Toc --sticky, LS.toc); layout.css: .page-top;
   prose.css: .prose for the rendered Markdown); this file lays the pages
   out. Tokens only. No page script: the table of contents, its drop-down
   and the spoilers in the text are the kit's (main.js).

   Contents
     0. Page top        .legal-top (document title size)
     1. Register        .legal-hub, .legal-note, .legal-docs, .legal-card
     2. Document layout .legal-doc-layout (+ the #legalToc column)
     3. Document text   .legal-doc__content (on top of the kit .prose)
     4. Contact band    .legal-contact (kit .callout)
   ========================================================================== */


/* ── 0. Page top ─────────────────────────────────────────────────────────────
   The kit .page-top band; the breadcrumb (Shared/Breadcrumb) opens the
   header. Document titles run long, so they take a size step down. */
/* .page-top.legal-top: beats layout.css's two-column title size (watermark header). */
.page-top.legal-top .page-header__title { max-width: 24ch; font-size: clamp(2.125rem, 4.6vw, 3.5rem); }


/* ── 1. Register ───────────────────────────────────────────────────────── */
.legal-hub__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}
.legal-note { max-width: 52rem; }

.legal-docs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--grid-gap);
  margin: 0;
}
@media (min-width: 768px) {
  .legal-docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .legal-docs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.legal-card { gap: var(--space-3); }
.legal-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.legal-card__num {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
}
.legal-card__title {
  margin: 0;
  color: var(--text-strong);
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  transition: color var(--dur-fast) var(--ease-standard);
}
.legal-card__desc {
  margin: 0;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.6;
  text-wrap: pretty;
}
.legal-card__go {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-4);
  color: var(--accent-text);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.legal-card__arrow { transition: transform var(--dur-fast) var(--ease-out); }
@media (hover: hover) and (pointer: fine) {   /* title colour + arrow nudge: mouse only (tokens.css) */
  .legal-card:hover .legal-card__title { color: var(--accent-300); }
  .legal-card:hover .legal-card__arrow { transform: translateX(2px); }
}


/* ── 2. Document layout ────────────────────────────────────────────────────
   One column; with a table of contents (Shared/Toc --sticky, #legalToc —
   shown by LS.toc once it has entries) a 17rem column on the left from
   1024px, where the kit card sticks under the header. Below 1024px the
   kit sticky "Spis treści" toggle sits above the text with its drop-down
   (and its Firefox fade-only fallback). A document without sections drops
   the nav (data-toc-empty="remove") and keeps the one column. */
.legal-doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
}
.legal-doc { min-width: 0; }
@media (min-width: 1024px) {
  .legal-doc-layout:has(> .toc:not([hidden])) {
    grid-template-columns: 17rem minmax(0, 1fr);
    align-items: start;
    gap: var(--space-16);
  }
}


/* ── 3. Document text ────────────────────────────────────────────────────
   The kit .prose (prose.css) with two document touches: a reading measure,
   and a hairline above every first-level heading (the sections the table of
   contents lists). */
.legal-doc__content { max-width: 72ch; overflow-wrap: anywhere; }
.legal-doc__content > h2 {
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}
.legal-doc__content > h2:first-child { padding-top: 0; border-top: 0; }


/* ── 4. Contact band ───────────────────────────────────────────────────── */
.legal-contact-wrap { padding-top: 0; }   /* follows a section that already has its bottom padding */
@media (min-width: 1024px) {
  .legal-contact .callout__actions { flex-direction: column; align-items: stretch; }
}
