/* The house pattern: Apple's inset grouped list. Rows sit on one surface,
   separated by hairlines and nothing else, so a group reads as one object.
   The questions, the long-form prose and the tables are here too. */

/* ---------------------------------------------------------------- groups --- */

.group {
  display: grid;
  padding: 0;
  margin: 0;
  border-radius: var(--r-group);
  background: var(--surface);
  box-shadow: var(--highlight);
  list-style: none;
  overflow: hidden;
}

.group-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: start;
  padding: 16px 20px;
}

/* The hairline starts where the words do, as an inset list's does. */
.group-row:not(:has(.group-icon)) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.group-row + .group-row {
  background-image: linear-gradient(var(--hairline), var(--hairline));
  background-size: calc(100% - var(--inset, 20px)) 1px;
  background-position: right top;
  background-repeat: no-repeat;
}

.group-row:has(.group-icon) + .group-row {
  --inset: 72px;
}

/* A rounded tile carrying the row's glyph, tinted or neutral. */
.group-icon {
  display: grid;
  margin-top: 2px;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-button);
  background: var(--fill-2);
  color: var(--label);
}

.group-icon.is-tint {
  background: var(--tint-fill);
  color: var(--tint);
}

.group-icon.is-green {
  background: var(--green-fill);
  color: var(--green-ink);
}

.group-icon svg {
  width: 20px;
  height: 20px;
}

.group-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.group-copy b {
  color: var(--label);
  font-size: var(--headline);
  font-weight: 600;
  letter-spacing: var(--track-body);
}

.group-copy span,
.group-copy p {
  color: var(--label-2);
  font-size: var(--callout);
  line-height: 1.47;
  letter-spacing: var(--track-callout);
}

.group-aside {
  align-self: center;
  justify-self: end;
}

/* --------------------------------------------------------------- questions --- */

.faq-list {
  max-width: 820px;
  border-radius: var(--r-group);
  background: var(--surface);
  box-shadow: var(--highlight);
  overflow: hidden;
}

details.faq + details.faq {
  background-image: linear-gradient(var(--hairline), var(--hairline));
  background-size: calc(100% - 20px) 1px;
  background-position: right top;
  background-repeat: no-repeat;
}

details.faq summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  color: var(--label);
  font-size: var(--headline);
  font-weight: 600;
  letter-spacing: var(--track-body);
  list-style: none;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease-out-soft);
}

details.faq summary:hover {
  background: var(--fill-2);
}

details.faq summary:focus-visible {
  outline-offset: -2px;
}

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

/* A chevron that turns from pointing right to pointing down. */
details.faq summary::after {
  width: 8px;
  height: 8px;
  flex: none;
  margin-left: auto;
  border-right: 1.75px solid var(--label-2);
  border-bottom: 1.75px solid var(--label-2);
  content: "";
  transform: rotate(-45deg);
  transition: transform var(--spring-snappy-ms) var(--spring-snappy);
}

details.faq[open] summary::after {
  transform: translate(0, -2px) rotate(45deg);
}

details.faq p {
  max-width: var(--measure);
  padding: 0 20px 20px;
  color: var(--label-2);
  font-size: var(--callout);
  line-height: 1.6;
  letter-spacing: var(--track-callout);
}

/* The questions beside their heading, on the page's left axis. */
.faq-split {
  display: grid;
  gap: 32px clamp(36px, 5vw, 80px);
  align-items: start;
}

@media (min-width: 940px) {
  .faq-split {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  }
}

.faq-more {
  margin-top: 16px;
  font-size: var(--callout);
}

/* ------------------------------------------------------------------ prose --- */

.prose {
  max-width: var(--measure);
}

.prose h1 {
  font-size: var(--title-page);
  line-height: 1.07;
}

.prose h2 {
  margin-top: 56px;
  margin-bottom: 4px;
  font-size: var(--title-3);
  letter-spacing: var(--track-title-3);
}

.prose h1 + h2,
.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin-top: 28px;
  font-size: var(--headline);
}

.prose p {
  margin-top: 14px;
  color: var(--label-body);
  line-height: 1.6;
}

.prose ul,
.prose ol {
  display: grid;
  gap: 10px;
  padding-left: 22px;
  margin-top: 14px;
  color: var(--label-body);
}

.prose li {
  padding-left: 4px;
  line-height: 1.6;
}

.prose li::marker {
  color: var(--label-2);
}

.prose hr {
  height: 0;
  margin-block: 48px 0;
  border: 0;
}

.legal-meta {
  margin-top: 16px;
  margin-bottom: 8px;
  color: var(--label-2);
  font-size: var(--callout);
  line-height: 1.55;
}

/* ----------------------------------------------------------------- tables --- */

.table-scroll {
  margin-top: 18px;
  border-radius: var(--r-group);
  background: var(--surface);
  box-shadow: var(--highlight);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--callout);
  letter-spacing: var(--track-callout);
}

/* Cells wrap: the one table holds sentences, and kept to one line each row
   ran sideways off every screen. */
th,
td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
}

tbody tr {
  box-shadow: inset 0 0.5px 0 var(--hairline);
}

thead th {
  color: var(--label);
  font-size: var(--footnote);
  font-weight: 600;
}

tbody th {
  color: var(--label);
  font-weight: 510;
}

td {
  color: var(--label-body);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

td.num {
  color: var(--label);
  font-weight: 600;
}
