/* Shared styles for the legal pages (imprint.html, privacy.html).
   Same tokens and light/dark behaviour as the homepage. */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: light;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --ink: #111111;
  --text: #2b2b2b;
  --muted: #6f6f6f;
  --line: #e4e4e4;
  --accent: #f8ec63;
  --bg: #ffffff;
  --todo-bg: #f8ec63;
  --todo-fg: #111111;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #f5f5f5;
    --text: #d6d6d6;
    --muted: #9a9a9a;
    --line: #2c2c2c;
    --bg: #141414;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f5f5f5;
  --text: #d6d6d6;
  --muted: #9a9a9a;
  --line: #2c2c2c;
  --bg: #141414;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 3rem;
  border-bottom: 1px solid var(--line);
}

.top a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.top .back {
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--muted);
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 4rem 3rem 5rem;
}

h1 {
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

h1 span {
  background: linear-gradient(transparent 55%, var(--accent) 55%, var(--accent) 92%, transparent 92%);
  color: #111111;
  padding: 0 0.1em;
}

:root[data-theme="dark"] h1 span {
  color: var(--ink);
  background: none;
  box-shadow: inset 0 -0.35em 0 rgba(248, 236, 99, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) h1 span {
    color: var(--ink);
    background: none;
    box-shadow: inset 0 -0.35em 0 rgba(248, 236, 99, 0.35);
  }
}

.updated {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 3rem;
}

h2 {
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.3;
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

h3 {
  color: var(--ink);
  font-size: 1rem;
  margin: 1.5rem 0 0.4rem;
}

p,
ul,
address,
dl {
  margin-bottom: 1rem;
}

ul {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.35rem;
}

address {
  font-style: normal;
}

a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

strong {
  color: var(--ink);
}

dl {
  display: grid;
  grid-template-columns: minmax(9rem, max-content) 1fr;
  gap: 0.4rem 1.5rem;
}

dt {
  color: var(--muted);
}

dd {
  color: var(--text);
}

/* Details still to be filled in before going live */
.todo {
  background: var(--todo-bg);
  color: var(--todo-fg);
  padding: 0 0.25em;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--ink);
}

footer {
  padding: 1.75rem 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  font-size: 0.875rem;
  color: var(--muted);
}

footer .legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

footer .legal a,
footer .legal button {
  color: inherit;
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

footer .legal a:hover,
footer .legal button:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 600px) {
  .top,
  footer {
    padding: 1.1rem 1rem;
  }

  main {
    padding: 2.5rem 1rem 4rem;
  }

  dl {
    grid-template-columns: 1fr;
    gap: 0 0;
  }

  dd {
    margin-bottom: 0.6rem;
  }
}
