/* ============================================================
   LEGAL PAGES — Impressum & Datenschutz
   Shares all base styles from styles.css, adds layout for
   long-form text content.
   ============================================================ */

/* Offset content below fixed nav and give the page some air */
.legal-hero {
  padding: calc(var(--section-pad) + 2rem) 0 calc(var(--section-pad) * 0.6);
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--cream) 100%);
  position: relative;
  overflow: hidden;
}

.legal-hero .container {
  position: relative;
  z-index: 2;
}

.legal-hero .section-label {
  margin-bottom: 1rem;
}

.legal-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.legal-hero h1 .text-accent {
  color: var(--blue-600);
  font-style: italic;
}

.legal-hero .legal-lead {
  font-size: 1.1rem;
  color: var(--gray-600);
  max-width: 620px;
  line-height: 1.7;
}

/* Soft decorative blob in the legal hero */
.legal-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 380px;
  height: 380px;
  background: var(--blue-100);
  border-radius: 60% 40% 50% 50% / 50% 60% 40% 50%;
  opacity: 0.6;
  z-index: 0;
  animation: morphBlob 10s ease-in-out infinite;
}
.legal-hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -60px;
  width: 200px;
  height: 200px;
  background: var(--amber-100);
  border-radius: 50% 60% 40% 55% / 45% 50% 60% 40%;
  opacity: 0.5;
  z-index: 0;
}

/* ---------- LEGAL CONTENT LAYOUT ---------- */
.legal-content {
  padding: 0 0 var(--section-pad);
  background: var(--cream);
  position: relative;
}

.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 4rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

/* Sticky table of contents */
.legal-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  font-size: 0.9rem;
}

.legal-toc h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue-500);
  margin-bottom: 1rem;
  padding-left: 2rem;
  position: relative;
}
.legal-toc h4::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1.25rem;
  height: 2px;
  background: var(--blue-400);
  transform: translateY(-50%);
}

.legal-toc ol {
  list-style: none;
  counter-reset: toc;
  border-left: 1px solid var(--blue-200);
  padding-left: 0;
}

.legal-toc ol li {
  counter-increment: toc;
  margin: 0;
}

.legal-toc ol li a {
  display: block;
  padding: 0.55rem 0 0.55rem 1rem;
  color: var(--gray-600);
  font-size: 0.9rem;
  line-height: 1.35;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: all 0.25s ease;
}
.legal-toc ol li a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--blue-400);
  margin-right: 0.6rem;
  font-size: 0.75rem;
}
.legal-toc ol li a:hover,
.legal-toc ol li a.active {
  color: var(--blue-700);
  border-left-color: var(--blue-500);
}

/* ---------- LEGAL TEXT ---------- */
.legal-body {
  max-width: 720px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--gray-700);
}

.legal-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  color: var(--gray-900);
  margin: 3.5rem 0 1.25rem;
  scroll-margin-top: 100px;
  position: relative;
  padding-left: 1.5rem;
}
.legal-body h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--blue-400);
  transform: translateY(-50%);
}
.legal-body h2:first-of-type { margin-top: 0; }

.legal-body h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--blue-800);
  margin: 2rem 0 0.75rem;
}

.legal-body h4 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 1.5rem 0 0.5rem;
}

.legal-body p {
  margin-bottom: 1rem;
}

.legal-body ul {
  list-style: none;
  margin: 0.5rem 0 1.25rem;
  padding-left: 0;
}
.legal-body ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}
.legal-body ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue-300);
}

.legal-body a {
  color: var(--blue-600);
  border-bottom: 1px solid var(--blue-200);
  transition: all 0.25s ease;
  word-break: break-word;
}
.legal-body a:hover {
  color: var(--blue-800);
  border-bottom-color: var(--blue-600);
}

/* Address / contact card block */
.legal-card {
  background: var(--white);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: 1.25rem 0;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.legal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 2rem;
  width: 40px;
  height: 3px;
  background: var(--blue-400);
  border-radius: 0 0 3px 3px;
}
.legal-card strong {
  display: block;
  font-family: var(--font-display);
  color: var(--gray-900);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}
.legal-card p {
  margin-bottom: 0.35rem;
  color: var(--gray-700);
}
.legal-card .legal-card-row {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--blue-100);
  font-size: 0.95rem;
}
.legal-card .legal-card-row:first-of-type {
  margin-top: 0.35rem;
  padding-top: 0;
  border-top: 0;
}
.legal-card .legal-card-row span:first-child {
  color: var(--gray-500);
  min-width: 90px;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

/* Back-to-home link at the end */
.legal-footer-link {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--blue-100);
}
.legal-footer-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blue-600);
  border: none;
  transition: gap 0.25s ease, color 0.25s ease;
}
.legal-footer-link a:hover {
  gap: 0.85rem;
  color: var(--blue-800);
}
.legal-footer-link a svg {
  width: 18px;
  height: 18px;
}

/* Fine-print updated date */
.legal-updated {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--gray-500);
  background: var(--blue-50);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  margin-top: 1.25rem;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .legal-toc {
    position: static;
    order: 2;
    padding-top: 2rem;
    border-top: 1px solid var(--blue-100);
  }
  .legal-body {
    order: 1;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .legal-hero::before { width: 240px; height: 240px; }
  .legal-body h2 { padding-left: 1.25rem; }
}
.footer-credit {
  font-size: 0.75rem;
  opacity: 0.5;
  margin-top: 0.5rem;
}
.footer-credit a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.3);
  transition: opacity 0.2s;
}
.footer-credit a:hover { opacity: 1; }

.made-by-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  background: rgba(10, 49, 86, 0.04);
  border: 1px solid rgba(10, 49, 86, 0.1);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--color-text-muted, #666);
}
.made-by-card span { font-size: 1.5rem; }
.made-by-card strong { display: block; color: var(--color-text, #333); }
.made-by-card a { color: var(--color-primary, #0a3156); font-weight: 600; text-decoration: none; }
.made-by-card a:hover { text-decoration: underline; }