/* WeatherPulse Forecast — hourly, daily and overview data presentation */

body.wp-page-forecast .forecast-analysis-grid,
body.wp-page-forecast .forecast-hourly-key,
body.wp-page-forecast .forecast-daily-trends {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

body.wp-page-forecast .forecast-analysis-stat,
body.wp-page-forecast .forecast-key-stat,
body.wp-page-forecast .forecast-trend-stat {
  min-width: 0;
  min-height: 88px;
  padding: 13px;
  border: 1px solid var(--forecast-line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--forecast-soft) 52%, var(--forecast-surface));
  box-shadow: none;
}

body.wp-page-forecast :is(.forecast-analysis-stat, .forecast-key-stat, .forecast-trend-stat) :is(small, span) {
  display: block;
  color: var(--forecast-muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

body.wp-page-forecast :is(.forecast-analysis-stat, .forecast-key-stat, .forecast-trend-stat) strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  color: var(--forecast-ink);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

body.wp-page-forecast .forecast-today-brief {
  margin-top: 18px;
  padding: 17px;
  border: 1px solid var(--forecast-line);
  border-radius: 10px;
  background: var(--forecast-surface);
}

body.wp-page-forecast .forecast-today-brief-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

body.wp-page-forecast .forecast-today-brief h3 { margin: 3px 0 0; font-size: 1.08rem; line-height: 1.25; }
body.wp-page-forecast .forecast-today-brief > p { margin: 7px 0 0; color: var(--forecast-muted); font-size: 0.84rem; }
body.wp-page-forecast .forecast-plan-status { flex: 0 0 auto; padding: 5px 9px; display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; background: var(--forecast-soft); color: var(--forecast-muted); font-size: 0.7rem; font-weight: 750; }
body.wp-page-forecast .forecast-plan-status .material-icons-round { font-size: 15px; }
body.wp-page-forecast .forecast-dayparts { margin-top: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--forecast-line); border-radius: 10px; overflow: hidden; }
body.wp-page-forecast .forecast-dayparts article { min-width: 0; padding: 13px; border-right: 1px solid var(--forecast-line); }
body.wp-page-forecast .forecast-dayparts article:last-child { border-right: 0; }
body.wp-page-forecast .forecast-dayparts :is(span, strong, small) { display: block; }
body.wp-page-forecast .forecast-dayparts span { color: var(--forecast-accent); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
body.wp-page-forecast .forecast-dayparts strong { margin-top: 4px; color: var(--forecast-ink); font-size: 0.9rem; }
body.wp-page-forecast .forecast-dayparts small { margin-top: 3px; color: var(--forecast-muted); font-size: 0.7rem; line-height: 1.35; }

body.wp-page-forecast #card-forecast-signals {
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--forecast-line);
  background: var(--forecast-surface);
}

body.wp-page-forecast .wp-forecast-signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--forecast-line);
  border-radius: 10px;
  overflow: hidden;
}

body.wp-page-forecast .wp-forecast-signal {
  min-height: 108px;
  padding: 15px;
  border-right: 1px solid var(--forecast-line);
  border-bottom: 1px solid var(--forecast-line);
  background: transparent;
}

body.wp-page-forecast .wp-forecast-signal:nth-child(3n) { border-right: 0; }
body.wp-page-forecast .wp-forecast-signal:nth-last-child(-n + 3) { border-bottom: 0; }
body.wp-page-forecast .wp-forecast-signal-top { display: flex; align-items: center; gap: 7px; color: var(--forecast-muted); font-size: 0.72rem; font-weight: 750; }
body.wp-page-forecast .wp-forecast-signal-top .material-icons-round { color: var(--forecast-accent); font-size: 17px; }
body.wp-page-forecast .wp-forecast-signal-clock { display: none; }
body.wp-page-forecast .wp-forecast-signal strong { display: block; margin-top: 10px; color: var(--forecast-ink); font-size: 0.98rem; }
body.wp-page-forecast .wp-forecast-signal small { display: block; margin-top: 3px; color: var(--forecast-muted); font-size: 0.74rem; }

body.wp-page-forecast #card-hourly .card-header { align-items: flex-end; }

body.wp-page-forecast .hourly-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

body.wp-page-forecast .hourly-primary-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px;
  border: 1px solid var(--forecast-line);
  border-radius: var(--forecast-control-radius);
  background: var(--forecast-soft);
}

body.wp-page-forecast .hourly-primary-metric {
  min-height: 44px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--forecast-muted);
  font-size: 0.76rem;
  font-weight: 720;
  white-space: nowrap;
}

body.wp-page-forecast .hourly-primary-metric.is-active {
  background: var(--forecast-surface);
  color: var(--forecast-ink);
  box-shadow: 0 1px 4px rgba(16, 34, 48, 0.12);
}

body.wp-page-forecast .forecast-hourly-select-shell {
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 11px;
  border: 1px solid var(--forecast-line);
  border-radius: var(--forecast-control-radius);
  background: var(--forecast-surface);
  color: var(--forecast-muted);
}

body.wp-page-forecast .forecast-hourly-select-shell > .material-icons-round:first-child { font-size: 17px; }
body.wp-page-forecast .forecast-more-metrics-label { font-size: 0.76rem; font-weight: 720; white-space: nowrap; }

body.wp-page-forecast .forecast-hourly-select-shell select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

body.wp-page-forecast .forecast-hourly-select-caret { margin-left: -2px; margin-right: 7px; font-size: 18px; pointer-events: none; }

body.wp-page-forecast #hourly-view-toggle {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--forecast-line);
  background: var(--forecast-surface);
  color: var(--forecast-ink);
}

body.wp-page-forecast #hourly-view-toggle .material-icons-round { font-size: 20px; }

body.wp-page-forecast .hourly-scroll {
  margin-top: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--forecast-line);
  border-radius: 10px;
  background: var(--forecast-surface);
  scroll-snap-type: x proximity;
  scrollbar-color: color-mix(in srgb, var(--forecast-muted) 38%, transparent) transparent;
}

body.wp-page-forecast .hourly-track { min-width: 960px; height: 244px; padding: 15px 10px 8px; }
body.wp-page-forecast #hourly-container { align-items: stretch; }

body.wp-page-forecast .hour-item {
  position: relative;
  flex: 0 0 72px;
  min-width: 72px;
  height: 100%;
  padding: 5px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  border-right: 1px solid color-mix(in srgb, var(--forecast-line) 62%, transparent);
  color: var(--forecast-ink);
  scroll-snap-align: start;
}

body.wp-page-forecast .hour-item:last-child { border-right: 0; }
body.wp-page-forecast .hour-item.bad-weather { background: rgba(176, 48, 48, 0.055); }
body.wp-page-forecast .hour-graph-slot { position: relative; width: 100%; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
body.wp-page-forecast .hour-bar { width: 8px; height: var(--hour-bar-height, 40px); max-height: 110px; border-radius: 4px 4px 1px 1px; background: var(--hour-bar-color, var(--forecast-accent)); }
body.wp-page-forecast .hour-val-float { position: absolute; bottom: calc(var(--hour-bar-height, 40px) + 5px); color: var(--forecast-ink); font-size: 0.74rem; font-weight: 760; font-variant-numeric: tabular-nums; }
body.wp-page-forecast .hour-time { margin-top: 8px; color: var(--forecast-muted); font-size: 0.68rem; white-space: nowrap; }
body.wp-page-forecast .hour-bottom-stack { margin-top: 4px; display: flex; flex-direction: column; align-items: center; }
body.wp-page-forecast .hour-icon { width: 28px; height: 28px; object-fit: contain; }
body.wp-page-forecast .hour-precip-prob { min-height: 16px; font-size: 0.65rem; font-variant-numeric: tabular-nums; }

body.wp-page-forecast #hourly-list-view { display: none; flex-direction: column; border: 1px solid var(--forecast-line); border-radius: 10px; overflow: hidden; }
body.wp-page-forecast .hour-row { position: relative; min-height: 64px; padding: 8px 48px 8px 12px; display: grid; grid-template-columns: 62px 34px minmax(86px, 0.8fr) minmax(120px, 1fr) 62px; align-items: center; gap: 10px; border-bottom: 1px solid var(--forecast-line); background: var(--forecast-surface); }
body.wp-page-forecast .hour-row:last-of-type { border-bottom: 0; }
body.wp-page-forecast .hour-list-time,
body.wp-page-forecast .hour-list-temp,
body.wp-page-forecast .hour-list-rain { font-variant-numeric: tabular-nums; }
body.wp-page-forecast .hour-list-time { color: var(--forecast-muted); font-size: 0.78rem; }
body.wp-page-forecast .hour-list-icon { width: 30px; height: 30px; }
body.wp-page-forecast .hour-list-details { display: flex; gap: 6px; align-items: baseline; }
body.wp-page-forecast .hour-list-temp { font-weight: 780; }
body.wp-page-forecast .hour-list-feels,
body.wp-page-forecast .hour-list-cond { color: var(--forecast-muted); font-size: 0.76rem; }
body.wp-page-forecast .hour-list-rain { display: flex; align-items: center; gap: 3px; color: var(--forecast-accent); font-size: 0.76rem; }

body.wp-page-forecast .forecast-hourly-matrix { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--forecast-line); }
body.wp-page-forecast .forecast-subsection-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
body.wp-page-forecast .forecast-subsection-head h3 { margin: 3px 0 0; font-size: 1.05rem; }
body.wp-page-forecast .forecast-table-hint { color: var(--forecast-muted); font-size: 0.72rem; }
body.wp-page-forecast .forecast-table-scroll { overflow: auto; border: 1px solid var(--forecast-line); border-radius: 10px; }
body.wp-page-forecast .forecast-table-scroll table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.78rem; }
body.wp-page-forecast .forecast-table-scroll :is(th, td) { padding: 10px 12px; border-bottom: 1px solid var(--forecast-line); text-align: left; white-space: nowrap; }
body.wp-page-forecast .forecast-table-scroll th { position: sticky; top: 0; background: var(--forecast-soft); color: var(--forecast-muted); font-size: 0.7rem; }

body.wp-page-forecast .forecast-daily-column-heads {
  margin-top: 16px;
  padding: 0 46px 7px 14px;
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(170px, 1.4fr) 70px 92px 82px minmax(210px, 1.5fr) 20px;
  gap: 10px;
  color: var(--forecast-muted);
  font-size: 0.66rem;
  font-weight: 750;
}

body.wp-page-forecast .daily-list { overflow: hidden; border: 1px solid var(--forecast-line); border-radius: 10px; }
body.wp-page-forecast .forecast-day-item { border-bottom: 1px solid var(--forecast-line); background: var(--forecast-surface); }
body.wp-page-forecast .forecast-day-item:last-child { border-bottom: 0; }

body.wp-page-forecast .day-row.day-row-button {
  position: relative;
  width: 100%;
  min-height: 74px;
  padding: 9px 46px 9px 14px;
  display: grid;
  grid-template-columns: minmax(90px, 0.8fr) minmax(170px, 1.4fr) 70px 92px 82px minmax(210px, 1.5fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--forecast-ink);
  text-align: left;
}

body.wp-page-forecast .day-row.day-row-button:hover { background: color-mix(in srgb, var(--forecast-accent) 5%, transparent); }
body.wp-page-forecast .day-primary { min-width: 0; display: flex; flex-direction: column; }
body.wp-page-forecast .day-name { font-weight: 760; }
body.wp-page-forecast .day-date { color: var(--forecast-muted); font-size: 0.7rem; }
body.wp-page-forecast .day-condition { min-width: 0; display: flex; align-items: center; gap: 8px; }
body.wp-page-forecast .day-condition > span { overflow: hidden; color: var(--forecast-muted); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
body.wp-page-forecast .day-icon { flex: 0 0 32px; width: 32px; height: 32px; object-fit: contain; }
body.wp-page-forecast .day-metric { display: flex; align-items: center; gap: 4px; color: var(--forecast-muted); font-size: 0.72rem; font-variant-numeric: tabular-nums; }
body.wp-page-forecast .day-metric .material-icons-round { color: var(--forecast-accent); font-size: 15px; }
body.wp-page-forecast .day-range-container { min-width: 0; display: grid; grid-template-columns: 48px minmax(72px, 1fr) 48px; align-items: center; gap: 8px; }
body.wp-page-forecast .range-temp-text { display: flex; flex-direction: column; color: var(--forecast-muted); font-size: 0.62rem; }
body.wp-page-forecast .range-temp-text strong { color: var(--forecast-ink); font-size: 0.84rem; font-variant-numeric: tabular-nums; }
body.wp-page-forecast .range-temp-high { align-items: flex-end; }
body.wp-page-forecast .range-track { position: relative; height: 5px; border-radius: 3px; background: var(--forecast-soft); }
body.wp-page-forecast .range-bar { position: absolute; top: 0; bottom: 0; border-radius: inherit; background: var(--forecast-accent); }
body.wp-page-forecast .day-expand-icon { position: absolute; right: 14px; top: 50%; color: var(--forecast-muted); transform: translateY(-50%); }
body.wp-page-forecast .day-row.active .day-expand-icon { transform: translateY(-50%) rotate(180deg); }

body.wp-page-forecast .details-panel {
  padding: 0 14px 14px;
  border-top: 1px solid var(--forecast-line);
  background: color-mix(in srgb, var(--forecast-soft) 48%, var(--forecast-surface));
}

body.wp-page-forecast .details-panel.is-open { padding-top: 14px; }
body.wp-page-forecast .wx-detail-hero { display: flex; align-items: center; gap: 12px; }
body.wp-page-forecast .wx-detail-hero img { width: 44px; height: 44px; }
body.wp-page-forecast .wx-detail-hero-copy { min-width: 0; flex: 1; }
body.wp-page-forecast .wx-detail-hero-copy :is(strong, small) { display: block; }
body.wp-page-forecast .wx-detail-hero-copy small { color: var(--forecast-muted); }
body.wp-page-forecast .wx-detail-hero-temp,
body.wp-page-forecast .wx-detail-hero-temps { font-size: 1.35rem; font-weight: 780; font-variant-numeric: tabular-nums; }
body.wp-page-forecast .wx-detail-hero-temps { display: flex; flex-direction: column; text-align: right; }
body.wp-page-forecast .wx-detail-hero-temps small { color: var(--forecast-muted); font-size: 0.7rem; }
body.wp-page-forecast .wx-tile-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
body.wp-page-forecast .wx-tile { min-width: 0; padding: 10px; display: flex; align-items: flex-start; gap: 7px; border: 1px solid var(--forecast-line); border-radius: 8px; background: var(--forecast-surface); }
body.wp-page-forecast .wx-tile-icon { color: var(--forecast-accent); font-size: 18px; }
body.wp-page-forecast .wx-tile-copy { min-width: 0; }
body.wp-page-forecast .wx-tile-copy :is(small, strong, span) { display: block; overflow-wrap: anywhere; }
body.wp-page-forecast .wx-tile-copy small,
body.wp-page-forecast .wx-tile-copy span { color: var(--forecast-muted); font-size: 0.65rem; }
body.wp-page-forecast .wx-tile-copy strong { margin: 2px 0; font-size: 0.78rem; }
body.wp-page-forecast .wx-sun-strip { margin-top: 9px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
body.wp-page-forecast .wx-sun-cell { padding: 9px; display: grid; grid-template-columns: auto 1fr; gap: 0 7px; border: 1px solid var(--forecast-line); border-radius: 8px; background: var(--forecast-surface); }
body.wp-page-forecast .wx-sun-cell .material-icons-round { grid-row: 1 / 3; color: var(--forecast-accent); }
body.wp-page-forecast .wx-sun-cell small { color: var(--forecast-muted); font-size: 0.62rem; }
body.wp-page-forecast .wx-sun-cell strong { font-size: 0.74rem; }
body.wp-page-forecast .wx-summary-note { margin-top: 9px; padding: 10px; display: flex; gap: 8px; border: 1px solid var(--forecast-line); background: var(--forecast-surface); color: var(--forecast-muted); font-size: 0.76rem; }

body.wp-page-forecast #card-aqi .aqi-summary { display: flex; align-items: center; gap: 18px; }
body.wp-page-forecast .aqi-left-content { display: flex; align-items: center; gap: 13px; }
body.wp-page-forecast .aqi-circle { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
body.wp-page-forecast .aqi-graph-container { min-width: 0; flex: 1; display: flex; align-items: flex-end; gap: 5px; overflow-x: auto; }
body.wp-page-forecast .aqi-expand-btn { width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--forecast-soft); color: var(--forecast-muted); }
body.wp-page-forecast .aqi-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
body.wp-page-forecast .aqi-table :is(th, td) { padding: 8px; border-bottom: 1px solid var(--forecast-line); text-align: left; }

@media (max-width: 820px) {
  body.wp-page-forecast .forecast-analysis-grid,
  body.wp-page-forecast .forecast-hourly-key,
  body.wp-page-forecast .forecast-daily-trends { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.wp-page-forecast .wp-forecast-signals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.wp-page-forecast .wp-forecast-signal:nth-child(3n) { border-right: 1px solid var(--forecast-line); }
  body.wp-page-forecast .wp-forecast-signal:nth-child(2n) { border-right: 0; }
  body.wp-page-forecast .wp-forecast-signal:nth-last-child(-n + 3) { border-bottom: 1px solid var(--forecast-line); }
  body.wp-page-forecast .wp-forecast-signal:nth-last-child(-n + 2) { border-bottom: 0; }
  body.wp-page-forecast #card-hourly .card-header { align-items: stretch; }
  body.wp-page-forecast .hourly-controls { justify-content: flex-start; }
  body.wp-page-forecast .hour-row { grid-template-columns: 56px 32px minmax(80px, 0.7fr) minmax(90px, 1fr) 58px; gap: 7px; }
  body.wp-page-forecast .forecast-daily-column-heads { display: none; }
  body.wp-page-forecast .day-row.day-row-button { min-height: 92px; grid-template-columns: minmax(92px, 0.8fr) minmax(120px, 1.2fr) minmax(150px, 1.2fr); grid-template-areas: "day condition range" "day rain range"; }
  body.wp-page-forecast .day-primary { grid-area: day; }
  body.wp-page-forecast .day-condition { grid-area: condition; }
  body.wp-page-forecast .day-rain { grid-area: rain; }
  body.wp-page-forecast .day-range-container { grid-area: range; }
  body.wp-page-forecast .day-wind,
  body.wp-page-forecast .day-humidity { display: none; }
  body.wp-page-forecast .wx-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  body.wp-page-forecast .forecast-today-brief-head { align-items: stretch; flex-direction: column; }
  body.wp-page-forecast .forecast-plan-status { align-self: flex-start; }
  body.wp-page-forecast .forecast-dayparts { grid-template-columns: 1fr; }
  body.wp-page-forecast .forecast-dayparts article { border-right: 0; border-bottom: 1px solid var(--forecast-line); }
  body.wp-page-forecast .forecast-dayparts article:last-child { border-bottom: 0; }
  body.wp-page-forecast .hourly-primary-metrics { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.wp-page-forecast .hourly-primary-metric { min-width: 0; padding: 0 4px; white-space: normal; line-height: 1.1; }
  body.wp-page-forecast .forecast-hourly-select-shell { flex: 1; }
  body.wp-page-forecast .hourly-track { min-width: 820px; }
  body.wp-page-forecast .hour-item { flex-basis: 62px; min-width: 62px; }
  body.wp-page-forecast .hour-row { min-height: 72px; grid-template-columns: 54px 32px minmax(78px, 1fr) 56px; }
  body.wp-page-forecast .hour-list-cond { display: none; }
  body.wp-page-forecast .day-row.day-row-button { min-height: 112px; padding: 10px 40px 10px 11px; grid-template-columns: minmax(80px, 0.8fr) minmax(105px, 1.2fr); grid-template-areas: "day condition" "rain range"; }
  body.wp-page-forecast .day-range-container { grid-template-columns: 40px minmax(58px, 1fr) 40px; gap: 5px; }
  body.wp-page-forecast .range-temp-label { display: none; }
  body.wp-page-forecast .wx-sun-strip { grid-template-columns: 1fr; }
  body.wp-page-forecast #card-aqi .aqi-summary { align-items: stretch; flex-direction: column; }
}
