/* ============================================================
   WEATHER DUCK — Nightly Outlook (slider)
   Replaces the old "Nightly Cloud Detail" accordion.
   Each panel = one night, with moon altitude arc, sunset/sunrise
   transitions, hourly cloud strip, best-window highlight.
   Uses --sky-* tokens from stargazing-table.css and --wd-* tokens
   from design-tokens.css.
============================================================ */

.sg-no-section {
  /* section-scoped palette */
  --moon-arc-line: #f6efd6;
  --moon-arc-glow: rgba(246, 239, 214, 0.55);
  --horizon-red:   #e63946;
  --sun-orange:    #f4a261;
  --best-green:    #66c685;
  --best-fill:     rgba(102, 198, 133, 0.18);
  --best-edge:     rgba(102, 198, 133, 0.55);
  --no-go-red:     rgba(216, 67, 47, 0.35);
  --no-go-fill:    rgba(216, 67, 47, 0.10);

  font-family: var(--wd-font);
}

/* Title is now .wd-section-title (set in markup) — uses canonical
   site-wide section-title style. No section-specific overrides needed
   here since this card is on a light background like the Tonight card. */

.sg-no-sub {
  font-size: var(--wd-font-size-xs);
  color: var(--wd-text-muted);
  margin-bottom: var(--wd-space-md);
}
.sg-no-sub b { color: var(--wd-text-secondary); font-weight: 600; }

/* ---------- Day tab navigator ---------- */
.sg-no-tabs {
  display: flex;
  gap: var(--wd-space-xs);
  margin-bottom: var(--wd-space-md);
  overflow-x: auto;
  scrollbar-width: none;
}
.sg-no-tabs::-webkit-scrollbar { display: none; }

.sg-no-tab {
  flex: 1;
  min-width: 70px;
  padding: 8px 6px 9px;
  background: var(--wd-bg-subtle);
  border: 1px solid var(--wd-border);
  border-radius: var(--wd-radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font: 700 11px/1 var(--wd-font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wd-text-secondary);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sg-no-tab:hover { background: var(--wd-bg-card); }
.sg-no-tab.is-active {
  background: #1b1b1b;
  color: var(--moon-arc-line);
  border-color: #1b1b1b;
}
.sg-no-tab__moon { font-size: 16px; line-height: 1; }
.sg-no-tab__score {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.sg-no-tab__score--excellent { color: var(--wd-score-excellent-text); }
.sg-no-tab__score--good      { color: var(--wd-score-good-text); }
.sg-no-tab__score--fair      { color: var(--wd-score-fair-text); }
.sg-no-tab__score--poor      { color: var(--wd-score-poor-text); }
.sg-no-tab__score--terrible  { color: var(--wd-score-bad-text); }
.sg-no-tab.is-active .sg-no-tab__score--excellent { color: #5cb8e8; }
.sg-no-tab.is-active .sg-no-tab__score--good     { color: #66c685; }
.sg-no-tab.is-active .sg-no-tab__score--fair     { color: #e8a317; }
.sg-no-tab.is-active .sg-no-tab__score--poor     { color: #f06b48; }
.sg-no-tab.is-active .sg-no-tab__score--terrible { color: #d8432f; }

/* ---------- Slider container ---------- */
.sg-no-slider {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 0 8px;
}
.sg-no-slider::-webkit-scrollbar { display: none; }

/* ---------- Panel (one per night) ---------- */
.sg-no-panel {
  flex: 0 0 100%;
  scroll-snap-align: center;
  border-radius: var(--wd-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  /* background colour set inline per-panel based on cloud cover */
}

.sg-no-panel__head {
  padding: 14px 18px 12px;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wd-space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sg-no-panel__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.sg-no-panel__day {
  color: var(--moon-arc-line);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sg-no-panel__phase {
  color: rgba(246, 239, 214, 0.65);
  font-size: 12px;
  font-weight: 500;
}
.sg-no-panel__moon-emoji {
  font-size: 28px;
  line-height: 1;
}
.sg-no-panel__score-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.sg-no-panel__score {
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.sg-no-panel__score--excellent { color: #5cb8e8; }
.sg-no-panel__score--good      { color: #66c685; }
.sg-no-panel__score--fair      { color: #e8a317; }
.sg-no-panel__score--poor      { color: #f06b48; }
.sg-no-panel__score--terrible  { color: #d8432f; }
.sg-no-panel__score-lbl {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(246, 239, 214, 0.5);
  margin-top: 2px;
}

/* ---------- Best-window banner ---------- */
.sg-no-banner {
  margin: 10px 18px 0;
  padding: 8px 12px;
  border-radius: var(--wd-radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid;
}
.sg-no-banner--go {
  color: #cfe8d6;
  background: var(--best-fill);
  border-color: var(--best-edge);
}
.sg-no-banner--no {
  color: #f6c2a3;
  background: var(--no-go-fill);
  border-color: var(--no-go-red);
}
.sg-no-banner__icon { font-size: 14px; line-height: 1; }
.sg-no-banner__text { flex: 1; }
.sg-no-banner__time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.sg-no-banner__note {
  font-weight: 400;
  color: rgba(246, 239, 214, 0.65);
  font-size: 11.5px;
  margin-left: 4px;
}

/* ---------- Chart area ---------- */
.sg-no-chart-wrap {
  position: relative;
  margin-top: 12px;
}
.sg-no-chart-canvas {
  position: relative;
  height: 220px;
  margin-left: 36px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
}
.sg-no-chart-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* y-axis labels — absolutely positioned to align with viewBox y values */
.sg-no-yaxis-lbl {
  position: absolute;
  left: -32px;
  width: 28px;
  text-align: right;
  font-size: 10px;
  color: rgba(246, 239, 214, 0.55);
  font-variant-numeric: tabular-nums;
  transform: translateY(-50%);
  pointer-events: none;
}
.sg-no-yaxis-lbl--60 { top: 28.3%; }
.sg-no-yaxis-lbl--30 { top: 56.7%; }
.sg-no-yaxis-lbl--0  {
  top: 85%;
  color: rgba(230, 57, 70, 0.85);
  font-weight: 600;
}

/* moonrise / moonset chips on the chart */
.sg-no-chart-lbl {
  position: absolute;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--moon-arc-line);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}
.sg-no-chart-lbl__arrow { font-size: 10px; margin-right: 3px; }
.sg-no-chart-lbl--rise { color: #cfe8d6; }
.sg-no-chart-lbl--set  { color: #f6c2a3; }

/* sunset / sunrise chips — sized to match moonrise/moonset chips */
.sg-no-sun-lbl {
  position: absolute;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--sun-orange);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}

/* moon emoji marker on the arc at peak position */
.sg-no-moon-on-arc {
  position: absolute;
  font-size: 18px;
  line-height: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 0 6px var(--moon-arc-glow));
}

.sg-no-chart-xaxis {
  display: flex;
  justify-content: space-between;
  padding: 6px 18px 12px 36px;
  font-size: 10px;
  color: rgba(246, 239, 214, 0.45);
  font-variant-numeric: tabular-nums;
}

/* ---------- Cloud strip ---------- */
.sg-no-cloud-wrap {
  padding: 0 18px 14px;
}
.sg-no-cloud-lbl {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 239, 214, 0.55);
  margin-bottom: 4px;
}
.sg-no-cloud-strip {
  display: flex;
  height: 26px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.sg-no-cloud-cell {
  flex: 1;
  border-right: 1px solid rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 9px/1 var(--wd-font);
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  letter-spacing: -0.02em;
}
.sg-no-cloud-cell:last-child { border-right: none; }
/* Light cell backgrounds (low cloud %) need dark text for contrast. */
.sg-no-cloud-cell--dark-text {
  color: rgba(0, 0, 0, 0.78);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
@media (max-width: 480px) {
  .sg-no-cloud-cell { font-size: 8px; }
}

/* ---------- Footer stats grid ---------- */
.sg-no-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 18px 18px;
}
.sg-no-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--wd-radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sg-no-stat__lbl {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 239, 214, 0.5);
}
.sg-no-stat__val {
  font-size: 14px;
  font-weight: 700;
  color: var(--moon-arc-line);
  font-variant-numeric: tabular-nums;
}
.sg-no-stat__val .sg-no-dim {
  font-weight: 400;
  color: rgba(246, 239, 214, 0.55);
  font-size: 12px;
}

/* ---------- Slider footer (hint + dots) ---------- */
.sg-no-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--wd-text-muted);
}
.sg-no-controls__hint { font-style: italic; }
.sg-no-dots { display: flex; gap: 5px; }
.sg-no-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease, width 0.2s ease, border-radius 0.2s ease;
}
.sg-no-dot.is-active {
  background: var(--wd-green);
  width: 22px;
  border-radius: 4px;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .sg-no-panel__day { font-size: 16px; }
  .sg-no-panel__moon-emoji { font-size: 24px; }
  .sg-no-panel__score { font-size: 24px; }
  .sg-no-chart-canvas { height: 180px; margin-left: 30px; }
  .sg-no-yaxis-lbl { left: -28px; width: 24px; font-size: 9px; }
  .sg-no-stats { grid-template-columns: repeat(2, 1fr); }
  .sg-no-tab { min-width: 60px; font-size: 10px; }
  .sg-no-tab__moon { font-size: 14px; }
  .sg-no-banner { font-size: 11.5px; padding: 7px 10px; }
}
