/* Styling of the help center alone: its header and the search and the two tabs and the categories and the guide topics (decision 389) */
/* Loads after site.css on this page alone so the shared styling is lighter for the other pages */
.faq-list {
  display: grid;
  gap: var(--sp-3);
}

.faq-item {
  border: var(--line) solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg);
  transition: border-color var(--dur-2) var(--ease);
}

.faq-item[open] {
  border-color: var(--border-strong);
}

.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-block-size: var(--sp-16);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-lg);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
  cursor: pointer;
  list-style: none;
}

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

.faq-a {
  max-inline-size: var(--measure-wide);
  padding: 0 var(--sp-5) var(--sp-5);
  color: var(--text-muted);
}

/* An inline link whose touch area grows with padding offset by a negative margin so the line height does not change */
.text-link {
  display: inline-block;
  margin-block: calc(-1 * var(--sp-3));
  padding-block: var(--sp-3);
  color: var(--primary-text);
  font-weight: var(--fw-semibold);
  text-decoration: underline;
  text-decoration-thickness: var(--line);
  text-underline-offset: var(--sp-1);
}

.text-link:hover {
  text-decoration-thickness: var(--line-2);
}

/* Above the colored section the orange icon keeps its dark ink */

.faq-item[open] {
  border-color: var(--accent);
  box-shadow: inset 0 var(--sp-1) 0 0 var(--accent);
}

/* What the script hides with the hidden attribute stays hidden even if the element has a display in the styling */
.faq-cat[hidden],
.faq-item[hidden],
.faq-empty[hidden] {
  display: none;
}

/* The header of the guide and questions pages: the title and its line and then what is specific to the page */
.doc-hero {
  padding-block: var(--hero-top) var(--sp-10);
  border-block-end: var(--line) solid var(--border);
  background: var(--bg-band);
}

.doc-hero-body {
  display: grid;
  justify-items: start;
  gap: var(--sp-4);
}

.doc-title {
  font-size: var(--fs-doc-title);
  letter-spacing: var(--tracking-heading);
}

/* Usage guide: the index is chips on the phone and a sticky column on desktop and the sections are at a comfortable reading width */

.guide-steps {
  display: grid;
  gap: var(--sp-3);
  counter-reset: step;
}

.guide-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--sp-3);
  counter-increment: step;
}

.guide-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  inline-size: var(--num);
  block-size: var(--num);
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  color: var(--on-primary-soft);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}

.guide-list {
  display: grid;
  gap: var(--sp-3);
}

.guide-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: var(--sp-3);
}

.guide-list b {
  font-weight: var(--fw-bold);
}

/* Frequently asked questions: the search and the group links and then the groups, with each one's title beside its questions on desktop */
.faq-search {
  display: none;
  position: relative;
  inline-size: min(100%, var(--search-w));
}

.faq-search-input {
  inline-size: 100%;
  min-block-size: var(--control-h);
  padding-inline: calc(var(--sp-4) + var(--icon) + var(--sp-3)) var(--sp-4);
  border: var(--line) solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-base);
}

.faq-search-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.faq-search-input:focus-visible {
  border-color: var(--focus);
}

.faq-search-icon {
  position: absolute;
  inset-block-start: calc((var(--control-h) - var(--icon)) / 2);
  inset-inline-start: var(--sp-4);
  color: var(--text-muted);
  pointer-events: none;
}

.faq-count {
  min-block-size: var(--sp-6);
  margin-block-start: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.faq-chips ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.faq-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-block-size: var(--touch);
  padding-inline: var(--sp-4) var(--sp-2);
  border: var(--line) solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.faq-chip:hover {
  border-color: var(--primary-text);
}

.faq-chip-count {
  min-inline-size: var(--num);
  padding-inline: var(--sp-1);
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  text-align: center;
}

.faq-page {
  display: grid;
  gap: var(--sp-12);
  padding-block: var(--sp-10) var(--section-y);
}

.faq-cat {
  display: grid;
  gap: var(--sp-5);
}

.faq-cat-title {
  font-size: var(--fs-xl);
}

.faq-page .faq-item {
  background: var(--surface);
}

.faq-empty {
  display: grid;
  justify-items: center;
  gap: var(--sp-4);
  padding: var(--sp-10) var(--sp-6);
  border: var(--line) dashed var(--border-strong);
  border-radius: var(--r-lg);
  color: var(--text-muted);
  text-align: center;
}

@media (min-width: 64rem) {
  .faq-cat {
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    align-items: start;
    gap: var(--sp-12);
  }

  .faq-cat-title {
    position: sticky;
    inset-block-start: calc(var(--header-h) + var(--sp-8));
  }
}

/* Help center (decision 353): a guide topic opens like a question and beside its title the guide icon */
.help-kind {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: var(--num);
  block-size: var(--num);
  border-radius: var(--r-pill);
  background: var(--primary-soft);
  color: var(--on-primary-soft);
}

.help-q {
  flex: 1;
}

.help-article-body {
  display: grid;
  gap: var(--sp-4);
  padding: 0 var(--sp-5) var(--sp-6);
}

.help-article-body h3 {
  margin-block-start: var(--sp-2);
  font-size: var(--fs-md);
}

/* Questions: cards with the page surface and the open one with a border in the brand color and a shadow, and the icon in a circle that turns orange when opened */
.faq-item {
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.faq-item[open] {
  border-color: var(--primary);
  box-shadow:
    0 0 0 var(--line) var(--primary),
    var(--shadow-2);
}


/* The help center header is a panel in the deep brand color like the first screen: the title and the search and the categories are above it (decision 388) */
.doc-hero {
  padding-block: var(--sp-4) 0;
  border-block-end: 0;
  background: transparent;
}

.doc-hero-body {
  padding: clamp(2rem, 1rem + 4vw, 4rem) clamp(1.25rem, 0.5rem + 4vw, 4rem);
  border-radius: var(--r-device);
  background-color: var(--hero-deep);
  background-image:
    radial-gradient(55% 90% at 100% 0%, var(--hero-glow-1), transparent 72%),
    radial-gradient(35% 60% at 0% 100%, var(--hero-glow-2), transparent 70%),
    linear-gradient(180deg, var(--hero-deep), var(--hero-deep-2));
  color: var(--on-deep);
  --focus: var(--on-deep);
}

:root[data-theme='dark'] .doc-hero-body {
  box-shadow: inset 0 0 0 var(--line) var(--border);
}

.doc-hero-body .doc-title {
  color: var(--on-deep);
  font-weight: var(--fw-black);
}

.doc-hero-body .faq-search-input {
  border-color: transparent;
  box-shadow: var(--shadow-2);
}

.doc-hero-body .faq-count {
  color: var(--on-deep-muted);
}

/* The help center's two tabs (decision 389): a pill with two buttons on the deep panel and the selected one is filled with the page surface */
.help-tabs {
  display: none;
  gap: var(--sp-1);
  margin-block-start: var(--sp-2);
  padding: var(--sp-1);
  border-radius: var(--r-pill);
  background: var(--on-deep-fill);
  box-shadow: inset 0 0 0 var(--line) var(--on-deep-line);
}

.help-tab {
  min-block-size: var(--touch);
  padding-inline: var(--sp-6);
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--on-deep);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition:
    background-color var(--dur-1) var(--ease),
    color var(--dur-1) var(--ease);
}

.help-tab:hover {
  background: var(--on-deep-fill);
}

.help-tab[aria-selected='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-1);
}

.help-panel {
  display: grid;
  gap: var(--sp-12);
}

.help-panel[hidden] {
  display: none;
}

/* The tab title appears with no script or during search when the two tabs appear together, and otherwise for the screen reader alone */
.help-panel-title {
  font-size: var(--fs-h2);
  font-weight: var(--fw-black);
}

/* The categories in the header of the questions tab as quiet pills */
.help-panel .faq-chips ul {
  gap: var(--sp-2);
}

/* The guide topics are a group with no side heading: its list is in the same column as the question lists on desktop */
@media (min-width: 64rem) {
  #guide.faq-cat .faq-list {
    grid-column: 2;
  }
}

/* The privacy tab: the policy text as it is at reading width (decision 403) */
.help-privacy {
  display: grid;
  gap: var(--sp-4);
  max-inline-size: var(--measure-wide);
}

.help-privacy-date {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.help-privacy section {
  display: grid;
  gap: var(--sp-2);
}

.help-privacy h3 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.help-privacy ul {
  display: grid;
  gap: var(--sp-1);
  padding-inline-start: var(--sp-5);
}

/* Three tabs on the phone take the screen width equally with less padding so they do not exceed it (decision 403) */
@media (max-width: 29.99rem) {
  .js .help-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    inline-size: 100%;
  }

  .help-tab {
    padding-inline: var(--sp-2);
  }
}

