/* #guide — the sky chart and the eyepiece. Values from tokens.css only.
   The chart is physical geometry (east on the left, canvas pixels), so the stage is forced to direction: ltr. */
/* the lens may overhang the chart edge (Pleiades and Canopus sit near it): leave room above and below */
#guide .sec-head { margin-block-end: 56px; }

/* ── chart ── */
.guide-stage {
  --lens-d: 180px;
  position: relative; inline-size: 100%; aspect-ratio: 16 / 9; direction: ltr; isolation: isolate; border-radius: var(--r-card);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.guide-stage::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line-night); pointer-events: none; z-index: 1; }
.guide-stage[data-fine] { cursor: crosshair; }
.guide-canvas { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border-radius: inherit; background: var(--night); }

/* selected-object ring (the faint rings of every named object are painted into the chart) */
.guide-ring {
  position: absolute; left: 0; top: 0; inline-size: 24px; block-size: 24px; border: 1.5px solid var(--gold); border-radius: 50%;
  opacity: 0; pointer-events: none; will-change: transform;
}
.guide-ring[data-dashed] { border-style: dashed; }
.is-ready .guide-ring { opacity: 1; transition: opacity .4s ease; }
.is-ready .guide-ring[data-glide] { transition: opacity .4s ease, transform .5s var(--ease-out); }

/* the eyepiece: moves by transform only; touch-action none on the lens alone so the page still scrolls elsewhere */
.guide-lens {
  position: absolute; left: 0; top: 0; z-index: 2; inline-size: var(--lens-d); block-size: var(--lens-d); border-radius: 50%; overflow: hidden;
  background: var(--night); color: var(--gold); touch-action: none; will-change: transform; opacity: 0;
  box-shadow: 0 0 0 1px var(--gold), 0 14px 36px -8px color-mix(in srgb, var(--night) 92%, transparent);
}
.is-ready .guide-lens { opacity: 1; transition: opacity .5s ease; }
.guide-stage:not([data-fine]) .guide-lens { cursor: grab; }
.guide-lens[data-drag] { cursor: grabbing; }
.guide-lens canvas { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; }
.guide-reticle { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; pointer-events: none; }
.guide-reticle use { fill: currentColor; }
.guide-lens::after { /* glass vignette */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, transparent 62%, color-mix(in srgb, var(--night) 55%, transparent) 100%);
}

.guide-note { margin-block-start: 32px; color: var(--star-3); max-inline-size: none; }

/* ── chips + info card ── */
.guide-console { display: grid; gap: 20px 28px; margin-block-start: 64px; align-items: start; }
.guide-chips { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.guide-chip {
  flex: none; min-block-size: 44px; padding-inline: 18px; border: 1px solid var(--line-night); border-radius: var(--r-pill);
  background: transparent; color: var(--star); font-size: var(--t-sm); font-weight: 500; line-height: 1.2; white-space: nowrap; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, scale .15s ease;
}
.guide-chip:hover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.guide-chip:active { scale: .97; }
.guide-chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--night); font-weight: 600; }

.guide-card {
  display: grid; gap: 2px; align-content: start; padding: 22px 24px; min-block-size: 168px;
  background: var(--night-2); border: 1px solid var(--line-night); border-radius: var(--r-card);
}
.guide-card__ar { font-family: var(--font-display); font-weight: 700; font-size: var(--t-xl); line-height: var(--lh-display); color: var(--gold); }
.guide-card__la { font-size: var(--t-sm); color: var(--star-3); }
.guide-card__line { margin-block-start: 6px; font-size: var(--t-md); color: var(--star-2); }

@media (min-width: 761px) {
  .guide-console { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}

/* ── mobile: square chart, smaller lens, chips as a snapping row ── */
@media (max-width: 760px) {
  .guide-stage { --lens-d: 140px; aspect-ratio: 1 / 1; }
  .guide-console { margin-block-start: 56px; }
  .guide-chips {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding: 6px var(--gutter); scroll-padding-inline: var(--gutter);
  }
  .guide-chips::-webkit-scrollbar { display: none; }
  .guide-chip { scroll-snap-align: start; }
  .guide-card { padding: 20px; }
}

/* without script the chart has nothing to show; the chips and card remain readable */
html:not(.js) .guide-stage, html:not(.js) .guide-note { display: none; }

/* roaming hint: names the nearest object while the lens is over empty sky */
.guide-card__hint { font-size: var(--t-sm); color: var(--star-3); margin-block-end: 4px; }
