/* Legal pages (privacy, terms, imprint) — a readable prose surface layered on
   top of style.css, which supplies the palette, header and footer. */

.legal {
  padding: 120px 0 4rem;
}

.legal-sheet {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.12);
}

html.dark .legal-sheet {
  background: #1f1f1f;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.4);
}

.legal-sheet h1 {
  font-size: 2rem;
  color: #2d5a3d;
  margin-bottom: 0.5rem;
}

.legal-sheet h2 {
  font-size: 1.35rem;
  color: #2d5a3d;
  margin: 2.5rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.legal-sheet h3 {
  font-size: 1.05rem;
  color: #35443c;
  margin: 1.5rem 0 0.5rem;
}

html.dark .legal-sheet h1,
html.dark .legal-sheet h2 {
  color: #89c9a4;
}

html.dark .legal-sheet h3 {
  color: #d0f3de;
}

html.dark .legal-sheet h2 {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* The first heading opens the document — no rule above it. */
.legal-sheet h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.legal-sheet p,
.legal-sheet li {
  margin-bottom: 0.75rem;
  color: #444;
}

html.dark .legal-sheet p,
html.dark .legal-sheet li {
  color: #ccc;
}

.legal-sheet ul,
.legal-sheet ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-sheet a {
  color: #2d5a3d;
  text-decoration: underline;
}

html.dark .legal-sheet a {
  color: #89c9a4;
}

.legal-lead {
  font-size: 1.05rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: #f2f8f4;
  border-left: 4px solid #5a9d7a;
  border-radius: 0 6px 6px 0;
}

html.dark .legal-lead {
  background: #263028;
}

.legal-meta {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 2rem;
}

html.dark .legal-meta {
  color: #999;
}

/* Records stand in for what would otherwise be wide tables. A four-column row
   cannot be read on a phone at any font size, and scrolling sideways is not
   reading — so each record is a title with its facts below it.

   The labels are deliberately quiet: small, spaced capitals in a muted tone.
   They name the field, they are not part of what you read, and setting them in
   bold would give them the same weight as the content — which is what makes a
   dense list of records unscannable. The value column carries the reading. */
.entry {
  margin-top: 1.75rem;
}

.entry + .entry {
  padding-top: 1.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

html.dark .entry + .entry {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.legal-sheet .entry h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: #2d5a3d;
}

html.dark .legal-sheet .entry h3 {
  color: #89c9a4;
}

/* Label column wide enough for the longest field name, so the values line up
   and the eye can run down them. */
.legal-sheet dl {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  column-gap: 1.5rem;
  row-gap: 0.5rem;
  margin: 0 0 1.5rem;
}

.legal-sheet .entry dl {
  margin-bottom: 0;
}

.legal-sheet dt {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7b8a82;
  /* Nudged down so the small capitals sit on the value's first baseline. */
  padding-top: 0.28rem;
}

html.dark .legal-sheet dt {
  color: #8a9a92;
}

.legal-sheet dd {
  margin: 0;
  color: #444;
}

html.dark .legal-sheet dd {
  color: #ccc;
}

/* Unresolved values — must be empty before this page goes live. */
mark.todo {
  background: #ffe08a;
  color: #5a4300;
  padding: 0 0.3rem;
  border-radius: 3px;
  font-weight: 600;
}

html.dark mark.todo {
  background: #6b5310;
  color: #ffe9a8;
}

/* The bare `nav` selector in style.css (written for the header menu) lays every
   nav out as a space-between flex row, which would strand these links at the
   left edge — so the centring has to be stated in flex terms, not text-align. */
.legal-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  max-width: 820px;
  margin: 2rem auto 0;
  font-size: 0.9rem;
}

.legal-nav a {
  color: #fff;
  text-decoration: underline;
}

@media (max-width: 768px) {
  /* The header keeps its height on every width; what gives way on a narrow
     screen is the gap above the sheet, not the bar itself. */
  .legal {
    padding-top: 88px;
  }

  .legal-sheet {
    padding: 1.75rem 1.25rem;
  }

  /* No room for a label column on a phone: the label sits above its value,
     still quiet, and the pair stays a unit through the gap between them. */
  .legal-sheet dl {
    grid-template-columns: 1fr;
    row-gap: 0;
  }

  .legal-sheet dt {
    padding-top: 0.9rem;
  }

  .legal-sheet dt:first-child {
    padding-top: 0;
  }

  .legal-sheet dd {
    margin-top: 0.15rem;
  }
}

@media (max-width: 480px) {
  .legal {
    padding-top: 76px;
  }
}
