/* Storm Center page (storm-center.html). Builds on styles.css. */

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.nav-link.is-current { color: var(--green); }
.nav-link.is-current::after { transform: scaleX(1); }

/* Title + location picker */
.sc-hero {
  position: relative; isolation: isolate; overflow: hidden; color: var(--cream);
  background:
    radial-gradient(800px 420px at 80% 30%, rgba(42, 97, 44, .55), transparent 65%),
    linear-gradient(160deg, #15321a 0%, var(--forest-900) 60%, var(--forest-950) 100%);
  padding: clamp(48px, 7vw, 84px) 0 clamp(40px, 6vw, 64px);
}
.sc-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../images/rings.svg") no-repeat right -420px center / 1300px auto;
}
.sc-hero-inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: end; }
.sc-hero h1 {
  font-size: clamp(2.8rem, 6.5vw, 5rem); font-weight: 800; text-transform: uppercase;
  line-height: .92; margin-bottom: 18px;
}
.sc-sub { color: rgba(246, 242, 233, .8); font-size: 1.12rem; max-width: 32em; }

.sc-location {
  padding: 22px; border-radius: 18px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(246, 242, 233, .14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.sc-loc-label {
  font-family: var(--font-display); font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .14em; color: var(--hivis);
}
.sc-loc-name {
  margin: 4px 0 16px; font-family: var(--font-display); font-weight: 800; font-size: 1.9rem;
  text-transform: uppercase; line-height: 1.05;
}
.sc-loc-form { display: flex; gap: 8px; }
.sc-loc-form input {
  flex: 1; min-width: 0; padding: 11px 14px; border-radius: 10px;
  border: 1px solid rgba(246, 242, 233, .25); background: rgba(0, 0, 0, .25);
  color: var(--cream); font: inherit; letter-spacing: .08em;
}
.sc-loc-form input::placeholder { color: rgba(246, 242, 233, .55); letter-spacing: normal; }
.sc-loc-form input:focus { outline: 2px solid var(--hivis); border-color: transparent; }
.sc-loc-actions { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; }
.sc-link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 0;
  background: none; border: 0; cursor: pointer;
  color: rgba(246, 242, 233, .88); font: inherit; font-weight: 600;
}
.sc-link-btn:hover { color: var(--hivis); }
.sc-loc-msg { margin-top: 8px; min-height: 1.3em; font-size: .92rem; color: #ffd27a; }
.sc-privacy { margin-top: 4px; font-size: .8rem; color: rgba(246, 242, 233, .55); }

/* Scrolling Missouri & Illinois alert bar */
.sc-ticker {
  display: flex; align-items: stretch;
  background: var(--forest-950); color: var(--cream);
  border-bottom: 3px solid var(--hivis);
}
.sc-ticker.has-alerts { border-bottom-color: #f2b632; }
.sc-ticker-tag {
  flex: none; display: flex; align-items: center; padding: 0 18px;
  background: var(--hivis); color: var(--forest-950);
  font-family: var(--font-display); font-weight: 800; font-size: .95rem;
  text-transform: uppercase; letter-spacing: .1em; white-space: nowrap;
}
.sc-ticker.has-alerts .sc-ticker-tag { background: #f2b632; }
.sc-ticker-window {
  position: relative; flex: 1; min-width: 0; overflow: hidden; padding: 13px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
.sc-ticker-static { padding: 0 24px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-ticker-track { display: flex; width: max-content; animation: marquee var(--dur, 60s) linear infinite; }
.sc-ticker-window:hover .sc-ticker-track { animation-play-state: paused; }
.sc-tick { display: inline-flex; align-items: center; gap: 10px; margin-right: 44px; white-space: nowrap; }
.sc-tick svg { flex: none; width: 16px; height: 16px; fill: var(--hivis); }
.sc-tick strong {
  font-family: var(--font-display); font-weight: 700; font-size: 1.08rem;
  text-transform: uppercase; letter-spacing: .04em; color: var(--hivis);
}
.sc-tick.is-warning strong { color: #f2b632; }
.sc-ticker.paused .sc-ticker-track { animation-play-state: paused; }
.sc-ticker-pause {
  flex: none; width: 46px; border: 0; cursor: pointer;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .06); color: var(--cream);
}
.sc-ticker-pause:hover { background: rgba(255, 255, 255, .12); color: var(--hivis); }
.sc-ticker-pause .i-play { display: none; }
.sc-ticker.paused .sc-ticker-pause .i-play { display: block; }
.sc-ticker.paused .sc-ticker-pause .i-pause { display: none; }

/* Radar + side panel */
.sc-main { padding-top: clamp(36px, 5vw, 56px); }
.sc-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 24px; align-items: start; }
.sc-radar-card, .sc-card {
  padding: 18px; border-radius: 18px;
  background: var(--paper); border: 1px solid var(--sand);
  box-shadow: 0 18px 40px -30px rgba(15, 36, 18, .5);
}
.sc-card + .sc-card { margin-top: 20px; }
.sc-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sc-h { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; margin-bottom: 12px; }
.sc-card-head .sc-h { margin-bottom: 0; }

/* Keeps the map's internal layers from floating over the sticky header */
.sc-map { position: relative; z-index: 0; isolation: isolate; height: 540px; border-radius: 12px; overflow: hidden; background: #dfe3dc; }
.sc-map .leaflet-tile-pane { filter: grayscale(.55) contrast(.95); }
/* LIVE / FORECAST badge over the map (its own stacking context so it never covers the sticky header) */
.sc-map-wrap { position: relative; z-index: 0; isolation: isolate; }
.sc-badge {
  position: absolute; top: 10px; right: 10px; z-index: 500; pointer-events: none;
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
  background: var(--forest-900); color: var(--hivis);
  font-family: var(--font-display); font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .12em;
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .5);
}
.sc-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: sc-blink 1.6s ease-in-out infinite; }
.sc-badge.is-forecast { background: #f2b632; color: #1f1a0a; }
.sc-badge.is-forecast::before { animation: none; }
.sc-badge.is-past { color: var(--cream); }
.sc-badge.is-past::before { animation: none; opacity: .5; }
@keyframes sc-blink { 50% { opacity: .25; } }

/* Clickable timeline under the map: past = solid, now = green, forecast = striped */
.sc-timeline-wrap { margin-top: 12px; }
.sc-timeline { display: flex; gap: 4px; }
.sc-tl-btn {
  flex: 1; height: 12px; padding: 0; border: 0; border-radius: 3px; cursor: pointer;
  background: #c9d3c1; transition: transform .15s ease;
}
.sc-tl-btn:hover { transform: scaleY(1.35); }
.sc-tl-btn.now { background: var(--green); }
.sc-tl-btn.future { background: repeating-linear-gradient(-45deg, #f2c46a 0 4px, #f8dda0 4px 8px); }
.sc-tl-btn.is-active { outline: 2px solid var(--forest-900); outline-offset: 2px; }
.sc-tl-labels { position: relative; height: 18px; margin-top: 6px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.sc-tl-labels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.sc-tl-labels span:first-child { transform: none; }
.sc-tl-labels span:last-child { transform: translateX(-100%); }
.sc-forecast-note { margin-top: 10px; font-size: .86rem; color: var(--muted); }

.sc-radar-controls { display: flex; align-items: center; gap: 10px; }
.sc-frame {
  min-width: 15ch; text-align: right;
  font-family: var(--font-display); font-weight: 700; font-size: .98rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.sc-play {
  width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: var(--forest-900); color: var(--hivis);
}
.sc-play .i-play { display: none; }
.sc-play.paused .i-play { display: block; }
.sc-play.paused .i-pause { display: none; }
.sc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; font-size: .88rem; color: var(--muted); }
.sc-legend-bar {
  width: 150px; height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, #7fd3f5, #3a9ee8, #2fbf3a, #f7e31b, #f39a1b, #e3271b, #c02bd1);
}
.sc-legend-warn { display: inline-flex; align-items: center; gap: 6px; }
.sc-legend-warn:first-of-type { margin-left: 14px; }
.sc-legend-warn i { width: 16px; height: 11px; border: 2px solid var(--w); background: color-mix(in srgb, var(--w) 20%, transparent); border-radius: 2px; }

/* Warning outlines drawn on the radar */
.sc-warn-tip { font-family: var(--font-body); font-size: .85rem; line-height: 1.35; }
.sc-warn-tip strong { display: block; font-family: var(--font-display); font-size: 1rem; text-transform: uppercase; letter-spacing: .03em; }

.sc-pin {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--hivis); border: 3px solid var(--forest-900);
  animation: sc-pulse 2s ease-out infinite;
}
@keyframes sc-pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 242, 58, .7); }
  70%, 100% { box-shadow: 0 0 0 16px rgba(200, 242, 58, 0); }
}

/* Alerts for the chosen location */
.sc-alerts { display: grid; gap: 10px; }
.sc-alert { padding: 12px 14px; border-radius: 12px; background: #fff; border-left: 5px solid var(--c, #2f6fb3); }
.sc-alert.warning { --c: #d23a2a; }
.sc-alert.watch { --c: #f29a1b; }
.sc-alert.advisory { --c: #d9b400; }
.sc-alert h3 { font-size: 1.2rem; margin-bottom: 2px; }
.sc-when { font-size: .88rem; color: var(--muted); }
.sc-alert details { margin-top: 6px; }
.sc-alert summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--green); }
.sc-alert details p {
  margin-top: 6px; max-height: 260px; overflow: auto; white-space: pre-line;
  font-size: .88rem; color: #3a4138;
}
.sc-clear {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: #eaf3df; color: var(--forest-900); font-weight: 600;
}
.sc-clear svg { flex: none; width: 22px; height: 22px; }
.sc-muted { color: var(--muted); }

/* Right now (latest observation) */
.sc-h-gap { margin-top: 22px; }
.sc-current { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; align-items: center; }
.sc-now-temp { grid-row: span 2; font-family: var(--font-display); font-weight: 800; font-size: 3.6rem; line-height: .9; color: var(--forest-900); }
.sc-now-desc { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.1; }
.sc-now-details { font-size: .9rem; color: var(--muted); }
.sc-now-source { grid-column: 1 / -1; margin-top: 6px; font-size: .8rem; color: var(--muted); }

/* Forecast */
.sc-forecast { display: grid; }
.sc-fc { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--sand); }
.sc-fc:last-child { border-bottom: 0; }
.sc-fc img { width: 52px; height: 52px; border-radius: 10px; }
.sc-fc-name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; }
.sc-fc-desc { font-size: .9rem; line-height: 1.35; color: var(--muted); }
.sc-fc-temp { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; text-align: right; line-height: 1; }
.sc-fc-temp small { display: block; margin-top: 4px; font-family: var(--font-body); font-weight: 600; font-size: .8rem; color: var(--muted); }

/* Call to action */
.sc-cta-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 32px; }
.sc-cta h2 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.sc-cta h2 .hivis { display: block; }
.sc-area-note { margin-top: 12px; font-weight: 600; color: rgba(246, 242, 233, .82); }
.sc-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Safety tips */
.sc-tips { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.sc-tips li { padding: 22px; border-radius: 16px; background: #fff; border: 1px solid var(--sand); border-top: 4px solid #f2b632; }
.sc-tips h3 { font-size: 1.25rem; margin-bottom: 6px; }
.sc-tips p { font-size: .97rem; color: var(--muted); }
.sc-disclaimer { margin-top: 24px; font-size: .92rem; color: var(--muted); }

.sc-credits { margin-top: 36px; font-size: .82rem; color: rgba(246, 242, 233, .55); }
.sc-credits a { color: inherit; }
.storm-page .footer-bottom { margin-top: 18px; }

@media (max-width: 1000px) {
  .sc-grid { grid-template-columns: 1fr; }
  .sc-tips { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 880px) {
  .sc-hero-inner { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .sc-map { height: 380px; }
  .sc-legend-warn:first-of-type { margin-left: 0; }
  .sc-tips { grid-template-columns: 1fr; }
  .sc-ticker-tag { padding: 0 12px; font-size: .8rem; }
  .sc-cta-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-ticker-window { overflow-x: auto; }
}
