/* ==========================================================================
   Terms and Conditions page: a clause sheet
   The title and introduction sit beside a key-facts panel; below, a full-width
   contents index, then one row per clause (title on the left, text on the
   right) between hairlines, and a closing contact row.
   Phones and tablets: everything stacks.
   ========================================================================== */

/* ---- Title, introduction and key facts ---- */

.terms-intro {
  padding-block: calc(var(--header-height) + var(--space-8)) var(--space-7);
}

.terms-intro__inner {
  display: grid;
  gap: var(--space-7);

  @media (width >= 64rem) {
    grid-template-columns: minmax(0, 1fr) 22rem;
    align-items: end;
    gap: var(--space-9);
  }
}

.terms-intro__text {
  display: grid;
  justify-items: start;
  gap: var(--space-4);
}

.terms-intro__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--brand-green);
}

.terms-intro__title {
  font-size: var(--fs-2xl);
}

.terms-intro__lead {
  max-width: 42rem;
  color: var(--ink-700);
}

/* A small grey panel of facts taken from the terms themselves */
.terms-facts {
  margin: 0;
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
}

.terms-facts__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);

  & + & {
    border-top: 1px solid var(--line);
  }

  dt {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    color: var(--ink-500);
  }

  dd {
    margin: 0;
    font-size: var(--fs-sm);
    font-weight: 600;
    text-align: right;
    color: var(--ink-900);
  }
}

/* ---- Contents index ---- */

.terms {
  padding-bottom: var(--section-y);
}

.terms-contents {
  padding-block: var(--space-6);
  border-block: 1px solid var(--line);

  ul {
    display: grid;
    gap: var(--space-3) var(--space-6);

    @media (width >= 40rem) {
      grid-template-columns: repeat(2, 1fr);
    }

    @media (width >= 64rem) {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  a {
    font-size: var(--fs-sm);
    color: var(--ink-700);
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 0.25em;
    transition:
      color var(--duration-fast) ease,
      text-decoration-color var(--duration-fast) ease;

    &:hover {
      color: var(--brand-green);
      text-decoration-color: currentColor;
    }
  }
}

.terms-contents__title {
  margin-bottom: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-500);
}

/* ---- Clauses: title on the left, text on the right ---- */

.clause {
  display: grid;
  gap: var(--space-3);
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-height) + var(--space-4));

  @media (width >= 64rem) {
    grid-template-columns: 18rem minmax(0, 46rem);
    gap: var(--space-9);
    padding-block: var(--space-7);
  }
}

.clause__title {
  font-size: var(--fs-md);
}

.clause__body {
  p {
    color: var(--ink-700);
  }

  p + p,
  ul + p {
    margin-top: var(--space-3);
  }

  ul {
    display: grid;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding: 0;
    list-style: none;
  }

  li {
    position: relative;
    padding-left: var(--space-5);
    color: var(--ink-700);

    /* A short rule as the marker */
    &::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0.8em;
      width: 0.6rem;
      height: 2px;
      border-radius: 2px;
      background: var(--brand-green);
    }
  }

  a {
    color: var(--brand-green);
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }
}

/* ---- Closing contact row ---- */

.terms-contact {
  display: grid;
  gap: var(--space-4);
  padding-top: var(--space-8);
  scroll-margin-top: calc(var(--header-height) + var(--space-4));

  @media (width >= 64rem) {
    grid-template-columns: 18rem minmax(0, 1fr) auto;
    align-items: start;
    gap: var(--space-9);
  }

  p {
    margin-top: var(--space-2);
    color: var(--ink-700);
  }

  address {
    font-style: normal;
    color: var(--ink-900);
  }
}

.terms-contact__title {
  font-size: var(--fs-md);
}

.terms-contact__email {
  font-weight: 600;
  color: var(--brand-green);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
