/* See ./guarantee.md for design notes and rationale. */

.guarantee {
  --guarantee-panel-bg: #f5f2eb;
  --guarantee-divider-color: #cdcccb;
  --guarantee-panel-radius: 8px;
  --guarantee-divider-gap: calc(var(--ll-space-7) + 0.5px);
  --guarantee-stat-size: 48px;
  --guarantee-stat-line-height: 56px;

  display: flex;
  flex-direction: column;
  gap: var(--ll-space-8);
  padding-block: var(--ll-space-9) var(--ll-space-6);
}

.guarantee__heading {
  margin: 0;
  color: var(--ll-color-text-secondary);
  font-family: var(--ll-text-h3-family);
  font-size: clamp(var(--ds-font-size-28), 8.5vw, var(--ll-text-h3-size));
  font-weight: var(--ll-text-h3-weight);
  line-height: 1.2;
  letter-spacing: var(--ll-text-h3-letter-spacing);
  text-align: center;
}

.guarantee__panel {
  background: var(--guarantee-panel-bg);
  border-radius: var(--guarantee-panel-radius);
  padding: var(--ll-space-7);
}

.guarantee__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guarantee__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ll-space-4);
  text-align: center;
}

.guarantee__item:not(:last-child) {
  padding-bottom: calc(2 * var(--guarantee-divider-gap));
}

.guarantee__item:not(:last-child)::after {
  content: "";
  position: absolute;
  inset-block-end: var(--guarantee-divider-gap);
  inset-inline-start: 50%;
  width: 60px;
  height: 1px;
  background: var(--guarantee-divider-color);
  transform: translateX(-50%);
}

.guarantee__stat {
  margin: 0;
}

.guarantee__stat-value {
  display: block;
  color: var(--ll-color-text-primary);
  font-family: var(--ll-text-h2-family);
  font-size: var(--guarantee-stat-size);
  font-weight: 300;
  line-height: var(--guarantee-stat-line-height);
  letter-spacing: var(--ll-text-h0-letter-spacing);
  font-variant-numeric: tabular-nums;
}

.guarantee__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ll-space-2);
  padding-inline: 0;
  width: 100%;
}

.guarantee__subtitle {
  margin: 0;
  color: var(--ll-color-text-secondary);
  font-family: var(--ll-text-body-sm-family);
  font-size: var(--ll-text-body-sm-size);
  font-weight: 600;
  line-height: var(--ll-text-body-sm-line-height);
  letter-spacing: var(--ll-text-body-sm-letter-spacing);
}

.guarantee__description {
  margin: 0;
  color: var(--ll-color-text-secondary);
  font-family: var(--ll-text-body-sm-family);
  font-size: var(--ll-text-body-sm-size);
  font-weight: var(--ll-text-body-sm-weight);
  line-height: var(--ll-text-body-sm-line-height);
  letter-spacing: var(--ll-text-body-sm-letter-spacing);
}

/* MD+ */
@media (width >= 768px) {
  .guarantee {
    --guarantee-divider-gap: var(--ll-space-9);
    --guarantee-stat-size: var(--ll-text-h0-size);
    --guarantee-stat-line-height: var(--ll-text-h0-line-height);

    gap: var(--ll-space-12);
    padding-block: var(--ll-space-13) var(--ll-space-8);
  }

  .guarantee__panel {
    padding: var(--ll-space-12) var(--ll-space-9) var(--ll-space-9);
  }

  .guarantee__item {
    gap: var(--ll-space-5);
  }

  .guarantee__item:not(:last-child)::after {
    width: 120px;
  }

  .guarantee__subtitle {
    font-family: var(--ll-text-body-lg-family);
    font-size: var(--ll-text-body-lg-size);
    line-height: var(--ll-text-body-lg-line-height);
    letter-spacing: var(--ll-text-body-lg-letter-spacing);
  }

  .guarantee__description {
    font-family: var(--ll-text-body-base-family);
    font-size: var(--ll-text-body-base-size);
    line-height: var(--ll-text-body-base-line-height);
    letter-spacing: var(--ll-text-body-base-letter-spacing);
  }
}

/* LG/XL */
@media (width >= 1024px) {
  .guarantee {
    gap: var(--ll-space-11);
    padding-block: var(--ll-space-13);
  }

  .guarantee__panel {
    padding: var(--ll-space-9) var(--ll-space-7);
  }

  .guarantee__list {
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: var(--ll-space-15);
  }

  .guarantee__item {
    flex: 1 1 0;
    justify-content: flex-start;
  }

  .guarantee__item:not(:last-child) {
    padding-bottom: 0;
  }

  .guarantee__item:not(:last-child)::after {
    inset-block-end: auto;
    inset-inline: auto calc(var(--ll-space-15) / -2);
    top: 50%;
    width: 1px;
    height: 120px;
    transform: translateY(-50%);
  }

  .guarantee__copy {
    padding-inline: var(--ll-space-4);
  }
}
