/* ==========================================================================
   ScienceHutch: The life cycle of a star (stellar-lifecycle.html only).
   Page colors come from the shared palette in main.css. The space artwork
   inside the illustration keeps its own scientific colors on purpose.
   ========================================================================== */

/* ======= PAGE ======= */
.stellar-page {
  flex: 1;
  width: 100%;
  padding: clamp(24px, 5vw, 56px) 16px;
}
.stellar-hero, .stellar-panel, .stellar-footnote { max-width: 900px; margin-inline: auto; }

/* ======= INTRO ======= */
.stellar-hero { margin-bottom: 30px; }
.stellar-hero h1 {
  margin: 8px 0 14px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.stellar-hero > p:last-child { max-width: 650px; color: var(--muted); font-size: 1.1rem; }
.stellar-eyebrow {
  margin: 0;
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ======= PANELS ======= */
.stellar-panel {
  margin-bottom: 24px;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 20px;
  background: var(--surface);
}
.stellar-panel h2 { margin: 8px 0 16px; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; }
.stellar-panel h3 { margin: 22px 0 5px; font-size: 1.05rem; }
.stellar-panel h3 span { color: var(--orange); }
.stellar-panel p { margin: 8px 0 16px; }
.stellar-panel-top, .stellar-slider-heading, .stellar-range-labels, .stellar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.stellar-panel-top {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ======= SIX-STAGE TIMELINE ======= */
.stellar-timeline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 20px 0;
}
.stellar-timeline button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 48px;          /* comfortable tap size on phones */
  padding: 4px 3px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;  /* the orange bar shows the choice */
}
.stellar-timeline button:hover { color: var(--ink); }
.stellar-timeline button.active { color: var(--ink); font-weight: 700; }
.stellar-track { width: 100%; height: 6px; border-radius: 8px; background: #3A2A26; }
.stellar-timeline button:hover .stellar-track { background: #5A3A30; }
.stellar-timeline button.active .stellar-track { background: linear-gradient(90deg, var(--red), var(--orange)); }
.stellar-timeline-label { font-size: 0.72rem; line-height: 1.2; text-align: center; }

/* ======= ILLUSTRATION ======= */
.stellar-art {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 22px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.stellar-object { animation: stellar-appear 0.45s ease-out both; transform-origin: 300px 140px; }
@keyframes stellar-appear {
  from { opacity: 0.3; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ======= DURATION + TEMPERATURE ======= */
.stellar-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.stellar-stats > div, .stellar-result, .stellar-feedback {
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-2);
}
.stellar-stats small, .stellar-result small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stellar-stats strong { display: block; margin-top: 5px; font-size: 0.98rem; }

/* ======= PREVIOUS / NEXT ======= */
.stellar-actions { margin-top: 26px; }
.stellar-actions button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #5A3A30;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.stellar-actions button:hover { border-color: var(--orange); }
.stellar-actions button.stellar-primary {
  border-color: var(--orange);
  background: var(--orange);
  color: var(--on-accent);
  font-weight: 700;
}
.stellar-actions button.stellar-primary:hover { background: #FF9D4D; }
.stellar-actions button:disabled { opacity: 0.4; cursor: not-allowed; border-color: #5A3A30; }

/* ======= STELLAR MASS SLIDER ======= */
.stellar-slider-heading { margin-top: 22px; font-weight: 700; }
.stellar-slider-heading output { color: var(--orange); font-size: 1.4rem; }
.stellar-page input[type="range"] {
  width: 100%;
  height: 32px;              /* bigger touch area for the thumb */
  margin: 14px 0 2px;
  accent-color: var(--orange);
  cursor: pointer;
}
.stellar-range-labels { color: var(--muted); font-size: 0.8rem; }
.stellar-result { margin-top: 20px; border-left: 4px solid var(--orange); }
.stellar-result h3 { margin-top: 0; }
.stellar-result > strong {
  display: block;
  margin: 7px 0;
  color: var(--orange);
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.2;
}
.stellar-note { color: var(--muted); font-size: 0.8rem; }

/* ======= QUIZ ======= */
.stellar-quiz { margin: 0; padding: 0; border: 0; }
.stellar-quiz legend { margin-bottom: 14px; font-weight: 700; }
.stellar-quiz label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 9px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.stellar-quiz label:hover { border-color: var(--orange); }
.stellar-quiz label:has(input:checked) { border-color: var(--orange); background: var(--surface-2); }
.stellar-quiz input { width: 20px; height: 20px; flex: none; accent-color: var(--orange); }
.stellar-feedback { margin-top: 16px; border-left: 4px solid var(--muted); }
.stellar-feedback.is-correct { border-left-color: var(--orange); }
.stellar-feedback.is-correct strong { color: var(--orange); }
.stellar-feedback.is-wrong { border-left-color: var(--red); }
.stellar-feedback.is-wrong strong { color: #FF6B57; }  /* lighter red, readable as text */
.stellar-feedback p { margin-bottom: 0; }

/* ======= FOOTNOTE ======= */
.stellar-footnote { padding: 10px 0 0; color: var(--muted); font-size: 0.82rem; }

/* ======= PHONES ======= */
@media (max-width: 600px) {
  /* Stage names are hidden on screen (numbers only) but still read aloud. */
  .stellar-timeline-label {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .stellar-timeline { gap: 2px; }
  .stellar-panel { padding-inline: 14px; }
  .stellar-stats { grid-template-columns: 1fr; }
  .stellar-panel-top { font-size: 0.64rem; }
  .stellar-actions button { padding: 10px 13px; }
}

/* ======= REDUCED MOTION ======= */
@media (prefers-reduced-motion: reduce) {
  .stellar-object { animation: none; }
}
