/* The Sun and Moon morsels (/sun-morsels, /moon-morsels, ADR 0053), light
   theme; morsels-dark.css overrides it (linked like css/dark.css). Each morsel
   is a band: its text beside a working figure. The figures are SVG drawn by
   the morsels island (web/src/morsels) and every color comes from the mx-*
   classes here, because the Content-Security-Policy forbids style attributes.
   The (i) sources and the closed source list reuse learn.css. */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
}

.mx-page {
  --mx-serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --mx-ac: var(--accent-moon);
  --mx-ac-soft: var(--accent-moon-soft);
  --mx-band: #f1eee6;
  --mx-moon: #dcd8ce;
  --mx-mare: #a9a59b;
  --mx-shade: #1a1e2e;
  --mx-warm: #e9a93a;
  --mx-earth: #2f6fb3;
  --mx-night: #2c3a72;
  --mx-day: #e6e1d4;
  --mx-ground: #efe4c8;
}
.mx-page.mx-sun { --mx-ac: #9a7230; --mx-ac-soft: #f3e3c2; }

/* ---- Hero: the Sun or the Moon of this minute ---- */
.mx-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(20px, 3vw, 40px) 0; }
.mx-hero-fig { width: 100%; height: min(500px, 80vw); display: block; }
.mx-kick { color: var(--mx-ac); font-size: 0.9rem; font-weight: 600; margin: 0 0 6px; }
.mx-page h1 { font-family: var(--mx-serif); font-weight: 500; font-size: clamp(2.4rem, 5.5vw, 3.6rem); line-height: 1.04; margin: 0 0 12px; text-wrap: balance; }
.mx-page h2 { font-family: var(--mx-serif); font-weight: 500; font-size: clamp(1.9rem, 3.4vw, 2.5rem); line-height: 1.06; margin: 0 0 10px; text-wrap: balance; }
.mx-intro { font-size: 1.1rem; max-width: 34em; }
.mx-now { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.mx-now dd, .mx-read dd { margin: 0; font: 500 1.7rem/1.15 var(--mx-serif); text-wrap: balance; }
.mx-now dt, .mx-read dt { font-size: 0.85rem; color: var(--muted); }
.mx-now div, .mx-read div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.mx-note { font-size: 0.875rem; color: var(--muted); margin-top: 10px; }

/* ---- Bands ---- */
.mx-band { border-top: 1px solid var(--line); padding: clamp(24px, 4vw, 52px) 0; }
.mx-band:nth-of-type(even) { background: var(--mx-band); box-shadow: 0 0 0 100vmax var(--mx-band); clip-path: inset(0 -100vmax); }
.mx-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 56px); align-items: start; }
.mx-band:nth-of-type(even) .mx-text { order: 2; }
.mx-lede { font-size: 1.08rem; max-width: 36em; }
.mx-big { font: 500 clamp(2.1rem, 5vw, 3.1rem)/1 var(--mx-serif); color: var(--mx-ac); white-space: nowrap; margin: 6px 0; }
.mx-read { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.mx-read div { border-top: 1px solid var(--line); padding-top: 8px; }
.mx-read .mx-lead dd { font-size: clamp(2rem, 4.5vw, 2.8rem); color: var(--mx-ac); }
.mx-inst { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(12px, 2vw, 20px); }
.mx-fig { display: block; width: 100%; height: 320px; }
.mx-fig-s { height: 240px; }
.mx-fig-t { height: 400px; }
.mx-fig-strip { height: 48px; margin-top: 12px; }
.mx-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.mx-ctl { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin-top: 12px; }
.mx-ctl label { display: flex; flex-direction: column; gap: 2px; font-size: 0.875rem; color: var(--muted); flex: 1 1 180px; }
.mx-ctl label.mx-check { flex-direction: row; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 44px; }
.mx-ctl input[type=range] { accent-color: var(--mx-ac); width: 100%; min-height: 44px; }
.mx-ctl input[type=number], .mx-ctl input[type=date], .mx-ctl select { font: inherit; font-size: 1rem; min-height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.mx-btn { font: inherit; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.mx-btn:hover, .mx-chip:hover { border-color: var(--mx-ac); }
.mx-btn:focus-visible, .mx-chip:focus-visible, .mx-row:focus-visible { outline: 2px solid var(--mx-ac); outline-offset: 2px; }
.mx-year { font: 500 1.75rem/1 var(--mx-serif); min-width: 3em; text-align: center; }
.mx-nojs { font-size: 0.875rem; color: var(--muted); }
.mx-sub { font-size: 0.9rem; font-weight: 600; margin: 16px 0 6px; }
.mx-p { margin: 0 0 12px; max-width: 36em; }
.mx-how summary { cursor: pointer; color: var(--mx-ac); min-height: 44px; display: flex; align-items: center; }

/* ---- Lists, chips, months and bars the script fills ---- */
.mx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mx-chip { font: inherit; font-size: 0.875rem; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.mx-chip[aria-pressed=true] { background: var(--mx-ac); border-color: var(--mx-ac); color: var(--surface); }
.mx-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.mx-months div { border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 0.875rem; min-height: 60px; }
.mx-months b { display: block; font-weight: 600; font-size: 0.8rem; color: var(--muted); }
.mx-months .mx-blue { background: var(--mx-ac-soft); border-color: var(--mx-ac); }
.mx-fm { display: inline-block; margin: 2px 6px 0 0; white-space: nowrap; }
.mx-fm-blue { color: var(--mx-ac); font-weight: 600; }
.mx-muted { color: var(--muted); }
.mx-list { columns: 2; column-gap: 24px; padding: 0; margin: 8px 0 0; list-style: none; font-size: 0.875rem; }
.mx-list li { break-inside: avoid; padding: 3px 0; border-bottom: 1px solid var(--line); }
.mx-rows { display: grid; gap: 6px; }
.mx-row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 5.5em; gap: 10px; align-items: center; font: inherit; font-size: 0.875rem; color: var(--text); border: 0; background: none; min-height: 32px; padding: 0; text-align: left; border-radius: 6px; }
button.mx-row { cursor: pointer; }
.mx-bar { height: 14px; background: var(--line); border-radius: 7px; overflow: hidden; }
.mx-bar i { display: block; height: 100%; width: 0; background: var(--mx-ac); border-radius: 7px; }
.mx-row-neg .mx-bar i { background: var(--muted); }
.mx-row-on { outline: 1px solid var(--mx-ac); outline-offset: 3px; }
.mx-v { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mx-table { border-collapse: collapse; width: 100%; font-size: 0.875rem; margin-top: 14px; }
.mx-table th, .mx-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.mx-table .mx-n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mx-months-row { display: grid; grid-template-columns: repeat(12, 1fr); font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

/* ---- Figures ---- */
.mx-fig text { font: 13px system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; fill: var(--muted); }
.mx-fig .mx-label { fill: var(--text); }
.mx-fig .mx-label-ac { fill: var(--mx-ac); }
.mx-hair { fill: none; stroke: var(--line); stroke-width: 1; }
.mx-grid-line { fill: none; stroke: var(--line); stroke-width: 1; }
.mx-faint { fill: none; stroke: var(--muted); stroke-width: 1; }
.mx-dashed { stroke-dasharray: 4 4; }
.mx-line { fill: none; stroke: var(--mx-ac); stroke-width: 2; }
.mx-thick { stroke-width: 5; stroke-linecap: round; }
.mx-dot { fill: var(--mx-ac); }
.mx-ring { fill: var(--surface); stroke: var(--text); stroke-width: 1.2; }
.mx-ink { fill: var(--text); }
.mx-cursor { stroke: var(--text); stroke-width: 1.2; }
.mx-sunline { fill: none; stroke: var(--mx-warm); stroke-width: 2; stroke-dasharray: 4 4; }
.mx-moon { fill: var(--mx-moon); }
.mx-mare { fill: var(--mx-mare); fill-opacity: 0.75; }
.mx-crater { fill: #fff; fill-opacity: 0.55; }
.mx-night { fill: var(--mx-shade); fill-opacity: 0.9; }
.mx-limb { fill: none; stroke: var(--text); stroke-width: 0.8; stroke-opacity: 0.5; }
.mx-grid { fill: none; stroke: var(--text); stroke-width: 0.5; stroke-opacity: 0.25; }
.mx-earth { fill: var(--mx-earth); }
.mx-planet { fill: var(--mx-ac); fill-opacity: 0.85; }
.mx-planet-over { fill: var(--muted); fill-opacity: 0.55; }
.mx-sky { fill: var(--mx-band); stroke: var(--muted); stroke-width: 1; }
.mx-sun-0 { stop-color: #fff4d6; }
.mx-sun-1 { stop-color: #f6cf6e; }
.mx-sun-2 { stop-color: #d98b2b; }
.mx-ray { stroke: var(--mx-ac); stroke-width: 0.8; stroke-opacity: 0.55; }
.mx-granule { fill: #b8761f; fill-opacity: 0.35; }
.mx-sun-zone { fill: var(--mx-ac-soft); }
.mx-photon { fill: var(--mx-warm); }
.mx-ground { fill: var(--mx-ground); }
.mx-shadow { stroke: var(--mx-ac); stroke-width: 5; stroke-linecap: round; }
.mx-stick { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.mx-polar-day { fill: var(--mx-warm); }
.mx-polar-night { fill: var(--mx-night); }
.mx-day { fill: var(--mx-day); }

@media (max-width: 900px) {
  .mx-hero, .mx-wrap { grid-template-columns: minmax(0, 1fr); }
  .mx-band:nth-of-type(even) .mx-text { order: 0; }
  .mx-hero-fig { height: 340px; }
}
@media (max-width: 600px) {
  .mx-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mx-list { columns: 1; }
  .mx-row { grid-template-columns: 6em minmax(0, 1fr) 4.8em; }
  .mx-now dd { font-size: 1.5rem; }
}
@media print {
  .mx-ctl, .mx-chips { display: none !important; }
}
