/* ─────────────────────────────────────────────────────────────
   Impressum, Datenschutz & AGB: a white reading sheet on the blue page
   ───────────────────────────────────────────────────────────── */
.legal-page { --l-ink: #0a1a4d; --l-tone: #4a5580; --l-line: rgba(1, 51, 204, 0.14); }

/* only the version for the current language is shown */
html:not([lang="de"]) .legal-doc[data-doc="de"],
html[lang="de"] .legal-doc[data-doc="en"] { display: none; }

.legal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 65px) clamp(20px, 3.9vw, 59px) 40px clamp(20px, 6.7vw, 101px);
}
.legal-top .lang-switch { position: relative; top: auto; right: auto; }

.legal-sheet {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 6vw, 72px) 72px;
  border-radius: 36px;
  background: var(--white);
  color: var(--l-ink);
}
@media (max-width: 940px) { .legal-sheet { margin: 0 12px; border-radius: 28px; } }

.legal-back {
  display: inline-flex;
  gap: 8px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.legal-back:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }

.legal-nav {
  position: sticky;
  top: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  margin: 24px 0 8px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1.5px var(--blue);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.legal-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
}
.legal-nav a:hover { background: rgba(1, 51, 204, 0.08); }
.legal-nav a[aria-current] { background: var(--blue); color: var(--white); }
@media (max-width: 560px) {
  /* one tidy row on phones; scrolls sideways if it ever doesn't fit */
  .legal-nav { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .legal-nav::-webkit-scrollbar { display: none; }
  .legal-nav a { flex-shrink: 0; padding: 8px 12px; font-size: 14px; white-space: nowrap; }
}

.legal-section { padding-top: 48px; scroll-margin-top: 64px; }
.legal-section + .legal-section { margin-top: 32px; border-top: 1px solid var(--l-line); }
.legal-section h1 {
  color: var(--blue);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.legal-section h2 { margin-top: 32px; font-size: 19px; font-weight: 700; letter-spacing: -0.005em; }
.legal-section p, .legal-section li { margin-top: 10px; font-size: 16px; line-height: 1.6; }
.legal-section ol { margin-top: 6px; padding-left: 22px; }
.legal-section li::marker { color: var(--l-tone); }
.legal-section a { color: var(--blue); text-underline-offset: 2px; overflow-wrap: anywhere; }
.legal-lead { margin-top: 16px !important; font-size: 18px !important; color: var(--l-tone); }
.legal-date { margin-top: 32px !important; font-size: 14px !important; color: var(--l-tone); }
.legal-note {
  margin-top: 24px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(1, 51, 204, 0.07);
  font-size: 14px;
  color: var(--l-tone);
}

/* Still to fill in before going live */
mark.todo { padding: 0 4px; border-radius: 4px; background: #ffe45c; color: #3a2d00; }

.legal-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  padding: 32px clamp(20px, 6vw, 72px) 48px;
  font-size: 15px;
}
.legal-foot a { color: inherit; }
