/* Moon libration (/moon-libration, ADR 0064), light theme, on top of
   learn.css. libration-dark.css overrides it for the dark theme. The figures
   are SVG drawn by the learn island (web/src/learn/libration.ts); every color
   comes from the lb-* classes here, because the Content-Security-Policy
   forbids style attributes. */

.lb-page {
  --lb-far: #f2a65a;
  --lb-feature: #e0703a;
  --lb-always: #dcd6c6;
  --lb-sometimes: #f2b46b;
  --lb-never: #2d3352;
  --lb-track: var(--accent-moon);
}

/* ---- Heights: the island draws to the box it is given ---- */
.lb-h-face { height: clamp(260px, 38vw, 400px); }
.lb-h-find { height: clamp(240px, 30vw, 330px); }
.lb-h-map { aspect-ratio: 2 / 1; height: auto; }

/* ---- The Moon's face ---- */
.lb-mare { fill: var(--lx-moon-sea); fill-opacity: 0.95; }
.lb-crater { fill: #ffffff; fill-opacity: 0.6; }
.lb-far { fill: var(--lb-far); fill-opacity: 0.38; }
.lb-feature { fill: var(--lb-feature); fill-opacity: 0.45; stroke: var(--lb-feature); stroke-width: 1; }
.lb-feature-on { fill-opacity: 0.85; stroke: #ffffff; stroke-width: 1.6; }
.lb-night { fill: #05081a; fill-opacity: 0.82; }
.lb-grid { fill: none; stroke: #1d2547; stroke-width: 0.6; stroke-opacity: 0.35; }
.lb-mean-limb { fill: none; stroke: #1d2547; stroke-width: 1.1; stroke-dasharray: 4 3; stroke-opacity: 0.7; }
.lb-center { stroke: #c2560f; stroke-width: 2; stroke-linecap: round; }
.lb-rim { fill: none; stroke: #ffffff; stroke-opacity: 0.35; stroke-width: 1; }
.lb-leader { stroke: var(--lx-muted-night); stroke-width: 0.8; stroke-opacity: 0.7; }

/* ---- The month's track ---- */
.lb-track { fill: none; stroke: var(--lb-track); stroke-width: 2.2; stroke-linejoin: round; }
.lb-track-past { stroke-opacity: 0.3; stroke-dasharray: 3 3; }
.lb-day { fill: var(--lb-track); }

/* ---- The orbits ---- */
.lb-ghost { fill: var(--lx-moon-lit); fill-opacity: 0.28; }
.lb-nose { stroke: #ffb36b; stroke-width: 2.4; stroke-linecap: round; }
.lb-nose-tip { fill: #ffb36b; }
.lb-angle { fill: none; stroke: #ffb36b; stroke-width: 1.6; }
.lb-axis { stroke: #ffffff; stroke-width: 2; stroke-linecap: round; }
.lb-axis-ghost { stroke: #ffffff; stroke-opacity: 0.35; stroke-width: 1.3; stroke-linecap: round; }
.lb-lat-ring { fill: none; stroke: #ffffff; stroke-opacity: 0.35; stroke-dasharray: 3 4; }
.lb-sight-you { stroke: #ffb36b; stroke-width: 1.6; }
.lb-you { fill: #ffb36b; stroke: #05081a; stroke-width: 1.5; }

/* ---- The map of what we see ---- */
.lb-map-fig { margin-bottom: 12px; }
.lb-always { fill: var(--lb-always); }
.lb-sometimes { fill: var(--lb-sometimes); }
.lb-never { fill: var(--lb-never); }
.lb-map-mare { fill: #8f8873; fill-opacity: 0.45; }
.lb-map-feature { fill: none; stroke: var(--lb-feature); stroke-width: 1.4; }
.lb-map-limb { stroke: var(--text); stroke-opacity: 0.55; stroke-dasharray: 5 4; }
.lb-h-map .lx-label { paint-order: stroke; stroke: var(--lx-panel); stroke-width: 3px; stroke-linejoin: round; }
.lb-key { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 3px; vertical-align: -0.1em; margin: 0 4px 0 10px; border: 1px solid var(--line); }
.lb-key:first-child { margin-left: 0; }
.lb-key-always { background: var(--lb-always); }
.lb-key-sometimes { background: var(--lb-sometimes); }
.lb-key-never { background: var(--lb-never); }

/* ---- Text bits ---- */
.lb-math { margin-top: 6px; padding: 10px 14px; border-radius: 12px; background: var(--accent-moon-soft); font-size: 0.95rem; line-height: 1.5; }
.lb-after { margin-top: 10px; }
.lx-readouts .lb-small-dd { font-size: 0.95rem; font-weight: 600; line-height: 1.35; }

/* ---- When to look ---- */
.lb-features { margin: 2px 0 14px; }
.lb-finder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 22px; align-items: start; }
@media (max-width: 760px) { .lb-finder { grid-template-columns: minmax(0, 1fr); } }
.lb-finder h3 { margin-bottom: 2px; }
.lb-windows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lb-windows li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-window {
  flex: 1 1 15em; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0;
  font: inherit; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.lb-window:hover { border-color: var(--muted); }
.lb-window[aria-pressed="true"] { border-color: var(--accent-moon); background: var(--accent-moon-soft); }
.lb-window:focus-visible { outline: 2px solid var(--accent-moon); outline-offset: 1px; }
.lb-window-date { font-weight: 650; }
.lb-window-detail { color: var(--muted); font-size: 0.86rem; }
.lb-best { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--lb-feature); color: #ffffff; font-size: 0.74rem; font-weight: 650; vertical-align: 0.1em; }
.lb-empty { color: var(--muted); }

@media print {
  .lb-windows .lx-btn { display: none; }
}

/* ---- The photo Moon (NASA's LRO map) under the figure's marks ---- */
.lb-stack { position: relative; }
.lb-stack > .lb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lb-stack > .lx-svg { position: relative; display: block; }
.is-textured .lb-far { fill-opacity: 0.3; }
.is-textured .lb-feature { fill: none; stroke-width: 1.4; }
.is-textured .lb-feature-on { fill: var(--lb-feature); fill-opacity: 0.25; stroke: #ffffff; stroke-width: 1.8; }
.is-textured .lb-grid { stroke: #ffffff; stroke-opacity: 0.3; }
.is-textured .lb-mean-limb { stroke: #ffffff; stroke-opacity: 0.7; }
.is-textured .lb-rim { stroke-opacity: 0.15; }
.is-textured .lb-center { stroke: #ffb36b; }
/* The night sky goes on the wrapper, so the photo sits between it and the marks. */
.lx-night .lb-stack { background: radial-gradient(130% 120% at 75% 15%, var(--lx-night-2) 0%, var(--lx-night) 60%, #070a1f 100%); border-radius: 14px; }
.lx-night .lb-stack > .lx-svg { background: transparent; }
.lb-h-hero { height: clamp(330px, 50vw, 580px); }
