/* Comets and asteroids (/comets-and-asteroids, ADR 0092), light theme, on top
   of learn.css. comets-dark.css overrides it for the dark theme. The scale and
   the map are SVG with classes for every color: the Content-Security-Policy
   forbids style attributes. */

.sb-page { --sb-comet: #2f7d8c; --sb-comet-soft: #e5f3f5; --sb-rock: #8a6a3a; --sb-inside: #c0532b; --sb-fire: #d9661b; --sb-ocean: #dcebf5; --sb-land: #f4f1e8; }

.sb-tabs { margin: 0 0 16px; }
.sb-empty { color: var(--muted); }
.sb-note { color: var(--muted); font-size: 0.88rem; margin-top: 10px; }

/* ---- Cards: one per comet, asteroid or pass ---- */
.sb-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.sb-item { border: 1px solid var(--line); border-left: 4px solid var(--sb-comet); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.sb-asteroid, .sb-pass-item { border-left-color: var(--sb-rock); }
.sb-pass-item.is-inside { border-left-color: var(--sb-inside); }
.sb-pass-item.is-past { opacity: 0.72; }
.sb-item-head { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 10px; }
.sb-item-head h3 { margin: 0; font-size: 1.05rem; grid-column: 1; }
.sb-kind { grid-column: 1 / -1; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.sb-mag, .sb-ld { grid-column: 2; grid-row: 2; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-verdict { margin: 6px 0 8px; font-size: 0.93rem; }
.sb-facts { display: grid; gap: 3px; margin: 0; font-size: 0.9rem; }
.sb-facts div { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px; }
.sb-facts dt { color: var(--muted); }
.sb-facts dd { margin: 0; }

/* ---- Tables ---- */
.sb-table-wrap { overflow-x: auto; }
.sb-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.93rem; }
.sb-table th, .sb-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.sb-table thead th { color: var(--muted); font-weight: 600; font-size: 0.84rem; vertical-align: bottom; }
.sb-table th[scope="row"] { font-weight: 600; white-space: nowrap; }

/* ---- The flyby scale ---- */
.sb-scale { margin: 6px 0 4px; }
.sb-scale-svg { display: block; width: 100%; height: auto; }
.sb-scale figcaption { color: var(--muted); font-size: 0.86rem; text-align: center; }
.sb-axis { stroke: var(--muted); stroke-width: 1; }
.sb-tick { stroke: var(--muted); stroke-width: 1; }
.sb-axis-label { fill: var(--muted); font-size: 12px; }
.sb-earth { fill: #3a78c2; }
.sb-moon { fill: #9a9a9a; }
.sb-moon-orbit { stroke: #9a9a9a; stroke-width: 1; stroke-dasharray: 3 3; }
.sb-moon-label { fill: var(--muted); font-size: 12px; }
.sb-pass { fill: var(--sb-rock); fill-opacity: 0.85; stroke: var(--surface); stroke-width: 1; }
.sb-pass.is-inside { fill: var(--sb-inside); }
.sb-pass.is-past { fill-opacity: 0.35; }

/* ---- The fireball map ---- */
.sb-map { position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--sb-ocean); }
.sb-map-fallback { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 12px; text-align: center; color: var(--muted); }
.sb-map.is-live .sb-map-fallback { display: none; }
.sb-map-svg { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.sb-map-land { fill: var(--sb-land); stroke: #c9c3b2; stroke-width: 0.15; }
.sb-map-borders { fill: none; stroke: #d8d2c2; stroke-width: 0.6; }
.sb-map-grid { fill: none; stroke: rgb(29 93 134 / 0.12); stroke-width: 1; }
.sb-fb { fill: var(--sb-fire); fill-opacity: 0.75; stroke: #fff; }
.sb-fb.is-hot { fill-opacity: 1; stroke: var(--text); }
.sb-map-card { position: absolute; z-index: 3; max-width: 240px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 6px 18px rgb(0 0 0 / 0.18); font-size: 0.86rem; display: grid; gap: 2px; pointer-events: none; }
.sb-map-card[hidden] { display: none; }
.sb-map-card strong { font-weight: 650; }
.sb-map-zoom { position: absolute; z-index: 2; right: 8px; top: 8px; display: grid; gap: 4px; }
.sb-map-zoom[hidden] { display: none; }
.sb-map-zoom button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 1.1rem/1 system-ui, sans-serif; cursor: pointer; }
.sb-map-zoom button:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 1px; }

/* Phones: the key columns; the rest is on wider screens. */
@media (max-width: 560px) {
  .sb-more { display: none; }
  .sb-axis-label, .sb-moon-label { font-size: 18px; }
}
.sb-past { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.sb-past > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
