/*
 * (pricing) The pricing page, on top of the landing page's stylesheet: the
 * same tokens, cards and type. Its own parts are the comparison table, the
 * limits, the billing text and the questions.
 */

.site-nav a[aria-current="page"] {
  color: var(--fg);
  background: var(--bg-hover);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.pricing-hero {
  padding-bottom: 8px;
}

.pricing-hero h1 {
  max-width: 20em;
  text-wrap: balance;
  font-size: clamp(30px, 4.6vw, 48px);
}

.pricing-plans {
  padding-bottom: 32px;
}

.pricing-plans .plans {
  margin-top: 32px;
}

/* Plus: only a stronger border; the three cards are otherwise the same. */
.plan-plus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm);
}

.plan-for {
  margin-top: 12px;
  color: var(--fg-muted);
  font-size: var(--text-md);
}

/* The cards' notes sit above their buttons, so the three buttons line up at the bottom. */
.plan .checks {
  margin-bottom: 16px;
}

.plan-note {
  margin: 0 0 20px;
  color: var(--fg-subtle);
  font-size: var(--text-sm);
}

.plan-for + .plan-note {
  margin-top: 12px;
}

/* Compare plans: the table scrolls inside itself; the page never scrolls sideways. */

.compare-scroll {
  margin-top: 28px;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
}

.compare {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: var(--text-md);
  line-height: 1.5;
}

.compare th,
.compare td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compare thead th {
  background: var(--bg-app);
  font-weight: 700;
  white-space: nowrap;
}

.compare tbody th {
  font-weight: 500;
  color: var(--fg);
}

.compare td {
  color: var(--fg-muted);
}

.compare tbody tr:last-child > * {
  border-bottom: 0;
}

/* How the limits work */

.limits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 48px;
  margin-top: 32px;
}

.limits h3 {
  font-size: var(--text-xl);
}

/* Billing */

.prose {
  max-width: 46em;
  margin-top: 20px;
}

.prose p + p {
  margin-top: 14px;
}

.prose p {
  color: var(--fg-muted);
}

/* Questions: native disclosure widgets, keyboard-operable without a script. */

.faq {
  max-width: 52em;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  padding: 16px 36px 16px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--fg-muted);
  border-bottom: 2px solid var(--fg-muted);
  transform: translateY(-70%) rotate(45deg);
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(225deg);
}

.faq summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.faq details p {
  padding: 0 0 18px;
  color: var(--fg-muted);
  font-size: var(--text-md);
}

/* A button that reads as a link (Contact Sales inside a sentence). */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (max-width: 720px) {
  .pricing-plans {
    padding-bottom: 16px;
  }

  .limits {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* All four columns on a phone: the labels wrap, the figures are short. */
  .compare {
    min-width: 0;
    font-size: var(--text-sm);
  }

  .compare th,
  .compare td {
    padding: 10px 6px;
  }

  .compare th:first-child {
    padding-left: 12px;
  }

  .compare thead th {
    white-space: normal;
  }
}
