/* Launches (views/launches.js), one launch (views/launch.js) and In space now (views/in-space.js). */

.launches > .card + .card, .launch-page > .card + .card, .launch-page > .card + .grid-2, .launch-page > .grid-2 + .card { margin-top: var(--space-6); }
.launch-section { container-type: inline-size; }
.launch-section .state { padding: var(--space-8) var(--space-4); }
[aria-busy="true"] > .recent-body, .launch-section[aria-busy="true"] .launch-table-wrap { opacity: 0.55; transition: opacity var(--dur) var(--ease-out); }
.not-announced { font-style: italic; }

/* A page head's eyebrow ("Upcoming launch") at its own small size: app.css sizes every paragraph
   after a head's h1 as the lead, the eyebrow included (a candidate fix for app.css). */
.launch-page .page-title .eyebrow { margin: 0 0 var(--space-2); font-size: var(--step--2); color: var(--ink-2); }

/* "Show times in": beside the title on a wide screen, the zone in words under it. */
.launch-times { display: grid; justify-items: end; gap: var(--space-2); }
.launch-times-words { margin: 0; font-size: var(--step--1); color: var(--ink-2); text-align: right; max-width: 32ch; }

/* When a launch is due, set large (launch.js launchWhen): shared by "Next launch" and a launch's page. */
.launch-when { display: grid; gap: var(--space-2); align-content: start; }
.launch-when p { margin: 0; }
.launch-when-big {
  font: 600 clamp(var(--step-3), 1.2rem + 1.8vw, var(--step-5))/1.1 var(--font-display);
  color: var(--ink);
}
.launch-when-big .countdown { display: inline; font-weight: inherit; }
.launch-when-big.date { font-size: clamp(var(--step-2), 1rem + 1.2vw, var(--step-4)); }
.launch-when-at { font-size: var(--step-0); font-weight: 650; color: var(--ink); }
.launch-when-firm { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); font-size: var(--step--1); color: var(--ink-2); }
.launch-when-firm-words { max-width: 46ch; }
.launch-when-big.outcome { line-height: 1; }
/* An outcome set large: the chip, bigger, its mark bigger. */
.chip.big { gap: 10px; padding: 6px 16px 6px 14px; font: 600 var(--step-2)/1.2 var(--font-display); color: var(--ink); border-width: 1.5px; }
.chip.big .dot { width: 14px; height: 14px; }
.chip.big.bad { border-color: var(--critical); }
.chip.big.warn { border-color: var(--warning); }
.chip.big.good { border-color: var(--good); }

/* The next launch: what, on what, from where; the countdown beside it. */
.card.answer > h2.next-eyebrow { margin: 0 0 var(--space-3); font: 700 var(--step--2)/1.3 var(--font-text); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.next-grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "name when" "what when";
  gap: 0 var(--space-10); align-items: start;
}
.next-grid > .next-name { grid-area: name; }
.next-grid > .launch-when { grid-area: when; }
.next-grid > .next-what { grid-area: what; }
.next-name { margin: 0 0 var(--space-4); font: 600 var(--step-3)/1.15 var(--font-display); }
.next-name a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.next-name a:hover { color: var(--accent-ink); }
.next-facts, .launch-hero-facts { display: grid; gap: var(--space-2); margin: 0 0 var(--space-4); }
.next-facts > div, .launch-hero-facts > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--space-3); }
.next-facts dt, .launch-hero-facts dt { font-size: var(--step--1); font-weight: 600; color: var(--ink-2); }
.next-facts dd, .launch-hero-facts dd { margin: 0; font-weight: 600; }
.next-purpose { margin: 0; font-size: var(--step--1); }
.next-launch .launch-when { padding-left: var(--space-8); border-left: 1px solid var(--hairline); }

/* The lists: grouped by day, the time large in the first column. */
.launch-table th[scope="row"] { font-weight: 600; font-size: var(--step-0); color: var(--ink); white-space: normal; min-width: 10rem; }
.launch-table th[scope="row"] .sub, .launch-table td .sub { display: block; font-size: var(--step--2); font-weight: 400; color: var(--muted); margin-top: 2px; }
.launch-table td.wrap { min-width: 7rem; }
.launch-table td { vertical-align: top; }
.launch-table td.when { width: 11.5rem; white-space: nowrap; }
.launch-table tbody tr:not(.day) > * { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.launch-table tr.day th {
  background: var(--surface-2); color: var(--ink); font: 650 var(--step--1)/1.3 var(--font-text); letter-spacing: 0.01em;
  padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--hairline);
}
.launch-table tbody + tbody tr.day th { border-top: 1px solid var(--hairline); }
.clock { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; }
.clock-figures { font: 600 var(--step-1)/1.2 var(--font-display); color: var(--ink); }
.clock-words { font-size: var(--step--2); font-weight: 600; color: var(--ink-2); }
.clock-unknown { font-size: var(--step--1); color: var(--ink-2); }
.clock-countdown .countdown { display: inline; font-weight: 650; color: var(--ink-2); }
/* A launch that went wrong: a mark at the row's edge; the outcome chip says which in words. */
.launch-table tr.went-wrong > :first-child { box-shadow: inset 3px 0 0 var(--critical); }
.launch-table tr.went-wrong.partial-failure > :first-child { box-shadow: inset 3px 0 0 var(--warning); }
.recent-summary { margin: 0 0 var(--space-4); font-weight: 600; max-width: var(--measure); }
.legend-help { margin-top: var(--space-4); font-size: var(--step--1); }
.legend-help .facts { margin-top: var(--space-1); }
.legend-help dt .chip { vertical-align: middle; }
.launches-note { margin: var(--space-5) 0 0; }

/* Narrow: each launch a block, the time in a column of its own beside the rest. */
@container (max-width: 900px) {
  .launch-table tr:not(.day) { display: grid; grid-template-columns: 7rem minmax(0, 1fr); column-gap: var(--space-4); row-gap: 3px; padding: var(--space-4) var(--space-3); }
  .launch-table tr:not(.day) > * { grid-column: 2; padding: 0; }
  .launch-table tbody tr:not(.day) > * { padding: 0; }
  .launch-table tr:not(.day) > td.when { grid-column: 1; grid-row: 1 / span 6; width: auto; white-space: normal; }
  .launch-table tr:not(.day) > th, .launch-table tr:not(.day) > td { min-width: 0; }
  .launch-table .chip { white-space: normal; }
  .launch-table td.status { margin-top: var(--space-1); }
  .launch-table td.status[data-label]::before { content: none; }
  .launch-table tr.went-wrong > :first-child { box-shadow: none; }
  .launch-table tr.went-wrong { box-shadow: inset 3px 0 0 var(--critical); }
  .launch-table tr.went-wrong.partial-failure { box-shadow: inset 3px 0 0 var(--warning); }
  .launch-table tr.day th { padding: var(--space-2) var(--space-3); }
  .clock { display: grid; justify-items: start; }
}
@container (max-width: 420px) {
  .launch-table tr:not(.day) { grid-template-columns: 5.25rem minmax(0, 1fr); column-gap: var(--space-3); }
}

/* One launch: the hero, then what it carried, then the facts. */
.launch-hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6) var(--space-10); align-items: start;
  padding-bottom: var(--space-6); border-bottom: 1px solid var(--hairline);
}
.launch-hero-facts { margin: 0; padding-left: var(--space-8); border-left: 1px solid var(--hairline); }
.launch-standing { max-width: var(--measure); margin: var(--space-5) 0 0; font-size: var(--step-0); line-height: var(--leading-body); color: var(--ink-2); }
.launch-standing .countdown { display: inline; font-weight: 650; }
.launch-page .page-head .lead { font-size: var(--step-0); }
.launch-page th[scope="row"] { font-weight: 600; font-size: inherit; color: var(--ink); white-space: normal; min-width: 110px; }
.mission-text p { white-space: pre-line; }
.objects-count { margin: 0 0 var(--space-3); font-size: var(--step--1); max-width: var(--measure); }
.source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.source-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--space-3); align-items: baseline; }
.source-list li .chip { grid-row: 1 / span 2; align-self: start; }
.source-list .secondary { font-size: var(--step--1); }

@media (max-width: 900px) {
  .next-grid, .launch-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .next-grid { grid-template-areas: "name" "when" "what"; }
  .next-launch .launch-when { padding: 0 0 var(--space-5); border-left: 0; margin-bottom: var(--space-5); border-bottom: 1px solid var(--hairline); }
  .launch-hero-facts { padding-left: 0; border-left: 0; padding-top: var(--space-5); border-top: 1px solid var(--hairline); }
}
@media (max-width: 640px) {
  .launch-times { justify-items: start; }
  .launch-times-words { text-align: left; }
  .next-name { font-size: var(--step-2); }
  .next-facts > div, .launch-hero-facts > div { grid-template-columns: 7.5rem minmax(0, 1fr); }
  .chip.big { font-size: var(--step-1); }
}

/* ---- In space now ------------------------------------------------------------------------------ */
.in-space > .card + .card, .in-space > section + section { margin-top: var(--space-6); }
.in-space-hero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-10); }
.in-space-count { display: flex; align-items: baseline; gap: var(--space-3); margin: 0; }
.in-space-count-figure { font: 600 clamp(3rem, 2rem + 4vw, 4.5rem)/1 var(--font-display); letter-spacing: -0.015em; }
.in-space-count-words { font: 600 var(--step-2)/1.2 var(--font-display); }
.in-space-where { display: grid; gap: var(--space-1); margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.in-space-where li { display: flex; align-items: baseline; gap: var(--space-2); font-size: var(--step-0); }
.in-space-where b { font: 600 var(--step-1)/1.2 var(--font-display); min-width: 1.6em; text-align: right; }
.in-space-hero-text { flex: 1 1 22rem; }
.in-space-summary { margin: 0 0 var(--space-2); font-size: var(--step-0); color: var(--ink); }
.in-space-caveat { margin: 0; font-size: var(--step--1); color: var(--ink-2); }

.station-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-1); }
.station-head h2 { margin: 0; }
.station-sub { margin: 0 0 var(--space-5); font-size: var(--step--1); color: var(--ink-2); }
.in-space h3 { margin: var(--space-5) 0 var(--space-3); font: 700 var(--step--2)/1.3 var(--font-text); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.in-space h3:first-of-type { margin-top: 0; }
.people, .vehicles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.person, .vehicle { display: grid; gap: 2px; align-content: start; padding: var(--space-3) var(--space-4); border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.person-name, .vehicle-name { margin: 0; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.person-role, .vehicle-kind { margin: 0; font-size: var(--step--1); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.person-when, .vehicle-when { margin: 4px 0 0; font-size: var(--step--2); color: var(--muted); }
.vehicle-port { margin: 0; font-size: var(--step--1); color: var(--ink-2); }
.person .agency, .vehicle .agency { display: inline-block; padding: 0 6px; border-radius: var(--radius-xs); background: var(--surface); font-size: var(--step--2); font-weight: 650; color: var(--ink-2); line-height: 1.6; }
.in-space abbr[title] { text-decoration: underline dotted; cursor: help; }
.events { display: grid; margin: 0; padding: 0; list-style: none; }
.event { display: grid; grid-template-columns: 11rem minmax(0, 1fr) auto; gap: var(--space-1) var(--space-5); align-items: baseline; padding: var(--space-3) 0; border-top: 1px solid var(--hairline); }
.event:first-child { border-top: 0; padding-top: 0; }
.event-when { font-size: var(--step--1); font-weight: 650; color: var(--ink); }
.event-when .sub { display: block; font-weight: 400; color: var(--muted); font-size: var(--step--2); }
.event-what { margin: 0; font-weight: 650; }
.event-where { display: block; font-weight: 400; font-size: var(--step--1); color: var(--ink-2); }
.event-long { font-size: var(--step--1); color: var(--ink-2); white-space: nowrap; }
@media (max-width: 640px) {
  .people, .vehicles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: var(--space-2); }
  .person, .vehicle { padding: var(--space-3); }
  .event { grid-template-columns: minmax(0, 1fr); }
  .in-space-where li { font-size: var(--step--1); }
}
.launch-when.on-hold .launch-when-big { color: var(--ink-2); }
/* What a launch put in orbit: a table, one block per object when the card is narrow. */
.objects-card { container-type: inline-size; }
@container (max-width: 900px) {
  .objects-table td.r { text-align: left; }
}
