/* Shop weather display. Dark, high-contrast, and sized for a TV viewed from a few feet. */

body.page-weather {
  background: #0c1218;
  color: #f4f7fb;
  color-scheme: dark;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.page-weather main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  min-width: 0;
}

body.page-weather.is-fullscreen .site-header,
body.page-weather.is-fullscreen .site-footer,
html.is-standalone body.page-weather .site-header,
html.is-standalone body.page-weather .site-footer,
html.is-pseudo-fs body.page-weather .site-header,
html.is-pseudo-fs body.page-weather .site-footer {
  display: none !important;
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  body.page-weather .site-header,
  body.page-weather .site-footer {
    display: none !important;
  }

  body.page-weather .weather-app {
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    padding:
      calc(clamp(0.7rem, 1.2vw, 1.4rem) + env(safe-area-inset-top, 0px))
      calc(clamp(0.7rem, 1.3vw, 1.6rem) + env(safe-area-inset-right, 0px))
      calc(clamp(0.45rem, 0.8vw, 0.9rem) + env(safe-area-inset-bottom, 0px))
      calc(clamp(0.7rem, 1.3vw, 1.6rem) + env(safe-area-inset-left, 0px));
  }
}

html.cursor-idle,
html.cursor-idle * {
  cursor: none !important;
}

.weather-app {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 5.75rem);
  min-height: calc(100dvh - 5.75rem);
  padding: clamp(0.7rem, 1.2vw, 1.4rem) clamp(0.7rem, 1.3vw, 1.6rem) clamp(0.45rem, 0.8vw, 0.9rem);
  gap: clamp(0.45rem, 0.8vw, 0.9rem);
  font-family: "Source Sans 3", "Segoe UI", "Gill Sans", "Trebuchet MS", sans-serif;
  line-height: 1.2;
}

body.page-weather.is-fullscreen .weather-app,
html.is-standalone body.page-weather .weather-app,
html.is-pseudo-fs body.page-weather .weather-app {
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  padding:
    calc(clamp(0.7rem, 1.2vw, 1.4rem) + env(safe-area-inset-top, 0px))
    calc(clamp(0.7rem, 1.3vw, 1.6rem) + env(safe-area-inset-right, 0px))
    calc(clamp(0.45rem, 0.8vw, 0.9rem) + env(safe-area-inset-bottom, 0px))
    calc(clamp(0.7rem, 1.3vw, 1.6rem) + env(safe-area-inset-left, 0px));
}

@media (min-width: 1001px) {
  body.page-weather.is-fullscreen .weather-app {
    height: 100vh;
    height: 100dvh;
  }
}

.weather-app h1,
.weather-app h2,
.weather-app p {
  font-family: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  padding: 0;
}

.weather-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.5rem, 1.2vw, 1.5rem);
  padding-bottom: clamp(0.35rem, 0.6vw, 0.7rem);
  border-bottom: 1px solid rgba(214, 184, 106, 0.4);
}

.weather-wordmark {
  font-size: clamp(0.72rem, 0.95vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e4c98a;
}

.weather-range {
  margin-top: 0.15em;
  font-size: clamp(0.78rem, 1vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #d5deea;
}

.weather-app h1 {
  margin-top: 0.12em;
  font-size: clamp(1.55rem, 2.4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.05;
}

.weather-clock {
  text-align: center;
}

.weather-time {
  font-size: clamp(1.9rem, 3.3vw, 4.4rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 0.95;
}

.weather-date {
  margin-top: 0.2em;
  font-size: clamp(0.95rem, 1.25vw, 1.6rem);
  color: #c5d2e0;
}

.weather-tools {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}

.weather-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: clamp(0.78rem, 0.95vw, 1.15rem);
  color: #b7c5d4;
}

.status-dot {
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: #8ea0b3;
  flex: 0 0 auto;
}

.status-dot.is-ok { background: #7dcea0; }
.status-dot.is-stale { background: #e2b657; }
.status-dot.is-offline { background: #d98978; }

.weather-fs {
  appearance: none;
  border: 1px solid rgba(244, 247, 251, 0.45);
  background: transparent;
  color: #f4f7fb;
  font: inherit;
  font-size: clamp(0.8rem, 0.95vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.4em 0.85em;
  border-radius: 999px;
  cursor: pointer;
}

.weather-fs:hover,
.weather-fs:focus-visible {
  background: rgba(244, 247, 251, 0.1);
  outline: 2px solid #e4c98a;
  outline-offset: 2px;
}

.weather-fs[hidden],
.weather-exit[hidden] {
  display: none !important;
}

.weather-exit {
  appearance: none;
  border: 0;
  background: transparent;
  color: #c5d2e0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2em 0.35em;
  cursor: pointer;
}

.weather-exit:focus-visible {
  outline: 2px solid #e4c98a;
  outline-offset: 2px;
}

.weather-fs-hint {
  max-width: 16rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: #c5d2e0;
}

.weather-fs-hint[hidden] {
  display: none !important;
}

.weather-stuck {
  display: none;
  margin: 0;
}

.weather-stuck[hidden] {
  display: none !important;
}

body.page-weather.is-stuck .weather-stuck {
  display: block;
  background: #e10600;
  color: #ffffff;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  font-size: clamp(1.15rem, 6.2vh, 2.15rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  padding: 0.28rem 0.45rem;
}

.weather-days {
  flex: 1 1 auto;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(0.4rem, 0.7vw, 0.85rem);
  min-height: 0;
}

.day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  min-width: 0;
  min-height: 0;
  padding: clamp(0.55rem, 0.9vw, 1rem) clamp(0.3rem, 0.5vw, 0.6rem);
  background: #17202b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.05rem;
  gap: 0.25rem;
}

.day-name {
  font-size: clamp(1.25rem, 1.85vw, 2.55rem);
  font-weight: 700;
  line-height: 1.05;
}

.day-date {
  font-size: clamp(0.85rem, 1.05vw, 1.35rem);
  color: #c5d2e0;
}

.day-icon {
  width: clamp(3.4rem, 5.6vw, 8.5rem);
  height: clamp(3.4rem, 5.6vw, 8.5rem);
  color: #e7eef6;
  flex: 0 0 auto;
}

.day-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.icon-sun { color: #ffd56a; }
.icon-night { color: #f4f7fb; }
.icon-partly { color: #e7eef6; }
.icon-night-partly { color: #e7eef6; }
.icon-cloudy { color: #d5e0ec; }
.icon-rain,
.icon-ice { color: #9ecbff; }
.icon-snow { color: #f3f8ff; }
.icon-storm { color: #f0d78c; }
.icon-fog,
.icon-wind { color: #c9d6e4; }

.day-cond {
  font-size: clamp(0.95rem, 1.15vw, 1.65rem);
  font-weight: 600;
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  display: block;
  overflow: hidden;
  text-overflow: clip;
}

.day-temps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05em;
}

.temp-high,
.temp-low {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 0.95;
}

.temp-high {
  font-size: clamp(3.15rem, 5.5vw, 8.6rem);
  color: #ffffff;
}

.temp-low {
  font-size: clamp(1.6rem, 2.5vw, 3.7rem);
  color: #b7c8da;
}

.day-card.is-tonight .temp-low {
  font-size: clamp(3.15rem, 5.5vw, 8.6rem);
  color: #ffffff;
}

.temp-label {
  display: block;
  margin-bottom: 0.12em;
  font-size: clamp(0.72rem, 0.85vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9fb0c2;
}

.day-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  font-size: clamp(0.9rem, 1.05vw, 1.4rem);
  font-weight: 600;
  color: #d5e0ec;
}

.day-pop { color: #b9d7ff; }
.day-cond-short,
.day-pop-short { display: none; }
.day-pop,
.day-wind { white-space: nowrap; }

.weather-empty {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  max-width: 36rem;
  text-align: center;
  font-size: clamp(1.2rem, 2vw, 2rem);
  color: #d5e0ec;
}

.weather-credit {
  text-align: center;
  font-size: clamp(0.72rem, 0.85vw, 1rem);
  color: #8ea0b3;
}

/* Phone portrait and other very narrow screens: one full-width row per weekday. */
@media (max-width: 480px) {
  html.is-phone-rows .weather-app,
  .weather-app {
    min-height: 0;
  }
}

html.is-phone-rows .weather-app {
  min-height: 0;
  gap: 0.3rem;
}

html.is-phone-rows .weather-bar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.15rem 0.6rem;
  padding-bottom: 0.25rem;
}

html.is-phone-rows .weather-clock {
  text-align: right;
}

html.is-phone-rows .weather-tools {
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  justify-self: start;
  align-items: center;
  gap: 0.35rem 0.6rem;
}

html.is-phone-rows .weather-wordmark,
html.is-phone-rows .weather-range {
  font-size: 0.68rem;
}

html.is-phone-rows .weather-range {
  margin-top: 0;
}

html.is-phone-rows .weather-app h1 {
  font-size: 1.2rem;
}

html.is-phone-rows .weather-time {
  font-size: 1.25rem;
}

html.is-phone-rows .weather-date,
html.is-phone-rows .weather-status {
  font-size: 0.72rem;
}

html.is-phone-rows .weather-days {
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  grid-auto-columns: auto;
  align-content: start;
  gap: 0.28rem;
}

html.is-phone-rows .day-card {
  display: grid;
  grid-template-columns: 2.7rem 1.7rem minmax(0, 1fr) auto;
  grid-template-areas:
    "name icon cond temps"
    "name icon meta temps";
  align-items: center;
  justify-content: stretch;
  text-align: left;
  column-gap: 0.35rem;
  row-gap: 0.05rem;
  height: auto;
  padding: 0.32rem 0.45rem;
  border-radius: 0.55rem;
}

html.is-phone-rows .day-name {
  grid-area: name;
  align-self: center;
  font-size: 0.95rem;
}

html.is-phone-rows .day-date {
  display: none;
}

html.is-phone-rows .day-icon {
  grid-area: icon;
  width: 1.7rem;
  height: 1.7rem;
}

html.is-phone-rows .day-cond {
  grid-area: cond;
  max-width: none;
  font-size: 0.82rem;
}

html.is-phone-rows .day-meta {
  grid-area: meta;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.15rem 0.45rem;
  font-size: 0.72rem;
}

html.is-phone-rows .day-temps {
  grid-area: temps;
  flex-direction: row;
  align-items: baseline;
  gap: 0.28rem;
}

html.is-phone-rows .temp-high,
html.is-phone-rows .day-card.is-tonight .temp-low {
  font-size: 1.4rem;
}

html.is-phone-rows .temp-low {
  font-size: 1.05rem;
}

html.is-phone-rows .temp-label {
  display: none;
}

html.is-phone-rows .weather-credit {
  font-size: 0.68rem;
}

html.is-standalone body.page-weather .weather-fs,
html.is-pseudo-fs body.page-weather .weather-fs {
  display: none !important;
}

@media (display-mode: standalone), (display-mode: fullscreen) {
  body.page-weather .weather-fs {
    display: none !important;
  }
}

/* iPhone landscape, including a wall-mounted 6S at 667x375. Rows stay portrait-only. */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 900px) {
  body.page-weather {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  body.page-weather .weather-app,
  body.page-weather.is-fullscreen .weather-app,
  html.is-standalone body.page-weather .weather-app,
  html.is-pseudo-fs body.page-weather .weather-app,
  html.is-phone-rows .weather-app {
    box-sizing: border-box;
    min-height: 0;
    height: 100vh;
    height: 100dvh;
    gap: 0;
    overflow: hidden;
    padding:
      calc(0.04rem + env(safe-area-inset-top, 0px))
      calc(0.08rem + env(safe-area-inset-right, 0px))
      calc(0.02rem + env(safe-area-inset-bottom, 0px))
      calc(0.08rem + env(safe-area-inset-left, 0px));
  }

  html.is-phone-rows .weather-bar,
  .weather-bar {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem;
    min-width: 0;
    padding: 0;
    margin: 0;
  }

  .weather-wordmark,
  .weather-range,
  .weather-clock {
    display: none;
  }

  html.is-phone-rows .weather-tools,
  .weather-tools {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    grid-column: auto;
    gap: 0.35rem;
  }

  .weather-app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
  }

  .weather-bar { grid-column: 1; grid-row: 1; }
  .weather-days { grid-column: 1 / -1; grid-row: 2; height: 100%; }
  .weather-app .weather-credit {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    white-space: nowrap;
    padding-left: 0.55rem;
  }

  .weather-app h1 {
    font-size: clamp(0.7rem, 2.8vh, 0.95rem);
    font-weight: 800;
    line-height: 1;
  }
  .weather-status,
  .weather-credit,
  .weather-fs-hint {
    font-size: clamp(0.62rem, 2.4vh, 0.85rem);
    font-weight: 700;
    line-height: 1;
    color: #f4f7fb;
  }
  .weather-fs-hint { max-width: 12rem; }

  html.is-standalone body.page-weather .weather-bar,
  html.is-standalone body.page-weather .weather-credit,
  html.is-pseudo-fs body.page-weather .weather-bar,
  html.is-pseudo-fs body.page-weather .weather-credit,
  body.page-weather.is-fullscreen .weather-bar,
  body.page-weather.is-fullscreen .weather-credit {
    display: none !important;
  }

  .weather-stuck {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  html.is-standalone body.page-weather:not(.is-stuck) .weather-days,
  html.is-pseudo-fs body.page-weather:not(.is-stuck) .weather-days,
  body.page-weather.is-fullscreen:not(.is-stuck) .weather-days {
    margin-top: clamp(8px, 2.5vh, 12px);
  }

  html.is-phone-rows .weather-days,
  .weather-days {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-columns: none;
    grid-template-rows: 1fr 1.27fr 0.75fr 2.12fr 1.46fr 1.32fr 0.68fr;
    align-content: stretch;
    align-items: center;
    justify-items: stretch;
    gap: 0 0.15rem;
    min-height: 0;
    height: auto;
  }

  html.is-phone-rows .day-card,
  .day-card,
  html.is-phone-rows .day-temps,
  .day-temps,
  html.is-phone-rows .day-meta,
  .day-meta {
    display: contents;
  }

  html.is-phone-rows .day-name,
  .day-name,
  html.is-phone-rows .day-icon,
  .day-icon,
  html.is-phone-rows .day-cond,
  .day-cond,
  html.is-phone-rows .temp-high,
  .temp-high,
  html.is-phone-rows .temp-low,
  .temp-low,
  html.is-phone-rows .day-pop,
  .day-pop,
  html.is-phone-rows .day-wind,
  .day-wind {
    min-width: 0;
    max-width: 100%;
    justify-self: stretch;
    align-self: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .day-name { grid-row: 1; }
  .day-icon { grid-row: 2; }
  .day-cond { grid-row: 3; }
  .temp-high { grid-row: 4; }
  .temp-low { grid-row: 5; }
  .day-pop { grid-row: 6; }
  .day-wind { grid-row: 7; }

  html.is-phone-rows .day-name,
  .day-name {
    font-size: clamp(1.5rem, 8vh, 2.6rem);
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
  }

  html.is-phone-rows .day-date,
  .day-date { display: none; }

  html.is-phone-rows .day-icon,
  .day-icon {
    width: auto;
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
  }

  .day-pop-long { display: none; }
  .day-pop-short { display: inline; }

  html.is-phone-rows .day-cond,
  .day-cond {
    align-self: end;
    max-width: 100%;
    font-size: clamp(1.15rem, 5.6vh, 1.9rem);
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    max-height: none;
    padding-bottom: 0;
  }

  html.is-phone-rows .day-temps,
  .day-temps {
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 0;
  }

  html.is-phone-rows .temp-high,
  .weather-app .temp-high,
  html.is-phone-rows .day-card.is-tonight .temp-low,
  .weather-app .day-card.is-tonight .temp-low {
    align-self: start;
    box-sizing: border-box;
    font-size: clamp(4rem, 23.5vh, 7.4rem);
    font-weight: 800;
    line-height: 0.82;
    color: #ffffff;
    letter-spacing: -0.04em;
    margin-top: clamp(14px, 3.7vh, 16px);
    padding: 0;
  }

  html.is-phone-rows .temp-low,
  .temp-low {
    align-self: end;
    box-sizing: border-box;
    font-size: clamp(2.6rem, 15.5vh, 4.9rem);
    font-weight: 800;
    line-height: 0.82;
    color: #ffffff;
    letter-spacing: -0.03em;
    padding-top: 0;
    padding-bottom: clamp(2px, 0.6vh, 4px);
  }

  html.is-phone-rows .temp-label,
  .temp-label { display: none; }

  html.is-phone-rows .day-meta,
  .day-meta {
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 0;
    font-size: clamp(1.15rem, 6.2vh, 2rem);
    font-weight: 800;
    line-height: 1.02;
    color: #ffffff;
  }

  html.is-phone-rows .day-pop,
  .weather-app .day-pop,
  .day-pop {
    align-self: end;
    color: #ffffff;
    font-weight: 800;
    margin: 0;
    padding: 0;
  }

  html.is-phone-rows .day-wind,
  .weather-app .day-wind,
  .day-wind {
    align-self: start;
    color: #ffffff;
    font-weight: 800;
    margin: 0;
    padding: 0;
  }
}
