/* T-518: the connect-a-screen guide (prototype v5), light only, in the site's own font. Everything is scoped under .gp
   because the theme styles bare section / ol / button / h2 / p / code. Without JavaScript the <ol> stays a readable list;
   with it (.gp-js) the list becomes the rail. The layout answers to the width of the guide's own column (container query),
   not the window: on the how-to page the guide sits in the 8-column text column. */
.gp {
  --gp-bg: #f3f4f8; --gp-surface: #fff; --gp-ink: #18203a; --gp-muted: #5b6382; --gp-line: #dde0ea;
  --gp-stage: #1d2840; --gp-ring: #f0a23a; --gp-accent: #2b5bd7; --gp-accent-ink: #fff;
  --gp-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  container: gp / inline-size;
  display: block; padding: 18px; margin: 0 0 36px; background: var(--gp-bg); color: var(--gp-ink); border-radius: 16px;
  font-size: 15px; line-height: 1.5; word-break: normal; overflow-wrap: anywhere;
}
.gp *, .gp *::before, .gp *::after { box-sizing: border-box; }
.gp [hidden] { display: none !important; }
.gp h2, .gp h3, .gp p, .gp ol, .gp li { margin: 0; padding: 0; letter-spacing: normal; }
.gp-head h2 { font-size: clamp(22px, 3.4vw, 30px); line-height: 1.15; font-weight: 700; color: var(--gp-ink); text-wrap: balance; }
.gp .gp-sub { margin-top: 6px; color: var(--gp-muted); max-width: 60ch; }

.gp-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }

/* no JavaScript: a numbered, readable list ("+" for the optional step) */
.gp-rail { list-style: none; counter-reset: gp; display: grid; gap: 0; }
.gp-rail > li { position: relative; padding: 10px 0 10px 42px; border-bottom: 1px solid var(--gp-line); }
.gp-rail > li::before { position: absolute; left: 0; top: 10px; width: 28px; height: 28px; border: 1px solid var(--gp-line); border-radius: 50%;
  display: grid; place-items: center; font: 500 12px var(--gp-mono); color: var(--gp-muted); background: var(--gp-surface); }
.gp-rail > li:not([data-optional]) { counter-increment: gp; }
.gp-rail > li:not([data-optional])::before { content: counter(gp); }
.gp-rail > li[data-optional]::before { content: "+"; border-style: dashed; }
.gp-where { display: block; font-weight: 600; font-size: 10.5px; line-height: 1.4; font-family: inherit; letter-spacing: .08em; text-transform: uppercase; color: var(--gp-muted); }
.gp-t { display: block; font-weight: 600; color: var(--gp-ink); }
.gp-c { display: block; color: var(--gp-muted); }

/* with JavaScript: the rail of v5 - buttons, a horizontal scroller when narrow */
.gp-js .gp-rail { grid-auto-flow: column; grid-auto-columns: max-content; gap: 2px; overflow-x: auto; padding-bottom: 4px; }
.gp-js .gp-rail > li { padding: 0; border: 0; }
.gp-js .gp-rail > li::before { content: none; display: none; }
.gp-rail button { width: 100%; text-align: left; display: grid; grid-template-columns: 26px; gap: 10px; align-items: center; margin: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--gp-muted); font-weight: 500; font-size: 14.5px; line-height: 1.3; font-family: inherit; padding: 6px; cursor: pointer; }
.gp-rail button .n { font: 500 12px var(--gp-mono); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--gp-line); }
.gp-rail button .t { display: none; }
.gp-rail button .where { display: block; font-weight: 500; font-size: 10.5px; line-height: 1.4; font-family: inherit; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.gp-rail button[aria-current="step"] { background: var(--gp-surface); color: var(--gp-ink); box-shadow: 0 1px 0 var(--gp-line); }
.gp-rail button[aria-current="step"] .n { background: var(--gp-accent); color: var(--gp-accent-ink); border-color: var(--gp-accent); }
.gp-rail button.done .n { border-color: var(--gp-accent); color: var(--gp-accent); }
.gp-rail button.opt .n { border-style: dashed; }
/* the rail stands beside the stage only when the guide itself is 900+ px wide. In the text column (~730 px at 1440) it never is, so
   the intended desktop layout is the stage at the full column width under the scrolling step rail */
@container gp (min-width: 900px) {
  .gp-main { grid-template-columns: 210px minmax(0, 1fr); }
  .gp-js .gp-rail { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; gap: 2px; padding-bottom: 0; }
  .gp-rail button { grid-template-columns: 28px 1fr; padding: 8px 9px; }
  .gp-rail button .t { display: block; }
}
@container gp (min-width: 560px) {
  .gp-caption { grid-template-columns: auto minmax(0, 1fr) auto; }
}

.gp-player { display: grid; gap: 12px; min-width: 0; }
.gp-stage { position: relative; background: var(--gp-stage); border-radius: 14px; aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center; }
.gp-first { display: block; width: calc(100% - 28px); height: calc(100% - 28px); max-width: none; object-fit: contain; border-radius: 6px; }
.gp-shot { position: relative; }
.gp-shot img { display: block; width: 100%; height: 100%; max-width: none; border-radius: 6px; }
.gp-ring { position: absolute; border: 3px solid var(--gp-ring); border-radius: 8px; box-shadow: 0 0 0 4px rgba(240, 162, 58, .28);
  opacity: 0; transform: scale(1.08); transition: opacity .35s ease, transform .35s ease; pointer-events: none; }
.gp-ring.on { opacity: 1; transform: scale(1); }
.gp-tag { position: absolute; top: 10px; left: 10px; z-index: 1; font-weight: 600; font-size: 11px; line-height: 1.4; font-family: inherit; letter-spacing: .08em; text-transform: uppercase;
  color: #cfd6ea; background: rgba(255, 255, 255, .1); padding: 3px 8px; border-radius: 6px; }

/* the two console cards drawn in HTML (English only, demo values) */
.gp-mock { width: min(560px, 86%); background: #f7f8fb; color: #1b2340; border-radius: 10px; padding: 22px; font-size: 14px; line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transform-origin: center; }
.gp-mock h3 { font-size: 18px; line-height: 1.25; font-weight: 700; margin: 0 0 12px; color: #1b2340; }
.gp-mock .row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #e3e6ef; }
.gp-mock .btn { display: inline-block; background: #2b5bd7; color: #fff; border-radius: 6px; padding: 8px 14px; font-weight: 600; }
.gp-mock .pill { display: inline-block; font-weight: 600; font-size: 12px; line-height: 1.5; font-family: inherit; padding: 3px 9px; border-radius: 999px; }
.gp-mock .pill.ok { background: #dcf5e6; color: #11663a; }
.gp-mock .act { margin: 14px 0 10px; }
.gp-mock .ph { margin-top: 12px; font-size: 12px; color: #6b7390; }
.gp-mock .pair { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.gp-mock .pair ol { padding-left: 18px; font-size: 13px; list-style: decimal; }
.gp-mock .pair li { list-style: decimal; }
.gp-mock.phone { width: min(300px, 70%); border-radius: 22px; border: 8px solid #0e1015; }
.gp-qr { position: relative; flex: none; display: grid; grid-template-columns: repeat(21, 1fr); width: 128px; aspect-ratio: 1; padding: 8px;
  background: #fff; border: 1px solid #cdd3e3; border-radius: 6px; }
.gp-qr i.on { background: #1b2340; }
.gp-qr b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #b3261e; transform: rotate(-18deg);
  text-shadow: 0 0 6px #fff, 0 0 3px #fff; }

/* the remote and the typed address of the keypad step */
.gp-remote { position: absolute; right: 14px; bottom: 14px; background: #20242c; border-radius: 16px 16px 10px 10px; padding: 10px;
  display: grid; grid-template-columns: repeat(3, 34px); gap: 6px; box-shadow: 0 8px 22px rgba(0, 0, 0, .45); }
.gp-remote span { height: 30px; border-radius: 6px; background: #0e1015; color: #e9ecf3; font: 500 14px/1 var(--gp-mono); display: grid; place-items: center;
  transition: background .2s, color .2s; }
.gp-remote span.hit { background: var(--gp-ring); color: #1d1300; }
.gp-remote .lbl { grid-column: 1 / -1; height: auto; background: none; font-weight: 600; font-size: 9px; line-height: 1.4; font-family: inherit; color: #9aa3b8; letter-spacing: .1em; text-transform: uppercase; }
.gp-typed { position: absolute; left: 14px; bottom: 14px; z-index: 1; font: 500 20px/1.3 var(--gp-mono); color: #fff; background: rgba(0, 0, 0, .45);
  padding: 6px 12px; border-radius: 8px; min-width: 7ch; min-height: 1.3em; }
@container gp (max-width: 520px) {
  .gp-remote { transform: scale(.75); transform-origin: right bottom; right: 8px; bottom: 8px; }
  .gp-typed { font-size: 15px; left: 8px; bottom: 8px; }
}

.gp-caption { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 14px; align-items: center; background: var(--gp-surface);
  border: 1px solid var(--gp-line); border-radius: 12px; padding: 14px 16px; }
.gp-count { font: 500 13px var(--gp-mono); color: var(--gp-muted); font-variant-numeric: tabular-nums; }
.gp-ctitle { font-size: 19px; line-height: 1.2; font-weight: 700; color: var(--gp-ink); text-wrap: balance; }
.gp .gp-ctext { margin-top: 2px; color: var(--gp-muted); }
.gp-ctrls { display: flex; gap: 6px; }
.gp-ctrls button { width: 40px; height: 40px; margin: 0; padding: 0; border: 1px solid var(--gp-line); border-radius: 10px; background: var(--gp-surface);
  color: var(--gp-ink); font-size: 16px; line-height: 1; cursor: pointer; }
.gp-ctrls button.gp-play { background: var(--gp-accent); color: var(--gp-accent-ink); border-color: var(--gp-accent); }
.gp button:focus-visible, .gp-stage:focus-visible { outline: 3px solid var(--gp-accent); outline-offset: 2px; }
.gp-values { display: flex; flex-wrap: wrap; gap: 8px; }
.gp-values code { font: 500 13px var(--gp-mono); color: var(--gp-ink); background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: 6px; padding: 3px 8px; }
.gp .gp-foot { margin-top: 14px; color: var(--gp-muted); font-size: 13px; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) { .gp-ring, .gp-remote span { transition: none; } }
