/* Summer vs winter solar estimator.
   Shared by blog/solar-panel-output-summer-vs-winter.html and the embeddable
   copy at embed/summer-vs-winter-solar.html. Colours come from onsun.css
   custom properties, so the tool follows whichever theme the host page sets. */
.st-tool {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 1.1rem;
  margin: 1.6rem 0 2rem;
}
/* Dark theme: match the TL;DR highlight box instead of the flat card navy. */
[data-theme="dark"] .st-tool {
  background: linear-gradient(135deg, rgba(255, 77, 141, 0.08) 0%, rgba(0, 212, 170, 0.05) 100%);
  border-color: var(--chip-border);
  box-shadow: none;
}
/* Title on its own line, the button row always underneath it. */
.st-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}
.st-title { display: flex; align-items: center; gap: 0.5rem; }
.st-title h3 { margin: 0; font-size: 1.05rem; color: var(--text-primary); }
/* The blog rounds and shadows every .article img; the logo keeps its own shape. */
.st-logo { width: 26px; height: 26px; flex: none; border-radius: 7px; box-shadow: none; }
.st-logo-link { display: inline-flex; line-height: 0; }
.st-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem; }
/* "Use my location" holds the left edge; the two copy buttons sit hard right. */
.st-head-actions #st-locate { margin-right: auto; }
.st-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.32rem 0.8rem;
  cursor: pointer;
  min-height: 34px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.st-btn:hover { border-color: var(--border-strong); }
.st-btn svg { width: 16px; height: 16px; flex: none; }
.st-btn-primary { background: var(--chip-bg); border-color: var(--chip-border); color: var(--coral); }
/* Copy buttons confirm by animating themselves: a quick pop and a tick. */
.st-copy-btn { min-width: 9.6rem; justify-content: center; }
/* Share holds a shorter label, but still wide enough that "Copied" fits without a jump. */
#st-share.st-copy-btn { min-width: 7rem; }
.st-copy-btn .st-icon-tick, .st-copy-btn .st-label-done { display: none; }
.st-copy-btn.st-copied { background: var(--chip-bg); border-color: var(--chip-border); color: var(--coral); animation: st-pop 0.5s ease; }
.st-copy-btn.st-copied .st-icon-idle { display: none; }
.st-copy-btn.st-copied .st-icon-tick, .st-copy-btn.st-copied .st-label-done { display: block; }
.st-copy-btn.st-copied .st-label-idle { display: none; }
@keyframes st-pop {
  0% { transform: scale(1); }
  35% { transform: scale(0.94); }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .st-copy-btn.st-copied { animation: none; } }
#st-map {
  height: 340px;
  background: var(--surface-soft);   /* Leaflet defaults to #ddd, which showed as a pale edge */
  border-radius: var(--r-media);
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 0;
}
/* The site rounds every .article img; that would round each 256px map
   tile, leaving star-shaped gaps where four tile corners meet. */
#st-map img { border-radius: 0; box-shadow: none; }
[data-theme="dark"] #st-map { border-color: transparent; }
[data-theme="dark"] .st-field input[type="number"],
[data-theme="dark"] .st-field select,
[data-theme="dark"] .st-fallback input,
[data-theme="dark"] .st-info-tip { background: rgba(10, 10, 26, 0.65); }
[data-theme="dark"] #st-map .leaflet-control-attribution { background: rgba(10, 10, 26, 0.7); color: var(--text-muted); }
.st-hint { margin: 0.7rem 0 0; font-size: 0.88rem; color: var(--text-secondary); }
.st-msg { margin: 0.7rem 0 0; font-size: 0.88rem; color: var(--coral); }
.st-fallback { display: none; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.7rem; }
.st-fallback label { font-size: 0.85rem; color: var(--text-secondary); }
.st-fallback input { width: 6.5rem; font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); color: var(--text-primary); }
.st-settings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem 1.2rem;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-media);
  padding: 0.9rem 1rem;
  margin-top: 0.9rem;
}
.st-field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.35rem; }
.st-field input[type="number"], .st-field select {
  width: 100%; font: inherit; font-size: 0.9rem; padding: 0.5rem 0.6rem;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-card); color: var(--text-primary);
}
.st-field input[type="range"] { width: 100%; accent-color: var(--coral); }
.st-field .st-range-val { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.st-results { margin-top: 1rem; }
.st-loc { font-size: 0.85rem; color: var(--text-secondary); margin: 0 0 0.6rem; }
.st-loc strong { color: var(--text-primary); }
.st-toggle-row {
  display: flex; align-items: center; justify-content: center; gap: 0.7rem;
  margin: 0.4rem 0 0.9rem;
}
.st-toggle-label { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); transition: color 0.15s ease; }
.st-toggle-label.active { color: var(--text-primary); }
.st-switch {
  position: relative; width: 54px; height: 32px; flex: none;
  border-radius: var(--r-pill); border: 1px solid var(--border-strong);
  background: var(--gradient-accent); cursor: pointer; padding: 0;
  transition: background 0.2s ease;
}
.st-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
  border-radius: 50%; background: #ffffff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.st-switch[aria-checked="true"] { background: #6b7787; }
.st-switch[aria-checked="true"]::after { transform: translateX(22px); }
#st-chart-wrap { position: relative; }
#st-chart { display: block; width: 100%; height: 260px; }
.st-legend { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; margin: 0.5rem 0 0.9rem; }
.st-legend span { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--text-secondary); }
.st-legend i { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.st-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; }
.st-stat {
  background: var(--surface-soft); border: 1px solid var(--border);
  border-radius: var(--r-media); padding: 0.75rem 0.6rem; text-align: center;
}
.st-stat .st-num { font-size: 1.15rem; font-weight: 800; color: var(--coral); }
.st-stat .st-lab { font-size: 0.72rem; color: var(--text-secondary); margin-top: 0.2rem; line-height: 1.3; }
.st-fine-row { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; font-size: 0.78rem; color: var(--text-muted); }
/* Download prompt: shares the fine-print row rather than sitting in its own box. */
.st-dl { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; margin-left: auto; }
.st-dl span { font-size: 0.78rem; color: var(--text-secondary); }
.st-dl a { display: inline-flex; line-height: 0; }
.st-dl img { height: 26px; width: auto; border-radius: 0; box-shadow: none; }
.st-info-btn {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface-soft);
  color: var(--text-secondary); font: italic 700 0.8rem Georgia, serif;
  cursor: pointer; line-height: 1; padding: 0;
}
.st-info-btn:hover { border-color: var(--coral); color: var(--coral); }
.st-info-tip {
  display: none; position: absolute; bottom: calc(100% + 10px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: var(--r-media); box-shadow: var(--shadow-card);
  padding: 0.8rem 0.9rem; font-size: 0.76rem; color: var(--text-secondary);
  line-height: 1.5; z-index: 5;
}
.st-fine-row:hover .st-info-tip,
.st-fine-row:focus-within .st-info-tip,
.st-fine-row.open .st-info-tip { display: block; }
@media (max-width: 560px) {
  .st-tool { padding: 0.8rem; }
  #st-map { height: 260px; }
  .st-stats { grid-template-columns: repeat(2, 1fr); }
  #st-chart { height: 220px; }
}
