/****************************************************************************************************
* Home page (index.htm), drawn by js/home.js.  Everything is prefixed hw- so it never collides with   *
* Bootstrap's own .alert, .card, .badge and friends; the navigation bar is the site's usual one.    *
*****************************************************************************************************/
body.hw-home {
  --hw-bg: #0b1220; --hw-panel: #111b2e; --hw-panel-2: #0e1728; --hw-line: rgba(148, 180, 220, 0.12);
  --hw-text: #eef3fa; --hw-dim: rgba(225, 235, 248, 0.62); --hw-faint: rgba(225, 235, 248, 0.40);
  --hw-accent: #5bc8f5; --hw-warm: #ffb347; --hw-cool: #8fb8ff; --hw-ok: #6fe0a8; --hw-radius: 14px;
  /* the Storm Prediction Center's own category colours */
  --tstm: #c0e8c0; --mrgl: #7fc57f; --slgt: #f6f67f; --enh: #e6c27f; --mdt: #e67f7f; --high: #ff7fff;
  background: var(--hw-bg);
  color: var(--hw-text);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 0;
}

.hw-home a { color: var(--hw-accent); text-decoration: none; }
.hw-home a:hover { text-decoration: underline; }
.hw-wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.hw-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--hw-faint); }
.hw-faint { color: var(--hw-faint); font-size: 13px; }
.hw-panel { background: var(--hw-panel); border: 1px solid var(--hw-line); border-radius: var(--hw-radius); }

/* ---- alert strip:  only when something is in force ---- */
.hw-alert { margin-top: 18px; display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 10px;
            --c: #ff9d3c; color: var(--hw-text) !important;
            background: linear-gradient(90deg, color-mix(in srgb, var(--c) 18%, transparent), color-mix(in srgb, var(--c) 4%, transparent));
            border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.hw-alert:hover { text-decoration: none !important; border-color: var(--c); }
.hw-alert .hw-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }
.hw-alert b { font-weight: 700; }
.hw-alert .hw-alert-what { color: var(--hw-dim); }
.hw-alert .hw-alert-more { margin-left: auto; font-size: 14px; color: var(--hw-accent); white-space: nowrap; }

/* ---- the SPC outlook band ---- */
.hw-spc { margin-top: 14px; display: grid; grid-template-columns: 1fr auto 230px; gap: 22px; padding: 18px 20px;
          border-radius: var(--hw-radius); border: 1px solid color-mix(in srgb, var(--risk) 55%, transparent);
          background: linear-gradient(100deg, color-mix(in srgb, var(--risk) 17%, transparent), color-mix(in srgb, var(--risk) 4%, transparent) 55%, var(--hw-panel)); }
.hw-spc-main { display: flex; gap: 18px; align-items: flex-start; }
.hw-spc-level { flex: none; width: 74px; height: 74px; border-radius: 16px; background: var(--risk); color: #1b1405;
                display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.hw-spc-level .n { font-size: 34px; font-weight: 900; }
.hw-spc-level .of { font-size: 11px; font-weight: 700; margin-top: 3px; opacity: .75; }
.hw-spc-kicker { color: color-mix(in srgb, var(--risk) 70%, white); }
.hw-spc-title { font-size: 21px; font-weight: 900; margin-top: 3px; }
.hw-spc-text { color: var(--hw-dim); margin-top: 4px; max-width: 580px; }
.hw-hazards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hw-hazards span { font-size: 12px; padding: 4px 10px; border-radius: 14px; background: rgba(8,14,26,.55); border: 1px solid rgba(255,255,255,.12); color: var(--hw-dim); }
.hw-hazards b { color: var(--hw-text); }
.hw-spc-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 14px; }
.hw-spc-days { display: flex; gap: 8px; align-self: center; }
.hw-spc-day { width: 100px; padding: 10px 8px; border-radius: 12px; text-align: center; background: rgba(8,14,26,.55); border: 1px solid var(--hw-line); }
.hw-spc-day.on { border-color: var(--risk); box-shadow: inset 0 0 0 1px var(--risk); }
.hw-spc-day .dn { font-size: 12px; color: var(--hw-faint); }
.hw-spc-day .pill { display: inline-block; margin: 6px 0 4px; padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 900; color: #1b1405; background: var(--risk); }
.hw-spc-day .pill.none { background: rgba(255,255,255,.08); color: var(--hw-faint); font-weight: 700; }
.hw-spc-day .st { font-size: 11px; color: var(--hw-faint); line-height: 1.35; }
.hw-spc-map { position: relative; border-radius: 12px; overflow: hidden; background: rgba(8,14,26,.55); border: 1px solid var(--hw-line); min-height: 160px; }
.hw-spc-map svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.hw-spc-map .cap { position: absolute; left: 10px; bottom: 8px; font-size: 11px; color: var(--hw-dim); }

/* ---- hero:  right now, and the weathercam ---- */
.hw-hero { display: grid; grid-template-columns: 5fr 7fr; gap: 20px; margin-top: 18px; }
.hw-now { padding: 22px 26px; display: flex; flex-direction: column; }
.hw-now-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.hw-place { font-weight: 700; font-size: 16px; }
.hw-updated { font-size: 13px; color: var(--hw-faint); white-space: nowrap; }
.hw-updated i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--hw-ok); margin-right: 6px; }
.hw-updated.stale { color: #ffc107; }
.hw-updated.stale i { background: #ffc107; }
.hw-updated.old { color: #ff6b6b; }
.hw-updated.old i { background: #ff6b6b; }
.hw-dials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; justify-items: center; }
.hw-dials > * { width: 100%; max-width: 230px; }
.hw-outlook { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 12px; margin-top: 14px; text-align: center; }
.hw-outlook .cond { font-size: 18px; font-weight: 700; }
.hw-outlook .feels { color: var(--hw-dim); }
.hw-outlook .quiet { width: 100%; font-size: 12px; color: var(--hw-faint); }
.hw-outlook .warnline { width: 100%; font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--risk, #e6c27f) 80%, white); }
.hw-facts { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 16px; margin-top: auto; padding-top: 16px; }
.hw-fact { padding: 11px 0; border-top: 1px solid var(--hw-line); min-width: 0; }
.hw-fact .v { font-size: 19px; font-weight: 700; }
.hw-fact .v small { font-size: 13px; color: var(--hw-dim); font-weight: 400; }
.hw-fact .s { font-size: 12px; color: var(--hw-faint); }
.hw-trend-rising { color: var(--hw-ok); }
.hw-trend-falling { color: #f0a868; }

.hw-cam { position: relative; overflow: hidden; min-height: 420px; background: #05080f; }
.hw-cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hw-cam::after { content: ""; position: absolute; inset: 0; pointer-events: none;
                 background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, transparent 22%, transparent 72%, rgba(0,0,0,.5) 100%); }
.hw-cam-top, .hw-cam-bottom { position: absolute; left: 16px; right: 16px; z-index: 1; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.hw-cam-top { top: 14px; }
.hw-cam-bottom { bottom: 14px; justify-content: space-between; }
.hw-chip { white-space: nowrap; padding: 5px 11px; border-radius: 20px; background: rgba(8, 14, 26, .72); backdrop-filter: blur(6px);
           border: 1px solid rgba(255,255,255,.14); color: var(--hw-text); font: inherit; }
.hw-chip.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #ff4d4d; margin-right: 7px; vertical-align: 1px; }
button.hw-chip { cursor: pointer; color: var(--hw-dim); }
button.hw-chip.on { color: var(--hw-text); border-color: var(--hw-accent); }
.hw-cam-tabs { margin-left: auto; display: flex; gap: 6px; }

/* ---- sections ---- */
.hw-section { margin-top: 34px; }
.hw-sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.hw-sec-head h2 { margin: 0; font-size: 20px; font-weight: 900; }
.hw-sec-head .meta { color: var(--hw-faint); font-size: 13px; }
.hw-sec-head a { margin-left: auto; font-size: 14px; }

/* ---- forecast ---- */
.hw-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.hw-day { padding: 14px 12px 12px; text-align: center; min-width: 0; width: 100%; font: inherit; color: inherit; cursor: pointer;
          transition: border-color .15s ease, background .15s ease; }
.hw-day:hover { border-color: rgba(91, 200, 245, .35); }
.hw-day:focus-visible { outline: 2px solid var(--hw-accent); outline-offset: 2px; }
/* the picked tile:  its words are in the panel below */
.hw-day.on { border-color: rgba(91, 200, 245, .65); background: linear-gradient(180deg, rgba(91,200,245,.14), var(--hw-panel)); box-shadow: inset 0 0 0 1px rgba(91,200,245,.35); }
.hw-day.svr { border-color: color-mix(in srgb, var(--risk) 65%, transparent); }
.hw-day .n { font-weight: 700; }
.hw-day .d { font-size: 12px; color: var(--hw-faint); }
.hw-day svg { width: 46px; height: 46px; margin: 8px auto 4px; display: block; }
.hw-day .c { font-size: 13px; color: var(--hw-dim); min-height: 2.6em; line-height: 1.3; }
.hw-day .hl { margin-top: 6px; font-size: 18px; }
.hw-day .hl b { font-weight: 900; }
.hw-day .hl span { color: var(--hw-faint); }
.hw-day .p { font-size: 12px; color: var(--hw-accent); margin-top: 2px; }
.hw-day .p.none { color: var(--hw-faint); }
.hw-day .svr-tag { margin-top: 6px; font-size: 11px; font-weight: 900; color: #1b1405; background: var(--risk); border-radius: 8px; padding: 2px 6px; display: inline-block; }
.hw-discussion { margin-top: 10px; padding: 14px 18px; font-size: 14px; color: var(--hw-dim); }
.hw-discussion-line { display: flex; gap: 14px; align-items: flex-start; }
.hw-discussion-periods { display: grid; gap: 6px; }
.hw-discussion-period { display: flex; gap: 14px; align-items: baseline; }
.hw-discussion-period strong { color: var(--hw-text); white-space: nowrap; min-width: 110px; }
.hw-discussion-line button { margin-left: auto; white-space: nowrap; background: none; border: 0; color: var(--hw-accent); font: inherit; cursor: pointer; padding: 0; }
.hw-periods { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hw-line); display: grid; grid-template-columns: 170px 1fr; gap: 8px 18px; }
.hw-periods dt { color: var(--hw-text); font-weight: 700; }
.hw-periods dd { margin: 0; }
.hw-periods-meta { grid-column: 1 / -1; font-size: 12px; color: var(--hw-faint); }

/* ---- the lower grid ---- */
.hw-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 20px; }
.hw-card { padding: 20px 22px; min-width: 0; }
.hw-card h3 { margin: 0 0 2px; font-size: 16px; font-weight: 900; }
.hw-card .sub { color: var(--hw-faint); font-size: 13px; }
.hw-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.hw-card-head > a { font-size: 14px; white-space: nowrap; }
.hw-tabs { display: flex; gap: 4px; background: var(--hw-panel-2); padding: 3px; border-radius: 9px; }
.hw-tabs button { padding: 5px 12px; border-radius: 7px; font: inherit; font-size: 13px; color: var(--hw-dim); background: none; border: 0; cursor: pointer; }
.hw-tabs button.on { background: rgba(91,200,245,.16); color: var(--hw-text); }
.hw-chart-card { display: flex; flex-direction: column; }
.hw-chart { flex: 1; min-height: 250px; position: relative; }
.hw-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.hw-chart-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--hw-dim); margin-top: 8px; }
.hw-chart-key i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.hw-chart-tip { position: absolute; pointer-events: none; padding: 6px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap;
                background: rgba(8,14,26,.94); border: 1px solid rgba(255,255,255,.14); color: var(--hw-text); transform: translate(-50%, -110%); }
.hw-stack { display: grid; gap: 20px; align-content: start; }

.hw-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 22px; margin-top: 4px; }
.hw-kv .hw-k { font-size: 12px; color: var(--hw-faint); }
.hw-kv .hw-v { font-size: 18px; font-weight: 700; }
.hw-kv .hw-v small { font-size: 12px; color: var(--hw-faint); font-weight: 400; margin-left: 4px; }
.hw-today-line { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hw-line); font-size: 13px; color: var(--hw-dim); }
.hw-today-line b { color: var(--hw-text); }
.hw-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: rgba(255,179,71,.16); color: var(--hw-warm); margin-left: 6px; vertical-align: 1px; }

.hw-daylight svg { width: 100%; height: 92px; display: block; overflow: visible; }
.hw-moon { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hw-line); font-size: 14px; color: var(--hw-dim); }
.hw-moon img { width: 30px; height: 30px; }
.hw-moon b { color: var(--hw-text); }
.hw-sun-times { display: flex; justify-content: space-between; font-size: 12px; color: var(--hw-faint); margin-top: 2px; }

.hw-trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.hw-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--hw-dim); margin-top: 10px; }
.hw-row b { color: var(--hw-text); white-space: nowrap; }
.hw-row b span { color: var(--hw-faint); font-weight: 400; }
.hw-bar { height: 7px; border-radius: 4px; background: var(--hw-panel-2); margin-top: 5px; overflow: hidden; }
.hw-bar i { display: block; height: 100%; border-radius: 4px; background: var(--hw-accent); }
.hw-bigline { font-size: 34px; font-weight: 300; margin-top: 6px; }
.hw-bigline small { font-size: 15px; color: var(--hw-dim); }
.hw-more { display: inline-block; margin-top: 12px; font-size: 14px; }
.hw-solar-bars { width: 100%; height: 96px; display: block; margin-top: 10px; }

/* ---- footer ---- */
.hw-footer { margin-top: 48px; border-top: 1px solid var(--hw-line); padding: 28px 0 40px; color: var(--hw-faint); font-size: 13px; }
.hw-footer .hw-wrap { display: flex; gap: 48px; flex-wrap: wrap; }
.hw-footer b { display: block; color: var(--hw-dim); margin-bottom: 6px; }
.hw-footer .col a { display: block; color: var(--hw-faint); line-height: 1.9; }
.hw-footer .copy { margin-left: auto; align-self: flex-end; text-align: right; }

/* ---- tablets ---- */
@media (max-width: 1100px) {
  .hw-spc { grid-template-columns: 1fr 230px; }
  .hw-spc-days { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---- phones ---- */
@media (max-width: 900px) {
  .hw-wrap { padding: 0 16px; }
  .hw-hero, .hw-grid, .hw-trio, .hw-spc { grid-template-columns: 1fr; }
  .hw-hero > *, .hw-grid > *, .hw-trio > * { min-width: 0; }
  .hw-cam { min-height: 230px; }
  .hw-days { grid-template-columns: repeat(7, 112px); overflow-x: auto; padding-bottom: 6px; }
  .hw-facts { grid-template-columns: repeat(2, 1fr); }
  .hw-alert { flex-wrap: wrap; row-gap: 4px; }
  .hw-alert .hw-alert-more { margin-left: 23px; width: 100%; }
  .hw-cam-top, .hw-cam-bottom { font-size: 12px; }
  .hw-cam-top .hw-cam-name, .hw-cam-bottom .hw-chip:first-child:not(:last-child) { display: none; }
  .hw-spc-map { min-height: 150px; }
  .hw-spc-title { font-size: 18px; }
  .hw-spc-level { width: 58px; height: 58px; }
  .hw-spc-level .n { font-size: 26px; }
  .hw-spc-days { align-self: stretch; }
  .hw-spc-day { flex: 1; width: auto; }
  .hw-discussion-line { flex-wrap: wrap; }
  .hw-discussion-period { flex-direction: column; gap: 0; }
  .hw-discussion-line button { margin-left: 0; }
  .hw-periods { grid-template-columns: 1fr; gap: 2px; }
  .hw-periods dd { margin-bottom: 8px; }
  .hw-footer .copy { margin-left: 0; text-align: left; }
}

/* ---- very narrow screens ---- */
@media (max-width: 400px) {
  .hw-wrap { padding: 0 10px; }
  .hw-now, .hw-card { padding-left: 16px; padding-right: 16px; }
  .hw-alert .hw-alert-more { margin-left: 0; }
  .hw-tabs { flex-wrap: wrap; max-width: 100%; }
  .hw-tabs button { padding: 5px 8px; font-size: 12px; }
}
