/* ============================================================
   SOLAR WEATHER — solarweather.css
   ============================================================ */

.solarweather-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.solarweather-hero {
  text-align: center;
  margin-bottom: var(--space-6);
}

.solarweather-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-gold-400), var(--color-amber-500), var(--color-red-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-2);
}

.solarweather-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-lg);
  margin: 0;
}

/* Loading */
.sw-loading {
  text-align: center;
  padding: var(--space-10) 0;
  color: var(--text-secondary);
}

/* Hero block (image + tabs + caption + safety) */
.sw-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-5);
}

.sw-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sw-tab {
  flex: 1 1 0;
  min-width: 90px;
  padding: var(--space-3) var(--space-2);
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sw-tab:last-child {
  border-right: none;
}

.sw-tab:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.sw-tab.active {
  background: rgba(212, 160, 23, 0.12);
  color: var(--color-gold-300);
  border-bottom: 2px solid var(--color-gold-500);
}

.sw-tab-label {
  font-size: var(--text-sm);
  font-weight: 700;
}

.sw-tab-sub {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sw-tab.active .sw-tab-sub {
  color: var(--color-gold-400);
}

.sw-hero-image-wrap {
  background: #000;
  display: flex;
  justify-content: center;
  padding: var(--space-3);
}

.sw-hero-image {
  width: 100%;
  max-width: 512px;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
}

.sw-hero-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}

.sw-hero-satellite {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-gold-400);
}

.sw-hero-caption {
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
}

.sw-hero-caption strong {
  color: var(--color-gold-300);
  font-weight: 600;
}

.sw-safety {
  margin: 0 var(--space-4) var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-left: 3px solid var(--color-red-500);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.sw-safety strong {
  color: var(--color-red-400);
  display: block;
  margin-bottom: 4px;
  font-size: var(--text-sm);
}

/* Status line */
.sw-status {
  text-align: center;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.sw-status strong {
  color: var(--color-gold-400);
  font-family: var(--font-display);
}

.sw-status-aurora {
  color: var(--text-secondary);
}

.sw-status-alert {
  color: var(--color-red-400);
  font-weight: 600;
}

.sw-sev-low { border-left: 3px solid var(--color-green-500); }
.sw-sev-active { border-left: 3px solid var(--color-gold-500); }
.sw-sev-storm { border-left: 3px solid var(--color-amber-500); }
.sw-sev-severe { border-left: 3px solid var(--color-red-500); }

/* Indian context */
.sw-indian {
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--color-gold-500);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
}

.sw-indian h3 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gold-400);
  margin: 0 0 var(--space-2);
}

.sw-indian p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0 0 var(--space-2);
}

.sw-indian p:last-child { margin-bottom: 0; }

/* Nerd mode block — shown only when body.nerd-active (global toggle from header pill).
   Resets the default .nerd-detail compact-mono style so big sections look normal. */
.nerd-active .sw-nerd-block.nerd-detail {
  margin: 0 0 var(--space-6);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--color-gold-500);
  border-radius: var(--radius-lg);
  font-size: inherit;
  font-family: inherit;
  color: inherit;
  line-height: inherit;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Hidden by default; the rule above only activates when body has .nerd-active */

.sw-section h3 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-heading);
  margin: 0 0 var(--space-2);
}

.sw-data-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-sm);
  gap: var(--space-2);
}

.sw-data-row:last-child {
  border-bottom: none;
}

.sw-data-row span {
  color: var(--text-secondary);
}

.sw-data-row strong {
  font-family: var(--font-display);
  color: var(--text-primary);
  font-weight: 600;
}

.sw-ar-loc {
  font-family: monospace;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.sw-note {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: var(--space-2) 0 0;
  line-height: var(--leading-relaxed);
}

/* Plain-English explainer at the top of each nerd section */
.sw-explain {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-3);
  line-height: var(--leading-relaxed);
  padding: var(--space-2) var(--space-3);
  background: rgba(212, 160, 23, 0.04);
  border-left: 2px solid var(--color-gold-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sw-explain strong {
  color: var(--color-gold-300);
  font-weight: 600;
}

.sw-data-row em {
  font-style: normal;
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

/* Status line helper text */
.sw-status-line {
  font-size: var(--text-base);
  margin-bottom: var(--space-1);
}

.sw-status-explain {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
}

.sw-status-explain strong {
  color: var(--text-secondary);
  font-weight: 600;
}

/* NOAA Scales */
.sw-scales {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .sw-scales {
    grid-template-columns: repeat(3, 1fr);
  }
}

.sw-scale {
  padding: var(--space-3);
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.sw-scale-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-2);
  gap: var(--space-2);
}

.sw-scale-letter {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
}

.sw-sev-low .sw-scale-letter { color: var(--color-green-400); }
.sw-sev-active .sw-scale-letter { color: var(--color-gold-400); }
.sw-sev-storm .sw-scale-letter { color: var(--color-amber-500); }
.sw-sev-severe .sw-scale-letter { color: var(--color-red-400); }

.sw-scale-name {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: right;
}

.sw-scale-bars {
  display: flex;
  gap: 3px;
  margin-bottom: var(--space-2);
}

.sw-scale-cell {
  flex: 1;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 2px;
}

.sw-sev-low .sw-scale-cell.filled { background: var(--color-green-500); }
.sw-sev-active .sw-scale-cell.filled { background: var(--color-gold-500); }
.sw-sev-storm .sw-scale-cell.filled { background: var(--color-amber-500); }
.sw-sev-severe .sw-scale-cell.filled { background: var(--color-red-500); }

.sw-scale-text {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* Alerts */
.sw-alert {
  background: var(--bg-surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}

.sw-alert > summary {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
}

.sw-alert > summary::-webkit-details-marker { display: none; }

.sw-alert pre {
  padding: var(--space-3);
  font-size: 11px;
  font-family: monospace;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-input);
}

/* Mobile */
@media (max-width: 640px) {
  .solarweather-hero h1 {
    font-size: var(--text-3xl);
  }
  .sw-tab-label {
    font-size: var(--text-xs);
  }
  .sw-hero-image {
    max-width: 100%;
  }
}
