/* The object profile (views/satellite.js and its profile-*.js parts) and its cards. The pass list
   on it is styled in passes.css, its height chart in weather.css (charts).

   One column in reading order: the answer at the top (name, what it is, whose, working, actions),
   the figures people ask for, a sticky "On this page" bar, then one card per section. Cards that
   hold two things (the verdict and its passes, the map and its figures, the story and its drawing)
   are containers and set them side by side when the card itself is wide enough. */

.profile-page { max-width: 1180px; display: flex; flex-direction: column; gap: var(--space-5); }
.profile-page > *, .profile-page > .card + .card { margin: 0; min-width: 0; }
/* The bar runs to the page's edges, as app.css draws it; the page's gap spaces it. */
.profile-page > .section-nav { margin: 0 calc(-1 * var(--page-pad)); }
.profile-loading { display: grid; gap: var(--space-6); }

/* ---- The answer at the top ---------------------------------------------------------------- */
.profile-hero { margin: 0 0 var(--space-1); align-items: flex-end; }
.profile-hero h1 { overflow-wrap: anywhere; }
.profile-hero .catalogue-name { margin: var(--space-2) 0 0; font-size: var(--step--1); color: var(--ink-2); }
/* What it is: one line, in ink, a step above body text. */
.profile-hero .page-head-text > .lead { color: var(--ink); margin-top: var(--space-3); }
/* Wikidata's one line, and for a station who is aboard: quieter than what it is. (Each is a
   paragraph after the h1, which .page-head would set as a lead.) */
.profile-hero .wikidata-line { margin: var(--space-2) 0 0; max-width: var(--measure); color: var(--ink-2); font-size: var(--step--1); line-height: 1.45; }
.wikidata-line .wikidata-text { color: var(--ink); }
.profile-hero .profile-station { margin: var(--space-1) 0 0; max-width: var(--measure); color: var(--ink-2); font-size: var(--step-0); }
.profile-hero .profile-station-link { margin: var(--space-2) 0 0; max-width: var(--measure); color: var(--ink); font-size: var(--step-0); }
.profile-station-link a { font-weight: 650; }
/* The short answers (whose it is, is it working, coming down), each a small label over its answer. */
.profile-answers { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-8); margin: var(--space-5) 0 0; }
.profile-answers > div { min-width: 0; max-width: 44ch; }
.profile-answers dt {
  margin-bottom: var(--space-1); font-size: var(--step--2); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}
.profile-answers dd { margin: 0; font-weight: 650; line-height: var(--leading-snug); overflow-wrap: anywhere; }
.profile-answers .disputed { font-weight: 400; color: var(--ink-2); }
/* "Is it working?": the answer's words in a chip whose dot echoes them, as the status chips do. */
.chip.answer-chip { padding: 3px 12px 3px 10px; font-size: var(--step--1); color: var(--ink); white-space: normal; line-height: 1.35; }
.profile-hero .page-actions { padding-top: var(--space-2); }

/* "Not named yet." and "The sources disagree.": calm notes, the words carrying the meaning. */
.profile-page > .callout { margin: 0; }
.sources-disagree p { margin: 0 0 var(--space-1); }
.sources-disagree ul { margin: 0; padding-left: 18px; }
.sources-disagree li + li { margin-top: var(--space-1); }

/* The figures people ask for, as stat tiles; up to four in a row on a wide screen. */
.tiles.profile-figures { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 0; }
.profile-figures .tile .value { font-size: var(--step-3); overflow-wrap: anywhere; }
@media (min-width: 900px) {
  .tiles.profile-figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- Cards --------------------------------------------------------------------------------- */
.profile-page .card > h2 { font-size: var(--step-2); margin-bottom: var(--space-4); }
.profile-page .card > h2 .live-dot { vertical-align: 0.18em; margin-right: var(--space-2); }
.profile-page .card > p:last-child { margin-bottom: 0; }
/* A scrolling table is a named region that takes focus; show where focus is. */
.profile-page .table-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- Can I see it? (the answer card) ------------------------------------------------------- */
.profile-see { container-type: inline-size; }
.see-body { display: grid; gap: var(--space-6); }
.see-verdict > :last-child { margin-bottom: 0; }
/* The verdict, large: the answer to the question the visitor came with. */
.see-lead {
  margin: 0 0 var(--space-3); max-width: 34ch;
  font: 500 clamp(var(--step-1), 2.6cqi, var(--step-3))/1.28 var(--font-display); color: var(--ink);
}
/* Brightness as stars, above the words that say it (aria-hidden: the verdict says it). */
.see-lead .stars { display: block; width: auto; height: 22px; margin-bottom: var(--space-3); }
/* Something to go out and see: the starlight-gold rule beside the answer. */
.see-verdict.can-see { padding-left: var(--space-4); border-left: 3px solid var(--gold); }
.see-note, .see-whose, .see-home { margin: 0 0 var(--space-2); max-width: 52ch; font-size: var(--step--1); color: var(--ink-2); }
.see-home a { font-weight: 650; }
.see-list { min-width: 0; }
/* "Passes you can see" / "Every pass", above the list, with the guide to listening by radio beside it. */
.see-choice { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-4); }
.see-choice[hidden] { display: none; }
.see-choice .guide-line { margin: 0; }
.see-list > :first-child { margin-top: 0; }
.see-passes.disclosure { border-top: 0; }
@container (min-width: 800px) {
  .see-body.has-list { grid-template-columns: minmax(280px, 1fr) minmax(320px, 620px); gap: var(--space-8); align-items: start; }
  /* The answer stays in view beside a long list of passes. */
  .see-body.has-list .see-verdict { position: sticky; top: calc(var(--topbar-h) + 64px); }
}

/* ---- Where it is right now ----------------------------------------------------------------- */
.profile-where { container-type: inline-size; }
.where-body { display: grid; gap: var(--space-5); }
.mini-map { position: relative; aspect-ratio: 2 / 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--map-ocean); border: 1px solid var(--hairline); }
.mini-map canvas { width: 100%; height: 100%; display: block; }
.where-figures .readout { margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-5); }
.where-figures .readout > div { padding: var(--space-2) 0 var(--space-3); border-bottom: 1px solid var(--hairline); min-width: 0; }
.where-figures .readout .v { overflow-wrap: anywhere; }
.where-sky .v { font-size: var(--step--1); font-weight: 600; line-height: 1.45; }
/* How old the orbit data is: said plainly, set quietly. */
.where-age { margin-top: var(--space-2); }
.where-age .readout > div { border-bottom: 0; padding-bottom: var(--space-1); }
.where-age .orbit-age-note { margin: 0; color: var(--muted); font-size: var(--step--2); }
.where-age .stale-warning { margin-top: var(--space-1); }
.no-position .fetch-note { margin: var(--space-3) 0 0; font-size: var(--step--1); }
.horizons-note { margin: var(--space-3) 0 0; }
@container (min-width: 760px) {
  .where-body { grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: var(--space-6); align-items: start; }
}
/* Where a spacecraft beyond Earth orbit is (JPL Horizons). */
.where-summary { font-size: var(--step-1); line-height: 1.45; }

/* ---- In plain English ---------------------------------------------------------------------- */
.profile-story { container-type: inline-size; }
.story-body { display: grid; gap: var(--space-6); }
.story-text p { max-width: 64ch; color: var(--ink); }
.story-text > :last-child { margin-bottom: 0; }
.orbit-figure { align-self: start; padding: var(--space-4); border-radius: var(--radius); background: var(--surface-2); }
.orbit-figure svg { width: 100%; height: auto; max-height: 260px; display: block; }
/* The Earth's edge is what the orbit is measured against: 3:1 on the figure's ground (WCAG 1.4.11). */
.orbit-figure .orbit-earth { fill: var(--map-land); stroke: var(--field-border); stroke-width: 1; }
.orbit-figure .orbit-path { fill: none; stroke: var(--series-1); stroke-width: 2.5; }
.orbit-figure .orbit-label { fill: var(--ink-2); font: 600 12px var(--font-text); }
.orbit-figure .earth-label { font-weight: 500; }
.orbit-figure figcaption { margin-top: var(--space-2); font-size: var(--step--2); line-height: 1.45; color: var(--muted); }
@container (min-width: 780px) {
  .story-body.with-figure { grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); gap: var(--space-10); }
}
/* The groups it is listed in: each a name that leads to the list, with what it is beneath. */
.story-groups { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--hairline); }
.story-groups h3 { margin-bottom: var(--space-3); }
.group-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3) var(--space-8); }
.group-list a { display: inline-block; min-height: 24px; font-weight: 650; }
.group-desc { display: block; max-width: 60ch; font-size: var(--step--1); line-height: 1.45; color: var(--ink-2); }
@container (min-width: 700px) {
  .group-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Who is aboard --------------------------------------------------------------------------- */
.aboard-list { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: var(--space-2); }
.aboard-list li { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--surface-2); line-height: var(--leading-snug); }
.aboard-detail { display: block; margin-top: 2px; font-size: var(--step--1); color: var(--ink-2); }
.aboard abbr[title] { text-decoration: underline dotted; cursor: help; }
.aboard-docked { margin-bottom: 0; }

/* ---- Radio: each transmitter a sentence, its technical details beneath in smaller type. ------ */
.radio-card h3 { margin: var(--space-4) 0 var(--space-2); font-size: var(--step--1); color: var(--ink-2); }
.radio-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.radio-alias { font-size: var(--step--1); }
.radio-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.radio-list li { padding-left: var(--space-3); border-left: 2px solid var(--hairline); }
.radio-sentence { display: block; }
.radio-details { display: block; font-size: var(--step--2); color: var(--muted); overflow-wrap: anywhere; }
.radio-more { margin-top: var(--space-3); }
.radio-more summary { color: var(--ink-2); font-size: var(--step--1); font-weight: 600; }
.radio-more[open] summary { margin-bottom: var(--space-2); }

/* ---- Coming back down ---------------------------------------------------------------------- */
.reentry-card p { max-width: var(--measure); }
.reentry-card time { font-variant-numeric: tabular-nums; }
.reentry-card .reentry-answer { font-size: var(--step-1); line-height: 1.45; color: var(--ink); }

/* ---- How it got to space ------------------------------------------------------------------- */
.launch-links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.launch-link { max-width: var(--measure); }
.launch-link a { display: inline-block; min-height: 24px; font-weight: 650; }
.siblings { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--hairline); }
.launch-links:empty + .siblings, .profile-launch > h2 + .siblings { margin-top: 0; padding-top: 0; border-top: 0; }
.sibling-intro { margin: 0 0 var(--space-3); color: var(--ink-2); }
.sibling-chips { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.sibling-chips .chip { white-space: normal; overflow-wrap: anywhere; min-height: 28px; font-size: var(--step--1); }
.sibling-chips .chip-note { color: var(--muted); }
.sibling-all { margin: 0; font-size: var(--step--1); }
.sibling-all a { display: inline-block; min-height: 24px; padding: 2px 0; font-weight: 650; }

/* ---- Recent alerts ------------------------------------------------------------------------- */
.alert-lines { list-style: none; margin: 0; padding: 0; }
.alert-lines li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px var(--space-4); padding: var(--space-2) 0; border-bottom: 1px solid var(--hairline); }
.alert-lines li:last-child { border-bottom: 0; }
.alert-line-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.alert-line-when { color: var(--muted); font-size: var(--step--1); white-space: nowrap; font-variant-numeric: tabular-nums; }
.profile-alerts .small-print { margin-top: var(--space-3); font-size: var(--step--1); }

/* ---- Technical details: a container, so its tables stack into labelled rows when it is narrow
   (table.stackable in app.css). ----------------------------------------------------------------- */
.profile-tech { container-type: inline-size; }
.profile-tech .tech-intro { font-size: var(--step--1); margin: 0 0 var(--space-2); }
.tech-details > summary { overflow-wrap: anywhere; }
.tech-body h3 { margin: var(--space-6) 0 var(--space-2); }
.tech-body > h3:first-child { margin-top: var(--space-2); }
.profile-page .facts { grid-template-columns: minmax(110px, 34%) minmax(0, 1fr); }
.profile-page .facts dd { overflow-wrap: anywhere; }
.record-links { margin: 0; padding-left: 18px; }
.record-links li + li { margin-top: var(--space-1); }
.record-links a { display: inline-block; min-height: 24px; }

/* ---- Phones -------------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .profile-page { gap: var(--space-4); }
  .profile-page .card > h2 { font-size: var(--step-1); margin-bottom: var(--space-3); }
  .profile-answers { gap: var(--space-3) var(--space-6); margin-top: var(--space-4); }
  /* The actions under the answer, each a full-size target sharing the row. */
  .profile-hero .page-actions { width: 100%; padding-top: 0; }
  .profile-hero .page-actions .btn { flex: 1 1 auto; height: 44px; }
  .profile-figures .tile .value { font-size: var(--step-2); }
  /* Two figures side by side, then each further one (the launch, the size with its caveats) on a
     row of its own, so a long note never towers beside a short one; a lone figure takes the row. */
  .profile-figures .tile:nth-child(n + 3), .profile-figures .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .see-verdict.can-see { padding-left: var(--space-3); }
  .see-lead .stars { height: 18px; }
}

/* A card's closing "see them all" link: a full-size line, not fine print. */
.reentry-card > .small-print:last-child, .aboard > .small-print:last-child { font-size: var(--step--1); }
.reentry-card > .small-print:last-child a, .aboard > .small-print:last-child a { display: inline-block; min-height: 24px; padding: 2px 0; font-weight: 650; }
