/* Lochaber Weather - live gauges page (wxlive.php), Nov 2026
   Uses the colours of the site theme (lochaber-theme.css), so it follows
   the night and light themes. */

.wxg { --g-track: rgba(255,255,255,.07); --g-text: var(--text); --g-muted: var(--muted); }
[data-theme="light"] .wxg { --g-track: rgba(16,32,58,.08); }

/* Status and units bar */
.wxg-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 14px; margin: 0 0 18px;
}
#main-copy .wxg-bar { background: var(--surface-2); }
.wxg-status { display: flex; align-items: center; gap: 8px; font-size: .92rem; font-variant-numeric: tabular-nums; }
.wxg-status::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(123,211,160,.6); animation: wxg-pulse 2s infinite; flex: none;
}
.wxg-status.is-stale::before { background: var(--warn-line); animation: none; }
@keyframes wxg-pulse { 70% { box-shadow: 0 0 0 7px rgba(123,211,160,0); } 100% { box-shadow: 0 0 0 0 rgba(123,211,160,0); } }
.wxg-desc { color: var(--muted); font-size: .92rem; }
.wxg-units { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-left: auto; }
.wxg-units label { display: flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--muted); }
.wxg select {
  font: inherit; font-size: .85rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px 6px; cursor: pointer;
}

/* Cards */
.wxg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.wxg-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px 16px 10px; min-width: 0; display: flex; flex-direction: column;
}
#main-copy .wxg-card { background: var(--surface-2); }
.wxg-card[hidden] { display: none; }
.wxg-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.wxg-card-head h2 { margin: 0; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.wxg-pill {
  font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; background: var(--hero); color: var(--text); border: 1px solid var(--border);
}
.wxg-pill-warm { color: #ffb37a; border-color: rgba(255,146,43,.45); }
.wxg-pill-cool { color: #9ccfff; border-color: rgba(116,192,252,.45); }
.wxg-pill-wet  { color: #9ccfff; border-color: rgba(77,171,247,.5); background: rgba(77,171,247,.12); }
.wxg-pill-sun  { color: #ffd66b; border-color: rgba(250,176,5,.5); }
.wxg-pill-warn { color: var(--warn-text); border-color: var(--warn-line); background: var(--warn-bg); }
[data-theme="light"] .wxg-pill-warm { color: #b3500a; }
[data-theme="light"] .wxg-pill-cool, [data-theme="light"] .wxg-pill-wet { color: #1d5fa8; }
[data-theme="light"] .wxg-pill-sun { color: #8a5a00; }

.wxg-card-body { display: grid; grid-template-columns: minmax(150px, 190px) 1fr; gap: 6px 18px; align-items: center; flex: 1; }
.wxg-dial-box { width: 100%; max-width: 190px; justify-self: center; }
.wxg-side { min-width: 0; }
.wxg-select { margin-bottom: 8px; }
.wxg-stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: .9rem; }
.wxg-stats dt { color: var(--muted); }
.wxg-stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wxg-stats b { font-weight: 700; font-size: 1rem; }
.wxg-time { color: var(--muted); font-size: .8rem; margin-left: 4px; }

/* Gauges */
.wxg-gauge { display: block; width: 100%; height: auto; overflow: visible; }
.wxg-track { fill: none; stroke: var(--g-track); stroke-width: 14; }
.wxg-scale { fill: none; stroke-width: 7; }
.wxg-band { fill: none; stroke: var(--text); stroke-opacity: .28; stroke-width: 4; stroke-linecap: round; }
.wxg-tick { stroke: var(--muted); stroke-opacity: .45; stroke-width: 1; }
.wxg-tick-major { stroke-opacity: .9; stroke-width: 1.6; }
.wxg-tick-label { fill: var(--muted); font-size: 11px; font-family: Inter, "Segoe UI", system-ui, sans-serif; }
.wxg-needle { transform-box: view-box; transform-origin: 100px 100px; transition: transform .9s cubic-bezier(.3,1.3,.5,1), opacity .3s; }
.wxg-needle-body { fill: var(--text); }
.wxg-hub { fill: var(--text); stroke: var(--surface); stroke-width: 3; }
.wxg-val { fill: var(--text); font: 600 30px "Space Grotesk", Inter, sans-serif; font-variant-numeric: tabular-nums; }
.wxg-val-s { font-size: 26px; }
.wxg-unit { fill: var(--muted); font-size: 12px; font-family: Inter, "Segoe UI", system-ui, sans-serif; }
.wxg-mark { stroke: var(--surface); stroke-width: 1; }
.wxg-mark-hi { fill: #ff8a80; }
.wxg-mark-lo { fill: #74c0fc; }
.wxg-mark-gust { fill: #ffd43b; }
.wxg-mark-sky { fill: #ffe066; }
.wxg-mark-avg { fill: #74c0fc; }

.wxg-dial { fill: var(--g-track); stroke: var(--border); stroke-width: 1; }
.wxg-cardinal { fill: var(--muted); font: 600 15px "Space Grotesk", Inter, sans-serif; }
.wxg-cardinal-s { font-size: 12px; }
.wxg-cardinal.is-north { fill: var(--text); }
.wxg-range { fill: none; stroke: #74c0fc; stroke-opacity: .55; stroke-width: 6; stroke-linecap: round; }
.wxg-arrow { fill: var(--accent); }
.wxg-arrow-shaft { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.wxg-arrow-tail { stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.wxg-ring { fill: none; stroke: var(--border); stroke-width: 1; }
.wxg-petal { fill: #4dabf7; stroke: var(--surface); stroke-width: .8; }

/* 24-hour charts */
.wxg-spark-box { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.wxg-spark { display: block; width: 100%; height: 56px; overflow: visible; touch-action: pan-y; }
.wxg-spark-line { fill: none; stroke: var(--c); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.wxg-spark-line2 { fill: none; stroke: var(--c); stroke-width: 1; stroke-dasharray: 3 3; opacity: .7; vector-effect: non-scaling-stroke; }
.wxg-spark-area { fill: var(--c); opacity: .14; }
.wxg-spark-dots circle { fill: var(--c); }
.wxg-spark-cursor { stroke: var(--text); stroke-opacity: .5; stroke-width: 1; vector-effect: non-scaling-stroke; display: none; }
.wxg-spark-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: .74rem; color: var(--muted); letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.wxg-spark-tip { color: var(--text); flex: 1; text-align: right; }
.wxg-spark-tip:empty { display: none; }
.wxg-spark-empty { font-size: .8rem; color: var(--muted); padding: 14px 0 6px; }

.wxg-note { color: var(--muted); font-size: .85rem; margin: 18px 0 0; max-width: 90ch; }
.wxg-credit { margin-top: 8px; }
.wxg-msg { display: none; padding: 16px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); margin: 0 0 16px; }
.wxg.is-error .wxg-msg-error, .wxg.is-loading .wxg-msg-loading { display: block; }
.wxg-msg-loading { background: var(--surface); border-color: var(--border); color: var(--muted); }
.wxg.is-loading .wxg-grid { display: none; }

@media (max-width: 560px) {
  .wxg-card-body { grid-template-columns: 1fr; }
  .wxg-dial-box { max-width: 220px; }
  .wxg-units { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wxg-needle { transition: none; }
  .wxg-status::before { animation: none; }
}
