/*
 * Tikado legal page: layout only. Tokens and fonts come from tokens.css (load it first).
 * No inline style, no external resource: compatible with a strict CSP (style-src 'self').
 *
 * Created by Kévin Naudin on 2026-11-15.
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; --hd: 64px; --toc: 52px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); font-size: 1rem; line-height: 1.6; overflow-wrap: break-word; }
img { display: block; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }

a { color: var(--redtx); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 3px solid var(--redtx); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: 12px; top: -80px; z-index: 30; padding: 12px 16px; background: var(--s1); color: var(--ink); border-radius: 12px; box-shadow: var(--e2); }
.skip:focus { top: 8px; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; height: var(--hd); background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand, .home { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.brand { text-decoration: none; }
.brand img { border-radius: 8px; }
.wm { font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -.01em; color: var(--redtx); }
.home { padding: 0 4px; font-family: var(--display); font-weight: 600; }

/* In-page navigation: horizontal bar under the header on mobile, side column on desktop */
.toc { position: sticky; top: var(--hd); z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.toc ul { list-style: none; margin: 0 auto; padding: 4px 20px; max-width: 1040px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.toc ul::-webkit-scrollbar { display: none; }
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 22px; white-space: nowrap; text-decoration: none; color: var(--grey); font-family: var(--display); font-weight: 600; font-size: .9375rem; }
.toc a:hover { color: var(--ink); }
.toc a[aria-current="true"] { background: var(--tint); color: var(--redtx); }

.layout { display: block; padding-top: 0; padding-bottom: 48px; }
.layout > .toc { margin: 0 -20px; width: calc(100% + 40px); }
main { min-width: 0; max-width: 70ch; margin: 0 auto; padding-top: 24px; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; margin: 0; color: var(--ink); }
h1 { font-size: 1.875rem; line-height: 1.2; margin-bottom: 8px; }
h2 { font-size: 1.5rem; line-height: 1.25; }
h3 { font-size: 1.125rem; line-height: 1.3; margin-bottom: 12px; }
.part { scroll-margin-top: calc(var(--hd) + var(--toc) + 16px); padding-top: 32px; }
.part > p:first-of-type { margin: 6px 0 20px; color: var(--grey); font-size: .9375rem; }
.blocks { display: flex; flex-direction: column; gap: 16px; }
.blk { padding: 20px; border-radius: 24px; background: var(--s1); box-shadow: var(--e1); border: 1px solid var(--line); }
.blk p { margin: 0 0 12px; }
.blk p:last-child, .blk ul:last-child, .blk ol:last-child { margin-bottom: 0; }
.blk ul, .blk ol { margin: 0 0 12px; padding-left: 1.25rem; }
.blk li + li { margin-top: 8px; }
.blk li::marker { color: var(--grey); }
.blk em { font-style: italic; }

/* Wide content scrolls inside its own box instead of the page */
table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
th, td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; }

.foot { border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: .875rem; color: var(--grey); }
.foot p { margin: 0 0 8px; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }

@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 48px; align-items: start; }
  .layout > .toc { position: sticky; top: calc(var(--hd) + 24px); margin: 24px 0 0; width: auto; border: 0; background: transparent; }
  .toc ul { flex-direction: column; padding: 0; overflow: visible; gap: 2px; }
  .toc a { border-radius: 12px; }
  main { margin: 0; }
  html { --toc: 0px; }
  h1 { font-size: 2.25rem; }
  .blk { padding: 24px; }
}
