
/* ── Now ── */
.weather-win-now {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "temp lines art"
    "next next next";
  align-items: center;
  column-gap: 16px;
}
.weather-win-temp {
  grid-area: temp;
  font-size: 76px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}
.weather-win-lines {
  grid-area: lines;
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
}
.weather-win-condition { font-size: 18px; font-weight: 600; }
.weather-win-art {
  display: block;
  width: 92px;
  aspect-ratio: 1;
}
.weather-win-now > .weather-win-art { grid-area: art; }
.weather-win-art svg { display: block; width: 100%; height: 100%; }
.weather-win-next {
  grid-area: next;
  margin: 10px 0 0;
  color: var(--muted-text);
  font-size: 15px;
  font-weight: 600;
}
.weather-win-next.is-wet { color: var(--wx-rain); }

/* ── Blocks: the name outside, one well, hairlines between rows ── */
.weather-win-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.weather-win-heading {
  margin: 0;
  color: var(--muted-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
.weather-win-well {
  box-sizing: border-box;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--wx-well);
}

/* The hours keep their own height: a well stretched to the column would float them in a hole. */
.weather-win-hours .weather-win-well { padding: 10px 8px; }
.weather-win-hours .weather-hours {
  --wx-col: 64px;
  --wx-hour-art: 38px;
}
.weather-win-hours .weather-hour { gap: 8px; padding: 10px 2px; }
.weather-win-hours .weather-hour-time { font-size: 14px; }
.weather-win-hours .weather-hour-temp { font-size: 20px; }
.weather-win-hours .weather-hour-rain { font-size: 13px; }

.weather-win-days .weather-fc-row {
  grid-template-columns: minmax(max(3.4em, min(var(--wx-name, 0px), 34%)), 0.9fr) 26px 2.4em minmax(44px, 3fr) 2.4em;
  gap: 10px;
}
.weather-win-days .weather-fc-row + .weather-fc-row { border-top: 1px solid var(--wx-line); }
.weather-win-days .weather-fc-art { width: 26px; height: 26px; }
.weather-win-days :is(.weather-fc-day, .weather-fc-min, .weather-fc-max) { font-size: 15px; }

.weather-win-facts .weather-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: none;
  grid-auto-rows: auto;
  overflow: visible;
}
.weather-win-facts .weather-fact { min-height: 58px; padding: 9px 0; }
.weather-win-facts .weather-fact dt { font-size: 13px; line-height: 1.15; white-space: normal; }
.weather-win-facts .weather-fact dd { font-size: 17px; }
.weather-win-facts .weather-fact:nth-child(n + 3) { border-top: 1px solid var(--wx-line); }
/* An odd one out takes the whole row, so the rule above it does not stop half way. */
.weather-win-facts .weather-fact:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ── When there is nothing to show ── */
.weather-win-trouble {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 0 12px;
  text-align: center;
}
.weather-win-trouble-title { margin: 0; font-size: 18px; font-weight: 700; }
.weather-win-trouble-hint {
  max-width: 44ch;
  margin: 0;
  color: var(--muted-text);
  font-size: 15px;
  line-height: 1.4;
}
.weather-win-key {
  min-height: 44px;
  margin-top: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.weather-win-key:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* ── Sizes ── */
/* Wide strip: now and the days on top, the hours across under them, the details down the side. */
@container wxwin (min-width: 1300px) {
  .weather-content {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "now days facts"
      "hours hours facts";
    row-gap: 14px;
  }
  .weather-win-main,
  .weather-win-side { display: contents; }
  .weather-win-now { grid-area: now; }
  .weather-win-hours { grid-area: hours; }
  .weather-win-days { grid-area: days; }
  .weather-win-facts { grid-area: facts; }
  /* The details spread down their column and end on the same line as the other two. */
  .weather-win-facts .weather-win-well { flex: 1 1 auto; display: grid; }
  .weather-win-facts .weather-facts { grid-auto-rows: 1fr; }
  .weather-win-facts .weather-fact { min-height: 58px; }
}
@container wxwin (max-width: 759px) {
  .weather-content { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-inline: 16px; }
  .weather-panel-head { padding-left: 16px; padding-right: 8px; }
}
@container wxwin (max-width: 479px) {
  .weather-win-temp { font-size: 64px; }
  .weather-win-art { width: 72px; }
  .weather-win-now { column-gap: 12px; }
  .weather-win-facts .weather-facts { grid-template-columns: minmax(0, 1fr); }
  .weather-win-facts .weather-fact:nth-child(2) { border-top: 1px solid var(--wx-line); }
}
@media (max-width: 560px) {
  .weather-overlay { padding: 8px; }
}

/* ───────────────────────────────────────
   The pill on small screens
──────────────────────────────────────── */
@media (max-height: 620px) and (min-width: 900px) {
  .clock-weather { height: 34px; max-width: 188px; }
}
@media (max-width: 860px) {
  .clock-row { flex-wrap: wrap; justify-content: center; }
}
