/* Lochaber Weather - Local Station History page (wxhighlow.php), Nov 2026
   Uses the site theme colours from lochaber-theme.css. */

.hl-page { --hl-hot: #e8613c; --hl-cold: #3d9be0; --hl-rain: #3d9be0; --hl-yr: #f2b134; }
[data-theme="light"] .hl-page { --hl-hot: #c9462a; --hl-cold: #1f74b8; --hl-rain: #2a7fc2; --hl-yr: #c98a0c; }

.hl-intro { color: var(--muted); max-width: 80ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Current readings */
.hl-now-strip {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 18px 0 18px;
}
.hl-now-strip > div {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; min-width: 0;
}
.hl-now-strip span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.hl-now-strip strong { display: block; font: 600 1.45rem/1.2 "Space Grotesk", Inter, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-now-strip small { font-size: .62em; font-weight: 500; color: var(--muted); margin-left: 2px; }

/* Cards */
.hl-card {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; margin: 0 0 16px; min-width: 0;
}
.hl-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.hl-two .hl-card { margin: 0 0 16px; }
.hl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hl-head h2 { margin: 0; font-size: 1.15rem; flex: 1; min-width: 0; }
.hl-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--hero); }
.hl-icon svg { width: 22px; height: 22px; fill: var(--accent); }
.hl-icon.is-temp svg { fill: var(--hl-hot); }
.hl-icon.is-hum svg, .hl-icon.is-rain svg, .hl-icon.is-snow svg { fill: var(--hl-cold); }
.hl-icon.is-sun svg { fill: var(--hl-yr); }
.hl-pill {
  flex: none; padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: .85rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Tables */
.hl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.hl-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 560px; }
.hl-table th, .hl-table td { padding: 8px 10px; text-align: right; vertical-align: top; border-top: 1px solid var(--border); }
.hl-table thead th {
  border-top: 0; color: var(--muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding-top: 2px;
}
.hl-table tbody th { text-align: left; font-weight: 500; color: var(--text); white-space: nowrap; }
.hl-table td:last-child, .hl-table thead th:last-child { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.hl-months td:last-child, .hl-months thead th:last-child { background: none; }
.hl-v { display: block; font-weight: 600; white-space: nowrap; }
.hl-v small { font-weight: 400; color: var(--muted); font-size: .8em; }
.hl-s { display: block; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.hl-na { color: var(--muted); opacity: .55; }
.hl-two .hl-table { min-width: 470px; }
.hl-two .hl-table th, .hl-two .hl-table td { padding: 7px 7px; }

/* Range bar */
.hl-range { margin: 2px 0 12px; }
.hl-track { position: relative; height: 14px; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); }
.hl-seg { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; }
.hl-seg.is-rec   { background: linear-gradient(90deg, color-mix(in srgb, var(--hl-cold) 30%, transparent), color-mix(in srgb, var(--hl-hot) 30%, transparent)); }
.hl-seg.is-year  { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.hl-seg.is-month { background: color-mix(in srgb, var(--accent) 65%, transparent); top: 3px; bottom: 3px; }
.hl-seg.is-today { background: var(--hl-yr); top: 3px; bottom: 3px; }
.hl-now {
  position: absolute; top: -4px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px;
  background: var(--text); box-shadow: 0 0 0 2px var(--surface-2);
}
.hl-range-ends { display: flex; justify-content: space-between; gap: 10px; margin-top: 5px; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hl-key { text-align: center; }
.hl-key i, .hl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: -1px; }
.hl-key i.is-today { background: var(--hl-yr); }
.hl-key i.is-month { background: color-mix(in srgb, var(--accent) 65%, transparent); }
.hl-key i.is-year  { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.hl-key i.is-rec   { background: linear-gradient(90deg, color-mix(in srgb, var(--hl-cold) 45%, transparent), color-mix(in srgb, var(--hl-hot) 45%, transparent)); }
.hl-range-cap { margin: -8px 0 8px; font-size: .76rem; color: var(--muted); }

/* Rain against average */
.hl-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-bottom: 12px; }
.hl-bar-head { display: flex; justify-content: space-between; font-size: .9rem; }
.hl-bar-head strong { font-variant-numeric: tabular-nums; }
.hl-bar-track { position: relative; height: 12px; margin: 5px 0 4px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; }
.hl-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--hl-rain); border-radius: 6px; }
.hl-bar-fill.is-over { background: linear-gradient(90deg, var(--hl-rain) 0 50%, #6b5fd6 50% 100%); background-size: 200% 100%; }
.hl-bar-avg { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .7; }
.hl-bar-foot { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.hl-note { margin: 10px 0 0; font-size: .82rem; color: var(--muted); }
.hl-foot { font-size: .82rem; color: var(--muted); margin: 6px 0 10px; }

/* Month by month */
.hl-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.hl-charts figure { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 10px 4px; min-width: 0; }
.hl-charts figcaption { font-weight: 600; font-size: .9rem; margin: 0 4px 4px; }
.hl-legend { font-weight: 400; font-size: .76rem; color: var(--muted); white-space: nowrap; }
.hl-legend i.is-rng  { background: linear-gradient(180deg, var(--hl-hot), var(--hl-cold)); opacity: .55; width: 8px; height: 12px; border-radius: 4px; }
.hl-legend i.is-avg  { background: var(--text); border-radius: 50%; }
.hl-legend i.is-yr   { background: var(--hl-yr); transform: rotate(45deg) scale(.85); border-radius: 1px; }
.hl-legend i.is-ravg { background: color-mix(in srgb, var(--hl-rain) 40%, transparent); }
.hl-legend i.is-ryr  { background: var(--hl-rain); }
.hl-chart { display: block; width: 100%; height: auto; }
.hl-chart .hl-grid { stroke: var(--border); stroke-width: 1; }
.hl-chart .hl-grid.is-zero { stroke: var(--muted); stroke-dasharray: 3 3; opacity: .7; }
.hl-chart .hl-ax { fill: var(--muted); font-size: 11px; }
.hl-chart .hl-ax.is-cur { fill: var(--text); font-weight: 700; }
.hl-chart .hl-cur { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.hl-chart .hl-rng { fill: color-mix(in srgb, var(--hl-hot) 45%, var(--hl-cold)); opacity: .45; }
.hl-chart .hl-lbl { font-size: 10px; font-weight: 600; }
.hl-chart .hl-lbl.is-hi { fill: var(--hl-hot); }
.hl-chart .hl-lbl.is-lo { fill: var(--hl-cold); }
.hl-chart .hl-avg { fill: none; stroke: var(--text); stroke-width: 1.5; opacity: .6; }
.hl-chart .hl-avg-dot { fill: var(--text); }
.hl-chart .hl-yr { fill: var(--hl-yr); stroke: var(--surface); stroke-width: 1.5; }
.hl-chart .hl-rain-avg { fill: color-mix(in srgb, var(--hl-rain) 40%, transparent); }
.hl-chart .hl-rain-yr { fill: var(--hl-rain); }

.hl-months { min-width: 720px; }
.hl-months th, .hl-months td { padding: 7px 6px; }
.hl-months tbody th { font-size: .86rem; }
.hl-months .is-cur { background: color-mix(in srgb, var(--accent) 12%, transparent) !important; font-weight: 700; color: var(--text); }
.hl-months tr.is-hi td { color: var(--hl-hot); }
.hl-months tr.is-lo td { color: var(--hl-cold); }
.hl-months tr.is-yr td, .hl-months tr.is-yr th { color: var(--hl-yr); }
.hl-months tr.is-yr th { font-weight: 600; }

@media (max-width: 1000px) {
  .hl-two, .hl-charts { grid-template-columns: minmax(0, 1fr); }
  .hl-now-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .hl-now-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hl-bars { grid-template-columns: 1fr; }
  .hl-card { padding: 14px 12px; }
  .hl-head { flex-wrap: wrap; }
  .hl-pill { order: 3; margin-left: 50px; }
  .hl-key { display: none; }
}

/* Phones: keep the row names in view while the table scrolls sideways */
@media (max-width: 700px) {
  .hl-table tbody th, .hl-table thead th:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--surface-2); box-shadow: 6px 0 6px -6px rgba(0,0,0,.45);
  }
  .hl-table tbody th { white-space: normal; min-width: 96px; max-width: 120px; }
  .hl-head h2 { font-size: 1.05rem; }
  .hl-scroll::after { content: "Swipe for more \2192"; display: block; text-align: right; font-size: .72rem; color: var(--muted); padding-top: 4px; position: sticky; left: 0; }
}
