/* IdealWeather 9 — (C) IdealPC Sàrl — GPL v2 or later */
.iw {
  --iw-color: inherit;
  --iw-bg: transparent;
  --iw-icon: 130px;
  --iw-temp: 34px;
  --iw-city: 30px;
  --iw-desc: 22px;
  --iw-pad: 28px;
  --iw-radius: 6px;
  --iw-width: 320px;
  box-sizing: border-box;
  width: var(--iw-width);
  max-width: 100%;
  padding: var(--iw-pad);
  border-radius: var(--iw-radius);
  background: var(--iw-bg);
  color: var(--iw-color);
  line-height: 1.3;
}
.iw *, .iw *::before, .iw *::after { box-sizing: border-box; }
.iw--shadow { box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
.iw--flat { box-shadow: none; border-radius: 0; }

.iw--align-center { text-align: center; }
.iw--align-left { text-align: left; }

.iw-icon { line-height: 0; margin: 0 0 12px; }
.iw--align-center .iw-icon { display: flex; justify-content: center; }
.iw-svg {
  width: var(--iw-icon);
  height: var(--iw-icon);
  max-width: 100%;
  overflow: visible;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .18));
}

.iw-temp { font-size: var(--iw-temp); font-weight: 300; margin: 0 0 8px; line-height: 1.1; }
.iw-city { font-size: var(--iw-city); font-weight: 600; margin: 0 0 6px; }
.iw-desc { font-size: var(--iw-desc); margin: 0 0 12px; opacity: .9; }

.iw-details { margin: 0; padding: 0; font-size: 16px; }
.iw-row { display: block; line-height: 1.6; }
.iw-row dt, .iw-row dd { display: inline; margin: 0; }
.iw-row dt { font-weight: 400; opacity: .8; }
.iw-row dt::after { content: " : "; }
.iw-row dd { font-weight: 500; }

/* Forecast (next days) */
.iw-forecast {
  --iw-ficon: 40px;
  display: grid;
  grid-template-columns: repeat(var(--iw-days, 5), minmax(0, 1fr));
  gap: 4px;
  list-style: none;
  margin: 14px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid rgba(128, 128, 128, .25);
  text-align: center;
  font-size: 14px;
  line-height: 1.3;
}
.iw-day { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; padding: 0; min-width: 0; }
.iw-day::before { content: none; }
.iw-day-name { font-weight: 600; font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.iw-day-icon { line-height: 0; }
.iw-day .iw-svg { width: var(--iw-ficon); height: var(--iw-ficon); filter: none; }
.iw-day-temp { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.iw-day-max { font-weight: 600; }
.iw-day-min { opacity: .65; }
.iw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.iw--horizontal { flex-wrap: wrap; }
.iw--horizontal .iw-forecast { flex-basis: 100%; }

/* Preview badge (sample data) */
.iw-preview { display: inline-block; margin-top: 10px; padding: 2px 8px; border-radius: 999px; font-size: 11px; line-height: 1.5; letter-spacing: .02em; border: 1px dashed currentColor; opacity: .7; }
.iw--horizontal .iw-preview { flex-basis: 100%; }

/* Horizontal layout */
.iw--horizontal { display: flex; align-items: center; gap: 16px; text-align: left; }
.iw--horizontal .iw-icon { margin: 0; flex: 0 0 auto; }
.iw--horizontal .iw-svg { max-width: none; }
.iw--horizontal .iw-body { min-width: 0; }
.iw--horizontal .iw-temp { margin-bottom: 2px; }

/* Error box (administrators only) */
.iw-error {
  padding: 12px 14px;
  border-radius: 6px;
  border-left: 4px solid #d9534f;
  background: #fdf2f2;
  color: #7a1f1f;
  font-size: 14px;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .iw-svg * { animation: none !important; }
}
