/****************************************************************************************************
* Temperature (temperature.htm).  Built on css/home.css - its colours, panels and footer.  The      *
* cards are Bootstrap .card.solar-card (main.css), restyled here as home-page panels like the solar *
* page.  js/temperatureHistory.js draws the history card (temp-history-); js/tempForecast.js draws   *
* the forecast with the tp- classes.                                                                *
*****************************************************************************************************/
.tp-page main { padding-top: 22px; }

.tp-title h1 { margin: 0; font-size: 26px; font-weight: 900; }
.tp-title-sub { color: var(--hw-faint); font-size: 13px; margin-top: 2px; }

/* ---- the cards, as home-page panels ---- */
.tp-page .solar-card { margin-top: 20px; border: 1px solid var(--hw-line); border-radius: var(--hw-radius); background: var(--hw-panel); overflow: hidden; }
.tp-page .solar-card .card-header { background: none; border: 0; color: var(--hw-text); font-size: 16px; font-weight: 900;
                                    letter-spacing: 0; text-transform: none; padding: 18px 22px 0; }
.tp-page .solar-card .card-body { background: none; padding: 14px 22px 20px; color: var(--hw-dim); }

/* ---- the history chart card ---- */
.temp-history-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* the range buttons, as the home page's tab bar */
.temp-history-ranges { gap: 4px; padding: 3px; border-radius: 9px; background: var(--hw-panel-2); }
.temp-history-ranges .btn { min-width: 48px; padding: 4px 12px; border-radius: 7px !important; border: 0; font-size: 13px; font-weight: 400;
                            color: var(--hw-dim); background: none; }
.temp-history-ranges .btn:hover { color: var(--hw-text); background: none; }
.temp-history-ranges .btn.active, .temp-history-ranges .btn[aria-pressed="true"] { color: var(--hw-text); background: rgba(91, 200, 245, .16); }
.temp-history-ranges .btn:focus-visible { outline: 2px solid var(--hw-accent); outline-offset: 1px; box-shadow: none; }

.temp-history-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.temp-history-stat { min-width: 130px; padding: 11px 16px 12px; border-radius: 12px; background: var(--hw-panel-2); border: 1px solid var(--hw-line); }
.temp-history-stat-value { font-size: 28px; font-weight: 300; line-height: 1.15; font-variant-numeric: tabular-nums; }
.temp-history-stat-label { margin-top: 2px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--hw-faint); }
.temp-history-stat-label span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--hw-faint); }

.temp-history-chart { position: relative; height: 340px; }
.temp-history-status { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; pointer-events: none; }
.temp-history-note { margin-top: 10px; font-size: 12px; color: var(--hw-faint); }
.tp-page .text-white-50 { color: var(--hw-faint) !important; }

/* ---- the forecast (js/tempForecast.js) ---- */
.tp-loading { font-size: 14px; color: var(--hw-faint); }
.tp-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--hw-faint); }
.tp-hi { color: #ff8a73; }   /* highs, warm */
.tp-lo { color: #8fb8ff; }   /* lows, cool */

.tp-fc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.tp-stat { padding: 12px 16px 13px; border-radius: 12px; background: var(--hw-panel-2); border: 1px solid var(--hw-line); }
.tp-value { margin-top: 4px; font-size: 28px; font-weight: 300; line-height: 1.15; color: var(--hw-text); font-variant-numeric: tabular-nums; }
.tp-value.tp-hi { color: #ff8a73; }
.tp-value.tp-lo { color: #8fb8ff; }

.tp-fc-head { margin-bottom: 8px; }
.tp-periods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tp-period { padding: 10px 12px 11px; border-radius: 10px; background: var(--hw-panel-2); border: 1px solid var(--hw-line); }
.tp-period.tp-night { background: rgba(8, 14, 26, .55); }
.tp-period-name { font-size: 12px; color: var(--hw-faint); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-period-val { font-size: 17px; font-weight: 700; }
.tp-period-none { font-size: 13px; color: var(--hw-faint); }
.tp-foot { margin-top: 12px; font-size: 12px; color: var(--hw-faint); }

@media (max-width: 640px) {
  .tp-page .solar-card .card-header { padding: 16px 16px 0; }
  .tp-page .solar-card .card-body { padding: 12px 16px 16px; }
  .temp-history-chart { height: 260px; }
  .temp-history-stat { flex: 1 1 130px; min-width: 0; }
  .temp-history-stat-value, .tp-value { font-size: 23px; }
  .tp-fc-stats { grid-template-columns: 1fr 1fr; }
}
