/* The legal pages (voorwaarden, privacy, hoe-we-verdienen): long reads, so a calm column with a
   summary first and a table of contents beside it. Built on the tokens, topbar, logo, category
   chips and footer from styles.css, which these pages load first. */

.topbar__cta {
  margin-left: auto;
}

@media (max-width: 859px) {
  .topbar__cta {
    padding: 10px 14px;
    font-size: 1rem;
  }
}

@media (max-width: 379px) {
  .topbar__cta svg {
    display: none;
  }
}

/* Header: the soft green of the home page hero, with a faint pavement fading out upwards. */
.legal-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f6fcf8 0%, #e2f4e9 100%);
}

.legal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.8) 2px, transparent 2px),
    linear-gradient(90deg, rgb(255 255 255 / 0.8) 2px, transparent 2px);
  background-position: center bottom;
  background-size: 44px 44px;
  -webkit-mask-image: linear-gradient(to top, #000, transparent 75%);
  mask-image: linear-gradient(to top, #000, transparent 75%);
  pointer-events: none;
}

/* As wide as the columns below it (.legal), so the title lines up with the table of contents. */
.legal-hero__inner {
  position: relative;
  width: min(100% - 32px, 1080px);
  margin-inline: auto;
  padding: 30px 0 34px;
}

/* The three pages as chips, like the category chips above the list. */
.legal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
}

.legal-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 5px 5px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  transition: translate 0.12s, border-color 0.12s;
}

.legal-tabs a:hover {
  border-color: var(--line-2);
  translate: 0 -1px;
}

.legal-tabs a[aria-current="page"] {
  border-color: var(--green-600);
  background: var(--green-600);
  box-shadow: 0 3px 0 var(--green-800);
  color: #fff;
}

.legal-tabs a[aria-current="page"] .cat__icon {
  background: rgb(255 255 255 / 0.2);
  color: #fff;
}

.legal-hero h1 {
  margin: 0;
  font: 700 clamp(2.25rem, 5.4vw, 3.75rem)/1.04 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.legal-hero__lead {
  max-width: 36em;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.1875rem;
  font-weight: 600;
}

.legal-hero__date {
  display: inline-block;
  margin: 20px 0 0;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line-2);
  color: var(--green-700);
  font-size: 0.8125rem;
  font-weight: 800;
}

/* Summary, table of contents and the text itself. On phones they stack in that order. */
.legal {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: min(100% - 32px, 1080px);
  margin-inline: auto;
  padding: 28px 0 64px;
}

@media (min-width: 980px) {
  .legal {
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-areas:
      "toc tldr"
      "toc body";
    column-gap: 36px;
    align-items: start;
  }

  .tldr { grid-area: tldr; }
  .legal__body { grid-area: body; }

  .toc {
    position: sticky;
    top: 20px;
    grid-area: toc;
  }
}

.tldr {
  padding: 22px 24px 24px;
  border: 2px solid var(--green-100);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--green-50) 0%, var(--surface) 75%);
  box-shadow: var(--shadow);
}

.tldr h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font: 600 1.375rem/1.2 var(--display);
}

.tldr__coin {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.14), 0 2px 0 var(--gold-edge);
  color: var(--gold-edge);
  font: 700 1.25rem/1 var(--display);
}

.tldr ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tldr li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  font-weight: 700;
}

.tldr li::before {
  content: "";
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--green-600) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 8.3 2.6 2.6L12 5.4' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.toc {
  padding: 16px 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toc__title {
  margin: 0 0 8px 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc a {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.toc a:hover {
  background: var(--green-50);
  color: var(--green-700);
}

.toc--numbered li {
  counter-increment: toc;
}

.toc--numbered a::before {
  content: counter(toc);
  flex: none;
  min-width: 1.3em;
  color: var(--green-600);
  font-weight: 800;
}

@media (max-width: 979px) {
  .toc ol {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* The text. One card; sections are separated by the dashed line the bonus rows use. */
.legal__body {
  padding: 4px 32px 8px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.legal__body section {
  padding: 26px 0 16px;
  border-top: 2px dashed var(--line);
  scroll-margin-top: 16px;
}

.legal__body section:first-child {
  border-top: 0;
}

.legal__body h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  font: 600 1.5rem/1.2 var(--display);
  letter-spacing: -0.01em;
}

.legal__body h3 {
  margin: 20px 0 6px;
  font: 600 1.125rem/1.3 var(--display);
}

.legal__body p,
.legal__body ul {
  max-width: 68ch;
  margin: 0 0 12px;
}

.legal__body ul {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.legal__body ul li {
  position: relative;
  padding-left: 22px;
}

.legal__body ul li::before {
  content: "";
  position: absolute;
  top: 0.6em;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.legal__body strong {
  font-weight: 800;
}

.legal__body a {
  font-weight: 700;
  text-underline-offset: 3px;
}

/* Article numbers in the terms, tilted like the steps under "Zo werkt het". */
.art {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--green-600);
  box-shadow: 0 3px 0 var(--green-800);
  color: #fff;
  font: 700 1rem/1 var(--display);
  rotate: -4deg;
}

.legal__body section:nth-child(even) .art {
  rotate: 3deg;
}

/* Arriving through a link to a section (/voorwaarden#eigen-acties): show where you landed. */
@media (prefers-reduced-motion: no-preference) {
  .legal__body section:target h2 {
    animation: landed 1.6s ease-out;
  }
}

@keyframes landed {
  0%,
  40% {
    color: var(--green-600);
  }
}

.callout {
  max-width: 68ch;
  margin: 4px 0 14px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: var(--yellow-100);
  color: var(--yellow-700);
  font-weight: 700;
}

.callout--pink {
  background: var(--pink-100);
  color: var(--pink-700);
}

.table-wrap {
  max-width: 100%;
  margin: 4px 0 14px;
  overflow-x: auto;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
}

.legal__body table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.legal__body th,
.legal__body td {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.legal__body thead th {
  border-top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal__body code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font: 700 0.8125rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

/* Legal basis and retention under each privacy section, in the look of the facts on a bonus row. */
.basis {
  display: grid;
  gap: 8px;
  max-width: 68ch;
  margin: 6px 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.basis div {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 12px;
}

.basis dt {
  padding-top: 0.2em;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.basis dd {
  margin: 0;
  font-weight: 600;
}

/* Name and explanation side by side: the sort options and the labels. */
.defs {
  max-width: 68ch;
  margin: 4px 0 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
}

.defs div {
  display: grid;
  grid-template-columns: 11em minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 16px;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
}

.defs div:first-child {
  border-top: 0;
}

.defs dt {
  font-weight: 800;
}

.defs dd {
  margin: 0;
}

@media (max-width: 639px) {
  .basis div,
  .defs div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
}

.contact {
  max-width: 68ch;
  margin: 4px 0 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-style: normal;
  font-weight: 700;
  line-height: 1.7;
}

.back {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin: 10px 0 18px;
  padding-top: 22px;
  border-top: 2px dashed var(--line);
}

.back p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 639px) {
  .legal-hero__inner {
    padding: 22px 0 26px;
  }

  .legal-hero__lead {
    font-size: 1.0625rem;
  }

  .legal-tabs {
    margin-bottom: 20px;
  }

  .tldr {
    padding: 18px 18px 20px;
  }

  .legal__body {
    padding: 2px 18px 6px;
  }

  .legal__body h2 {
    font-size: 1.3125rem;
  }

  .art {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 0.9375rem;
  }
}

@media print {
  .topbar,
  .legal-tabs,
  .toc,
  .back,
  .footer {
    display: none;
  }

  body,
  .legal-hero {
    background: #fff;
  }

  .legal-hero::before {
    display: none;
  }

  .legal {
    display: block;
    width: auto;
    padding: 0;
  }

  .tldr,
  .legal__body {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
}
