/* ============================================================
   Greg Rice Ride Weather Widget
   OpenWeather powered replacement for the old 10-widget-limit
   weather provider. Current conditions sit in a fixed-width
   column on the left, with the 7-day forecast filling the rest
   of the same row - single combined bar, 1200px wide and 100px
   tall on desktop. Collapses back to the original stacked
   (current on top, 7-day below, auto height) layout on narrower
   screens where a 1200x100 single row wouldn't fit legibly.
   ============================================================ */

.grw-widget {
  max-width: 1200px;
  height: 100px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  font-family: Arial, Helvetica, sans-serif;
  margin: 12px 0 10px 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

/* ---- Left: current conditions column ---- */
/* Laid out as a single centered row (icon, temp, city/label/desc)
   rather than stacked, so it fits comfortably inside the fixed
   100px row height. */
.grw-current {
  flex: 0 0 330px;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #17395c;
  padding: 6px 14px;
  overflow: hidden;
}

.grw-current-location {
  min-width: 0;
  line-height: 1.25;
}

.grw-current-city {
  font-weight: bold;
  font-size: 0.98em;
  color: #fff;
  white-space: nowrap;
}

.grw-current-label {
  font-size: 0.72em;
  color: #8fc1e3;
  white-space: nowrap;
}

.grw-current-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
}

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

/* Temperature + description stacked together, description below
   the temp number (rather than beside it in the row). */
.grw-current-temp-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.grw-current-temp {
  font-size: 1.7em;
  font-weight: bold;
  color: #ff9466;
  line-height: 1;
  white-space: nowrap;
}

.grw-current-desc {
  color: #8fc1e3;
  font-size: 0.72em;
  text-transform: lowercase;
  white-space: nowrap;
  margin-top: 2px;
}

/* ---- Right: 7-day horizontal strip, fills remaining width ---- */
.grw-forecast {
  flex: 1 1 auto;
  height: 100%;
  display: flex;
  background: #17395c;
}

.grw-day {
  flex: 1 1 0;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.grw-day:first-child {
  border-left: none;
}

.grw-day-name {
  color: #fff;
  font-weight: bold;
  font-size: 0.74em;
  text-transform: capitalize;
  margin-bottom: 3px;
  white-space: nowrap;
}

.grw-day-icon {
  width: 26px;
  height: 26px;
  margin-bottom: 3px;
}

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

.grw-day-hi {
  color: #ff9466;
  font-weight: bold;
  font-size: 0.88em;
  line-height: 1.25;
}

.grw-day-lo {
  color: #8fc1e3;
  font-size: 0.8em;
  line-height: 1.25;
}

/* ---- Loading / error states ---- */
.grw-widget.grw-loading .grw-current-desc::after {
  content: "loading forecast\2026";
}

.grw-error {
  background: #e3e3e3;
  color: #a33;
  font-size: 0.85em;
  padding: 10px 16px;
  font-family: Arial, Helvetica, sans-serif;
}

/* ---- Responsive: below 800px, a 1200x100px single row gets too
   cramped to read - fall back to the original stacked layout
   (current conditions bar on top, 7-day strip below), auto
   height, like the pre-1200px-redesign widget used. ---- */
@media (max-width: 800px) {
  .grw-widget {
    height: auto;
    flex-direction: column;
  }

  .grw-current {
    flex: 0 0 auto;
    height: auto;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 16px;
  }

  .grw-current-location {
    flex: 0 0 auto;
    min-width: 120px;
  }

  .grw-current-city {
    font-size: 1.05em;
    white-space: normal;
  }

  .grw-current-label {
    font-size: 0.78em;
  }

  .grw-current-icon {
    width: 44px;
    height: 44px;
  }

  .grw-current-temp-wrap {
    flex: 0 0 auto;
    align-items: flex-start;
  }

  .grw-current-temp {
    font-size: 2em;
  }

  .grw-current-desc {
    font-size: 0.9em;
    text-align: left;
    white-space: normal;
  }

  .grw-day {
    height: auto;
    padding: 8px 4px 10px 4px;
  }

  .grw-day-name {
    font-size: 0.78em;
    margin-bottom: 4px;
  }

  .grw-day-icon {
    width: 30px;
    height: 30px;
    margin-bottom: 4px;
  }

  .grw-day-hi {
    font-size: 0.92em;
  }

  .grw-day-lo {
    font-size: 0.85em;
  }
}

@media (max-width: 480px) {
  .grw-current-temp {
    font-size: 1.5em;
  }
  .grw-current-desc {
    display: none;
  }
  .grw-day-name {
    font-size: 0.68em;
  }
  .grw-day-hi,
  .grw-day-lo {
    font-size: 0.75em;
  }
}
