/**
 * Shared styles for the live HA weather page (/weather).
 * Layout mirrors the forecast overlay: hero zone mid-stage, reading strip at bottom.
 */

:root {
  --weather-live-fg: #e6eefc;
  --weather-live-muted: #c8d6ef;
  --weather-live-accent: #4ea1ff;
  --weather-live-temp: #eef4ff;
  --weather-live-wet: #7ec8ff;
  --weather-live-dry: #b8c9e6;
  --weather-live-glass: rgba(7, 14, 26, 0.52);
  --weather-live-glass-strong: rgba(7, 14, 26, 0.68);
  --weather-live-text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85), 0 0 28px rgba(0, 0, 0, 0.55);
  --weather-live-inset-top: calc(var(--forecast-overlay-inset-top, 12px) + var(--forecast-overlay-today-top-offset, 5vh));
  --weather-live-inset-x: 14px;
}

.weatherLiveContent--overlay {
  z-index: 3;
}

.viewWithLiveWeatherOverlay .weatherLivePlaceTitle {
  display: none;
}

.weatherLiveOverlayLocationBanner {
  margin: 0 0 clamp(8px, 1.2vh, 12px);
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--weather-live-muted);
  text-align: center;
  text-shadow: var(--weather-live-text-shadow);
  flex: 0 0 auto;
  width: 100%;
}

.weatherLiveRoot--overlay {
  padding-top: var(--weather-live-inset-top);
}

.weatherLiveContent {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 var(--weather-live-inset-x) 10px;
  box-sizing: border-box;
  pointer-events: none;
  color: var(--weather-live-fg);
}

.weatherLiveRoot {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  padding-top: var(--weather-live-inset-top);
  box-sizing: border-box;
}

.weatherLiveRoot--multi {
  gap: 12px;
}

.weatherLivePlace {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

.weatherLivePlaceTitle {
  margin: 0 0 8px;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--weather-live-muted);
  text-align: center;
  text-shadow: var(--weather-live-text-shadow);
}

.weatherLiveStack {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
  gap: clamp(8px, 1.2vh, 12px);
}

.weatherLiveHeroRow {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 14px);
  align-items: stretch;
}

.weatherLiveHeroPanel {
  background: var(--weather-live-glass);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  backdrop-filter: blur(5px);
  padding: clamp(10px, 1.8vh, 18px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  container-type: inline-size;
}

.weatherLiveHeroPanelLabel {
  margin: 0 0 8px;
  font-size: clamp(12px, 1.6vw, 14px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--weather-live-muted);
  text-shadow: var(--weather-live-text-shadow);
}

.weatherLiveHeroPanel--temp {
  align-items: stretch;
  justify-content: flex-start;
  text-align: center;
}

.weatherLiveTempHead {
  flex: 0 0 auto;
}

.weatherLiveTempChart {
  flex: 1 1 auto;
  min-height: 88px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-top: clamp(6px, 1vh, 10px);
  width: 100%;
  max-width: 100%;
}

.weatherLiveTempChart .weatherLiveChart {
  flex: 1 1 auto;
  min-height: 72px;
}

.weatherLiveHeroTemp {
  margin: 0;
  line-height: 1;
  text-shadow: var(--weather-live-text-shadow);
}

.weatherLiveHeroTempValue {
  font-size: clamp(28px, 20cqi, 56px);
  font-weight: 700;
  color: var(--weather-live-temp);
  font-variant-numeric: tabular-nums;
}

.weatherLiveHeroTempUnit {
  font-size: clamp(16px, 11cqi, 28px);
  font-weight: 600;
  color: var(--weather-live-muted);
  margin-left: 4px;
}

.weatherLiveHeroSub {
  margin: 10px 0 0;
  font-size: clamp(11px, 1.4vw, 13px);
  color: var(--weather-live-muted);
  text-shadow: var(--weather-live-text-shadow);
}

.weatherLiveHeroPanel--weather {
  justify-content: flex-start;
  text-align: center;
  align-items: center;
}

.weatherLiveWeatherDay {
  margin: 0 0 clamp(6px, 1vh, 10px);
  font-size: clamp(14px, 2vw, 20px);
  font-weight: 500;
  color: var(--weather-live-muted);
  text-shadow: var(--weather-live-text-shadow);
  width: 100%;
}

.weatherLiveWeatherIcon {
  margin: 0 auto clamp(4px, 0.8vh, 8px);
  display: flex;
  justify-content: center;
  align-items: center;
  width: clamp(56px, 32cqi, 88px);
  height: clamp(56px, 32cqi, 88px);
  flex: 0 0 auto;
}

.weatherLiveWeatherIcon .forecast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  line-height: 0;
}

.weatherLiveWeatherIcon .forecast-svg {
  width: 100%;
  height: 100%;
  max-width: 96px;
  max-height: 96px;
  display: block;
  margin: 0 auto;
}

.weatherLiveWeatherCondition {
  margin: 0 0 clamp(10px, 1.4vh, 14px);
  font-size: clamp(13px, 1.8vw, 17px);
  font-weight: 500;
  color: var(--weather-live-muted);
  text-shadow: var(--weather-live-text-shadow);
  width: 100%;
}

.weatherLiveWeatherCondition--majorStorm {
  color: #ff5c5c;
  font-size: clamp(17px, 2.6vw, 24px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow:
    0 1px 10px rgba(0, 0, 0, 0.9),
    0 0 24px rgba(255, 70, 70, 0.35);
}

.weatherLiveWeatherMetrics {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  width: 100%;
  text-align: left;
}

.weatherLiveWeatherMetric {
  margin: 0;
  min-width: 0;
}

.weatherLiveWeatherMetricLabel {
  margin: 0 0 2px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--weather-live-muted);
}

.weatherLiveWeatherMetricValue {
  margin: 0;
  font-size: clamp(14px, 1.9vw, 18px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--weather-live-fg);
  text-shadow: var(--weather-live-text-shadow);
}

.weatherLiveLightningSection {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  width: 100%;
  margin-top: 10px;
  text-align: left;
}

.weatherLiveLightningCol {
  margin: 0;
  min-width: 0;
}

.weatherLiveLightningTitle {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--weather-live-muted);
}

.weatherLiveLightningCount,
.weatherLiveLightningDetail {
  margin: 0;
  font-size: clamp(14px, 1.9vw, 18px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--weather-live-fg);
  text-shadow: var(--weather-live-text-shadow);
}

.weatherLiveLightningDetail + .weatherLiveLightningDetail {
  margin-top: 2px;
}

.weatherLiveHeroPanel--rainDaily {
  align-items: stretch;
  justify-content: flex-start;
  text-align: center;
}

.weatherLiveRainDailyHead {
  flex: 0 0 auto;
}

.weatherLiveHeroRainTotal {
  margin: 0;
  line-height: 1;
  text-shadow: var(--weather-live-text-shadow);
}

.weatherLiveHeroRainValue {
  font-size: clamp(28px, 20cqi, 56px);
  font-weight: 700;
  color: var(--weather-live-wet);
  font-variant-numeric: tabular-nums;
}

.weatherLiveHeroRainUnit {
  font-size: clamp(16px, 11cqi, 28px);
  font-weight: 600;
  color: var(--weather-live-muted);
  margin-left: 4px;
}

.weatherLiveRainWeeklyChart {
  flex: 1 1 auto;
  min-height: 88px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin-top: clamp(6px, 1vh, 10px);
  width: 100%;
  max-width: 100%;
}

.weatherLiveRainWeeklyChart .weatherLiveWeeklyRain {
  flex: 1 1 auto;
  min-height: 72px;
}

.weatherLiveWeeklyRain {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 6px 8px 4px;
  text-align: left;
}

.weatherLiveWeeklyRainSvg {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  display: block;
}

.weatherLiveRainBar {
  fill: rgba(78, 161, 255, 0.35);
}

.weatherLiveRainBar--wet {
  fill: rgba(126, 200, 255, 0.92);
}

.weatherLiveRainBarLabel {
  fill: var(--weather-live-muted);
  font-size: 9px;
  font-family: var(--chrome-font, system-ui, sans-serif);
}

.weatherLiveWeeklyRain--empty {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.weatherLiveHeroPanel--charts {
  display: flex;
  flex-direction: column;
  padding: clamp(8px, 1.2vh, 12px);
  align-content: stretch;
}

.weatherLiveHeroPanel--charts .weatherLiveChart {
  flex: 1 1 auto;
  min-height: 88px;
}

.weatherLiveChart--embedded {
  text-align: left;
}

.weatherLiveChart {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 6px 8px 4px;
}

.weatherLiveChartTitle {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--weather-live-muted);
  margin-bottom: 2px;
}

.weatherLiveChartMeta {
  font-size: 10px;
  color: var(--weather-live-muted);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weatherLiveChartSvg {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  display: block;
}

.weatherLiveChartLine {
  opacity: 0.95;
}

.weatherLiveChartMarker {
  stroke: rgba(7, 14, 26, 0.85);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.weatherLiveChartMarker--min {
  fill: #7eb8ff;
}

.weatherLiveChartMarker--max {
  fill: #eef4ff;
}

.weatherLiveChartMarkerLabel {
  fill: var(--weather-live-muted);
  font-size: 9px;
  font-family: var(--chrome-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

.weatherLiveRainBarPeakLabel {
  fill: var(--weather-live-fg);
  font-size: 9px;
  font-weight: 650;
  font-family: var(--chrome-font, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
}

.weatherLiveChart--empty {
  align-items: center;
  justify-content: center;
}

.weatherLiveChartEmpty {
  font-size: 12px;
  color: var(--weather-live-muted);
  text-align: center;
  padding: 12px 0;
}

.weatherLiveReadingStrip {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: clamp(6px, 1vw, 10px);
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  padding: 4px 2px 2px;
  box-sizing: border-box;
}

.weatherLiveReadingCard {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  background: var(--weather-live-glass-strong);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  pointer-events: auto;
}

.weatherLiveReadingCard--pageHidden {
  display: none;
}

.weatherLiveReadingCardLabel {
  font-size: 10px;
  line-height: 1.25;
  color: var(--weather-live-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.weatherLiveReadingCardValue {
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--weather-live-fg);
  text-shadow: var(--weather-live-text-shadow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.weatherLiveEmpty {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--weather-live-muted);
  padding: 24px;
  text-shadow: var(--weather-live-text-shadow);
}

/** Full-stage live weather scheduled display mode (/display). */
.displayModeLiveWeather {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  color: var(--weather-live-fg);
  background:
    linear-gradient(180deg, rgba(7, 14, 26, 0.15) 0%, rgba(7, 14, 26, 0.55) 100%),
    radial-gradient(circle at 30% 20%, #2a4a72 0%, #0b1220 55%, #050a12 100%);
}

.displayModeLiveWeatherInner {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.displayModeLiveWeatherInner .weatherLiveRoot {
  padding: clamp(10px, 1.5vh, 20px) var(--weather-live-inset-x);
}

.displayModeLiveWeatherInner .weatherLivePlaceTitle {
  display: none;
}

.displayModeLiveWeather--empty {
  align-items: center;
  justify-content: center;
}

/** Stack only on very narrow portrait screens; kiosk landscape stays horizontal. */
@media (max-width: 520px), (max-height: 420px) and (orientation: landscape) {
  .weatherLiveHeroRow {
    grid-template-columns: 1fr;
  }

  .weatherLiveHeroPanel--rainDaily {
    min-height: 200px;
  }
}
