/* =============================================
   Moon Path — page styles

   Sibling of sunpath.css and daylight.css.
   Inherits all tokens from css/styles.css.
   Keep the three pages feeling like the same publication.
   ============================================= */

.moonpath-body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--parchment);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.moonpath-main {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem) 6rem;
}

/* =============================================
   Hero — centered intro block
   ============================================= */

.moonpath-hero {
  max-width: 560px;
  margin: 0 auto 2.4rem;
  text-align: center;
}

.moonpath-hero .moonpath-lede {
  margin-left: auto;
  margin-right: auto;
  max-width: 480px;
}

.moonpath-hero .moonpath-entry-prose {
  margin-left: auto;
  margin-right: auto;
}

.moonpath-hero .moonpath-manual-entry {
  justify-content: center;
}

.moonpath-hero .moonpath-field {
  text-align: left; /* labels + inputs stay flush left within their box */
}

/* =============================================
   Sticky scrubber strip
   ============================================= */

.moonpath-scrubber-strip {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--parchment);
  border-bottom: 1px solid rgba(184, 175, 162, 0.2);
  padding: 0.8rem clamp(0.6rem, 3vw, 1.4rem);
  margin: 0 calc(-1 * clamp(1rem, 4vw, 2rem)) 2rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

body.constellation .moonpath-scrubber-strip {
  background-color: rgba(8, 6, 20, 0.85);
  border-bottom-color: rgba(232, 224, 255, 0.18);
}

.moonpath-scrubber-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: 720px;
  margin: 0 auto;
}

.moonpath-scrubber-row .mp-date-scrubber {
  flex: 1 1 auto;
  margin: 0;
}

.moonpath-scrubber-row .mp-scrubber-label {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.78rem;
  color: var(--stone);
  font-style: italic;
  min-width: 14rem;
  text-align: right;
  white-space: nowrap;
}

.mp-play-btn {
  flex: 0 0 auto;
  min-width: 40px;
  height: 32px;
  padding: 0 0.55em;
  border: 1px solid rgba(184, 175, 162, 0.45);
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.mp-play-btn:hover {
  border-color: var(--stone);
}

.mp-play-btn[aria-pressed="true"] {
  background-color: rgba(184, 175, 162, 0.18);
}

.mp-play-glyph {
  display: block;
}

/* ▶ glyph needs slight optical-center offset when paused */
.mp-play-btn[data-speed="0"] .mp-play-glyph {
  transform: translateX(1px);
}

body.constellation .mp-play-btn {
  border-color: rgba(232, 224, 255, 0.35);
  color: rgba(232, 224, 255, 0.92);
}

body.constellation .mp-play-btn:hover {
  border-color: rgba(232, 224, 255, 0.7);
}

.mp-scrubber-footnote-details {
  max-width: 720px;
  margin: 0.5rem auto 0;
}

.mp-scrubber-footnote-details > summary {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--stone);
  opacity: 0.6;
  cursor: pointer;
  list-style: none;
  padding: 0.2rem 0;
}

.mp-scrubber-footnote-details > summary::-webkit-details-marker {
  display: none;
}

.mp-scrubber-footnote-details > summary::before {
  content: '› ';
  display: inline-block;
  transition: transform 0.15s ease;
}

.mp-scrubber-footnote-details[open] > summary::before {
  transform: rotate(90deg);
}

.mp-scrubber-footnote-details .mp-scrubber-footnote {
  margin: 0.4rem 0 0;
  max-width: none;
}

/* =============================================
   Widget grid — 2 columns on desktop, 1 on mobile
   ============================================= */

.moonpath-widget-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem clamp(1.2rem, 4vw, 2.4rem);
  align-items: start;
}

@media (min-width: 768px) {
  .moonpath-widget-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* On desktop the 2-column grid IS the visual rhythm — interstitial
     prose is a single-column reading aid and would break row flow if
     forced to span. Mobile (<768px) keeps them visible inline. */
  .moonpath-widget-grid > .mp-interstitial {
    display: none;
  }

  /* Time-series widgets (dome, tide) span both columns. */
  .moonpath-widget-grid > .moonpath-section--full {
    grid-column: 1 / -1;
  }

  /* When dome/tide span full width, SVG can grow wider. */
  .moonpath-section--full .moonpath-dome-svg,
  .moonpath-section--full .moonpath-tide-svg {
    max-width: 560px;
  }
}

/* =============================================
   Header
   ============================================= */

.moonpath-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.01em;
  margin: 0 0 0.4em;
}

.moonpath-lede {
  font-style: italic;
  color: var(--stone);
  margin: 0 0 2.4rem;
  max-width: 480px;
}

/* =============================================
   Sections
   ============================================= */

.moonpath-section {
  margin: 0 0 2.8rem;
}

.moonpath-section-heading {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  letter-spacing: 0.01em;
  margin: 0 0 0.8rem;
}

.moonpath-section--widget {
  margin: 0 0 2rem;
  text-align: center;
}

/* Compact widget padding inside the grid */
.moonpath-widget-grid > .moonpath-section--widget {
  margin-bottom: 0;
}

.moonpath-section--widget svg {
  display: block;
  margin: 0 auto;
}

.moonpath-section--widget p {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

/* Honor [hidden] attribute on widget children — the widget-level
   display:block rules above otherwise win on specificity. */
.moonpath-section--widget svg[hidden],
.moonpath-section--widget p[hidden]:not(#mp-earthshine) {
  display: none;
}

/* Earthshine annotation inside Phase widget always occupies its
   natural height; we toggle opacity instead of [hidden] to keep
   the Phase widget's height constant across scrub. The renderer
   still sets the [hidden] attribute for a11y (screen-readers see
   the prose appear/disappear), but the visual layout is stable. */
#mp-phase #mp-earthshine {
  margin-top: 0.6rem;
  transition: opacity 0.2s ease;
}

#mp-phase #mp-earthshine[hidden] {
  display: block;       /* override the broader [hidden] display:none rule */
  opacity: 0;
  visibility: hidden;   /* belt-and-suspenders so screen-reader still skips */
}

/* =============================================
   Coord entry block
   ============================================= */

.moonpath-entry-prose {
  color: var(--stone);
  font-style: italic;
  margin: 0 0 1.4rem;
  max-width: 420px;
}

.moonpath-locate-btn {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(184, 175, 162, 0.45);
  border-radius: 2px;
  padding: 0.55em 1.1em;
  cursor: pointer;
  margin: 0 0 1.6rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.moonpath-locate-btn:hover {
  border-color: var(--stone);
  color: var(--stone);
}

.moonpath-locate-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.moonpath-manual-entry {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.moonpath-field {
  flex: 1 1 140px;
  min-width: 120px;
}

/* =============================================
   Preset places
   ============================================= */

.moonpath-presets-prose {
  margin: 1.8rem 0 0.8rem;
  font-style: italic;
  color: var(--stone);
  font-size: 0.88rem;
}

.moonpath-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.moonpath-preset {
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--stone);
  background: transparent;
  border: 1px solid rgba(184, 175, 162, 0.35);
  border-radius: 14px;
  padding: 0.35em 0.85em;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.moonpath-preset:hover {
  border-color: var(--stone);
  color: var(--ink);
}

.moonpath-preset-tide {
  opacity: 0.5;
  margin-left: 0.3em;
  font-style: italic;
}

body.constellation .moonpath-preset {
  border-color: rgba(232, 224, 255, 0.28);
  color: rgba(232, 224, 255, 0.6);
}

body.constellation .moonpath-preset:hover {
  border-color: rgba(232, 224, 255, 0.6);
  color: rgba(232, 224, 255, 0.95);
}

/* Scrubber + play disabled until a coord is set */
.mp-date-scrubber:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.mp-play-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.moonpath-label {
  display: block;
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--stone);
  margin: 0 0 0.3rem;
}

.moonpath-input {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(184, 175, 162, 0.35);
  border-radius: 0;
  padding: 0.25rem 0;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.moonpath-input::-webkit-inner-spin-button,
.moonpath-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.moonpath-input:focus {
  border-bottom-color: var(--stone);
}

/* =============================================
   Slice 4 SVG widgets
   ============================================= */

/* --- Moon-in-sky dome diagram --- */

.moonpath-dome-svg {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  overflow: visible;
}

.mp-dome-horizon {
  stroke: var(--stone);
  stroke-width: 1;
  opacity: 0.35;
}

.mp-dome-arc {
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-opacity: 0.7;
}

.mp-dome-arc--below {
  stroke-dasharray: 3 4;
  stroke-opacity: 0.25;
}

.mp-dome-marker {
  stroke: var(--stone);
  stroke-width: 1;
}

.mp-dome-label {
  font-family: var(--font-ui);
  font-size: 10px;
  fill: var(--stone);
  text-anchor: middle;
}

.mp-dome-transit {
  fill: none;
  stroke: var(--stone);
  stroke-width: 1.5;
}

.mp-dome-now {
  fill: var(--ink);
  opacity: 0.75;
}

/* --- Phase clock --- */

.moonpath-phase-svg {
  display: block;
  width: 100%;
  max-width: 180px;
  height: auto;
}

.mp-phase-ring {
  fill: none;
  stroke: var(--stone);
  stroke-width: 1;
  opacity: 0.35;
}

.mp-phase-wedge {
  fill: var(--ink);
  opacity: 0.2;
}

.mp-phase-label {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  fill: var(--stone);
  text-anchor: middle;
}

.mp-phase-pct {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 16px;
  fill: var(--ink);
  text-anchor: middle;
}

/* --- Apparent size dial --- */

.moonpath-dial-svg {
  display: block;
  width: 100%;
  max-width: 140px;
  height: auto;
}

.mp-size-dial-ring {
  fill: none;
  stroke: var(--stone);
  stroke-width: 1;
  opacity: 0.25;
}

.mp-size-dial-mean {
  stroke: var(--stone);
  stroke-width: 1;
  opacity: 0.5;
  stroke-dasharray: 2 3;
}

.mp-size-dial-needle {
  stroke: var(--ink);
  stroke-width: 1.5;
  opacity: 0.65;
}

.mp-size-dial-dot {
  fill: var(--ink);
  opacity: 0.65;
}

/* --- Lux brightness ring --- */

.moonpath-lux-svg {
  display: block;
  width: 100%;
  max-width: 140px;
  height: auto;
}

.mp-lux-ring {
  fill: none;
  stroke-width: 6;
}

.mp-lux-ring--bright {
  stroke: var(--ink);
  opacity: 0.55;
}

.mp-lux-ring--mid {
  stroke: var(--ink);
  opacity: 0.35;
}

.mp-lux-ring--dim {
  stroke: var(--stone);
  opacity: 0.3;
}

.mp-lux-ring--faint {
  stroke: var(--stone);
  opacity: 0.15;
}

.mp-lux-ring--below {
  stroke: var(--stone);
  stroke-width: 1;
  opacity: 0.18;
  stroke-dasharray: 3 4;
}

/* =============================================
   Annotations
   ============================================= */

.moonpath-annotation {
  font-style: italic;
  color: var(--stone);
  margin: 0.8rem 0 0;
  font-size: 0.95rem;
}

.moonpath-tz-note {
  font-size: 0.72rem;
  opacity: 0.55;
  letter-spacing: 0.04em;
}

.moonpath-crosslink {
  margin: 1.2rem 0 0;
  font-size: 0.95rem;
  color: var(--stone);
}

.moonpath-crosslink a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* =============================================
   Slice 3 — Moonrise azimuth dial
   ============================================= */

.moonpath-azimuth-svg {
  display: block;
  width: 100%;
  max-width: 140px;
  height: auto;
  margin: 0 auto;
}

.mp-azimuth-ring {
  fill: none;
  stroke: var(--stone);
  opacity: 0.25;
  stroke-width: 1;
}

.mp-azimuth-tick--cardinal {
  stroke: var(--stone);
  stroke-width: 1;
  opacity: 0.45;
}

.mp-azimuth-tick--intercardinal {
  stroke: var(--stone);
  stroke-width: 1;
  opacity: 0.2;
}

.mp-azimuth-label {
  font-family: var(--font-ui);
  font-size: 9px;
  fill: var(--stone);
  text-anchor: middle;
}

.mp-azimuth-needle {
  stroke: var(--ink);
  stroke-width: 1.5;
  opacity: 0.7;
}

.mp-azimuth-center-dot {
  fill: var(--ink);
  opacity: 0.65;
}

.mp-azimuth-dial--circumpolar {
  opacity: 0.5;
}

/* =============================================
   Slice 2 — Date scrubber
   ============================================= */

.mp-scrubber-footnote {
  font-style: italic;
  color: var(--stone);
  font-size: 0.82rem;
  opacity: 0.75;
  margin: 0 0 1rem;
  max-width: 480px;
  line-height: 1.55;
}

.mp-date-scrubber {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 1px;
  background: rgba(184, 175, 162, 0.4);
  outline: none;
  cursor: pointer;
  margin: 0.4rem 0;
}

.mp-date-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.65;
  cursor: pointer;
}

.mp-date-scrubber::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  opacity: 0.65;
  cursor: pointer;
}

.mp-date-scrubber:focus {
  outline: none;
}

.mp-scrubber-label {
  font-family: var(--font-ui);
  font-style: italic;
  font-weight: 300;
  font-size: 0.82rem;
  color: var(--stone);
  margin: 0.2rem 0 2rem;
  letter-spacing: 0.02em;
  min-height: 1.2em;
  text-align: center;
}

/* =============================================
   Slice 2 — Interstitial prose placeholders
   ============================================= */

.mp-interstitial {
  font-style: italic;
  color: var(--stone);
  font-size: 0.92rem;
  margin: -1rem 0 1.6rem;
  max-width: 480px;
  line-height: 1.55;
}

.mp-interstitial[hidden] {
  display: none;
}

/* =============================================
   Slice 5 — Standstill time-machine
   ============================================= */

.moonpath-standstill-result {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 0.88rem;
  color: var(--stone);
  margin: 0;
  letter-spacing: 0.02em;
  min-height: 1.4em;
}

.moonpath-standstill-callouts {
  margin: 0 0 1rem;
}

.moonpath-standstill-callout {
  font-style: italic;
  color: var(--stone);
  font-size: 0.92rem;
  margin: 0 0 0.4rem;
}

/* =============================================
   Slice 6 — Tide curve
   ============================================= */

.moonpath-tide-svg {
  display: block;
  width: 100%;
  max-width: 380px;
  height: auto;
  overflow: visible;
}

.mp-tide-zero {
  stroke: var(--stone);
  stroke-width: 1;
  opacity: 0.2;
  stroke-dasharray: 2 4;
}

.mp-tide-now {
  stroke: var(--stone);
  stroke-width: 1;
  opacity: 0.35;
}

.mp-tide-curve {
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-opacity: 0.65;
}

.mp-tide-marker {
  fill: none;
  stroke-width: 1;
}

.mp-tide-marker--high {
  stroke: var(--ink);
  opacity: 0.6;
}

.mp-tide-marker--low {
  stroke: var(--stone);
  opacity: 0.5;
}

.mp-tide-label {
  font-family: var(--font-ui);
  font-size: 9px;
  fill: var(--stone);
  text-anchor: middle;
}

.mp-tide-king-flag {
  color: var(--stone);
}

/* =============================================
   Footer — matches sunpath/daylight footer rules
   ============================================= */

.moonpath-footer {
  margin-top: 6rem;
  padding: 3rem clamp(1rem, 4vw, 2rem) 4rem;
  border-top: 1px solid rgba(184, 175, 162, 0.18);
  text-align: center;
  color: var(--stone);
}

.moonpath-footer-inner {
  max-width: 760px;
  margin: 0 auto;
}

.moonpath-footer-attribution {
  margin: 0 0 1.4rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink);
}

.moonpath-footer-attribution a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 175, 162, 0.4);
  padding-bottom: 1px;
  transition: border-bottom-color 0.2s ease;
}

.moonpath-footer-attribution a:hover {
  border-bottom-color: var(--ink);
}

.moonpath-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.6rem;
  font-size: 0.9rem;
}

.moonpath-footer-links a {
  color: var(--stone);
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 175, 162, 0.25);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-bottom-color 0.2s ease;
}

.moonpath-footer-links a:hover {
  color: var(--ink);
  border-bottom-color: var(--stone);
}

.moonpath-footer-sep {
  color: var(--stone);
  opacity: 0.35;
}

.moonpath-footer-license {
  margin: 0;
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  opacity: 0.55;
}

body.constellation .moonpath-footer {
  border-top-color: rgba(232, 224, 255, 0.15);
}

body.constellation .moonpath-footer-attribution {
  color: rgba(232, 224, 255, 0.92);
}

body.constellation .moonpath-footer-attribution a {
  border-bottom-color: rgba(232, 224, 255, 0.35);
}

body.constellation .moonpath-footer-attribution a:hover {
  border-bottom-color: rgba(232, 224, 255, 0.85);
}

body.constellation .moonpath-footer-links a {
  color: rgba(232, 224, 255, 0.55);
  border-bottom-color: rgba(232, 224, 255, 0.2);
}

body.constellation .moonpath-footer-links a:hover {
  color: rgba(232, 224, 255, 0.95);
  border-bottom-color: rgba(232, 224, 255, 0.5);
}

/* =============================================
   Slice 4 — Eclipse pointer widget
   ============================================= */

.mp-eclipse-content {
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.mp-eclipse-line {
  font-style: italic;
  color: var(--stone);
  margin: 0.2rem 0;
  font-size: 0.95rem;
}

.mp-eclipse-fallback {
  font-style: italic;
  color: var(--stone);
  margin: 0.2rem 0;
  font-size: 0.95rem;
  opacity: 0.65;
}
