/* Observatory Atlas styling for Introduction to Astronomy Explore article */
body {
  --astro-surface: #fbfaf7;
  --astro-card: #ffffff;
  --astro-border: var(--studio-line, #e2ded5);
  --astro-ink: var(--studio-ink, #1c1e21);
  --astro-muted: var(--studio-muted, #63686e);
  --astro-gold: #b57c1e;
  --astro-gold-soft: rgba(181, 124, 30, 0.10);
  --astro-blue: #275dad;
  --astro-blue-soft: rgba(39, 93, 173, 0.09);
  --astro-crimson: #b83b3b;
  --astro-crimson-soft: rgba(184, 59, 59, 0.09);
  --astro-teal: #1c7c6d;
  --astro-teal-soft: rgba(28, 124, 109, 0.09);
  --astro-night: #0c1526;
  --astro-night-2: #15243d;
}

body.quarto-dark {
  --astro-surface: #181b20;
  --astro-card: #1d2128;
  --astro-border: var(--studio-line, #303640);
  --astro-gold: #eab965;
  --astro-gold-soft: rgba(234, 185, 101, 0.13);
  --astro-blue: #7cb0ff;
  --astro-blue-soft: rgba(124, 176, 255, 0.13);
  --astro-crimson: #f07b7b;
  --astro-crimson-soft: rgba(240, 123, 123, 0.13);
  --astro-teal: #62ccb9;
  --astro-teal-soft: rgba(98, 204, 185, 0.13);
}

/* Epigraph & Cosmic prologue */
.astro-prologue {
  margin: 0.5rem 0 2rem;
  padding: 1.35rem 1.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--astro-night) 0%, var(--astro-night-2) 100%);
  color: #edf2f9;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.astro-prologue blockquote {
  margin: 0 0 0.85rem;
  padding: 0 0 0 0.95rem;
  border-inline-start: 3px solid #e6be70;
  color: #f8f4ea;
  font-size: 1.02rem;
  line-height: 1.65;
}

.astro-prologue p:last-child {
  margin: 0;
  color: #b9c8dc;
  font-size: 0.93rem;
  line-height: 1.7;
}

/* Scale hierarchy pills */
.scale-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  margin: 1.1rem 0 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--astro-border);
  border-radius: 10px;
  background: var(--astro-surface);
  font-size: 0.88rem;
}

.scale-node {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--astro-card);
  border: 1px solid var(--astro-border);
  font-weight: 600;
  color: var(--astro-ink);
}

.scale-node.is-highlight {
  border-color: var(--astro-gold);
  background: var(--astro-gold-soft);
  color: var(--astro-gold);
}

.scale-arrow {
  color: var(--astro-muted);
  font-family: var(--bs-font-monospace);
  font-size: 0.82rem;
}

/* Cosmic Calendar Timeline */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.2rem 0 1.6rem;
}

.cal-card {
  padding: 0.85rem 1rem;
  border: 1px solid var(--astro-border);
  border-radius: 9px;
  background: var(--astro-card);
}

.cal-card.is-midnight {
  grid-column: span 2;
  border-color: var(--astro-gold);
  background: var(--astro-gold-soft);
}

.cal-card.is-future {
  border-style: dashed;
  background: var(--astro-crimson-soft);
}

.cal-date {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--bs-font-monospace);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--astro-blue);
}

.cal-card.is-midnight .cal-date {
  color: var(--astro-gold);
}

.cal-card.is-future .cal-date {
  color: var(--astro-crimson);
}

.cal-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

/* Dark observatory SVG figure frame */
.astro-figure {
  margin: 1.6rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--astro-border);
  background: #0b1322;
}

.astro-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.astro-figure figcaption {
  padding: 0.65rem 1.1rem;
  background: var(--astro-surface);
  border-top: 1px solid var(--astro-border);
  color: var(--astro-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

/* Multi-column feature cards (Markdown + MathJax safe via fenced divs) */
.astro-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.astro-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
  margin: 1.25rem 0 1.5rem;
}

.astro-card {
  padding: 1.05rem 1.15rem;
  border: 1px solid var(--astro-border);
  border-radius: 10px;
  background: var(--astro-card);
  font-size: 0.93rem;
  line-height: 1.68;
}

.astro-card > :first-child {
  margin-top: 0;
}

.astro-card > :last-child {
  margin-bottom: 0;
}

.astro-card h4 {
  margin: 0 0 0.5rem;
  font-family: var(--studio-serif-bold);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--astro-ink);
}

.astro-card.accent-gold {
  border-top: 3px solid var(--astro-gold);
}

.astro-card.accent-blue {
  border-top: 3px solid var(--astro-blue);
}

.astro-card.accent-crimson {
  border-top: 3px solid var(--astro-crimson);
}

.astro-card.accent-teal {
  border-top: 3px solid var(--astro-teal);
}

/* Historical Chronicle Dossier */
.chronicle {
  margin: 1.35rem 0 1.6rem;
  padding: 1.05rem 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--astro-border);
  border-inline-start: 4px solid var(--astro-gold);
  background: var(--astro-surface);
  font-size: 0.93rem;
  line-height: 1.7;
}

.chronicle > :first-child {
  margin-top: 0;
}

.chronicle > :last-child {
  margin-bottom: 0;
}

.chronicle-label {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding: 0.12rem 0.55rem;
  border-radius: 4px;
  background: var(--astro-gold-soft);
  color: var(--astro-gold);
  font-family: var(--studio-sans);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Formula Spotlight Box */
.formula-deck {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.2rem 0 1.5rem;
}

.formula-box {
  padding: 0.95rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--astro-border);
  background: var(--astro-surface);
  font-size: 0.91rem;
}

.formula-box > :first-child {
  margin-top: 0;
}

.formula-box > :last-child {
  margin-bottom: 0;
}

/* Observatory Site & Telescope Pills */
.site-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0 1.25rem;
}

.site-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--astro-border);
  background: var(--astro-card);
  font-size: 0.82rem;
}

.site-badge code {
  font-size: 0.78rem;
  color: var(--astro-teal);
}

@media (max-width: 760px) {
  .calendar-grid,
  .astro-grid-2,
  .astro-grid-3,
  .formula-deck {
    grid-template-columns: 1fr;
  }

  .cal-card.is-midnight {
    grid-column: span 1;
  }
}
