/*
 * The connect hub and the per-client pages under /connect/.
 *
 * Its own sheet rather than more of shared.css: these five pages are the only
 * thing that uses any of it, and shared.css is already four thousand lines that
 * every page pays for.
 *
 * The pages were a stack of eight `h5` headings each with a bullet list under
 * it, and `.connect-snippet` — the URL you came to the page to copy — had no
 * rule anywhere in the codebase, so it rendered as a browser-default `<pre>`.
 * What follows gives the pages a top, puts the snippet in something that looks
 * copyable, and splits the eight sections into a column you read and a column
 * you glance at.
 *
 * Colours come from tokens.css. Nothing here declares a hex.
 */

/* --- The band across the top ------------------------------------------- */

/*
 * A white band under the header, so the page starts with something rather than
 * with a breadcrumb floating on --paper. It bleeds to the viewport edge; the
 * container inside it keeps the text on the same measure as the rest.
 */
.connect-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.75rem 0 2rem;
}

/* The eyebrow sits directly under the trail, so the gap has to come from here
   — the breadcrumb list carries Bootstrap's mb-0. */
.connect-hero nav[aria-label="Breadcrumb"] {
  margin-bottom: 1rem;
}

.connect-hero .breadcrumb {
  font-size: var(--text-small);
}

.connect-hero h1 {
  margin: 0.15rem 0 0;
  font-weight: 680;
  letter-spacing: -0.01em;
}

.connect-lede {
  margin: 0.6rem 0 0;
  max-width: 46rem;
  color: var(--ink-secondary);
  font-size: 1.05rem;
  line-height: 1.55;
}

/* The client mark and title sitting on one line at the top of a client page. */
.connect-hero-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/*
 * A letter tile, not a logo.
 *
 * The page deliberately carries no screenshot of somebody else's product, and
 * the same argument covers their wordmark: an approximation of a brand we do
 * not own is worse than an initial. Decorative, so it is aria-hidden and the
 * name beside it does the work.
 */
.connect-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--brand-ground);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
}

/* The tile holds either a logo or letters, so the glyph is sized as a share of
   the tile and both sizes stay in proportion without a second rule. */
.connect-mark svg {
  width: 58%;
  height: 58%;
}

.connect-mark-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* --- Pills -------------------------------------------------------------- */

.connect-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.connect-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: var(--text-chip);
  line-height: 1.35;
  white-space: nowrap;
}

.connect-pill-strong {
  border-color: var(--brand);
  background: var(--brand-ground);
  color: var(--brand-dark);
  font-weight: 600;
}

/* --- The endpoint, on the hub ------------------------------------------- */

/*
 * The hub never showed the URL. Every one of the four pages under it is a way
 * of getting this one string into a client, so it belongs on the page that is
 * meant to answer "is my client supported" — for the reader whose client is not
 * one of the four, it is the whole answer.
 */
.connect-url-card {
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
}

.connect-url-card .eyebrow {
  display: block;
  margin-bottom: 0.4rem;
}

.connect-url-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.connect-url-row code {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-body-sm);
  overflow-wrap: anywhere;
}

/* --- Section rhythm ------------------------------------------------------ */

.connect-section + .connect-section {
  margin-top: 2.25rem;
}

.connect-section > h2 {
  margin: 0 0 0.9rem;
  font-size: 1.15rem;
  font-weight: 660;
  letter-spacing: -0.005em;
}

.connect-section-note {
  margin: -0.55rem 0 0.9rem;
  color: var(--ink-secondary);
  font-size: var(--text-body-sm);
}

/* --- The client grid on the hub ------------------------------------------ */

.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
}

.connect-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.connect-card:hover,
.connect-card:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 6px 18px rgba(23, 92, 211, 0.1);
  transform: translateY(-1px);
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .connect-card {
    transition: none;
  }

  .connect-card:hover,
  .connect-card:focus-visible {
    transform: none;
  }
}

.connect-card-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.connect-card-title {
  font-weight: 660;
  font-size: 1rem;
  color: var(--ink);
}

.connect-card-blurb {
  margin: 0;
  flex: 1 1 auto;
  color: var(--ink-secondary);
  font-size: var(--text-small);
  line-height: 1.5;
}

/*
 * The foot carries the auth method and the go-there arrow. The arrow is the
 * card's only affordance for being a link once the whole card is one, so it
 * moves on hover rather than sitting still.
 */
.connect-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.2rem;
}

.connect-card-go {
  color: var(--brand);
  font-size: var(--text-small);
  font-weight: 600;
  transition: transform 0.15s ease;
}

.connect-card:hover .connect-card-go {
  transform: translateX(2px);
}

@media (prefers-reduced-motion: reduce) {
  .connect-card-go,
  .connect-card:hover .connect-card-go {
    transition: none;
    transform: none;
  }
}

/* --- "Also supported", as chips rather than a bullet list ---------------- */

.connect-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.connect-chips li {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-secondary);
  font-size: var(--text-chip);
}

/* --- The three-step strip on the hub ------------------------------------- */

.connect-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: connect-flow;
}

.connect-flow li {
  counter-increment: connect-flow;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.connect-flow li::before {
  content: counter(connect-flow);
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--brand-ground);
  color: var(--brand-dark);
  font-size: var(--text-chip);
  font-weight: 700;
}

.connect-flow strong {
  display: block;
  font-size: var(--text-body);
  font-weight: 650;
}

.connect-flow p {
  margin: 0.25rem 0 0;
  color: var(--ink-secondary);
  font-size: var(--text-small);
  line-height: 1.5;
}

/* --- Two columns on a client page ---------------------------------------- */

/*
 * Setup is what the reader came for, so it leads the main column. "What you
 * get" and "What you need" are a glance, not a read, so they go to an aside
 * that sticks while the setup scrolls. minmax(0, 1fr) rather than 1fr: a wide
 * snippet in the main column would otherwise push the grid past the viewport.
 */
.connect-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

@media (min-width: 62em) {
  .connect-layout {
    grid-template-columns: minmax(0, 1fr) 19rem;
    gap: 2.5rem;
  }

  /* Below the sticky site header, not under it. The header script sets the
     variable to its live height; the fallback covers a one-row header. */
  .connect-aside {
    position: sticky;
    top: calc(var(--site-header-height, 4.5rem) + 1.5rem);
    align-self: start;
  }
}

.connect-panel {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.connect-panel + .connect-panel {
  margin-top: 0.85rem;
}

.connect-panel > h2 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  font-weight: 660;
}

/* --- Lists ---------------------------------------------------------------- */

/* A checked list, because "what you get" is a set of claims, not steps. */
.connect-ticks {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-body-sm);
  line-height: 1.5;
}

.connect-ticks li {
  position: relative;
  padding-left: 1.4rem;
  color: var(--ink-secondary);
}

.connect-ticks li + li {
  margin-top: 0.5rem;
}

.connect-ticks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.42em;
  width: 0.5rem;
  height: 0.26rem;
  border-left: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

/* The requirements list: same measure, a dot rather than a tick. */
.connect-needs {
  margin: 0;
  padding-left: 1.05rem;
  font-size: var(--text-body-sm);
  line-height: 1.5;
  color: var(--ink-secondary);
}

.connect-needs li + li {
  margin-top: 0.5rem;
}

.connect-links {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-body-sm);
}

.connect-links li + li {
  margin-top: 0.45rem;
}

.connect-links a {
  color: var(--brand-dark);
}

/* --- The stepper ---------------------------------------------------------- */

/*
 * Numbers in circles with a rule running between them, so a five-step setup
 * reads as a sequence with an end rather than as five sentences. The rule is
 * drawn on the list item and stopped on the last one, which is cheaper than a
 * pseudo-element per gap and survives a step wrapping to three lines.
 */
.connect-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: connect-step;
}

.connect-steps li {
  counter-increment: connect-step;
  position: relative;
  padding: 0 0 1.35rem 2.4rem;
  font-size: var(--text-body);
  line-height: 1.55;
}

.connect-steps li:last-child {
  padding-bottom: 0;
}

.connect-steps li::before {
  content: counter(connect-step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: var(--surface);
  font-size: var(--text-chip);
  font-weight: 700;
}

.connect-steps li::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 1.75rem;
  bottom: 0.3rem;
  border-left: 2px solid var(--border-cool);
}

.connect-steps li:last-child::after {
  display: none;
}

/* --- The snippet ----------------------------------------------------------- */

/*
 * This is the thing the page exists to hand over, and it had no styling at all.
 * A labelled card with a copy button, because the alternative is selecting
 * monospace text by hand and hoping the selection did not take the newline.
 */
.connect-code {
  margin: 0;
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  overflow: hidden;
}

.connect-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.5rem 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border-cool);
  background: var(--surface);
}

.connect-code-head .eyebrow {
  margin: 0;
}

.connect-snippet {
  margin: 0;
  padding: 0.85rem;
  /* A long JSON config has to scroll rather than widen the page at 320px. */
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-body-sm);
  line-height: 1.55;
  color: var(--ink);
  background: transparent;
}

.connect-snippet code {
  color: inherit;
  background: none;
  font-size: inherit;
  white-space: pre;
}

/* A one-line URL should wrap rather than scroll — it is meant to be read. */
.connect-code-url .connect-snippet code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.connect-copy-btn {
  flex: 0 0 auto;
}

/* --- Notes, troubleshooting, FAQ -------------------------------------------- */

.connect-note {
  margin: 0.7rem 0 0;
  color: var(--ink-secondary);
  font-size: var(--text-small);
  line-height: 1.5;
}

/*
 * The four failures, as disclosures. Every one of them is read by somebody with
 * exactly one symptom, so four collapsed headings beat four open paragraphs —
 * and it matches the FAQ below, which is the same shape.
 */
.connect-trouble {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.75rem 0.95rem;
}

.connect-trouble + .connect-trouble {
  margin-top: 0.5rem;
}

.connect-trouble > summary {
  cursor: pointer;
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink);
}

.connect-trouble > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.connect-trouble p {
  margin: 0.55rem 0 0;
  color: var(--ink-secondary);
  font-size: var(--text-body-sm);
  line-height: 1.55;
}

.connect-faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 0.6rem;
  align-items: start;
}

/* --- The closing card ------------------------------------------------------- */

.connect-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.25rem;
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--border-cool);
  border-radius: var(--radius-lg);
  background: var(--brand-ground);
}

.connect-cta h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 660;
}

.connect-cta p {
  margin: 0.25rem 0 0;
  max-width: 34rem;
  color: var(--ink-secondary);
  font-size: var(--text-body-sm);
}
