/* style.css  -  The Life of a Star
   My stylesheet. I switched it to a white background because I think it's
   easier to read, especially printing out my notes for school. I keep it
   simple - I'm still learning CSS. */

body {
  font-family: Verdana, Arial, sans-serif;
  background-color: #ffffff;
  color: #222222;
  line-height: 1.6;
  font-size: 17px;
  margin: 0;
}

.wrap {
  max-width: 850px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: #1559b0; }
a:hover { color: #b8860b; }

img { max-width: 100%; height: auto; }

/* skip link for screen readers - my teacher told me to add this */
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 10px;
  top: 10px;
  background: #ffd66b;
  color: #000;
  padding: 6px 10px;
}

/* ---- header and menu ---- */
header.site {
  background-color: #f3f5fa;
  border-bottom: 2px solid #c9d2e6;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #222;
}
.brand .logo { width: 34px; height: 34px; }
.brand b { font-size: 18px; }
.brand small {
  display: block;
  color: #667;
  font-size: 11px;
  font-weight: normal;
}

.menu-btn {
  display: none;
  background: #e7ecf6;
  color: #222;
  border: 1px solid #b9c4dc;
  padding: 6px 10px;
  cursor: pointer;
}

nav.main ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
}
nav.main a {
  color: #333;
  text-decoration: none;
  font-size: 15px;
}
nav.main a:hover { text-decoration: underline; color: #1559b0; }
nav.main a.active { color: #1559b0; font-weight: bold; }

/* ---- headings and text ---- */
h1 { font-size: 28px; color: #182a4e; }
h2 { font-size: 22px; color: #182a4e; border-bottom: 1px solid #d4dae8; padding-bottom: 4px; }
h3 { font-size: 18px; color: #1559b0; }

main { padding: 10px 0 40px; }
section { margin: 26px 0; }

.lead-block { color: #444; }
.muted { color: #667; }
.center { text-align: center; }

/* ---- simple hero (no animations) ---- */
.hero { padding: 24px 0; }
.hero h1 { font-size: 30px; margin-bottom: 6px; }
.hero .tag { color: #b8860b; font-size: 14px; }
.hero p.lead { color: #444; }

/* ---- links that look like buttons (kept simple) ---- */
.btn {
  display: inline-block;
  background: #1559b0;
  color: #ffffff;
  text-decoration: none;
  padding: 9px 16px;
  border: 1px solid #114a93;
  font-weight: bold;
}
.btn:hover { background: #114a93; color: #fff; }
.btn.ghost {
  background: transparent;
  color: #1559b0;
  border: 1px solid #1559b0;
}
.btn.ghost:hover { background: #eef3fb; color: #114a93; }
.btn-row { margin-top: 16px; }
.btn-row .btn { margin-right: 8px; margin-bottom: 8px; }

/* ---- boxes ---- */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.card {
  background: #f7f9fc;
  border: 1px solid #d4dae8;
  padding: 14px;
  flex: 1 1 220px;
}
.card h3 { margin-top: 0; }
.more { font-weight: bold; }

.panel {
  background: #f3f5fa;
  border: 1px solid #d4dae8;
  padding: 16px;
}

/* simple callout boxes */
.fact {
  border-left: 4px solid #e0a800;
  background: #fff8e6;
  padding: 10px 14px;
  margin: 16px 0;
}
.fact b { color: #9a6f00; }
.note {
  border-left: 4px solid #b06bcc;
  background: #f8f0fb;
  padding: 10px 14px;
  margin: 16px 0;
  font-style: italic;
}

.pill {
  display: inline-block;
  border: 1px solid #c9d2e6;
  background: #f3f5fa;
  padding: 2px 8px;
  font-size: 13px;
  color: #556;
}
.big-num { font-size: 30px; font-weight: bold; color: #1559b0; }

/* ---- tables ---- */
table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15px;
}
table.data caption {
  text-align: left;
  color: #667;
  margin-bottom: 6px;
  font-size: 14px;
}
table.data th, table.data td {
  border: 1px solid #cdd5e4;
  padding: 8px 10px;
  text-align: left;
}
table.data th { background: #e9eef7; }
table.data tr:nth-child(even) td { background: #f7f9fc; }

/* ---- journal entries ---- */
.entry {
  border-bottom: 1px solid #d4dae8;
  padding: 14px 0;
}
.entry .date { color: #b8860b; font-weight: bold; font-size: 14px; }
.entry h3 { color: #222; margin: 4px 0; }
.entry .mood { color: #667; font-size: 14px; font-style: italic; }

/* ---- timeline (kept very simple) ---- */
.timeline {
  border-left: 2px solid #c9d2e6;
  padding-left: 18px;
  margin: 20px 0;
}
.tl-item { margin-bottom: 18px; }
.tl-item .when { color: #b8860b; font-weight: bold; font-size: 14px; }
.tl-item h3 { margin: 2px 0; }

/* ---- crumbs ---- */
.crumb { color: #667; font-size: 14px; margin: 8px 0; }
.crumb a { color: #667; }

/* ---- footer ---- */
footer.site {
  border-top: 2px solid #c9d2e6;
  background: #f3f5fa;
  padding: 22px 0;
  margin-top: 30px;
  color: #556;
  font-size: 14px;
}
footer.site .cols { display: flex; flex-wrap: wrap; gap: 30px; }
footer.site .cols > div { flex: 1 1 200px; }
footer.site a { color: #556; }
footer .counter {
  display: inline-block;
  margin-top: 8px;
  font-family: "Courier New", monospace;
  background: #ffffff;
  border: 1px solid #cdd5e4;
  padding: 4px 8px;
  font-size: 13px;
}
footer .counter .num { color: #1559b0; letter-spacing: 2px; font-weight: bold; }

/* ---- quiz ---- */
.quiz-q {
  border: 1px solid #d4dae8;
  background: #f7f9fc;
  padding: 14px;
  margin: 14px 0;
}
.quiz-q .opts { display: block; margin-top: 8px; }
.quiz-q button.opt {
  display: block;
  width: 100%;
  text-align: left;
  background: #ffffff;
  color: #222;
  border: 1px solid #cdd5e4;
  padding: 9px 12px;
  margin: 5px 0;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
}
.quiz-q button.opt:hover { border-color: #1559b0; }
.quiz-q button.opt.correct { background: #e3f5e9; border-color: #4caf72; }
.quiz-q button.opt.wrong { background: #fce4e4; border-color: #d06b6b; }
.quiz-q .explain { margin-top: 8px; color: #444; font-size: 14px; display: none; }
#score { font-size: 17px; font-weight: bold; }

/* ---- glossary ---- */
#glossarySearch {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cdd5e4;
  background: #ffffff;
  color: #222;
  font-size: 15px;
  margin: 8px 0;
  font-family: inherit;
}
.term { border-bottom: 1px solid #d4dae8; padding: 12px 0; }
.term h3 { margin: 0 0 3px; }
.term.hidden { display: none; }

/* ---- video list ---- */
.video {
  border: 1px solid #d4dae8;
  background: #f7f9fc;
  padding: 12px 14px;
  margin: 12px 0;
}
.video h3 { margin: 0 0 4px; }
.video .src { color: #667; font-size: 13px; }

/* ---- star life cycle explorer ---- */
.explorer { display: flex; flex-wrap: wrap; gap: 18px; }
.explorer > div { flex: 1 1 280px; }
/* I keep the diagram box dark like a night sky so my star drawings show up */
.stage-stage {
  background: #0b1026;
  border: 1px solid #2a3360;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.stage-info h3 { margin-top: 0; }
.stage-buttons { margin-bottom: 14px; }
.stage-buttons button {
  background: #e9eef7;
  color: #333;
  border: 1px solid #cdd5e4;
  padding: 6px 10px;
  margin: 0 5px 5px 0;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.stage-buttons button.on { background: #1559b0; color: #fff; font-weight: bold; border-color: #114a93; }

/* simple bar used in the magnetic field comparison */
.meter {
  background: #e9eef7;
  border: 1px solid #cdd5e4;
  height: 16px;
  margin: 6px 0;
}
.meter span { display: block; height: 100%; background: #1559b0; }

/* ---- responsive: phone menu ---- */
@media (max-width: 700px) {
  .menu-btn { display: block; }
  nav.main { width: 100%; display: none; }
  nav.main.open { display: block; }
  nav.main ul { flex-direction: column; gap: 0; }
  nav.main a { display: block; padding: 10px 0; border-top: 1px solid #d4dae8; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
