/* Long-form legal pages: privacy policy, terms and delete data. Loaded after site.css, which supplies the footer.
   Text colours stay on --sp-content-primary, --sp-content-secondary and --kp-deep: all measure 4.5:1 or better on white. */

/* ---- Header: a bar holding the wordmark link ---- */
.legal-header {
  /* The side padding lines the wordmark up with the 1240px column the site footer uses */
  padding: 14px max(24px, calc((100% - 1240px) / 2));
  border-bottom: 1px solid var(--sp-border-soft);
}

.legal-header a {
  font-family: var(--sp-font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.legal-header a:hover {
  color: var(--kp-deep);
  text-decoration: none;
}

/* ---- Page body ---- */
main.legal {
  /* Error colours have no shared token; they are used only by the form messages. */
  --legal-danger: #b3261e;
  --legal-danger-tint: #fdecea;

  max-width: 70ch;
  margin: 0 auto;
  padding: 56px 24px 96px;
  font-size: 17px;
  line-height: 1.7;
  color: var(--sp-content-primary);
}

.legal__title {
  margin: 0 0 16px;
  font-family: var(--sp-font-display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.05;
  letter-spacing: var(--sp-display-tracking);
  text-wrap: balance;
}

.legal__effective {
  margin: 0 0 40px;
  font-family: var(--sp-font-mono);
  font-size: 13px;
  line-height: 20px;
  letter-spacing: 0.04em;
  color: var(--sp-content-secondary);
}

.legal__lede {
  margin: 0;
  font-size: 19px;
  line-height: 1.6;
  color: var(--sp-content-secondary);
  text-wrap: pretty;
}

.legal__section {
  margin-top: 48px;
}

.legal__section h2 {
  margin: 0 0 16px;
  font-family: var(--sp-font-display);
  font-weight: 700;
  font-size: clamp(24px, 3.4vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.legal__section h3 {
  margin: 28px 0 8px;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}

.legal__section p {
  margin: 0 0 16px;
}

.legal__list {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.legal__list li {
  margin: 0 0 8px;
  padding-left: 4px;
}

.legal__list li::marker {
  color: var(--kp-deep);
}

/* Highlighted box for what a reader must not miss, or a block of contact details. Text inside keeps its normal colour and weight. */
.legal__notice {
  margin: 24px 0;
  padding: 18px 20px;
  background: var(--kp-tint);
  border-left: 4px solid var(--kp-deep);
  border-radius: 12px;
}

.legal__notice p {
  margin: 0 0 8px;
}

.legal__notice > :last-child {
  margin-bottom: 0;
}

a.legal__link {
  color: var(--kp-deep);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.legal__link:hover {
  color: var(--kp-edge1);
}

/* ---- Delete-data form ---- */
.delete-card {
  padding: 28px;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--sp-shadow-card), 0 0 0 1px var(--sp-border-soft);
}

.delete-form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.delete-form__label {
  font-size: 15px;
  font-weight: 600;
}

.delete-form__control {
  box-sizing: border-box;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--sp-content-secondary);
  border-radius: 12px;
  background: #fff;
  color: var(--sp-content-primary);
  font: inherit;
  line-height: 1.4;
}

.delete-form__control::placeholder {
  color: var(--sp-content-secondary);
  opacity: 1;
}

.delete-form__control:focus {
  border-color: var(--kp-deep);
}

.delete-form__control[aria-invalid="true"] {
  border-color: var(--legal-danger);
  box-shadow: inset 0 0 0 1px var(--legal-danger);
}

textarea.delete-form__control {
  min-height: 120px;
  resize: vertical;
}

/* Message regions stay in the page when empty so screen readers announce what is put in them */
.delete-form__status {
  margin-bottom: 20px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.delete-form__status:empty {
  margin: 0;
  padding: 0;
  border: 0;
}

.delete-form__status--info {
  background: var(--kp-tint);
  border: 1px solid var(--kp-deep);
}

.delete-form__status--error {
  background: var(--legal-danger-tint);
  border: 1px solid var(--legal-danger);
  color: var(--legal-danger);
}

.delete-form__submit {
  width: 100%;
  white-space: normal;
}

.delete-form .delete-form__hint {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--sp-content-secondary);
  text-align: center;
}

.delete-help {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--sp-border-soft);
  font-size: 15px;
  text-align: center;
  color: var(--sp-content-secondary);
}

.delete-help p {
  margin: 0 0 8px;
}

/* ---- Small screens ---- */
@media (max-width: 640px) {
  main.legal {
    padding: 40px 20px 64px;
  }

  .legal__section {
    margin-top: 40px;
  }

  .delete-card {
    padding: 20px;
  }
}
