/* pricing.css: Pricing page only (pricing.html). The intro split (P2, photo on the left) with its policy
   list, the price list (the jump index, six category sheets and the price table component, whose rows
   turn into cards on phones) and the questions about paying. Mobile first, built from the tokens and
   components in css/styles.css. */

/* == Intro: P2 with the photo on the left == */

/* Phones: the H1 comes first and the photo follows the text, standing on the green band below
   (aligned left, as on desktop). From 56.25em the photo is the left column. Its place in the flow is
   on the section's bottom edge (P2), and sticky bottom lifts it into the first screen: it rides at the
   bottom of the window until the green band arrives under it. Its width is also capped by the window
   height, so on short laptop windows the whole 4:5 arch stays below the sticky header. The intro's
   top padding is the shared one under the header (--intro-top). */
.pricing-intro__title { max-width: 13ch; }
.pricing-intro__lead { max-width: 27em; }
.policy { margin-top: var(--space-6); }
.policy__item { padding-block: var(--space-4); }
.policy__text { max-width: var(--measure); }
.pricing-intro__note { margin-top: var(--space-5); color: var(--color-text-muted); }
.pricing-intro { padding-top: var(--intro-top); }
.pricing-intro__media { justify-self: start; }
@media (min-width: 56.25em) {
  .policy__item { grid-template-columns: minmax(0, 1fr); }
  .pricing-intro__media { position: sticky; bottom: 0; width: min(100%, 30rem, (100svh - var(--header-h) - var(--space-6)) * 0.8); }
}

/* == Price list ==
   The heading and date, then the jump index (ruled rows: one, two, then three across; from 62.5em two
   across beside the heading). The six category sheets follow at full width: the table is the content. */

.price-list__head { display: grid; gap: var(--space-6); margin-bottom: clamp(var(--space-7), 6vw, var(--space-9)); }
.price-list__date { margin-top: var(--space-3); color: var(--color-text-muted); }

.price-jump__label { margin-bottom: var(--space-2); font-weight: 700; font-size: var(--step-small); }
.price-jump__list { display: grid; column-gap: var(--space-5); border-bottom: var(--border-hairline) solid var(--color-rule); }
.price-jump__list li { border-top: var(--border-hairline) solid var(--color-rule); }
.price-jump__link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: var(--btn-h); padding-block: var(--space-2);
  font-family: var(--font-display); font-weight: 500; font-size: var(--step-lead); line-height: var(--leading-tight);
  text-decoration-color: transparent;
}
.price-jump__link:hover { text-decoration-color: currentColor; }
.price-jump__link .icon { --icon-size: var(--icon-size-sm); flex: none; transition: transform var(--t-2); }
.price-jump__link:hover .icon { transform: translateY(var(--nudge)); }
@media (min-width: 43.75em) { .price-jump__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 56.25em) { .price-jump__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 62.5em) {
  .price-list__head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--space-8); align-items: end; }
  .price-jump__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.price-groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(var(--space-7), 6vw, var(--space-9)); }
.price-group { container: price-group / inline-size; }
.price-group__title { margin-bottom: var(--space-5); }
.price-group__note { max-width: none; margin-top: var(--space-4); font-size: var(--step-small); color: var(--color-text-muted); }

/* == Price table: a page component, in four layouts ==
   Phones: each row is a white card (name and price; the time and visits; what is included), every
   value labelled with its column name. The labels are CSS text with empty alternative text, so screen
   readers hear the real column headers once. The table keeps its table, row and header roles. */
.price-table, .price-table thead, .price-table tbody { display: block; }
.price-table thead, .price-table thead th:last-child {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.price-table tbody { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.price-table th, .price-table td { padding: 0; text-align: left; font-weight: 400; }
.price-table tbody th {
  font-family: var(--font-display); font-weight: 500; font-size: var(--step-lead); line-height: var(--leading-tight);
  letter-spacing: var(--tracking-h3); color: var(--color-heading); text-wrap: balance;
}
.price-table td { font-size: var(--step-small); line-height: var(--leading-lead); }
.price-table td.price-table__price {
  white-space: nowrap; font-family: var(--font-display); font-weight: 500; font-size: var(--step-lead); line-height: var(--leading-tight);
}
.price-table__included { color: var(--color-text-muted); }

/* The card: name beside the price, a forced break (the row's ::after), then the facts. The name is never
   narrower than its longest unbreakable piece (a .nowrap compound such as "Habit-breaking"), so where
   name and price do not fit side by side the price drops under the name instead of running into it.
   "Usually takes" gets more of the facts line than "Visits", whose values are shorter. */
.price-table tr {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-5);
  padding: var(--space-5); border-radius: var(--radius-sm); background: var(--color-white);
}
.price-table tr::after { content: ""; order: 1; flex-basis: 100%; }
.price-table tbody th { flex: 1 1 0; min-width: min-content; }
.price-table td { order: 2; flex: 1 1 0; min-width: 0; margin-top: var(--space-4); }
.price-table td:nth-of-type(2) { flex-grow: 1.4; }
.price-table td.price-table__price { order: 0; flex: none; margin-top: 0; }
.price-table td.price-table__included { order: 3; flex-basis: 100%; padding-top: var(--space-4); border-top: var(--border-hairline) solid var(--color-rule); }
.price-table td::before {
  content: attr(data-label); content: attr(data-label) / "";
  display: block; font-family: var(--font-body); font-weight: 700; font-size: var(--step-tiny); color: var(--color-text-muted);
}
.price-table td.price-table__price::before { display: inline; margin-inline-end: var(--space-2); }

/* Narrow cards (under 21rem: phones narrower than about 385px, and any phone with large text): every
   name takes the full width with the price under it, so the cards stay alike. At very large text the
   facts stack, the compounds may break at their hyphens, and a word longer than the card breaks
   rather than overflow. */
@container price-group (max-width: 21rem) {
  .price-table tbody th { flex-basis: 100%; min-width: 0; overflow-wrap: break-word; }
  .price-table td.price-table__price { margin-top: var(--space-2); }
}
@container price-group (max-width: 12.25rem) {
  .price-table tr { padding: var(--space-4); }
  .price-table td { flex-basis: 100%; }
  .price-table :is(tbody th .nowrap, td.price-table__price) { white-space: normal; }
}

/* From 43.75em: each category is a white sheet and its rows are ruled lines, still in two lines (name
   and price, then the labelled time and visits, then what is included), so the name keeps the width. */
@media (min-width: 43.75em) {
  .price-group { padding: var(--space-6) var(--space-6) var(--space-3); border-radius: var(--radius-sm); background: var(--color-white); }
  .price-group__note { margin-top: 0; padding-block: var(--space-4) var(--space-2); border-top: var(--border-hairline) solid var(--color-rule); }

  .price-table tbody { display: block; }
  .price-table tr { padding: var(--space-4) 0; border-radius: 0; background: none; }
  .price-table tbody tr + tr { border-top: var(--border-hairline) solid var(--color-rule); }
  .price-table td, .price-table td:nth-of-type(2) { flex: 0 1 15rem; margin-top: var(--space-3); }
  .price-table td.price-table__included { flex-basis: 100%; max-width: var(--measure); padding-top: 0; border-top: 0; }
}

/* The two wider layouts follow the sheet's own width in rem, so larger text keeps the two-line rows.
   With default text, 49.25rem of sheet is a 900px window (56.25em) and 61.75rem is 1100px (68.75em).
   First, ruled columns (name, price, time, visits) with what is included underneath as a description;
   its column header stays for screen readers. */
@container price-group (min-width: 49.25rem) {
  .price-table thead { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal; }
  .price-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) 7rem 9.5rem 8.5rem; column-gap: var(--space-5); align-items: baseline;
  }
  .price-table tr::after { content: none; }
  .price-table thead tr { padding-block: var(--space-2) var(--space-3); border-bottom: var(--border-strong) solid var(--color-heading); }
  .price-table thead th { font-weight: 700; font-size: var(--step-small); line-height: var(--leading-tight); color: var(--color-text-muted); }
  .price-table tbody th { min-width: 0; }
  .price-table td, .price-table td.price-table__price { order: 0; margin: 0; }
  .price-table td::before { content: none; }
  .price-table .price-table__price { text-align: right; }
  .price-table td.price-table__included { grid-column: 1 / -1; padding-top: var(--space-2); }
}

/* The full table. Fixed columns, the same widths in every table, so the six line up */
@container price-group (min-width: 61.75rem) {
  .price-table { display: table; width: 100%; table-layout: fixed; }
  .price-table thead { display: table-header-group; }
  .price-table thead th:last-child { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; white-space: normal; }
  .price-table tbody { display: table-row-group; }
  .price-table tr { display: table-row; padding: 0; }
  .price-table th, .price-table td { display: table-cell; padding: var(--space-4) var(--space-3); vertical-align: baseline; }
  .price-table :is(th, td):first-child { padding-left: 0; }
  .price-table :is(th, td):last-child { padding-right: 0; }
  .price-table thead th { padding-block: var(--space-2) var(--space-3); }
  .price-table thead th:nth-child(1) { width: 29%; }
  .price-table thead th:nth-child(2) { width: 12.5%; }
  .price-table thead th:nth-child(3) { width: 15.5%; }
  .price-table thead th:nth-child(4) { width: 12%; }
  .price-table td.price-table__included { max-width: none; padding-top: var(--space-4); }
}

/* == Questions about paying: the heading beside the answers == */

.pricing-faq__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
.pricing-faq__title { max-width: 12ch; }
@media (min-width: 56.25em) {
  .pricing-faq__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--space-8); align-items: start; }
  .pricing-faq__head { position: sticky; top: calc(var(--header-h) + var(--space-7)); }
}
